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