45#include "io/PolarizableAtomTypesSectionParser.hpp"
48#include "types/PolarizableAdapter.hpp"
49#include "utils/simError.h"
53 PolarizableAtomTypesSectionParser::PolarizableAtomTypesSectionParser(
55 setSectionName(
"PolarizableAtomTypes");
58 void PolarizableAtomTypesSectionParser::parseLine(ForceField& ff,
59 const std::string& line,
61 StringTokenizer tokenizer(line);
62 int nTokens = tokenizer.countTokens();
65 snprintf(painCave.errMsg, MAX_SIM_ERROR_MSG_LENGTH,
66 "PolarizableAtomTypesSectionParser Error: "
67 "Not enough tokens at line %d\n",
72 std::string atomTypeName = tokenizer.nextToken();
74 AtomType* atomType = ff.getAtomType(atomTypeName);
75 if (atomType != NULL) {
76 PolarizableAdapter fca = PolarizableAdapter(atomType);
77 RealType polarizability = tokenizer.nextTokenAsDouble();
78 fca.makePolarizable(polarizability);
80 snprintf(painCave.errMsg, MAX_SIM_ERROR_MSG_LENGTH,
81 "PolarizableAtomTypesSectionParser Error: "
82 "Can not find matching AtomType at line %d\n",
This basic Periodic Table class was originally taken from the data.cpp file in OpenBabel.