45#include "io/BaseAtomTypesSectionParser.hpp"
50#include "types/AtomType.hpp"
51#include "utils/simError.h"
55 BaseAtomTypesSectionParser::BaseAtomTypesSectionParser() {
56 setSectionName(
"BaseAtomTypes");
59 void BaseAtomTypesSectionParser::parseLine(ForceField& ff,
60 const std::string& line,
62 StringTokenizer tokenizer(line);
63 int nTokens = tokenizer.countTokens();
69 painCave.errMsg, MAX_SIM_ERROR_MSG_LENGTH,
70 "BaseAtomTypesSectionParser Error: Not enough tokens at line %d\n",
76 std::string baseAtomTypeName = tokenizer.nextToken();
77 AtomType* baseAtomType = ff.getAtomType(baseAtomTypeName);
79 if (baseAtomType == NULL) {
80 baseAtomType =
new AtomType();
81 int ident = ff.getNAtomType();
82 baseAtomType->setIdent(ident);
83 baseAtomType->setName(baseAtomTypeName);
84 ff.addAtomType(baseAtomTypeName, baseAtomType);
96 RealType mass = tokenizer.nextTokenAsDouble();
97 baseAtomType->setMass(mass);
98 if (tokenizer.hasMoreTokens()) {
99 RealType nelectron = tokenizer.nextTokenAsDouble();
100 baseAtomType->addProperty(std::shared_ptr<GenericData>(
This basic Periodic Table class was originally taken from the data.cpp file in OpenBabel.
SimpleTypeData< RealType > DoubleGenericData
DoubleGenericData is a generic data type contains a RealType variable.