45#include "io/StickyAtomTypesSectionParser.hpp"
48#include "types/StickyAdapter.hpp"
49#include "utils/simError.h"
53 StickyAtomTypesSectionParser::StickyAtomTypesSectionParser(
54 ForceFieldOptions& options) :
56 setSectionName(
"StickyAtomTypes");
59 void StickyAtomTypesSectionParser::parseLine(ForceField& ff,
60 const string& line,
int lineNo) {
61 StringTokenizer tokenizer(line);
62 int nTokens = tokenizer.countTokens();
63 RealType dus = options_.getDistanceUnitScaling();
64 RealType eus = options_.getEnergyUnitScaling();
69 snprintf(painCave.errMsg, MAX_SIM_ERROR_MSG_LENGTH,
70 "StickyAtomTypesSectionParser Error: Not enough "
71 "tokens at line %d\n",
76 string atomTypeName = tokenizer.nextToken();
77 AtomType* atomType = ff.getAtomType(atomTypeName);
79 if (atomType != NULL) {
80 StickyAdapter sa = StickyAdapter(atomType);
82 RealType w0 = tokenizer.nextTokenAsDouble();
83 RealType v0 = eus * tokenizer.nextTokenAsDouble();
84 RealType v0p = eus * tokenizer.nextTokenAsDouble();
85 RealType rl = dus * tokenizer.nextTokenAsDouble();
86 RealType ru = dus * tokenizer.nextTokenAsDouble();
87 RealType rlp = dus * tokenizer.nextTokenAsDouble();
88 RealType rup = dus * tokenizer.nextTokenAsDouble();
91 sa.makeSticky(w0, v0, v0p, rl, ru, rlp, rup, isPower);
94 snprintf(painCave.errMsg, MAX_SIM_ERROR_MSG_LENGTH,
95 "StickyAtomTypesSectionParser Error: "
96 "Can not find matching AtomType %s\n",
97 atomTypeName.c_str());
This basic Periodic Table class was originally taken from the data.cpp file in OpenBabel.