Old code silently computed zeroes for Coulomb(SR) when using
Generalized Born and the free energy kernel, because of the
inappropriate use of a default branch of a switch statement.
Fixed the default branch for icoul and ivdw switch statements to issue
gmx_incons (similar to usage in the Verlet kernel code). Now we invoke
explicit code paths for all legal values of icoul and ivdw. Added
gmx_fatal for un-implemented GB case (similar to the gmx_fatal for
Buckingham with this free energy kernel).
Partial fix for #1237
Change-Id: I30684aed9fba9beac9b1b87eb99e2cbc7e7e374d
FscalC[i] = -qq[i]*tabscale*FF*rC*rpinvC;
break;
- default:
+ case GMX_NBKERNEL_ELEC_GENERALIZEDBORN:
+ gmx_fatal(FARGS, "Free energy and GB not implemented.\n");
+ break;
+
+ case GMX_NBKERNEL_ELEC_NONE:
FscalC[i] = 0.0;
Vcoul[i] = 0.0;
break;
+
+ default:
+ gmx_incons("Invalid icoul in free energy kernel");
+ break;
}
if (fr->coulomb_modifier == eintmodPOTSWITCH)
FscalV[i] -= c12[i]*tabscale*FF*rV*rpinvV;
break;
- default:
+ case GMX_NBKERNEL_VDW_NONE:
Vvdw[i] = 0.0;
FscalV[i] = 0.0;
break;
+
+ default:
+ gmx_incons("Invalid ivdw in free energy kernel");
+ break;
}
if (fr->vdw_modifier == eintmodPOTSWITCH)