ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/branches/new_design/OOPSE-3.0/src/UseTheForce/DUFF.cpp
(Generate patch)

Comparing branches/new_design/OOPSE-3.0/src/UseTheForce/DUFF.cpp (file contents):
Revision 1759 by tim, Fri Nov 19 18:02:33 2004 UTC vs.
Revision 1765 by tim, Mon Nov 22 20:55:52 2004 UTC

# Line 76 | Line 76 | void DUFF::parse(const std::string& filename) {
76      std::string line;
77      char buffer[bufferSize];
78      int lineNo = 0;
79 <    int atomIdent = 1;  //atom's indent begins from 1 (since only fortran's array begins from 1)
79 >    int atomIdent = getNAtomType() + 1;  //atom's indent begins from 1 (since only fortran's array begins from 1)
80      ParseState currentSection = DUFF::UnknownSection;
81      
82      while(ffStream.getline(buffer, bufferSize)){
# Line 146 | Line 146 | void DUFF::parse(const std::string& filename) {
146      delete ffStream;
147   }
148  
149
149   void DUFF::parseAtomType(const std::string& line, int lineNo, int& ident){
150      StringTokenizer tokenizer(line);
151      int nTokens = tokenizer.countTokens();    
# Line 198 | Line 197 | void DUFF::parseAtomType(const std::string& line, int
197          atomType->setName(atomTypeName);
198          atomType->setMass(mass);
199          
200 <        //by default, all of the properties in AtomTypeProperties is set to 0
201 <        //In  Lennard-Jones Force Field, we only need to set Lennard-Jones to true
202 <        atomType->setLennardJones();
200 >        if (isLJ) {
201 >            atomType->setLennardJones();
202 >        }
203  
204 +        if (isCharge) {
205 +            atomType->setCharge();
206 +        }
207 +        
208          atomType->setIdent(ident);
209          
210          atomType->complete();
# Line 235 | Line 238 | void DUFF::parseDirectionalAtomType(const std::string&
238      StringTokenizer tokenizer(line);
239      int nTokens = tokenizer.countTokens();  
240      
241 <    //in irectionalAtomTypeSection, a line at least contains 6 tokens
241 >    //in DirectionalAtomTypeSection, a line at least contains 6 tokens
242      //AtomTypeName, isDipole, isSticky, I_xx, I_yy and I_zz
243      if (nTokens < 6) {
244 <
244 >        std::cerr << "Not enought tokens" << std::endl;
245      } else {
246  
247  
# Line 261 | Line 264 | void DUFF::parseDirectionalAtomType(const std::string&
264  
265          }
266  
267 <        dAtomType->setDipole(isDipole);
268 <        dAtomType->setSticky(isSticky);
267 >        if (isDipole) {
268 >            dAtomType->setDipole();
269 >        }
270  
271 +        if (isSticky) {
272 +            dAtomType->setSticky();
273 +        }
274 +        
275          Mat3x3d inertialMat;
276          inertialMat(0, 0) = Ixx;
277 <        inertialMat(1, 1) = Ixx;
278 <        inertialMat(2, 2) = Ixx;        
277 >        inertialMat(1, 1) = Iyy;
278 >        inertialMat(2, 2) = Izz;        
279          dAtomType->setI(inertialMat);
280  
281          //read dipole moment

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines