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 2448 by tim, Wed Nov 16 23:10:02 2005 UTC

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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines