45#include "io/BendTypesSectionParser.hpp"
48#include "types/BendTypeParser.hpp"
49#include "utils/simError.h"
53 BendTypesSectionParser::BendTypesSectionParser(ForceFieldOptions& options) :
55 setSectionName(
"BendTypes");
58 void BendTypesSectionParser::parseLine(ForceField& ff,
59 const std::string& line,
int lineNo) {
60 StringTokenizer tokenizer(line);
61 BendTypeParser btParser;
62 BendType* bendType = NULL;
64 int nTokens = tokenizer.countTokens();
67 snprintf(painCave.errMsg, MAX_SIM_ERROR_MSG_LENGTH,
68 "BendTypesSectionParser Error: Not enough tokens at line %d\n",
75 std::string at1 = tokenizer.nextToken();
76 std::string at2 = tokenizer.nextToken();
77 std::string at3 = tokenizer.nextToken();
78 std::string remainder = tokenizer.getRemainingString();
79 RealType kScale = options_.getBendForceConstantScaling();
82 bendType = btParser.parseLine(remainder, kScale);
83 }
catch (OpenMDException& e) {
84 snprintf(painCave.errMsg, MAX_SIM_ERROR_MSG_LENGTH,
85 "BendTypesSectionParser Error: %s "
92 if (bendType != NULL) { ff.addBendType(at1, at2, at3, bendType); }
This basic Periodic Table class was originally taken from the data.cpp file in OpenBabel.