If the reference System object does not manually specify alpha_ewald for PME, it appears that the direct-space PME contribution is incorrect. The logic in this block does not work as intended, instead skipping the if alpha_ewald == 0.0 clause (since alpha_ewald has units of 1/nm) and using a value of 0 in the calculation of the electrostatic energy expression.
If alpha_ewald is not manually set, it will be determined automatically from the PME tolerance upon Context creation. This is thankfully standardized in NonbondedForceImpl:
double tol = force.getEwaldErrorTolerance();
alpha = (1.0/force.getCutoffDistance())*std::sqrt(-log(2.0*tol));
If the reference
System
object does not manually specifyalpha_ewald
for PME, it appears that the direct-space PME contribution is incorrect. The logic in this block does not work as intended, instead skipping theif alpha_ewald == 0.0
clause (sincealpha_ewald
has units of 1/nm) and using a value of 0 in the calculation of the electrostatic energy expression.If
alpha_ewald
is not manually set, it will be determined automatically from the PME tolerance uponContext
creation. This is thankfully standardized inNonbondedForceImpl
: