45#include "types/MultipoleAdapter.hpp"
50#include "utils/simError.h"
54 bool MultipoleAdapter::isMultipole() {
58 MultipoleAtypeParameters MultipoleAdapter::getMultipoleParam() {
61 painCave.errMsg, MAX_SIM_ERROR_MSG_LENGTH,
62 "MultipoleAdapter::getMultipoleParam was passed an atomType (%s)\n"
63 "\tthat does not appear to be a Multipole atom.\n",
64 at_->getName().c_str());
65 painCave.severity = OPENMD_ERROR;
71 if (data ==
nullptr) {
72 snprintf(painCave.errMsg, MAX_SIM_ERROR_MSG_LENGTH,
73 "MultipoleAdapter::getMultipoleParam could not find Multipole\n"
74 "\tparameters for atomType %s.\n",
75 at_->getName().c_str());
76 painCave.severity = OPENMD_ERROR;
81 std::shared_ptr<MultipoleAtypeData> multipoleData =
82 std::dynamic_pointer_cast<MultipoleAtypeData>(data);
83 if (multipoleData ==
nullptr) {
84 snprintf(painCave.errMsg, MAX_SIM_ERROR_MSG_LENGTH,
85 "MultipoleAdapter::getMultipoleParam could not convert\n"
86 "\tGenericData to MultipoleAtypeData for atom type %s\n",
87 at_->getName().c_str());
88 painCave.severity = OPENMD_ERROR;
93 return multipoleData->getData();
96 bool MultipoleAdapter::isDipole() {
98 MultipoleAtypeParameters multipoleParam = getMultipoleParam();
99 return multipoleParam.isDipole;
103 bool MultipoleAdapter::isQuadrupole() {
105 MultipoleAtypeParameters multipoleParam = getMultipoleParam();
106 return multipoleParam.isQuadrupole;
111 Vector3d MultipoleAdapter::getDipole() {
112 MultipoleAtypeParameters multipoleParam = getMultipoleParam();
113 return multipoleParam.dipole;
116 Mat3x3d MultipoleAdapter::getQuadrupole() {
117 MultipoleAtypeParameters multipoleParam = getMultipoleParam();
118 return multipoleParam.quadrupole;
121 void MultipoleAdapter::makeMultipole(Vector3d dipole, Mat3x3d quadrupole,
122 bool isDipole,
bool isQuadrupole) {
125 MultipoleAtypeParameters multipoleParam {};
127 multipoleParam.dipole = dipole;
128 multipoleParam.quadrupole = quadrupole;
130 multipoleParam.isDipole = isDipole;
131 multipoleParam.isQuadrupole = isQuadrupole;
134 std::make_shared<MultipoleAtypeData>(MultipoleTypeID, multipoleParam));
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.