45#include "io/BondTypesSectionParser.hpp"
48#include "types/BondTypeParser.hpp"
49#include "utils/simError.h"
53 BondTypesSectionParser::BondTypesSectionParser(ForceFieldOptions& options) :
55 setSectionName(
"BondTypes");
58 void BondTypesSectionParser::parseLine(ForceField& ff,
59 const std::string& line,
int lineNo) {
60 StringTokenizer tokenizer(line);
61 BondTypeParser btParser;
62 BondType* bondType = NULL;
63 int nTokens = tokenizer.countTokens();
66 snprintf(painCave.errMsg, MAX_SIM_ERROR_MSG_LENGTH,
67 "BondTypesSectionParser Error: Not enough tokens at line %d\n",
73 std::string at1 = tokenizer.nextToken();
74 std::string at2 = tokenizer.nextToken();
75 std::string remainder = tokenizer.getRemainingString();
76 RealType kScale = options_.getBondForceConstantScaling();
79 bondType = btParser.parseLine(remainder, kScale);
80 }
catch (OpenMDException& e) {
81 snprintf(painCave.errMsg, MAX_SIM_ERROR_MSG_LENGTH,
82 "BondTypesSectionParser Error: %s "
89 if (bondType != NULL) { ff.addBondType(at1, at2, bondType); }
This basic Periodic Table class was originally taken from the data.cpp file in OpenBabel.