45#include "io/DirectionalAtomTypesSectionParser.hpp"
48#include "types/DirectionalAdapter.hpp"
49#include "utils/simError.h"
53 DirectionalAtomTypesSectionParser::DirectionalAtomTypesSectionParser(
55 setSectionName(
"DirectionalAtomTypes");
58 void DirectionalAtomTypesSectionParser::parseLine(ForceField& ff,
59 const std::string& line,
61 StringTokenizer tokenizer(line);
62 int nTokens = tokenizer.countTokens();
67 snprintf(painCave.errMsg, MAX_SIM_ERROR_MSG_LENGTH,
68 "DirectionalAtomTypesSectionParser Error: Not enough tokens at "
75 std::string atomTypeName = tokenizer.nextToken();
76 AtomType* atomType = ff.getAtomType(atomTypeName);
78 if (atomType == NULL) {
79 snprintf(painCave.errMsg, MAX_SIM_ERROR_MSG_LENGTH,
80 "DirectionalAtomTypesSectionParser:: AtomType %s was not\n"
81 "\tdeclared in the BaseAtomTypes or AtomTypes before being\n"
82 "\tdeclared as a DirectionalAtomType!\n",
83 atomTypeName.c_str());
88 DirectionalAdapter da = DirectionalAdapter(atomType);
91 I(0, 0) = tokenizer.nextTokenAsDouble();
92 I(1, 1) = tokenizer.nextTokenAsDouble();
93 I(2, 2) = tokenizer.nextTokenAsDouble();
95 da.makeDirectional(I);
This basic Periodic Table class was originally taken from the data.cpp file in OpenBabel.