45#include "types/DirectionalAdapter.hpp"
50#include "utils/simError.h"
54 bool DirectionalAdapter::isDirectional() {
58 DirectionalAtypeParameters DirectionalAdapter::getDirectionalParam() {
59 if (!isDirectional()) {
60 snprintf(painCave.errMsg, MAX_SIM_ERROR_MSG_LENGTH,
61 "DirectionalAdapter::getDirectionalParam was passed an atomType "
63 "\tthat does not appear to be a Directional atom.\n",
64 at_->getName().c_str());
65 painCave.severity = OPENMD_ERROR;
70 std::shared_ptr<GenericData> data =
72 if (data ==
nullptr) {
74 painCave.errMsg, MAX_SIM_ERROR_MSG_LENGTH,
75 "DirectionalAdapter::getDirectionalParam could not find Directional\n"
76 "\tparameters for atomType %s.\n",
77 at_->getName().c_str());
78 painCave.severity = OPENMD_ERROR;
83 std::shared_ptr<DirectionalAtypeData> directionalData =
84 std::dynamic_pointer_cast<DirectionalAtypeData>(data);
85 if (directionalData ==
nullptr) {
86 snprintf(painCave.errMsg, MAX_SIM_ERROR_MSG_LENGTH,
87 "DirectionalAdapter::getDirectionalParam could not convert\n"
88 "\tGenericData to DirectionalAtypeData for atom type %s\n",
89 at_->getName().c_str());
90 painCave.severity = OPENMD_ERROR;
95 return directionalData->getData();
98 Mat3x3d DirectionalAdapter::getI() {
99 DirectionalAtypeParameters directionalParam = getDirectionalParam();
100 return directionalParam.I;
103 void DirectionalAdapter::makeDirectional(Mat3x3d I) {
106 DirectionalAtypeParameters directionalParam {};
108 directionalParam.I = I;
110 at_->
addProperty(std::make_shared<DirectionalAtypeData>(DirectionalTypeID,
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.