X-Git-Url: http://biod.pnpi.spb.ru/gitweb/?a=blobdiff_plain;f=src%2Fgromacs%2Fgmxlib%2Fnonbonded%2Fnb_softcore.h;h=de1852d3b718014fe904d5d09d70f02f822d4bcc;hb=0558c2b62eb4a41bafba23dbd55c1e6ad05c1926;hp=5db070ff42a034ff04ff04d783f45d6ab7ec1cc6;hpb=80d4eb6527ac2699b3a277dbf9eb142bb3d15feb;p=alexxy%2Fgromacs.git diff --git a/src/gromacs/gmxlib/nonbonded/nb_softcore.h b/src/gromacs/gmxlib/nonbonded/nb_softcore.h index 5db070ff42..de1852d3b7 100644 --- a/src/gromacs/gmxlib/nonbonded/nb_softcore.h +++ b/src/gromacs/gmxlib/nonbonded/nb_softcore.h @@ -86,8 +86,11 @@ static inline void reactionFieldQuadraticPotential(const RealType qq, RealType* dvdl, BoolType mask) { + RealType one(1); + RealType zero(0); + /* check if we have to use the hardcore values */ - BoolType computeValues = mask && (lambdaFac < 1 && 0 < alphaEff && facel != 0); + BoolType computeValues = mask && (lambdaFac < one && zero < alphaEff && facel != zero); if (gmx::anyTrue(computeValues)) { RealType lambdaFacRev = gmx::selectByMask(1 - lambdaFac, computeValues); @@ -146,8 +149,11 @@ static inline void ewaldQuadraticPotential(const RealType qq, RealType* dvdl, BoolType mask) { + RealType one(1); + RealType zero(0); + /* check if we have to use the hardcore values */ - BoolType computeValues = mask && (lambdaFac < 1 && 0 < alphaEff && facel != 0); + BoolType computeValues = mask && (lambdaFac < one && zero < alphaEff && facel != zero); if (gmx::anyTrue(computeValues)) { RealType lambdaFacRev = gmx::selectByMask(1 - lambdaFac, computeValues); @@ -212,8 +218,11 @@ static inline void lennardJonesQuadraticPotential(const RealType c6, constexpr real c_oneTwelth = 1.0_real / 12.0_real; constexpr real c_half = 1.0_real / 2.0_real; + RealType one(1); + RealType zero(0); + /* check if we have to use the hardcore values */ - BoolType computeValues = mask && (lambdaFac < 1 && 0 < alphaEff); + BoolType computeValues = mask && (lambdaFac < one && zero < alphaEff); if (gmx::anyTrue(computeValues)) { RealType lambdaFacRev = gmx::selectByMask(1 - lambdaFac, computeValues);