--- branches/development/src/nonbonded/EAM.cpp 2012/05/18 21:44:02 1710 +++ branches/development/src/nonbonded/EAM.cpp 2013/02/20 15:39:39 1850 @@ -35,7 +35,7 @@ * * [1] Meineke, et al., J. Comp. Chem. 26, 252-271 (2005). * [2] Fennell & Gezelter, J. Chem. Phys. 124, 234104 (2006). - * [3] Sun, Lin & Gezelter, J. Chem. Phys. 128, 24107 (2008). + * [3] Sun, Lin & Gezelter, J. Chem. Phys. 128, 234107 (2008). * [4] Kuang & Gezelter, J. Chem. Phys. 133, 164101 (2010). * [5] Vardeman, Stocker & Gezelter, J. Chem. Theory Comput. 7, 834 (2011). */ @@ -90,7 +90,7 @@ namespace OpenMD { phivals.push_back(0.0); - for (int i = 1; i < rvals.size(); i++ ) { + for (unsigned int i = 1; i < rvals.size(); i++ ) { r = rvals[i]; // only use z(r) if we're inside this atom's cutoff radius, @@ -300,7 +300,9 @@ namespace OpenMD { *(sdat.dfrhodrho) = result.second; (*(sdat.pot))[METALLIC_FAMILY] += result.first; - *(sdat.particlePot) += result.first; + if (sdat.doParticlePot) { + *(sdat.particlePot) += result.first; + } return; } @@ -392,21 +394,23 @@ namespace OpenMD { *(idat.f1) += *(idat.d) * dudr / *(idat.rij); - // particlePot is the difference between the full potential and - // the full potential without the presence of a particular - // particle (atom1). - // - // This reduces the density at other particle locations, so we - // need to recompute the density at atom2 assuming atom1 didn't - // contribute. This then requires recomputing the density - // functional for atom2 as well. - - *(idat.particlePot1) += data2.F->getValueAt( *(idat.rho2) - rha ) - - *(idat.frho2); + if (idat.doParticlePot) { + // particlePot is the difference between the full potential and + // the full potential without the presence of a particular + // particle (atom1). + // + // This reduces the density at other particle locations, so we + // need to recompute the density at atom2 assuming atom1 didn't + // contribute. This then requires recomputing the density + // functional for atom2 as well. + + *(idat.particlePot1) += data2.F->getValueAt( *(idat.rho2) - rha ) + - *(idat.frho2); + + *(idat.particlePot2) += data1.F->getValueAt( *(idat.rho1) - rhb) + - *(idat.frho1); + } - *(idat.particlePot2) += data1.F->getValueAt( *(idat.rho1) - rhb) - - *(idat.frho1); - (*(idat.pot))[METALLIC_FAMILY] += phab; *(idat.vpair) += phab;