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

Comparing branches/new_design/OOPSE-4/src/UseTheForce/EAM.cpp (file contents):
Revision 1766 by tim, Fri Nov 19 21:38:22 2004 UTC vs.
Revision 1767 by tim, Mon Nov 22 23:04:16 2004 UTC

# Line 33 | Line 33 | ForceFieldFactory::getInstance()->registerForceField("
33   }
34  
35   //register createDUFF to ForceFieldFactory
36 < ForceFieldFactory::getInstance()->registerForceField("EAM", createDUFF);
36 > ForceFieldFactory::getInstance()->registerForceField("EAM", createEAM);
37  
38   void EAM::parse(const std::string& filename) {
39      ifstrstream* ffStream;
# Line 71 | Line 71 | void EAM::parse(const std::string& filename) {
71                  atomType->setEAM();                            
72                  atomType->complete();
73  
74 <                parseEAMParamFile(potentialParamFile);
74 >                parseEAMParamFile(potentialParamFile, ident);
75                                  
76                  //add atom type to AtomTypeContainer
77                  addAtomType(atomTypeName, atomType);
# Line 80 | Line 80 | void EAM::parse(const std::string& filename) {
80                  
81              } else {
82                  sprintf( painCave.errMsg,
83 <                       "Not enough tokens when parsing Lennard-Jones Force Field : %s\n"
83 >                       "Not enough tokens when parsing EAM Force Field : %s\n"
84                         "in line %d : %s\n",
85                         filename.c_str(), lineNo, line);
86                  painCave.severity = OOPSE_ERROR;
# Line 96 | Line 96 | void EAM::parseEAMParamFile(const std::string& potenti
96  
97   }
98  
99 < void EAM::parseEAMParamFile(const std::string& potentialParamFile) {
99 > void EAM::parseEAMParamFile(const std::string& potentialParamFile, int ident) {
100  
101      ifstrstream* ppfStream;
102      ppfStream = openForceFiledFile(potentialParamFile);
# Line 109 | Line 109 | void EAM::parseEAMParamFile(const std::string& potenti
109  
110  
111      //The Second line contains atomic number, atomic mass, a lattice constant and lattic type
112 <    int ident;
112 >    int junk;
113      double mass;
114      double latticeConstant;
115 <    std::string lattic;
115 >    std::string lattice;
116      if (ppfStream->getline(buffer, bufferSize)) {      
117          StringTokenizer tokenizer1(buffer);
118          ident = tokenizer1.nextTokenAsInt();
119          
120          if (tokenizer1.countTokens() >= 4) {
121 <            ident = tokenizer1.nextTokenAsInt();
121 >            junk = tokenizer1.nextTokenAsInt();
122              mass = tokenizer1.nextTokenAsDouble();
123              latticeConstant = tokenizer1.nextTokenAsDouble();
124              lattice = tokenizer1.nextToken();
# Line 160 | Line 160 | void EAM::parseEAMParamFile(const std::string& potenti
160      parseEAMArray(ppfStream, rhovals, nr);
161      parseEAMArray(ppfStream, Frhovals, nrho);
162  
163 +    
164      int status;
165      newEAMtype(&latticeConstant, &nrho, &drho,  &nr, &dr, &rcut,
166                          &rvals[0], &rhovals[0], &Frhovals[0], &ident, &status );

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines