Guard for epsfac equals zero in sc-gapsys.
[alexxy/gromacs.git] / src / gromacs / gmxlib / nonbonded / nb_softcore.h
index f06c48b3fc7a68775ec192aa96ba45b6055b83a1..a2615ede4a7aedd78199d58b71bf94aa4de1bbda 100644 (file)
@@ -84,7 +84,7 @@ static inline void reactionFieldQuadraticPotential(const RealType qq,
                                                    BoolType       mask)
 {
     /* check if we have to use the hardcore values */
-    BoolType computeValues = mask && (lambdaFac < 1 && 0 < alphaEff);
+    BoolType computeValues = mask && (lambdaFac < 1 && 0 < alphaEff && facel != 0);
     if (gmx::anyTrue(computeValues))
     {
         RealType lambdaFacRev = gmx::selectByMask(1 - lambdaFac, computeValues);
@@ -140,9 +140,8 @@ static inline void ewaldQuadraticPotential(const RealType qq,
                                            RealType*      dvdl,
                                            BoolType       mask)
 {
-
     /* check if we have to use the hardcore values */
-    BoolType computeValues = mask && (lambdaFac < 1 && 0 < alphaEff);
+    BoolType computeValues = mask && (lambdaFac < 1 && 0 < alphaEff && facel != 0);
     if (gmx::anyTrue(computeValues))
     {
         RealType lambdaFacRev = gmx::selectByMask(1 - lambdaFac, computeValues);