45#include "types/SuttonChenAdapter.hpp"
50#include "utils/simError.h"
54 bool SuttonChenAdapter::isSuttonChen() {
return at_->
hasProperty(SCtypeID); }
56 SCAtypeParameters SuttonChenAdapter::getSuttonChenParam() {
57 if (!isSuttonChen()) {
59 painCave.errMsg, MAX_SIM_ERROR_MSG_LENGTH,
60 "SuttonChenAdapter::getSuttonChenParam was passed an atomType (%s)\n"
61 "\tthat does not appear to be a Sutton-Chen atom.\n",
62 at_->getName().c_str());
63 painCave.severity = OPENMD_ERROR;
69 if (data ==
nullptr) {
71 painCave.errMsg, MAX_SIM_ERROR_MSG_LENGTH,
72 "SuttonChenAdapter::getSuttonChenParam could not find Sutton-Chen\n"
73 "\tparameters for atomType %s.\n",
74 at_->getName().c_str());
75 painCave.severity = OPENMD_ERROR;
80 std::shared_ptr<SCAtypeData> scData =
81 std::dynamic_pointer_cast<SCAtypeData>(data);
82 if (scData ==
nullptr) {
83 snprintf(painCave.errMsg, MAX_SIM_ERROR_MSG_LENGTH,
84 "SuttonChenAdapter::getSuttonChenParam could not convert\n"
85 "\tGenericData to SCAtypeData for atom type %s\n",
86 at_->getName().c_str());
87 painCave.severity = OPENMD_ERROR;
92 return scData->getData();
95 RealType SuttonChenAdapter::getC() {
96 SCAtypeParameters scParam = getSuttonChenParam();
100 RealType SuttonChenAdapter::getM() {
101 SCAtypeParameters scParam = getSuttonChenParam();
105 RealType SuttonChenAdapter::getN() {
106 SCAtypeParameters scParam = getSuttonChenParam();
110 RealType SuttonChenAdapter::getAlpha() {
111 SCAtypeParameters scParam = getSuttonChenParam();
112 return scParam.alpha;
115 RealType SuttonChenAdapter::getEpsilon() {
116 SCAtypeParameters scParam = getSuttonChenParam();
117 return scParam.epsilon;
120 void SuttonChenAdapter::makeSuttonChen(RealType c, RealType m, RealType n,
121 RealType alpha, RealType epsilon) {
124 SCAtypeParameters scParam {};
128 scParam.alpha = alpha;
129 scParam.epsilon = epsilon;
131 at_->
addProperty(std::make_shared<SCAtypeData>(SCtypeID, scParam));
std::shared_ptr< GenericData > getPropertyByName(const string &propName)
Returns property.
void removeProperty(const string &propName)
Removes property from PropertyMap by name.
bool hasProperty(const string &propName)
Checks if property is in this PropertyMap.
void addProperty(std::shared_ptr< GenericData > genData)
Adds property into property map.
This basic Periodic Table class was originally taken from the data.cpp file in OpenBabel.