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

Comparing trunk/OOPSE-3.0/src/io/DirectionalAtomTypesSectionParser.cpp (file contents):
Revision 2208 by gezelter, Fri Apr 15 22:04:00 2005 UTC vs.
Revision 2209 by chrisfen, Mon Apr 18 03:50:23 2005 UTC

# Line 49 | Line 49 | namespace oopse {
49      setSectionName("DirectionalAtomTypes");
50    }
51  
52 <  void DirectionalAtomTypesSectionParser::parseLine(ForceField& ff,const std::string& line, int lineNo){
52 >  void DirectionalAtomTypesSectionParser::parseLine(ForceField& ff,
53 >                                                    const std::string& line,
54 >                                                    int lineNo){
55      StringTokenizer tokenizer(line);
56      int nTokens = tokenizer.countTokens();    
57  
58      //in AtomTypeSection, a line at least contains 2 tokens
59      //atomTypeName and mass
60      if (nTokens < 4)  {
61 <      sprintf(painCave.errMsg, "DirectionalAtomTypesSectionParser Error: Not enough tokens at line %d\n",
62 <              lineNo);
61 >      sprintf(painCave.errMsg,
62 >              "DirectionalAtomTypesSectionParser Error: Not enough tokens at line %d\n",
63 >              lineNo);
64        painCave.isFatal = 1;
65        simError();
66                    
# Line 67 | Line 70 | namespace oopse {
70        AtomType* atomType = ff.getAtomType(atomTypeName);
71        DirectionalAtomType* dAtomType;
72        if (atomType == NULL) {
73 <        dAtomType = new DirectionalAtomType();
74 <        int ident = ff.getNAtomType() + 1;
75 <        dAtomType->setIdent(ident);
76 <        dAtomType->setName(atomTypeName);
77 <        ff.addAtomType(atomTypeName, dAtomType);
73 >        dAtomType = new DirectionalAtomType();
74 >        int ident = ff.getNAtomType() + 1;
75 >        dAtomType->setIdent(ident);
76 >        dAtomType->setName(atomTypeName);
77 >        ff.addAtomType(atomTypeName, dAtomType);
78        } else {
79 <        dAtomType = dynamic_cast<DirectionalAtomType*>(atomType);
80 <        if (dAtomType == NULL) {
81 <          sprintf(painCave.errMsg,"DirectionalAtomTypesSectionParser:: Can not cast to DirectionalAtomType");
82 <          painCave.isFatal = 1;
83 <          simError();
84 <        }
79 >        dAtomType = dynamic_cast<DirectionalAtomType*>(atomType);
80 >        if (dAtomType == NULL) {
81 >          sprintf(painCave.errMsg,
82 >                  "DirectionalAtomTypesSectionParser:: Can not cast to DirectionalAtomType");
83 >          painCave.isFatal = 1;
84 >          simError();
85 >        }
86        }
87 <
87 >      
88        double Ixx = tokenizer.nextTokenAsDouble();
89        double Iyy = tokenizer.nextTokenAsDouble();
90        double Izz = tokenizer.nextTokenAsDouble();            

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines