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

Comparing trunk/OOPSE-4/src/io/LennardJonesAtomTypesSectionParser.cpp (file contents):
Revision 2062 by tim, Fri Feb 25 21:22:00 2005 UTC vs.
Revision 2204 by gezelter, Fri Apr 15 22:04:00 2005 UTC

# Line 1 | Line 1
1 < /*
1 > /*
2   * Copyright (c) 2005 The University of Notre Dame. All Rights Reserved.
3   *
4   * The University of Notre Dame grants you ("Licensee") a
# Line 45 | Line 45 | LennardJonesAtomTypesSectionParser::LennardJonesAtomTy
45   #include "utils/simError.h"
46   namespace oopse {
47  
48 < LennardJonesAtomTypesSectionParser::LennardJonesAtomTypesSectionParser() {
48 >  LennardJonesAtomTypesSectionParser::LennardJonesAtomTypesSectionParser() {
49      setSectionName("LennardJonesAtomTypes");
50 < }
50 >  }
51  
52 < void LennardJonesAtomTypesSectionParser::parseLine(ForceField& ff,const std::string& line, int lineNo){
52 >  void LennardJonesAtomTypesSectionParser::parseLine(ForceField& ff,const std::string& line, int lineNo){
53      StringTokenizer tokenizer(line);
54      int nTokens = tokenizer.countTokens();    
55  
56      //in LennardJonesAtomTypesSectionParser, a line at least contains 3 tokens
57      //atomTypeName, epsilon and sigma
58      if (nTokens < 3)  {
59 <        sprintf(painCave.errMsg, "LennardJonesAtomTypesSectionParser Error: Not enough tokens at line %d\n",
60 <                lineNo);
61 <        painCave.isFatal = 1;
62 <        simError();                    
59 >      sprintf(painCave.errMsg, "LennardJonesAtomTypesSectionParser Error: Not enough tokens at line %d\n",
60 >              lineNo);
61 >      painCave.isFatal = 1;
62 >      simError();                    
63      } else {
64  
65 <        std::string atomTypeName = tokenizer.nextToken();    
66 <        AtomType* atomType = ff.getAtomType(atomTypeName);
65 >      std::string atomTypeName = tokenizer.nextToken();    
66 >      AtomType* atomType = ff.getAtomType(atomTypeName);
67  
68 <        if (atomType != NULL) {
69 <            LJParam ljParam;                        
70 <            ljParam.epsilon = tokenizer.nextTokenAsDouble();
71 <            ljParam.sigma = tokenizer.nextTokenAsDouble();
72 <            ljParam.soft_pot = 0;
68 >      if (atomType != NULL) {
69 >        LJParam ljParam;                        
70 >        ljParam.epsilon = tokenizer.nextTokenAsDouble();
71 >        ljParam.sigma = tokenizer.nextTokenAsDouble();
72 >        ljParam.soft_pot = 0;
73  
74 <            if (tokenizer.hasMoreTokens()) {
75 <                std::string pot_type = tokenizer.nextToken();
76 <                if (pot_type == "soft") {
77 <                    ljParam.soft_pot = 1;
78 <                }
79 <            }
74 >        if (tokenizer.hasMoreTokens()) {
75 >          std::string pot_type = tokenizer.nextToken();
76 >          if (pot_type == "soft") {
77 >            ljParam.soft_pot = 1;
78 >          }
79 >        }
80              
81 <            atomType->addProperty(new LJParamGenericData("LennardJones", ljParam));
82 <            atomType->setLennardJones();
83 <        }else {
84 <            sprintf(painCave.errMsg, "LennardJonesAtomTypesSectionParser Error: Atom Type [%s] is not created yet\n", atomTypeName.c_str());
85 <            painCave.isFatal = 1;
86 <            simError();    
87 <        }
81 >        atomType->addProperty(new LJParamGenericData("LennardJones", ljParam));
82 >        atomType->setLennardJones();
83 >      }else {
84 >        sprintf(painCave.errMsg, "LennardJonesAtomTypesSectionParser Error: Atom Type [%s] is not created yet\n", atomTypeName.c_str());
85 >        painCave.isFatal = 1;
86 >        simError();    
87 >      }
88                        
89      }    
90  
91  
92 < }
92 >  }
93  
94   } //end namespace oopse
95  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines