| 52 |
|
namespace OpenMD { |
| 53 |
|
|
| 54 |
|
Electrostatic::Electrostatic(): name_("Electrostatic"), initialized_(false), |
| 55 |
< |
forceField_(NULL) {} |
| 55 |
> |
forceField_(NULL), info_(NULL) {} |
| 56 |
|
|
| 57 |
|
void Electrostatic::initialize() { |
| 58 |
|
|
| 59 |
< |
Globals* simParams_; |
| 59 |
> |
Globals* simParams_ = info_->getSimParams(); |
| 60 |
|
|
| 61 |
|
summationMap_["HARD"] = esm_HARD; |
| 62 |
|
summationMap_["SWITCHING_FUNCTION"] = esm_SWITCHING_FUNCTION; |
| 407 |
|
return; |
| 408 |
|
} |
| 409 |
|
|
| 410 |
< |
void Electrostatic::setElectrostaticCutoffRadius( RealType theECR, |
| 411 |
< |
RealType theRSW ) { |
| 412 |
< |
cutoffRadius_ = theECR; |
| 410 |
> |
void Electrostatic::setCutoffRadius( RealType rCut ) { |
| 411 |
> |
cutoffRadius_ = rCut; |
| 412 |
|
rrf_ = cutoffRadius_; |
| 414 |
– |
rt_ = theRSW; |
| 413 |
|
haveCutoffRadius_ = true; |
| 414 |
+ |
} |
| 415 |
+ |
|
| 416 |
+ |
void Electrostatic::setSwitchingRadius( RealType rSwitch ) { |
| 417 |
+ |
rt_ = rSwitch; |
| 418 |
|
} |
| 419 |
|
void Electrostatic::setElectrostaticSummationMethod( ElectrostaticSummationMethod esm ) { |
| 420 |
|
summationMethod_ = esm; |
| 465 |
|
|
| 466 |
|
if (!initialized_) initialize(); |
| 467 |
|
|
| 468 |
< |
ElectrostaticAtomData data1 = ElectrostaticMap[idat.atypes->first]; |
| 469 |
< |
ElectrostaticAtomData data2 = ElectrostaticMap[idat.atypes->second]; |
| 468 |
> |
ElectrostaticAtomData data1 = ElectrostaticMap[idat.atypes.first]; |
| 469 |
> |
ElectrostaticAtomData data2 = ElectrostaticMap[idat.atypes.second]; |
| 470 |
|
|
| 471 |
|
// some variables we'll need independent of electrostatic type: |
| 472 |
|
|
| 911 |
|
} |
| 912 |
|
} |
| 913 |
|
|
| 914 |
< |
idat.pot[ELECTROSTATIC_FAMILY] += epot; |
| 914 |
> |
(*(idat.pot))[ELECTROSTATIC_FAMILY] += epot; |
| 915 |
|
*(idat.f1) += dVdr; |
| 916 |
|
|
| 917 |
|
if (i_is_Dipole || i_is_Quadrupole) |
| 935 |
|
|
| 936 |
|
if (!initialized_) initialize(); |
| 937 |
|
|
| 938 |
< |
ElectrostaticAtomData data1 = ElectrostaticMap[idat.atypes->first]; |
| 939 |
< |
ElectrostaticAtomData data2 = ElectrostaticMap[idat.atypes->second]; |
| 938 |
> |
ElectrostaticAtomData data1 = ElectrostaticMap[idat.atypes.first]; |
| 939 |
> |
ElectrostaticAtomData data2 = ElectrostaticMap[idat.atypes.second]; |
| 940 |
|
|
| 941 |
|
// logicals |
| 942 |
|
|
| 1022 |
|
} |
| 1023 |
|
|
| 1024 |
|
// accumulate the forces and torques resulting from the self term |
| 1025 |
< |
idat.pot[ELECTROSTATIC_FAMILY] += myPot; |
| 1025 |
> |
(*(idat.pot))[ELECTROSTATIC_FAMILY] += myPot; |
| 1026 |
|
*(idat.f1) += dVdr; |
| 1027 |
|
|
| 1028 |
|
if (i_is_Dipole) |