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

Comparing trunk/OOPSE-2.0/src/io/ElectrostaticAtomTypesSectionParser.cpp (file contents):
Revision 1930 by gezelter, Wed Jan 12 22:41:40 2005 UTC vs.
Revision 1957 by tim, Tue Jan 25 17:45:23 2005 UTC

# Line 42 | Line 42 | namespace oopse {
42   #include "io/ElectrostaticAtomTypesSectionParser.hpp"
43   #include "UseTheForce/ForceField.hpp"
44   #include "utils/NumericConstant.hpp"
45 + #include "utils/simError.h"
46   namespace oopse {
47  
48   ElectrostaticAtomTypesSectionParser::ElectrostaticAtomTypesSectionParser() {
# Line 67 | Line 68 | void ElectrostaticAtomTypesSectionParser::parseLine(Fo
68      // name 2 charge |u| Qxx Qyy Qzz [theta phi psi]
69      
70      if (nTokens < 2)  {
71 <        std::cerr << "ElectrostaticAtomTypesSectionParser Error: Not enought Tokens at line " << lineNo << std::endl;                  
71 >        sprintf(painCave.errMsg, "ElectrostaticAtomTypesSectionParser Error: Not enough tokens at line %d\n",
72 >                lineNo);
73 >        painCave.isFatal = 1;
74 >        simError();
75      } else {
76  
77          std::string atomTypeName = tokenizer.nextToken();    
# Line 87 | Line 91 | void ElectrostaticAtomTypesSectionParser::parseLine(Fo
91  
92                      dAtomType = dynamic_cast<DirectionalAtomType*>(atomType);            
93                      if (dAtomType == NULL) {
94 <                        std::cerr << "ElectrostaticAtomTypesSectionParser Warning:" << std::endl;
94 >                        sprintf(painCave.errMsg, "ElectrostaticAtomTypesSectionParser Error: Can not Cast Atom to DirectionalAtom at line \n");
95 >                        painCave.isFatal = 1;
96 >                        simError();
97                      }
98  
99                      parseCharge(tokenizer, dAtomType);
# Line 99 | Line 105 | void ElectrostaticAtomTypesSectionParser::parseLine(Fo
105  
106                      dAtomType = dynamic_cast<DirectionalAtomType*>(atomType);            
107                      if (dAtomType == NULL) {
108 <                        std::cerr << "ElectrostaticAtomTypesSectionParser Warning:" << std::endl;
108 >                        sprintf(painCave.errMsg, "ElectrostaticAtomTypesSectionParser Error: Can not Cast Atom to DirectionalAtom at line \n");
109 >                        painCave.isFatal = 1;
110 >                        simError();
111                      }
112  
113                      parseCharge(tokenizer, dAtomType);
# Line 114 | Line 122 | void ElectrostaticAtomTypesSectionParser::parseLine(Fo
122              }
123              
124          } else {
125 <            std::cerr << "ElectrostaticAtomTypesSectionParser Error: Can not find matched AtomType " << atomTypeName
126 <                          << "at line " << lineNo << std::endl;
125 >
126 >            sprintf(painCave.errMsg, "ElectrostaticAtomTypesSectionParser Error: Can not find matched AtomType at line %d\n",
127 >                    lineNo);
128 >            painCave.isFatal = 1;
129 >            simError();
130          }
131                        
132      }    

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines