ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE-4/src/UseTheForce/DUFF.cpp
(Generate patch)

Comparing trunk/OOPSE-4/src/UseTheForce/DUFF.cpp (file contents):
Revision 2109 by tim, Thu Mar 10 20:28:17 2005 UTC vs.
Revision 2229 by chrisfen, Tue May 17 22:35:01 2005 UTC

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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines