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

Comparing branches/new_design/OOPSE-2.0/src/io/BondTypesSectionParser.cpp (file contents):
Revision 1800 by tim, Tue Nov 30 04:14:43 2004 UTC vs.
Revision 1801 by tim, Tue Nov 30 04:43:29 2004 UTC

# Line 44 | Line 44 | void BondTypesSectionParser::parseLine(ForceField& ff,
44  
45   void BondTypesSectionParser::parseLine(ForceField& ff,const std::string& line, int lineNo){
46      StringTokenizer tokenizer(line);
47    std::string at1;
48    std::string at2;
49    std::string bt;
47      BondType* bondType = NULL;
51    double b0;
52    
48      int nTokens = tokenizer.countTokens();
49  
50      if (nTokens < 4) {
# Line 57 | Line 52 | void BondTypesSectionParser::parseLine(ForceField& ff,
52          return;
53      }
54      
55 <    at1 = tokenizer.nextToken();
56 <    at2 = tokenizer.nextToken();
57 <    BondTypeEnum bt = getTorsionTypeEnum(tokenizer.nextToken());
58 <    b0 = tokenizer.nextTokenAsDouble();
55 >    std::string at1 = tokenizer.nextToken();
56 >    std::string at2 = tokenizer.nextToken();
57 >    BondTypeEnum bt = getBondTypeEnum(tokenizer.nextToken());
58 >    double b0 = tokenizer.nextTokenAsDouble();
59      nTokens -= 4;
60  
61      //switch is a maintain nightmare
62      switch(bt) {
63          case btFixed :
64 <            bondType = new FixedBondType();
64 >            bondType = new FixedBondType(b0);
65              break;
66              
67          case btHarmonic :
# Line 117 | Line 112 | void BondTypesSectionParser::parseLine(ForceField& ff,
112                  int nPairs = nTokens / 2;
113                  int power;
114                  double coefficient;
115 <                PolynomialBondType pbt = new PolynomialBondType();
115 >                PolynomialBondType* pbt = new PolynomialBondType(b0);
116                  
117                  for (int i = 0; i < nPairs; ++i) {
118                      power = tokenizer.nextTokenAsInt();
# Line 128 | Line 123 | void BondTypesSectionParser::parseLine(ForceField& ff,
123              
124              break;
125  
126 +        case btUnknown :
127          default:
128 +            break;
129              
130      }
131  
# Line 138 | Line 135 | BondTypeEnum BondTypesSectionParser::getTorsionTypeEnu
135  
136   }
137  
138 < BondTypeEnum BondTypesSectionParser::getTorsionTypeEnum(const std::string& str) {
138 > BondTypesSectionParser::BondTypeEnum BondTypesSectionParser::getBondTypeEnum(const std::string& str) {
139      std::map<std::string, BondTypeEnum>::iterator i;
140      i = stringToEnumMap_.find(str);
141  
142 <    return i == stringToEnumMap_.end() ? TorsionTypesSectionParser::ttUnknown : i->second;
142 >    return i == stringToEnumMap_.end() ? btUnknown : i->second;
143   }
144  
145   } //end namespace oopse

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines