48 |
|
#include "utils/simError.h" |
49 |
|
#include "types/NonBondedInteractionType.hpp" |
50 |
|
#include "types/FixedChargeAdapter.hpp" |
51 |
+ |
#include "types/FluctuatingChargeAdapter.hpp" |
52 |
|
#include "types/MultipoleAdapter.hpp" |
53 |
|
#include "io/Globals.hpp" |
54 |
|
#include "nonbonded/SlaterIntegrals.hpp" |
289 |
|
|
290 |
|
if (fca.isFixedCharge()) { |
291 |
|
electrostaticAtomData.is_Charge = true; |
292 |
< |
electrostaticAtomData.charge = fca.getCharge(); |
292 |
> |
electrostaticAtomData.fixedCharge = fca.getCharge(); |
293 |
|
} |
294 |
|
|
295 |
|
MultipoleAdapter ma = MultipoleAdapter(atomType); |
316 |
|
FluctuatingChargeAdapter fqa = FluctuatingChargeAdapter(atomType); |
317 |
|
|
318 |
|
if (fqa.isFluctuatingCharge()) { |
319 |
< |
electrostaticAtomData.is_FluctuatingCharge = true; |
320 |
< |
electrostaticAtomData.electronegativity = fca.getElectronegativity(); |
321 |
< |
electrostaticAtomData.hardness = fca.getHardness(); |
322 |
< |
electrostaticAtomData.slaterN = fca.getSlaterN(); |
323 |
< |
electrostaticAtomData.slaterZeta = fca.getSlaterZeta(); |
319 |
> |
electrostaticAtomData.is_Fluctuating = true; |
320 |
> |
electrostaticAtomData.electronegativity = fqa.getElectronegativity(); |
321 |
> |
electrostaticAtomData.hardness = fqa.getHardness(); |
322 |
> |
electrostaticAtomData.slaterN = fqa.getSlaterN(); |
323 |
> |
electrostaticAtomData.slaterZeta = fqa.getSlaterZeta(); |
324 |
|
} |
325 |
|
|
326 |
|
pair<map<int,AtomType*>::iterator,bool> ret; |
342 |
|
map<AtomType*, ElectrostaticAtomData>::iterator it; |
343 |
|
for( it = ElectrostaticMap.begin(); it != ElectrostaticMap.end(); ++it) { |
344 |
|
AtomType* atype2 = (*it).first; |
345 |
< |
|
346 |
< |
if ((*it).is_FluctuatingCharge && electrostaticAtomData.is_FluctuatingCharge) { |
345 |
> |
ElectrostaticAtomData eaData2 = (*it).second; |
346 |
> |
if (eaData2.is_Fluctuating && electrostaticAtomData.is_Fluctuating) { |
347 |
|
|
348 |
|
RealType a = electrostaticAtomData.slaterZeta; |
349 |
< |
RealType b = (*it).slaterZeta; |
349 |
> |
RealType b = eaData2.slaterZeta; |
350 |
|
int m = electrostaticAtomData.slaterN; |
351 |
< |
int n = (*it).slaterN; |
351 |
> |
int n = eaData2.slaterN; |
352 |
|
|
353 |
|
// Create the spline of the coulombic integral for s-type |
354 |
|
// Slater orbitals. Add a 2 angstrom safety window to deal |
355 |
|
// with cutoffGroups that have charged atoms longer than the |
356 |
|
// cutoffRadius away from each other. |
357 |
|
|
358 |
+ |
RealType rval; |
359 |
|
RealType dr = (cutoffRadius_ + 2.0) / RealType(np_ - 1); |
360 |
|
vector<RealType> rvals; |
361 |
|
vector<RealType> J1vals; |
367 |
|
J2vals.push_back( sSTOCoulInt( b, a, n, m, rval * PhysicalConstants::angstromsToBohr ) ); |
368 |
|
} |
369 |
|
|
370 |
< |
CubicSpline J1 = new CubicSpline(); |
370 |
> |
CubicSpline* J1 = new CubicSpline(); |
371 |
|
J1->addPoints(rvals, J1vals); |
372 |
< |
CubicSpline J2 = new CubicSpline(); |
372 |
> |
CubicSpline* J2 = new CubicSpline(); |
373 |
|
J2->addPoints(rvals, J2vals); |
374 |
|
|
375 |
|
pair<AtomType*, AtomType*> key1, key2; |
471 |
|
bool j_is_Quadrupole = data2.is_Quadrupole; |
472 |
|
|
473 |
|
if (i_is_Charge) { |
474 |
< |
q_i = data1.charge; |
474 |
> |
q_i = data1.fixedCharge; |
475 |
|
if (idat.excluded) { |
476 |
|
*(idat.skippedCharge2) += q_i; |
477 |
|
} |
509 |
|
} |
510 |
|
|
511 |
|
if (j_is_Charge) { |
512 |
< |
q_j = data2.charge; |
512 |
> |
q_j = data2.fixedCharge; |
513 |
|
if (idat.excluded) { |
514 |
|
*(idat.skippedCharge1) += q_j; |
515 |
|
} |
1022 |
|
} |
1023 |
|
} else if (summationMethod_ == esm_SHIFTED_FORCE || summationMethod_ == esm_SHIFTED_POTENTIAL) { |
1024 |
|
if (i_is_Charge) { |
1025 |
< |
chg1 = data.charge; |
1025 |
> |
chg1 = data.fixedCharge; |
1026 |
|
if (screeningMethod_ == DAMPED) { |
1027 |
|
self = - 0.5 * (c1c_ + alphaPi_) * chg1 * (chg1 + *(sdat.skippedCharge)) * pre11_; |
1028 |
|
} else { |