45 |
|
#include "UseTheForce/DarkSide/sticky_interface.h" |
46 |
|
#include "UseTheForce/DarkSide/gb_interface.h" |
47 |
|
#include "UseTheForce/ForceFieldFactory.hpp" |
48 |
+ |
#include "io/BaseAtomTypesSectionParser.hpp" |
49 |
|
#include "io/DirectionalAtomTypesSectionParser.hpp" |
50 |
|
#include "io/AtomTypesSectionParser.hpp" |
51 |
+ |
#include "io/BaseAtomTypesSectionParser.hpp" |
52 |
|
#include "io/LennardJonesAtomTypesSectionParser.hpp" |
53 |
|
#include "io/ChargeAtomTypesSectionParser.hpp" |
54 |
|
#include "io/MultipoleAtomTypesSectionParser.hpp" |
83 |
|
//BendTypesSectionParser and TorsionTypesSectionParser are not important. |
84 |
|
spMan_.push_back(new OptionSectionParser(forceFieldOptions_)); |
85 |
|
spMan_.push_back(new DirectionalAtomTypesSectionParser(forceFieldOptions_)); |
86 |
+ |
spMan_.push_back(new BaseAtomTypesSectionParser()); |
87 |
|
spMan_.push_back(new AtomTypesSectionParser()); |
88 |
|
spMan_.push_back(new LennardJonesAtomTypesSectionParser(forceFieldOptions_)); |
89 |
|
spMan_.push_back(new ChargeAtomTypesSectionParser(forceFieldOptions_)); |
99 |
|
|
100 |
|
void DUFF::parse(const std::string& filename) { |
101 |
|
ifstrstream* ffStream; |
102 |
+ |
bool hasGBtypes; |
103 |
+ |
|
104 |
|
ffStream = openForceFieldFile(filename); |
105 |
|
|
106 |
|
spMan_.parse(*ffStream, *this); |
110 |
|
|
111 |
|
for (at = atomTypeCont_.beginType(i); at != NULL; |
112 |
|
at = atomTypeCont_.nextType(i)) { |
113 |
+ |
// useBase sets the responsibilities, and these have to be done |
114 |
+ |
// after the atomTypes and Base types have all been scanned: |
115 |
+ |
|
116 |
+ |
std::vector<AtomType*> ayb = at->allYourBase(); |
117 |
+ |
if (ayb.size() > 1) { |
118 |
+ |
for (int j = ayb.size()-1; j > 0; j--) { |
119 |
+ |
|
120 |
+ |
ayb[j-1]->useBase(ayb[j]); |
121 |
+ |
|
122 |
+ |
} |
123 |
+ |
} |
124 |
|
at->makeFortranAtomType(); |
125 |
|
} |
126 |
|
|
129 |
|
at->complete(); |
130 |
|
} |
131 |
|
|
132 |
+ |
hasGBtypes = false; |
133 |
+ |
for (at = atomTypeCont_.beginType(i); at != NULL; |
134 |
+ |
at = atomTypeCont_.nextType(i)) { |
135 |
+ |
if (at->isGayBerne()) |
136 |
+ |
hasGBtypes = true; |
137 |
+ |
} |
138 |
+ |
|
139 |
|
int isError = 0; |
140 |
|
|
141 |
+ |
if (hasGBtypes) { |
142 |
+ |
completeGBFF(&isError); |
143 |
+ |
} |
144 |
+ |
|
145 |
|
delete ffStream; |
146 |
|
|
147 |
|
} |