45#include "io/SCAtomTypesSectionParser.hpp"
48#include "types/SuttonChenAdapter.hpp"
49#include "utils/simError.h"
53 SCAtomTypesSectionParser::SCAtomTypesSectionParser(
54 ForceFieldOptions& options) :
56 setSectionName(
"SCAtomTypes");
59 void SCAtomTypesSectionParser::parseLine(ForceField& ff,
60 const std::string& line,
62 StringTokenizer tokenizer(line);
63 int nTokens = tokenizer.countTokens();
68 snprintf(painCave.errMsg, MAX_SIM_ERROR_MSG_LENGTH,
69 "SCAtomTypesSectionParser Error: Not enough tokens at line %d\n",
74 std::string atomTypeName = tokenizer.nextToken();
75 AtomType* atomType = ff.getAtomType(atomTypeName);
77 if (atomType != NULL) {
78 SuttonChenAdapter sca = SuttonChenAdapter(atomType);
80 RealType epsilon = tokenizer.nextTokenAsDouble();
81 RealType c = tokenizer.nextTokenAsDouble();
82 RealType m = tokenizer.nextTokenAsDouble();
83 RealType n = tokenizer.nextTokenAsDouble();
84 RealType alpha = tokenizer.nextTokenAsDouble();
86 epsilon *= options_.getMetallicEnergyUnitScaling();
87 alpha *= options_.getDistanceUnitScaling();
89 sca.makeSuttonChen(c, m, n, alpha, epsilon);
93 painCave.errMsg, MAX_SIM_ERROR_MSG_LENGTH,
94 "SCAtomTypesSectionParser Error: Atom Type [%s] is not created "
96 atomTypeName.c_str());
This basic Periodic Table class was originally taken from the data.cpp file in OpenBabel.