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

Comparing trunk/OOPSE-2.0/src/io/ChargeAtomTypesSectionParser.cpp (file contents):
Revision 2097 by tim, Wed Mar 9 17:30:29 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 | ChargeAtomTypesSectionParser::ChargeAtomTypesSectionPa
45   #include "utils/simError.h"
46   namespace oopse {
47  
48 < ChargeAtomTypesSectionParser::ChargeAtomTypesSectionParser() {
48 >  ChargeAtomTypesSectionParser::ChargeAtomTypesSectionParser() {
49      setSectionName("ChargeAtomTypes");
50 < }
50 >  }
51  
52 < void ChargeAtomTypesSectionParser::parseLine(ForceField& ff,const std::string& line, int lineNo){
52 >  void ChargeAtomTypesSectionParser::parseLine(ForceField& ff,const std::string& line, int lineNo){
53      StringTokenizer tokenizer(line);
54      int nTokens = tokenizer.countTokens();    
55      
56      if (nTokens < 2)  {
57 <        sprintf(painCave.errMsg, "ChargeAtomTypesSectionParser Error: Not enough tokens at line %d\n",
58 <                lineNo);
59 <        painCave.isFatal = 1;
60 <        simError();
57 >      sprintf(painCave.errMsg, "ChargeAtomTypesSectionParser Error: Not enough tokens at line %d\n",
58 >              lineNo);
59 >      painCave.isFatal = 1;
60 >      simError();
61      } else {
62  
63 <        std::string atomTypeName = tokenizer.nextToken();    
63 >      std::string atomTypeName = tokenizer.nextToken();    
64          
65 <        AtomType* atomType = ff.getAtomType(atomTypeName);
66 <        if (atomType != NULL) {
67 <            double charge = tokenizer.nextTokenAsDouble();
65 >      AtomType* atomType = ff.getAtomType(atomTypeName);
66 >      if (atomType != NULL) {
67 >        double charge = tokenizer.nextTokenAsDouble();
68  
69 <            atomType->addProperty(new DoubleGenericData("Charge", charge));
70 <            atomType->setCharge();
71 <        } else {
69 >        atomType->addProperty(new DoubleGenericData("Charge", charge));
70 >        atomType->setCharge();
71 >      } else {
72  
73 <            sprintf(painCave.errMsg, "ChargeAtomTypesSectionParser Error: Can not find matched AtomType at line %d\n",
74 <                    lineNo);
75 <            painCave.isFatal = 1;
76 <            simError();
77 <        }
73 >        sprintf(painCave.errMsg, "ChargeAtomTypesSectionParser Error: Can not find matched AtomType at line %d\n",
74 >                lineNo);
75 >        painCave.isFatal = 1;
76 >        simError();
77 >      }
78                        
79      }
80  
81 < }
81 >  }
82  
83  
84   } //end namespace oopse

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines