ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/OpenMD/trunk/src/brains/ForceField.cpp
(Generate patch)

Comparing trunk/src/UseTheForce/ForceField.cpp (file contents):
Revision 507 by gezelter, Fri Apr 15 22:04:00 2005 UTC vs.
Revision 1151 by chuckv, Fri Jul 6 18:15:03 2007 UTC

# Line 50 | Line 50
50   #include "UseTheForce/ForceField.hpp"
51   #include "utils/simError.h"
52   #include "UseTheForce/DarkSide/atype_interface.h"
53 + #include "UseTheForce/DarkSide/fForceOptions_interface.h"
54 + #include "UseTheForce/DarkSide/switcheroo_interface.h"
55   namespace oopse {
56  
57    ForceField::ForceField() {
# Line 67 | Line 69 | namespace oopse {
69  
70    ForceField::~ForceField() {
71      deleteAtypes();
72 +    deleteSwitch();
73    }
74  
75    AtomType* ForceField::getAtomType(const std::string &at) {
# Line 128 | Line 131 | namespace oopse {
131  
132    }
133  
134 +  NonBondedInteractionType* ForceField::getNonBondedInteractionType(const std::string &at1, const std::string &at2) {
135 +    std::vector<std::string> keys;
136 +    keys.push_back(at1);
137 +    keys.push_back(at2);    
138 +
139 +    //try exact match first
140 +    NonBondedInteractionType* nbiType = nonBondedInteractionTypeCont_.find(keys);
141 +    if (nbiType) {
142 +      return nbiType;
143 +    } else {
144 +      //if no exact match found, try wild card match
145 +      return nonBondedInteractionTypeCont_.find(keys, wildCardAtomTypeName_);
146 +    }
147 +
148 +  }
149 +
150    BondType* ForceField::getExactBondType(const std::string &at1, const std::string &at2){
151      std::vector<std::string> keys;
152      keys.push_back(at1);
# Line 153 | Line 172 | namespace oopse {
172      keys.push_back(at4);  
173      return torsionTypeCont_.find(keys);
174    }
175 +
176 +  NonBondedInteractionType* ForceField::getExactNonBondedInteractionType(const std::string &at1, const std::string &at2){
177 +    std::vector<std::string> keys;
178 +    keys.push_back(at1);
179 +    keys.push_back(at2);    
180 +    return nonBondedInteractionTypeCont_.find(keys);
181 +  }
182 +
183 +
184    bool ForceField::addAtomType(const std::string &at, AtomType* atomType) {
185      std::vector<std::string> keys;
186      keys.push_back(at);
# Line 186 | Line 214 | namespace oopse {
214      return torsionTypeCont_.add(keys, torsionType);
215    }
216  
217 <  double ForceField::getRcutFromAtomType(AtomType* at) {
217 >  bool ForceField::addNonBondedInteractionType(const std::string &at1, const std::string &at2, NonBondedInteractionType* nbiType) {
218 >    std::vector<std::string> keys;
219 >    keys.push_back(at1);
220 >    keys.push_back(at2);    
221 >    return nonBondedInteractionTypeCont_.add(keys, nbiType);
222 >
223 >  }
224 >
225 >  RealType ForceField::getRcutFromAtomType(AtomType* at) {
226      /**@todo */
227      GenericData* data;
228 <    double rcut = 0.0;
228 >    RealType rcut = 0.0;
229  
230      if (at->isLennardJones()) {
231        data = at->getPropertyByName("LennardJones");
# Line 252 | Line 288 | namespace oopse {
288  
289    }
290  
291 +  void ForceField::setFortranForceOptions(){
292 +    ForceOptions theseFortranOptions;
293 +    forceFieldOptions_.makeFortranOptions(theseFortranOptions);
294 +    setfForceOptions(&theseFortranOptions);
295 +  }
296   } //end namespace oopse

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines