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

Comparing trunk/OOPSE-4/src/UseTheForce/Amber_FF.cpp (file contents):
Revision 3431 by cli2, Fri Jul 4 20:54:29 2008 UTC vs.
Revision 3432 by gezelter, Mon Jul 14 12:35:58 2008 UTC

# Line 64 | Line 64 | namespace oopse {
64      //The order of adding section parsers is important.
65  
66      spMan_.push_back(new OptionSectionParser(forceFieldOptions_));    
67
67      spMan_.push_back(new BaseAtomTypesSectionParser());
68      spMan_.push_back(new AtomTypesSectionParser());
69      spMan_.push_back(new LennardJonesAtomTypesSectionParser(forceFieldOptions_));
# Line 73 | Line 72 | namespace oopse {
72      spMan_.push_back(new BendTypesSectionParser(forceFieldOptions_));
73      spMan_.push_back(new TorsionTypesSectionParser(forceFieldOptions_));
74      spMan_.push_back(new InversionTypesSectionParser(forceFieldOptions_));
76    
75    }
76  
77    void Amber_FF::parse(const std::string& filename) {
78      ifstrstream* ffStream;
79  
80      ffStream = openForceFieldFile(filename);
83
81      spMan_.parse(*ffStream, *this);
82  
83      ForceField::AtomTypeContainer::MapTypeIterator i;
# Line 88 | 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 >
101 >      at->makeFortranAtomType();      
102      }
103  
104      for (at = atomTypeCont_.beginType(i); at != NULL;
105           at = atomTypeCont_.nextType(i)) {
106        at->complete();
107      }    
108 <
108 >    
109      delete ffStream;
110      
111    }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines