45#include "types/FluctuatingChargeAdapter.hpp"
52#include "nonbonded/SlaterIntegrals.hpp"
53#include "utils/simError.h"
57 bool FluctuatingChargeAdapter::isFluctuatingCharge() {
62 FluctuatingChargeAdapter::getFluctuatingChargeParam() {
63 if (!isFluctuatingCharge()) {
65 painCave.errMsg, MAX_SIM_ERROR_MSG_LENGTH,
66 "FluctuatingChargeAdapter::getFluctuatingChargeParam was passed an "
69 "\tthat does not appear to be a fluctuating charge atom.\n",
70 at_->getName().c_str());
71 painCave.severity = OPENMD_ERROR;
77 if (data ==
nullptr) {
79 painCave.errMsg, MAX_SIM_ERROR_MSG_LENGTH,
80 "FluctuatingChargeAdapter::getFluctuatingChargeParam could not find "
81 "fluctuating charge\n"
82 "\tparameters for atomType %s.\n",
83 at_->getName().c_str());
84 painCave.severity = OPENMD_ERROR;
89 std::shared_ptr<FluctuatingAtypeData> fqData =
90 std::dynamic_pointer_cast<FluctuatingAtypeData>(data);
91 if (fqData ==
nullptr) {
92 snprintf(painCave.errMsg, MAX_SIM_ERROR_MSG_LENGTH,
93 "FluctuatingChargeAdapter::getFluctuatingChargeParam could not "
95 "\tGenericData to FluctuatingAtypeData for atom type %s\n",
96 at_->getName().c_str());
97 painCave.severity = OPENMD_ERROR;
102 return fqData->getData();
105 bool FluctuatingChargeAdapter::isMetallic() {
107 return fqParam.isMetallic;
109 bool FluctuatingChargeAdapter::usesSlaterIntramolecular() {
111 return fqParam.usesSlaterIntramolecular;
113 RealType FluctuatingChargeAdapter::getChargeMass() {
115 return fqParam.chargeMass;
117 RealType FluctuatingChargeAdapter::getElectronegativity() {
121 RealType FluctuatingChargeAdapter::getHardness() {
125 int FluctuatingChargeAdapter::getSlaterN() {
129 RealType FluctuatingChargeAdapter::getNValence() {
131 return fqParam.nValence;
133 RealType FluctuatingChargeAdapter::getNMobile() {
137 RealType FluctuatingChargeAdapter::getSlaterZeta() {
143 return fqParam.
vself;
146 void FluctuatingChargeAdapter::makeFluctuatingCharge(
147 RealType chargeMass, RealType electronegativity, RealType hardness,
148 int slaterN, RealType slaterZeta) {
152 fqParam.chargeMass = chargeMass;
153 fqParam.usesSlaterIntramolecular =
true;
155 fqParam.electronegativity = electronegativity;
156 fqParam.hardness = hardness;
157 fqParam.slaterN = slaterN;
158 fqParam.slaterZeta = slaterZeta;
160 fqParam.vself.setCoefficient(1, electronegativity);
161 fqParam.vself.setCoefficient(2, 0.5 * hardness);
163 at_->
addProperty(std::make_shared<FluctuatingAtypeData>(FQtypeID, fqParam));
166 void FluctuatingChargeAdapter::makeFluctuatingCharge(RealType chargeMass,
173 fqParam.chargeMass = chargeMass;
174 fqParam.usesSlaterIntramolecular =
false;
177 fqParam.isMetallic =
true;
178 fqParam.nValence = nValence;
179 fqParam.nMobile = nValence;
183 at_->
addProperty(std::make_shared<FluctuatingAtypeData>(FQtypeID, fqParam));
186 void FluctuatingChargeAdapter::makeFluctuatingCharge(RealType chargeMass,
194 fqParam.chargeMass = chargeMass;
195 fqParam.usesSlaterIntramolecular =
false;
196 fqParam.isMetallic =
true;
197 fqParam.nValence = nValence;
198 fqParam.nMobile = nMobile;
202 at_->
addProperty(std::make_shared<FluctuatingAtypeData>(FQtypeID, fqParam));
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.
DoublePolynomial vself
off-diagonal Slater exponent
RealType nMobile
number of valence electrons in neutral atom
RealType electronegativity
number of "mobile" electrons
RealType hardness
(relative) electronegativity
int slaterN
diagonal "Coulomb" Jii
RealType slaterZeta
principal quantum number for Slater orbitals