ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/OpenMD/branches/development/src/nonbonded/Electrostatic.cpp
(Generate patch)

Comparing branches/development/src/nonbonded/Electrostatic.cpp (file contents):
Revision 1601 by gezelter, Thu Aug 4 20:04:35 2011 UTC vs.
Revision 1720 by gezelter, Thu May 24 01:48:29 2012 UTC

# Line 36 | Line 36
36   * [1]  Meineke, et al., J. Comp. Chem. 26, 252-271 (2005).            
37   * [2]  Fennell & Gezelter, J. Chem. Phys. 124 234104 (2006).          
38   * [3]  Sun, Lin & Gezelter, J. Chem. Phys. 128, 24107 (2008).          
39 < * [4]  Vardeman & Gezelter, in progress (2009).                        
39 > * [4]  Kuang & Gezelter,  J. Chem. Phys. 133, 164101 (2010).
40 > * [5]  Vardeman, Stocker & Gezelter, J. Chem. Theory Comput. 7, 834 (2011).
41   */
42  
43   #include <stdio.h>
# Line 46 | Line 47
47   #include "nonbonded/Electrostatic.hpp"
48   #include "utils/simError.h"
49   #include "types/NonBondedInteractionType.hpp"
50 < #include "types/DirectionalAtomType.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"
55 + #include "utils/PhysicalConstants.hpp"
56  
57 +
58   namespace OpenMD {
59    
60    Electrostatic::Electrostatic(): name_("Electrostatic"), initialized_(false),
# Line 64 | Line 70 | namespace OpenMD {
70      Globals* simParams_ = info_->getSimParams();
71  
72      summationMap_["HARD"]               = esm_HARD;
73 +    summationMap_["NONE"]               = esm_HARD;
74      summationMap_["SWITCHING_FUNCTION"] = esm_SWITCHING_FUNCTION;
75      summationMap_["SHIFTED_POTENTIAL"]  = esm_SHIFTED_POTENTIAL;
76      summationMap_["SHIFTED_FORCE"]      = esm_SHIFTED_FORCE;    
# Line 116 | Line 123 | namespace OpenMD {
123          sprintf( painCave.errMsg,
124                   "Electrostatic::initialize: Unknown electrostaticSummationMethod.\n"
125                   "\t(Input file specified %s .)\n"
126 <                 "\telectrostaticSummationMethod must be one of: \"none\",\n"
126 >                 "\telectrostaticSummationMethod must be one of: \"hard\",\n"
127                   "\t\"shifted_potential\", \"shifted_force\", or \n"
128                   "\t\"reaction_field\".\n", myMethod.c_str() );
129          painCave.isFatal = 1;
# Line 249 | Line 256 | namespace OpenMD {
256        preRF2_ = 2.0 * preRF_;
257      }
258      
259 <    RealType dx = cutoffRadius_ / RealType(np_ - 1);
259 >    // Add a 2 angstrom safety window to deal with cutoffGroups that
260 >    // have charged atoms longer than the cutoffRadius away from each
261 >    // other.  Splining may not be the best choice here.  Direct calls
262 >    // to erfc might be preferrable.
263 >
264 >    RealType dx = (cutoffRadius_ + 2.0) / RealType(np_ - 1);
265      RealType rval;
266      vector<RealType> rvals;
267      vector<RealType> yvals;
# Line 273 | Line 285 | namespace OpenMD {
285      electrostaticAtomData.is_SplitDipole = false;
286      electrostaticAtomData.is_Quadrupole = false;
287  
288 <    if (atomType->isCharge()) {
277 <      GenericData* data = atomType->getPropertyByName("Charge");
288 >    FixedChargeAdapter fca = FixedChargeAdapter(atomType);
289  
290 <      if (data == NULL) {
280 <        sprintf( painCave.errMsg, "Electrostatic::addType could not find "
281 <                 "Charge\n"
282 <                 "\tparameters for atomType %s.\n",
283 <                 atomType->getName().c_str());
284 <        painCave.severity = OPENMD_ERROR;
285 <        painCave.isFatal = 1;
286 <        simError();                  
287 <      }
288 <      
289 <      DoubleGenericData* doubleData = dynamic_cast<DoubleGenericData*>(data);
290 <      if (doubleData == NULL) {
291 <        sprintf( painCave.errMsg,
292 <                 "Electrostatic::addType could not convert GenericData to "
293 <                 "Charge for\n"
294 <                 "\tatom type %s\n", atomType->getName().c_str());
295 <        painCave.severity = OPENMD_ERROR;
296 <        painCave.isFatal = 1;
297 <        simError();          
298 <      }
290 >    if (fca.isFixedCharge()) {
291        electrostaticAtomData.is_Charge = true;
292 <      electrostaticAtomData.charge = doubleData->getData();          
292 >      electrostaticAtomData.fixedCharge = fca.getCharge();
293      }
294  
295 <    if (atomType->isDirectional()) {
296 <      DirectionalAtomType* daType = dynamic_cast<DirectionalAtomType*>(atomType);
297 <      
298 <      if (daType->isDipole()) {
299 <        GenericData* data = daType->getPropertyByName("Dipole");
308 <        
309 <        if (data == NULL) {
310 <          sprintf( painCave.errMsg,
311 <                   "Electrostatic::addType could not find Dipole\n"
312 <                   "\tparameters for atomType %s.\n",
313 <                   daType->getName().c_str());
314 <          painCave.severity = OPENMD_ERROR;
315 <          painCave.isFatal = 1;
316 <          simError();                  
317 <        }
318 <      
319 <        DoubleGenericData* doubleData = dynamic_cast<DoubleGenericData*>(data);
320 <        if (doubleData == NULL) {
321 <          sprintf( painCave.errMsg,
322 <                   "Electrostatic::addType could not convert GenericData to "
323 <                   "Dipole Moment\n"
324 <                   "\tfor atom type %s\n", daType->getName().c_str());
325 <          painCave.severity = OPENMD_ERROR;
326 <          painCave.isFatal = 1;
327 <          simError();          
328 <        }
329 <        electrostaticAtomData.is_Dipole = true;
330 <        electrostaticAtomData.dipole_moment = doubleData->getData();
295 >    MultipoleAdapter ma = MultipoleAdapter(atomType);
296 >    if (ma.isMultipole()) {
297 >      if (ma.isDipole()) {
298 >        electrostaticAtomData.is_Dipole = true;
299 >        electrostaticAtomData.dipole_moment = ma.getDipoleMoment();
300        }
301 <
333 <      if (daType->isSplitDipole()) {
334 <        GenericData* data = daType->getPropertyByName("SplitDipoleDistance");
335 <        
336 <        if (data == NULL) {
337 <          sprintf(painCave.errMsg,
338 <                  "Electrostatic::addType could not find SplitDipoleDistance\n"
339 <                  "\tparameter for atomType %s.\n",
340 <                  daType->getName().c_str());
341 <          painCave.severity = OPENMD_ERROR;
342 <          painCave.isFatal = 1;
343 <          simError();                  
344 <        }
345 <      
346 <        DoubleGenericData* doubleData = dynamic_cast<DoubleGenericData*>(data);
347 <        if (doubleData == NULL) {
348 <          sprintf( painCave.errMsg,
349 <                   "Electrostatic::addType could not convert GenericData to "
350 <                   "SplitDipoleDistance for\n"
351 <                   "\tatom type %s\n", daType->getName().c_str());
352 <          painCave.severity = OPENMD_ERROR;
353 <          painCave.isFatal = 1;
354 <          simError();          
355 <        }
301 >      if (ma.isSplitDipole()) {
302          electrostaticAtomData.is_SplitDipole = true;
303 <        electrostaticAtomData.split_dipole_distance = doubleData->getData();
303 >        electrostaticAtomData.split_dipole_distance = ma.getSplitDipoleDistance();
304        }
305 <
360 <      if (daType->isQuadrupole()) {
361 <        GenericData* data = daType->getPropertyByName("QuadrupoleMoments");
362 <        
363 <        if (data == NULL) {
364 <          sprintf( painCave.errMsg,
365 <                   "Electrostatic::addType could not find QuadrupoleMoments\n"
366 <                   "\tparameter for atomType %s.\n",
367 <                   daType->getName().c_str());
368 <          painCave.severity = OPENMD_ERROR;
369 <          painCave.isFatal = 1;
370 <          simError();                  
371 <        }
372 <        
305 >      if (ma.isQuadrupole()) {
306          // Quadrupoles in OpenMD are set as the diagonal elements
307          // of the diagonalized traceless quadrupole moment tensor.
308          // The column vectors of the unitary matrix that diagonalizes
309          // the quadrupole moment tensor become the eFrame (or the
310          // electrostatic version of the body-fixed frame.
378
379        Vector3dGenericData* v3dData = dynamic_cast<Vector3dGenericData*>(data);
380        if (v3dData == NULL) {
381          sprintf( painCave.errMsg,
382                   "Electrostatic::addType could not convert GenericData to "
383                   "Quadrupole Moments for\n"
384                   "\tatom type %s\n", daType->getName().c_str());
385          painCave.severity = OPENMD_ERROR;
386          painCave.isFatal = 1;
387          simError();          
388        }
311          electrostaticAtomData.is_Quadrupole = true;
312 <        electrostaticAtomData.quadrupole_moments = v3dData->getData();
312 >        electrostaticAtomData.quadrupole_moments = ma.getQuadrupoleMoments();
313        }
314      }
315      
316 <    AtomTypeProperties atp = atomType->getATP();    
316 >    FluctuatingChargeAdapter fqa = FluctuatingChargeAdapter(atomType);
317 >
318 >    if (fqa.isFluctuatingCharge()) {
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;    
327 <    ret = ElectrostaticList.insert( pair<int,AtomType*>(atp.ident, atomType) );
327 >    ret = ElectrostaticList.insert( pair<int,AtomType*>(atomType->getIdent(),
328 >                                                        atomType) );
329      if (ret.second == false) {
330        sprintf( painCave.errMsg,
331                 "Electrostatic already had a previous entry with ident %d\n",
332 <               atp.ident);
332 >               atomType->getIdent() );
333        painCave.severity = OPENMD_INFO;
334        painCave.isFatal = 0;
335        simError();        
336      }
337      
338 <    ElectrostaticMap[atomType] = electrostaticAtomData;    
338 >    ElectrostaticMap[atomType] = electrostaticAtomData;  
339 >
340 >    // Now, iterate over all known types and add to the mixing map:
341 >    
342 >    map<AtomType*, ElectrostaticAtomData>::iterator it;
343 >    for( it = ElectrostaticMap.begin(); it != ElectrostaticMap.end(); ++it) {
344 >      AtomType* atype2 = (*it).first;
345 >      ElectrostaticAtomData eaData2 = (*it).second;
346 >      if (eaData2.is_Fluctuating && electrostaticAtomData.is_Fluctuating) {
347 >        
348 >        RealType a = electrostaticAtomData.slaterZeta;
349 >        RealType b = eaData2.slaterZeta;
350 >        int m = electrostaticAtomData.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;
362 >        vector<RealType> J2vals;
363 >        for (int i = 0; i < np_; i++) {
364 >          rval = RealType(i) * dr;
365 >          rvals.push_back(rval);
366 >          J1vals.push_back( sSTOCoulInt( a, b, m, n, rval * PhysicalConstants::angstromsToBohr ) );
367 >          J2vals.push_back( sSTOCoulInt( b, a, n, m, rval * PhysicalConstants::angstromsToBohr ) );
368 >        }
369 >
370 >        CubicSpline* J1 = new CubicSpline();
371 >        J1->addPoints(rvals, J1vals);
372 >        CubicSpline* J2 = new CubicSpline();
373 >        J2->addPoints(rvals, J2vals);
374 >        
375 >        pair<AtomType*, AtomType*> key1, key2;
376 >        key1 = make_pair(atomType, atype2);
377 >        key2 = make_pair(atype2, atomType);
378 >        
379 >        Jij[key1] = J1;
380 >        Jij[key2] = J2;
381 >      }
382 >    }
383 >
384      return;
385    }
386    
# Line 454 | Line 430 | namespace OpenMD {
430      RealType c1, c2, c3, c4;
431      RealType erfcVal(1.0), derfcVal(0.0);
432      RealType BigR;
433 +    RealType two(2.0), three(3.0);
434  
435      Vector3d Q_i, Q_j;
436      Vector3d ux_i, uy_i, uz_i;
# Line 494 | Line 471 | namespace OpenMD {
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        }
# Line 532 | Line 509 | namespace OpenMD {
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        }
# Line 578 | Line 555 | namespace OpenMD {
555        if (j_is_Charge) {
556          if (screeningMethod_ == DAMPED) {
557            // assemble the damping variables
558 <          res = erfcSpline_->getValueAndDerivativeAt( *(idat.rij) );
559 <          erfcVal = res.first;
560 <          derfcVal = res.second;
558 >          //res = erfcSpline_->getValueAndDerivativeAt( *(idat.rij) );
559 >          //erfcVal = res.first;
560 >          //derfcVal = res.second;
561 >
562 >          erfcVal = erfc(dampingAlpha_ * *(idat.rij));
563 >          derfcVal = - alphaPi_ * exp(-alpha2_ * *(idat.r2));
564 >
565            c1 = erfcVal * riji;
566            c2 = (-derfcVal + c1) * riji;
567          } else {
# Line 610 | Line 591 | namespace OpenMD {
591            if (idat.excluded) {
592              indirect_vpair += preVal * rfVal;
593              indirect_Pot += *(idat.sw) * preVal * rfVal;
594 <            indirect_dVdr += *(idat.sw)  * preVal * 2.0 * rfVal  * riji * rhat;
594 >            indirect_dVdr += *(idat.sw)  * preVal * two * rfVal  * riji * rhat;
595            }
596            
597          } else {
# Line 638 | Line 619 | namespace OpenMD {
619            vpair += vterm;
620            epot +=  *(idat.sw)  * vterm;
621  
622 <          dVdr +=  -preSw * (ri3 * (uz_j - 3.0 * ct_j * rhat) - preRF2_*uz_j);
622 >          dVdr +=  -preSw * (ri3 * (uz_j - three * ct_j * rhat) - preRF2_*uz_j);
623            duduz_j += -preSw * rhat * (ri2 - preRF2_ *  *(idat.rij) );  
624  
625            // Even if we excluded this pair from direct interactions,
# Line 667 | Line 648 | namespace OpenMD {
648  
649            if (screeningMethod_ == DAMPED) {
650              // assemble the damping variables
651 <            res = erfcSpline_->getValueAndDerivativeAt( *(idat.rij) );
652 <            erfcVal = res.first;
653 <            derfcVal = res.second;
651 >            //res = erfcSpline_->getValueAndDerivativeAt( *(idat.rij) );
652 >            //erfcVal = res.first;
653 >            //derfcVal = res.second;
654 >            erfcVal = erfc(dampingAlpha_ * *(idat.rij));
655 >            derfcVal = - alphaPi_ * exp(-alpha2_ * *(idat.r2));
656              c1 = erfcVal * ri;
657              c2 = (-derfcVal + c1) * ri;
658              c3 = -2.0 * derfcVal * alpha2_ + 3.0 * c2 * ri;
# Line 704 | Line 687 | namespace OpenMD {
687            
688          if (screeningMethod_ == DAMPED) {
689            // assemble the damping variables
690 <          res = erfcSpline_->getValueAndDerivativeAt( *(idat.rij) );
691 <          erfcVal = res.first;
692 <          derfcVal = res.second;
690 >          //res = erfcSpline_->getValueAndDerivativeAt( *(idat.rij) );
691 >          //erfcVal = res.first;
692 >          //derfcVal = res.second;
693 >          erfcVal = erfc(dampingAlpha_ * *(idat.rij));
694 >          derfcVal = - alphaPi_ * exp(-alpha2_ * *(idat.r2));
695            c1 = erfcVal * riji;
696            c2 = (-derfcVal + c1) * riji;
697            c3 = -2.0 * derfcVal * alpha2_ + 3.0 * c2 * riji;
# Line 723 | Line 708 | namespace OpenMD {
708          c2ri = c2 * riji;
709          c3ri = c3 * riji;
710          c4rij = c4 *  *(idat.rij) ;
711 <        rhatdot2 = 2.0 * rhat * c3;
711 >        rhatdot2 = two * rhat * c3;
712          rhatc4 = rhat * c4rij;
713  
714          // calculate the potential
# Line 736 | Line 721 | namespace OpenMD {
721                  
722          // calculate derivatives for the forces and torques
723  
724 <        dVdr += -preSw * ( qxx_j* (cx2*rhatc4 - (2.0*cx_j*ux_j + rhat)*c3ri) +
725 <                           qyy_j* (cy2*rhatc4 - (2.0*cy_j*uy_j + rhat)*c3ri) +
726 <                           qzz_j* (cz2*rhatc4 - (2.0*cz_j*uz_j + rhat)*c3ri));
724 >        dVdr += -preSw * ( qxx_j* (cx2*rhatc4 - (two*cx_j*ux_j + rhat)*c3ri) +
725 >                           qyy_j* (cy2*rhatc4 - (two*cy_j*uy_j + rhat)*c3ri) +
726 >                           qzz_j* (cz2*rhatc4 - (two*cz_j*uz_j + rhat)*c3ri));
727                            
728          dudux_j += preSw * qxx_j * cx_j * rhatdot2;
729          duduy_j += preSw * qyy_j * cy_j * rhatdot2;
# Line 762 | Line 747 | namespace OpenMD {
747            vpair += vterm;
748            epot +=  *(idat.sw)  * vterm;
749            
750 <          dVdr += preSw * (ri3 * (uz_i - 3.0 * ct_i * rhat) - preRF2_ * uz_i);
750 >          dVdr += preSw * (ri3 * (uz_i - three * ct_i * rhat) - preRF2_ * uz_i);
751            
752            duduz_i += preSw * rhat * (ri2 - preRF2_ *  *(idat.rij) );
753  
# Line 793 | Line 778 | namespace OpenMD {
778              
779            if (screeningMethod_ == DAMPED) {
780              // assemble the damping variables
781 <            res = erfcSpline_->getValueAndDerivativeAt( *(idat.rij) );
782 <            erfcVal = res.first;
783 <            derfcVal = res.second;
781 >            //res = erfcSpline_->getValueAndDerivativeAt( *(idat.rij) );
782 >            //erfcVal = res.first;
783 >            //derfcVal = res.second;
784 >            erfcVal = erfc(dampingAlpha_ * *(idat.rij));
785 >            derfcVal = - alphaPi_ * exp(-alpha2_ * *(idat.r2));
786              c1 = erfcVal * ri;
787              c2 = (-derfcVal + c1) * ri;
788              c3 = -2.0 * derfcVal * alpha2_ + 3.0 * c2 * ri;
# Line 838 | Line 825 | namespace OpenMD {
825              
826            a1 = 5.0 * ct_i * ct_j - ct_ij;
827              
828 <          dVdr += preSw * 3.0 * ri4 * (a1 * rhat - ct_i * uz_j - ct_j * uz_i);
828 >          dVdr += preSw * three * ri4 * (a1 * rhat - ct_i * uz_j - ct_j * uz_i);
829  
830 <          duduz_i += preSw * (ri3 * (uz_j - 3.0 * ct_j * rhat) - preRF2_*uz_j);
831 <          duduz_j += preSw * (ri3 * (uz_i - 3.0 * ct_i * rhat) - preRF2_*uz_i);
830 >          duduz_i += preSw * (ri3 * (uz_j - three * ct_j * rhat) - preRF2_*uz_j);
831 >          duduz_j += preSw * (ri3 * (uz_i - three * ct_i * rhat) - preRF2_*uz_i);
832  
833            if (idat.excluded) {
834              indirect_vpair +=  - pref * preRF2_ * ct_ij;
# Line 872 | Line 859 | namespace OpenMD {
859            }
860            if (screeningMethod_ == DAMPED) {
861              // assemble damping variables
862 <            res = erfcSpline_->getValueAndDerivativeAt( *(idat.rij) );
863 <            erfcVal = res.first;
864 <            derfcVal = res.second;
862 >            //res = erfcSpline_->getValueAndDerivativeAt( *(idat.rij) );
863 >            //erfcVal = res.first;
864 >            //derfcVal = res.second;
865 >            erfcVal = erfc(dampingAlpha_ * *(idat.rij));
866 >            derfcVal = - alphaPi_ * exp(-alpha2_ * *(idat.r2));
867              c1 = erfcVal * ri;
868              c2 = (-derfcVal + c1) * ri;
869              c3 = -2.0 * derfcVal * alpha2_ + 3.0 * c2 * ri;
# Line 923 | Line 912 | namespace OpenMD {
912  
913          if (screeningMethod_ == DAMPED) {
914            // assemble the damping variables
915 <          res = erfcSpline_->getValueAndDerivativeAt( *(idat.rij) );
916 <          erfcVal = res.first;
917 <          derfcVal = res.second;
915 >          //res = erfcSpline_->getValueAndDerivativeAt( *(idat.rij) );
916 >          //erfcVal = res.first;
917 >          //derfcVal = res.second;
918 >          erfcVal = erfc(dampingAlpha_ * *(idat.rij));
919 >          derfcVal = - alphaPi_ * exp(-alpha2_ * *(idat.r2));
920            c1 = erfcVal * riji;
921            c2 = (-derfcVal + c1) * riji;
922            c3 = -2.0 * derfcVal * alpha2_ + 3.0 * c2 * riji;
# Line 942 | Line 933 | namespace OpenMD {
933          c2ri = c2 * riji;
934          c3ri = c3 * riji;
935          c4rij = c4 *  *(idat.rij) ;
936 <        rhatdot2 = 2.0 * rhat * c3;
936 >        rhatdot2 = two * rhat * c3;
937          rhatc4 = rhat * c4rij;
938  
939          // calculate the potential
# Line 956 | Line 947 | namespace OpenMD {
947  
948          // calculate the derivatives for the forces and torques
949  
950 <        dVdr += -preSw * (qxx_i* (cx2*rhatc4 - (2.0*cx_i*ux_i + rhat)*c3ri) +
951 <                          qyy_i* (cy2*rhatc4 - (2.0*cy_i*uy_i + rhat)*c3ri) +
952 <                          qzz_i* (cz2*rhatc4 - (2.0*cz_i*uz_i + rhat)*c3ri));
950 >        dVdr += -preSw * (qxx_i* (cx2*rhatc4 - (two*cx_i*ux_i + rhat)*c3ri) +
951 >                          qyy_i* (cy2*rhatc4 - (two*cy_i*uy_i + rhat)*c3ri) +
952 >                          qzz_i* (cz2*rhatc4 - (two*cz_i*uz_i + rhat)*c3ri));
953  
954          dudux_i += preSw * qxx_i * cx_i *  rhatdot2;
955          duduy_i += preSw * qyy_i * cy_i *  rhatdot2;
# Line 990 | Line 981 | namespace OpenMD {
981  
982        // only accumulate the forces and torques resulting from the
983        // indirect reaction field terms.
984 +
985        *(idat.vpair) += indirect_vpair;
986        (*(idat.pot))[ELECTROSTATIC_FAMILY] += indirect_Pot;
987        *(idat.f1) += indirect_dVdr;
# Line 1030 | Line 1022 | namespace OpenMD {
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 {        

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines