8 #include "DdMdConfigReader.h" 10 #include <tools/chemistry/Atom.h> 11 #include <tools/chemistry/Group.h> 12 #include <tools/chemistry/Species.h> 14 #include <tools/storage/Configuration.h> 16 #include <util/space/Vector.h> 30 hasMolecules_(hasMolecules)
37 int DdMdConfigReader::readGroups(std::ifstream& file,
38 const char* sectionLabel,
39 const char* nGroupLabel,
43 file >>
Label(sectionLabel);
44 file >> Label(nGroupLabel) >> nGroup;
46 for (
int i = 0; i < nGroup; ++i) {
47 groupPtr = groups.
newPtr();
59 if (!file.is_open()) {
64 file >>
Label(
"BOUNDARY");
73 file >> Label(
"ATOMS");
74 file >> Label(
"nAtom") >> nAtom;
75 for (
int i = 0; i < nAtom; ++i) {
81 if (atomPtr->
id < 0) {
82 std::cout <<
"atom id =" << atomPtr->
id << std::endl;
85 if (atomPtr->
id >= atomCapacity) {
86 std::cout <<
"atom id =" << atomPtr->
id << std::endl;
87 std::cout <<
"atomCapacity =" << atomCapacity << std::endl;
94 std::cout <<
"species Id =" << atomPtr->
speciesId << std::endl;
99 std::cout <<
"molecule Id =" << atomPtr->
moleculeId << std::endl;
103 if (atomPtr->
atomId < 0) {
104 std::cout <<
"atom id =" << atomPtr->
atomId << std::endl;
127 readGroups(file,
"ANGLES",
"nAngle",
configuration().angles());
133 readGroups(file,
"DIHEDRALS",
"nDihedral",
configuration().dihedrals());
#define UTIL_THROW(msg)
Macro for throwing an Exception, reporting function, file and line number.
Utility classes for scientific computation.
A label string in a file format.
void setClassName(const char *className)
Set class name string.