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

Comparing trunk/src/UseTheForce/SC_FF.cpp (file contents):
Revision 728 by chuckv, Mon Nov 14 21:29:36 2005 UTC vs.
Revision 1280 by gezelter, Wed Jul 16 02:07:09 2008 UTC

# Line 44 | Line 44
44   *
45   *  Created by Charles F. Vardeman II on 11/9/05.
46   *  @author  Charles F. Vardeman II
47 < *  @version $Id: SC_FF.cpp,v 1.1 2005-11-14 21:29:25 chuckv Exp $
47 > *  @version $Id: SC_FF.cpp,v 1.10 2008-07-16 02:07:09 gezelter Exp $
48   *
49   */
50  
# Line 54 | Line 54
54   #include "UseTheForce/DarkSide/sticky_interface.h"
55   #include "UseTheForce/DarkSide/suttonchen_interface.h"
56   #include "UseTheForce/ForceFieldFactory.hpp"
57 < #include "io/DirectionalAtomTypesSectionParser.hpp"
57 > #include "io/OptionSectionParser.hpp"
58 > #include "io/BaseAtomTypesSectionParser.hpp"
59   #include "io/AtomTypesSectionParser.hpp"
59 #include "io/LennardJonesAtomTypesSectionParser.hpp"
60 #include "io/ChargeAtomTypesSectionParser.hpp"
61 #include "io/MultipoleAtomTypesSectionParser.hpp"
62 #include "io/EAMAtomTypesSectionParser.hpp"
63 #include "io/StickyAtomTypesSectionParser.hpp"
64 #include "io/BondTypesSectionParser.hpp"
65 #include "io/BendTypesSectionParser.hpp"
66 #include "io/TorsionTypesSectionParser.hpp"
60   #include "io/SCAtomTypesSectionParser.hpp"
61   #include "UseTheForce/ForceFieldCreator.hpp"
62   #include "utils/simError.h"
# Line 72 | Line 65 | namespace oopse {
65    SC_FF::SC_FF(){
66      
67      //set default force field filename
68 <    setForceFieldFileName("SuttonChen.QSC.frc");
68 >    setForceFieldFileName("SuttonChen.frc");
69      
70      //the order of adding section parsers are important
71 +    //OptionSectionParser must come first to set options for other parsers
72      //DirectionalAtomTypesSectionParser should be added before AtomTypesSectionParser Since
73      //These two section parsers will actually create "real" AtomTypes (AtomTypesSectionParser will create
74      //AtomType and DirectionalAtomTypesSectionParser will creat DirectionalAtomType which is a subclass
# Line 84 | Line 78 | namespace oopse {
78      //Make sure they are added after DirectionalAtomTypesSectionParser and AtomTypesSectionParser.
79      //The order of BondTypesSectionParser, BendTypesSectionParser and TorsionTypesSectionParser are
80      //not important.
81 <    spMan_.push_back(new DirectionalAtomTypesSectionParser());
81 >    spMan_.push_back(new OptionSectionParser(forceFieldOptions_));
82 >    spMan_.push_back(new BaseAtomTypesSectionParser());
83      spMan_.push_back(new AtomTypesSectionParser());
84 <    spMan_.push_back(new LennardJonesAtomTypesSectionParser());
90 <    spMan_.push_back(new ChargeAtomTypesSectionParser());
91 <    spMan_.push_back(new MultipoleAtomTypesSectionParser());
92 <    spMan_.push_back(new EAMAtomTypesSectionParser());
93 <    spMan_.push_back(new StickyAtomTypesSectionParser());
94 <    spMan_.push_back(new BondTypesSectionParser());
95 <    spMan_.push_back(new BendTypesSectionParser());
96 <    spMan_.push_back(new TorsionTypesSectionParser());
97 <    spMan_.push_back(new SCAtomTypesSectionParser());
84 >    spMan_.push_back(new SCAtomTypesSectionParser(forceFieldOptions_));
85      
86    }
87    
# Line 107 | Line 94 | namespace oopse {
94      ForceField::AtomTypeContainer::MapTypeIterator i;
95      AtomType* at;
96      
97 +    // Set forcefield options
98 +    
99      for (at = atomTypeCont_.beginType(i); at != NULL; at = atomTypeCont_.nextType(i)) {
100 +      // useBase sets the responsibilities, and these have to be done
101 +      // after the atomTypes and Base types have all been scanned:
102 +
103 +      std::vector<AtomType*> ayb = at->allYourBase();      
104 +      if (ayb.size() > 1) {
105 +        for (int j = ayb.size()-1; j > 0; j--) {
106 +          
107 +          ayb[j-1]->useBase(ayb[j]);
108 +
109 +        }
110 +      }
111        at->makeFortranAtomType();
112      }
113      
114 +    
115      for (at = atomTypeCont_.beginType(i); at != NULL; at = atomTypeCont_.nextType(i)) {
116        at->complete();
117      }
# Line 121 | Line 122 | namespace oopse {
122      
123    SC_FF::~SC_FF(){
124      // We need to clean up the fortran side so we don't have bad things happen if
125 <    // we try to create a second EAM force field.
125 >    // we try to create a second SC force field.
126      destroySCTypes();
127    }
128   } //end namespace oopse

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines