45 |
|
|
46 |
|
void BendTypesSectionParser::parseLine(ForceField& ff,const std::string& line, int lineNo){ |
47 |
|
StringTokenizer tokenizer(line); |
48 |
– |
std::string at1; |
49 |
– |
std::string at2; |
50 |
– |
std::string at3; |
51 |
– |
std::string bt; |
52 |
– |
double theta0; |
48 |
|
BendType* bendType = NULL; |
49 |
|
|
50 |
|
int nTokens = tokenizer.countTokens(); |
54 |
|
return; |
55 |
|
} |
56 |
|
|
57 |
< |
at1 = tokenizer.nextToken(); |
58 |
< |
at2 = tokenizer.nextToken(); |
59 |
< |
at3 = tokenizer.nextToken(); |
60 |
< |
bt = tokenizer.nextToken(); |
61 |
< |
theta0 = tokenizer.nextTokenAsDouble(); |
57 |
> |
std::string at1 = tokenizer.nextToken(); |
58 |
> |
std::string at2 = tokenizer.nextToken(); |
59 |
> |
std::string at3 = tokenizer.nextToken(); |
60 |
> |
BendTypeEnum bt = getBendTypeEnum(tokenizer.nextToken()); |
61 |
> |
double theta0 = tokenizer.nextTokenAsDouble(); |
62 |
|
nTokens -= 5; |
63 |
|
|
64 |
|
//switch is a maintain nightmare |
131 |
|
int nPairs = nTokens / 2; |
132 |
|
int power; |
133 |
|
double coefficient; |
134 |
< |
PolynomialBendType* pbt = new PolynomialBendType(); |
134 |
> |
PolynomialBendType* pbt = new PolynomialBendType(theta0); |
135 |
|
|
136 |
|
for (int i = 0; i < nPairs; ++i) { |
137 |
|
power = tokenizer.nextTokenAsInt(); |
142 |
|
|
143 |
|
break; |
144 |
|
|
145 |
+ |
case btUnknown : |
146 |
|
default: |
147 |
+ |
break; |
148 |
|
|
149 |
|
} |
150 |
|
|
153 |
|
} |
154 |
|
} |
155 |
|
|
156 |
< |
BendTypeEnum BendTypesSectionParser::getTorsionTypeEnum(const std::string& str) { |
157 |
< |
std::map<std::string, BondTypeEnum>::iterator i; |
156 |
> |
BendTypesSectionParser::BendTypeEnum BendTypesSectionParser::getBendTypeEnum(const std::string& str) { |
157 |
> |
std::map<std::string, BendTypeEnum>::iterator i; |
158 |
|
i = stringToEnumMap_.find(str); |
159 |
|
|
160 |
< |
return i == stringToEnumMap_.end() ? TorsionTypesSectionParser::ttUnknown : i->second; |
160 |
> |
return i == stringToEnumMap_.end() ? btUnknown : i->second; |
161 |
|
} |
162 |
|
|
163 |
|
} //end namespace oopse |