ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/OpenMD/branches/heatflux/src/UseTheForce/Amber_FF.cpp
(Generate patch)

Comparing trunk/src/UseTheForce/Amber_FF.cpp (file contents):
Revision 1271 by gezelter, Tue Jul 1 13:53:43 2008 UTC vs.
Revision 1280 by gezelter, Wed Jul 16 02:07:09 2008 UTC

# Line 50 | Line 50
50   #include "io/BondTypesSectionParser.hpp"
51   #include "io/BendTypesSectionParser.hpp"
52   #include "io/TorsionTypesSectionParser.hpp"
53 + #include "io/InversionTypesSectionParser.hpp"
54   #include "io/OptionSectionParser.hpp"
55   #include "UseTheForce/ForceFieldCreator.hpp"
56  
# Line 63 | Line 64 | namespace oopse {
64      //The order of adding section parsers is important.
65  
66      spMan_.push_back(new OptionSectionParser(forceFieldOptions_));    
66
67      spMan_.push_back(new BaseAtomTypesSectionParser());
68      spMan_.push_back(new AtomTypesSectionParser());
69      spMan_.push_back(new LennardJonesAtomTypesSectionParser(forceFieldOptions_));
# Line 71 | Line 71 | namespace oopse {
71      spMan_.push_back(new BondTypesSectionParser(forceFieldOptions_));
72      spMan_.push_back(new BendTypesSectionParser(forceFieldOptions_));
73      spMan_.push_back(new TorsionTypesSectionParser(forceFieldOptions_));
74 <    
74 >    spMan_.push_back(new InversionTypesSectionParser(forceFieldOptions_));
75    }
76  
77    void Amber_FF::parse(const std::string& filename) {
78      ifstrstream* ffStream;
79  
80      ffStream = openForceFieldFile(filename);
81
81      spMan_.parse(*ffStream, *this);
82  
83      ForceField::AtomTypeContainer::MapTypeIterator i;
# Line 86 | Line 85 | namespace oopse {
85  
86      for (at = atomTypeCont_.beginType(i); at != NULL;
87           at = atomTypeCont_.nextType(i)) {
88 <      at->makeFortranAtomType();
88 >    
89 >      // useBase sets the responsibilities, and these have to be done
90 >      // after the atomTypes and Base types have all been scanned:
91 >
92 >      std::vector<AtomType*> ayb = at->allYourBase();      
93 >      if (ayb.size() > 1) {
94 >        for (int j = ayb.size()-1; j > 0; j--) {
95 >          
96 >          ayb[j-1]->useBase(ayb[j]);
97 >
98 >        }
99 >      }
100 >      at->makeFortranAtomType();      
101      }
102  
103      for (at = atomTypeCont_.beginType(i); at != NULL;
104           at = atomTypeCont_.nextType(i)) {
105        at->complete();
106      }    
107 <
107 >    
108      delete ffStream;
109      
110    }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines