42 |
|
|
43 |
|
#include "UseTheForce/DUFF.hpp" |
44 |
|
#include "UseTheForce/DarkSide/lj_interface.h" |
45 |
– |
#include "UseTheForce/DarkSide/charge_interface.h" |
46 |
– |
#include "UseTheForce/DarkSide/dipole_interface.h" |
45 |
|
#include "UseTheForce/DarkSide/sticky_interface.h" |
46 |
|
#include "UseTheForce/ForceFieldFactory.hpp" |
47 |
|
#include "io/DirectionalAtomTypesSectionParser.hpp" |
48 |
|
#include "io/AtomTypesSectionParser.hpp" |
49 |
|
#include "io/LennardJonesAtomTypesSectionParser.hpp" |
50 |
< |
#include "io/ElectrostaticAtomTypesSectionParser.hpp" |
50 |
> |
#include "io/ChargeAtomTypesSectionParser.hpp" |
51 |
> |
#include "io/MultipoleAtomTypesSectionParser.hpp" |
52 |
|
#include "io/StickyAtomTypesSectionParser.hpp" |
53 |
+ |
#include "io/StickyPowerAtomTypesSectionParser.hpp" |
54 |
|
#include "io/BondTypesSectionParser.hpp" |
55 |
|
#include "io/BendTypesSectionParser.hpp" |
56 |
|
#include "io/TorsionTypesSectionParser.hpp" |
58 |
|
|
59 |
|
namespace oopse { |
60 |
|
|
61 |
< |
DUFF::DUFF(){ |
61 |
> |
DUFF::DUFF(){ |
62 |
|
|
63 |
|
//set default force field filename |
64 |
|
setForceFieldFileName("DUFF2.frc"); |
65 |
|
|
66 |
< |
//the order of adding section parsers are important |
67 |
< |
//DirectionalAtomTypesSectionParser should be added before AtomTypesSectionParser Since |
68 |
< |
//These two section parsers will actually create "real" AtomTypes (AtomTypesSectionParser will create |
69 |
< |
//AtomType and DirectionalAtomTypesSectionParser will creat DirectionalAtomType which is a subclass |
70 |
< |
//of AtomType, therefore it should come first). Other AtomTypes Section Parser will not create the |
71 |
< |
//"real" AtomType, they only add and set some attribute of the AtomType. Thus their order are not |
72 |
< |
//important. AtomTypesSectionParser should be added before other atom type section parsers. |
73 |
< |
//Make sure they are added after DirectionalAtomTypesSectionParser and AtomTypesSectionParser. |
74 |
< |
//The order of BondTypesSectionParser, BendTypesSectionParser and TorsionTypesSectionParser are |
75 |
< |
//not important. |
66 |
> |
//The order of adding section parsers is important. |
67 |
> |
//DirectionalAtomTypesSectionParser should be added before |
68 |
> |
//AtomTypesSectionParser, and these two section parsers will actually |
69 |
> |
//create "real" AtomTypes (AtomTypesSectionParser will create AtomType and |
70 |
> |
//DirectionalAtomTypesSectionParser will create DirectionalAtomType, which |
71 |
> |
//is a subclass of AtomType and should come first). Other AtomTypes Section |
72 |
> |
//Parser will not create the "real" AtomType, they only add and set some |
73 |
> |
//attribute of the AtomType. Thus their order are not important. |
74 |
> |
//AtomTypesSectionParser should be added before other atom type section |
75 |
> |
//parsers. Make sure they are added after DirectionalAtomTypesSectionParser |
76 |
> |
//and AtomTypesSectionParser. The order of BondTypesSectionParser, |
77 |
> |
//BendTypesSectionParser and TorsionTypesSectionParser are not important. |
78 |
|
spMan_.push_back(new DirectionalAtomTypesSectionParser()); |
79 |
|
spMan_.push_back(new AtomTypesSectionParser()); |
80 |
|
spMan_.push_back(new LennardJonesAtomTypesSectionParser()); |
81 |
< |
spMan_.push_back(new ElectrostaticAtomTypesSectionParser()); |
81 |
> |
spMan_.push_back(new ChargeAtomTypesSectionParser()); |
82 |
> |
spMan_.push_back(new MultipoleAtomTypesSectionParser()); |
83 |
|
spMan_.push_back(new StickyAtomTypesSectionParser()); |
84 |
+ |
spMan_.push_back(new StickyPowerAtomTypesSectionParser()); |
85 |
|
spMan_.push_back(new BondTypesSectionParser()); |
86 |
|
spMan_.push_back(new BendTypesSectionParser()); |
87 |
|
spMan_.push_back(new TorsionTypesSectionParser()); |
88 |
|
|
89 |
< |
} |
89 |
> |
} |
90 |
|
|
91 |
< |
void DUFF::parse(const std::string& filename) { |
91 |
> |
void DUFF::parse(const std::string& filename) { |
92 |
|
ifstrstream* ffStream; |
93 |
|
ffStream = openForceFieldFile(filename); |
94 |
|
|
97 |
|
ForceField::AtomTypeContainer::MapTypeIterator i; |
98 |
|
AtomType* at; |
99 |
|
|
100 |
< |
for (at = atomTypeCont_.beginType(i); at != NULL; at = atomTypeCont_.nextType(i)) { |
101 |
< |
at->makeFortranAtomType(); |
100 |
> |
for (at = atomTypeCont_.beginType(i); at != NULL; |
101 |
> |
at = atomTypeCont_.nextType(i)) { |
102 |
> |
at->makeFortranAtomType(); |
103 |
|
} |
104 |
|
|
105 |
< |
for (at = atomTypeCont_.beginType(i); at != NULL; at = atomTypeCont_.nextType(i)) { |
106 |
< |
at->complete(); |
105 |
> |
for (at = atomTypeCont_.beginType(i); at != NULL; |
106 |
> |
at = atomTypeCont_.nextType(i)) { |
107 |
> |
at->complete(); |
108 |
|
} |
109 |
+ |
|
110 |
+ |
delete ffStream; |
111 |
|
|
112 |
< |
} |
112 |
> |
} |
113 |
|
|
114 |
+ |
DUFF::~DUFF(){ |
115 |
+ |
destroyLJTypes(); |
116 |
+ |
destroyStickyTypes(); |
117 |
+ |
} |
118 |
|
} //end namespace oopse |