45#include "types/GayBerneAdapter.hpp"
50#include "utils/simError.h"
54 bool GayBerneAdapter::isGayBerne() {
return at_->
hasProperty(GBtypeID); }
56 GBAtypeParameters GayBerneAdapter::getGayBerneParam() {
58 snprintf(painCave.errMsg, MAX_SIM_ERROR_MSG_LENGTH,
59 "GayBerneAdapter::getGayBerneParam was passed an atomType (%s)\n"
60 "\tthat does not appear to be a Gay-Berne atom.\n",
61 at_->getName().c_str());
62 painCave.severity = OPENMD_ERROR;
68 if (data ==
nullptr) {
69 snprintf(painCave.errMsg, MAX_SIM_ERROR_MSG_LENGTH,
70 "GayBerneAdapter::getGayBerneParam could not find Gay-Berne\n"
71 "\tparameters for atomType %s.\n",
72 at_->getName().c_str());
73 painCave.severity = OPENMD_ERROR;
78 std::shared_ptr<GBAtypeData> gbData =
79 std::dynamic_pointer_cast<GBAtypeData>(data);
80 if (gbData ==
nullptr) {
81 snprintf(painCave.errMsg, MAX_SIM_ERROR_MSG_LENGTH,
82 "GayBerneAdapter::getGayBerneParam could not convert\n"
83 "\tGenericData to GBAtypeData for atom type %s\n",
84 at_->getName().c_str());
85 painCave.severity = OPENMD_ERROR;
90 return gbData->getData();
93 RealType GayBerneAdapter::getD() {
94 GBAtypeParameters gbParam = getGayBerneParam();
98 RealType GayBerneAdapter::getL() {
99 GBAtypeParameters gbParam = getGayBerneParam();
103 RealType GayBerneAdapter::getEpsX() {
104 GBAtypeParameters gbParam = getGayBerneParam();
105 return gbParam.GB_eps_X;
108 RealType GayBerneAdapter::getEpsS() {
109 GBAtypeParameters gbParam = getGayBerneParam();
110 return gbParam.GB_eps_S;
113 RealType GayBerneAdapter::getEpsE() {
114 GBAtypeParameters gbParam = getGayBerneParam();
115 return gbParam.GB_eps_E;
118 RealType GayBerneAdapter::getDw() {
119 GBAtypeParameters gbParam = getGayBerneParam();
120 return gbParam.GB_dw;
123 void GayBerneAdapter::makeGayBerne(RealType d, RealType l, RealType eps_X,
124 RealType eps_S, RealType eps_E,
128 GBAtypeParameters gbParam {};
131 gbParam.GB_eps_X = eps_X;
132 gbParam.GB_eps_S = eps_S;
133 gbParam.GB_eps_E = eps_E;
136 at_->
addProperty(std::make_shared<GBAtypeData>(GBtypeID, gbParam));
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.