45#include "types/UFFAdapter.hpp"
50#include "utils/simError.h"
54 bool UFFAdapter::isUFF() {
return at_->
hasProperty(UFFtypeID); }
56 UFFAtypeParameters UFFAdapter::getUFFParam() {
58 snprintf(painCave.errMsg, MAX_SIM_ERROR_MSG_LENGTH,
59 "UFFAdapter::getUFFParam was passed an atomType (%s)\n"
60 "\tthat does not appear to be a UFF 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 "UFFAdapter::getUFFParam could not find UFF\n"
71 "\tparameters for atomType %s.\n",
72 at_->getName().c_str());
73 painCave.severity = OPENMD_ERROR;
78 std::shared_ptr<UFFAtypeData> uffData =
79 std::dynamic_pointer_cast<UFFAtypeData>(data);
80 if (uffData == NULL) {
81 snprintf(painCave.errMsg, MAX_SIM_ERROR_MSG_LENGTH,
82 "UFFAdapter::getUFFParam could not convert\n"
83 "\tGenericData to UFFAtypeData for atom type %s\n",
84 at_->getName().c_str());
85 painCave.severity = OPENMD_ERROR;
90 return uffData->getData();
93 RealType UFFAdapter::getR1() {
94 UFFAtypeParameters uffParam = getUFFParam();
98 RealType UFFAdapter::getTheta0() {
99 UFFAtypeParameters uffParam = getUFFParam();
100 return uffParam.theta0;
103 RealType UFFAdapter::getX1() {
104 UFFAtypeParameters uffParam = getUFFParam();
108 RealType UFFAdapter::getD1() {
109 UFFAtypeParameters uffParam = getUFFParam();
113 RealType UFFAdapter::getZeta() {
114 UFFAtypeParameters uffParam = getUFFParam();
115 return uffParam.zeta;
118 RealType UFFAdapter::getZ1() {
119 UFFAtypeParameters uffParam = getUFFParam();
123 RealType UFFAdapter::getVi() {
124 UFFAtypeParameters uffParam = getUFFParam();
128 RealType UFFAdapter::getUj() {
129 UFFAtypeParameters uffParam = getUFFParam();
133 RealType UFFAdapter::getXi() {
134 UFFAtypeParameters uffParam = getUFFParam();
138 RealType UFFAdapter::getHard() {
139 UFFAtypeParameters uffParam = getUFFParam();
140 return uffParam.Hard;
143 RealType UFFAdapter::getRadius() {
144 UFFAtypeParameters uffParam = getUFFParam();
145 return uffParam.Radius;
148 void UFFAdapter::makeUFF(RealType r1, RealType theta0, RealType x1,
149 RealType D1, RealType zeta, RealType Z1, RealType Vi,
150 RealType Uj, RealType Xi, RealType Hard,
154 UFFAtypeParameters uffParam {};
157 uffParam.theta0 = theta0;
160 uffParam.zeta = zeta;
165 uffParam.Hard = Hard;
166 uffParam.Radius = Radius;
167 at_->
addProperty(std::make_shared<UFFAtypeData>(UFFtypeID, uffParam));
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.