const real gmx_unused gapsysScaleLinpointCoul = scParams.gapsysScaleLinpointCoul;
const real gmx_unused gapsysScaleLinpointVdW = scParams.gapsysScaleLinpointVdW;
- const real gmx_unused sigma6VdWGapsys = scParams.sigma6VdWGapsys;
+ const real gmx_unused gapsysSigma6VdW = scParams.gapsysSigma6VdW;
const bool gmx_unused doShiftForces = ((flags & GMX_NONBONDED_DO_SHIFTFORCE) != 0);
const bool doPotential = ((flags & GMX_NONBONDED_DO_POTENTIAL) != 0);
const RealType maxRInvSix(c_maxRInvSix);
const RealType gmx_unused floatMin(GMX_FLOAT_MIN);
- RealType dvdlCoul(zero);
- RealType dvdlVdw(zero);
+ RealType dvdlCoul{ zero };
+ RealType dvdlVdw{ zero };
/* Lambda factor for state A, 1-lambda*/
real LFC[NSTATES], LFV[NSTATES];
int preloadIi[DataTypes::simdRealWidth];
int gmx_unused preloadIs[DataTypes::simdRealWidth];
#endif
- for (int s = 0; s < DataTypes::simdRealWidth; s++)
+ for (int i = 0; i < DataTypes::simdRealWidth; i++)
{
- preloadIi[s] = ii;
- preloadIs[s] = shift[n];
+ preloadIi[i] = ii;
+ preloadIs[i] = shift[n];
}
IntType ii_s = gmx::load<IntType>(preloadIi);
alignas(GMX_SIMD_ALIGNMENT)
real gmx_unused preloadGapsysScaleLinpointCoul[DataTypes::simdRealWidth];
alignas(GMX_SIMD_ALIGNMENT)
- real gmx_unused preloadSigma6VdWGapsys[NSTATES][DataTypes::simdRealWidth];
+ real gmx_unused preloadGapsysSigma6VdW[NSTATES][DataTypes::simdRealWidth];
alignas(GMX_SIMD_ALIGNMENT) real preloadLjPmeC6Grid[NSTATES][DataTypes::simdRealWidth];
#else
real preloadPairIsValid[DataTypes::simdRealWidth];
real gmx_unused preloadAlphaCoulEff[DataTypes::simdRealWidth];
real gmx_unused preloadGapsysScaleLinpointVdW[DataTypes::simdRealWidth];
real gmx_unused preloadGapsysScaleLinpointCoul[DataTypes::simdRealWidth];
- real gmx_unused preloadSigma6VdWGapsys[NSTATES][DataTypes::simdRealWidth];
+ real gmx_unused preloadGapsysSigma6VdW[NSTATES][DataTypes::simdRealWidth];
real preloadLjPmeC6Grid[NSTATES][DataTypes::simdRealWidth];
#endif
- for (int s = 0; s < DataTypes::simdRealWidth; s++)
+ for (int j = 0; j < DataTypes::simdRealWidth; j++)
{
- if (k + s < nj1)
+ if (k + j < nj1)
{
- preloadPairIsValid[s] = true;
+ preloadPairIsValid[j] = true;
/* Check if this pair on the exclusions list.*/
- preloadPairIncluded[s] = (nlist.excl_fep.empty() || nlist.excl_fep[k + s]);
- const int jnr = jjnr[k + s];
- preloadJnr[s] = jnr;
- typeIndices[STATE_A][s] = ntiA + typeA[jnr];
- typeIndices[STATE_B][s] = ntiB + typeB[jnr];
- preloadQq[STATE_A][s] = iqA * chargeA[jnr];
- preloadQq[STATE_B][s] = iqB * chargeB[jnr];
+ preloadPairIncluded[j] = (nlist.excl_fep.empty() || nlist.excl_fep[k + j]);
+ const int jnr = jjnr[k + j];
+ preloadJnr[j] = jnr;
+ typeIndices[STATE_A][j] = ntiA + typeA[jnr];
+ typeIndices[STATE_B][j] = ntiB + typeB[jnr];
+ preloadQq[STATE_A][j] = iqA * chargeA[jnr];
+ preloadQq[STATE_B][j] = iqB * chargeB[jnr];
for (int i = 0; i < NSTATES; i++)
{
if constexpr (vdwInteractionTypeIsEwald)
{
- preloadLjPmeC6Grid[i][s] = nbfp_grid[2 * typeIndices[i][s]];
+ preloadLjPmeC6Grid[i][j] = nbfp_grid[2 * typeIndices[i][j]];
}
else
{
- preloadLjPmeC6Grid[i][s] = 0;
+ preloadLjPmeC6Grid[i][j] = 0;
}
if constexpr (softcoreType == KernelSoftcoreType::Beutler)
{
- const real c6 = nbfp[2 * typeIndices[i][s]];
- const real c12 = nbfp[2 * typeIndices[i][s] + 1];
+ const real c6 = nbfp[2 * typeIndices[i][j]];
+ const real c12 = nbfp[2 * typeIndices[i][j] + 1];
if (c6 > 0 && c12 > 0)
{
/* c12 is stored scaled with 12.0 and c6 is scaled with 6.0 - correct for this */
- preloadSigma6[i][s] = 0.5_real * c12 / c6;
- if (preloadSigma6[i][s]
+ preloadSigma6[i][j] = 0.5_real * c12 / c6;
+ if (preloadSigma6[i][j]
< sigma6_min) /* for disappearing coul and vdw with soft core at the same time */
{
- preloadSigma6[i][s] = sigma6_min;
+ preloadSigma6[i][j] = sigma6_min;
}
}
else
{
- preloadSigma6[i][s] = sigma6_def;
+ preloadSigma6[i][j] = sigma6_def;
}
}
if constexpr (softcoreType == KernelSoftcoreType::Gapsys)
{
- const real c6 = nbfp[2 * typeIndices[i][s]];
- const real c12 = nbfp[2 * typeIndices[i][s] + 1];
+ const real c6 = nbfp[2 * typeIndices[i][j]];
+ const real c12 = nbfp[2 * typeIndices[i][j] + 1];
if (c6 > 0 && c12 > 0)
{
/* c12 is stored scaled with 12.0 and c6 is scaled with 6.0 - correct for this */
- preloadSigma6VdWGapsys[i][s] = 0.5_real * c12 / c6;
+ preloadGapsysSigma6VdW[i][j] = 0.5_real * c12 / c6;
}
else
{
- preloadSigma6VdWGapsys[i][s] = sigma6VdWGapsys;
+ preloadGapsysSigma6VdW[i][j] = gapsysSigma6VdW;
}
}
}
if constexpr (softcoreType == KernelSoftcoreType::Beutler)
{
/* only use softcore if one of the states has a zero endstate - softcore is for avoiding infinities!*/
- const real c12A = nbfp[2 * typeIndices[STATE_A][s] + 1];
- const real c12B = nbfp[2 * typeIndices[STATE_B][s] + 1];
+ const real c12A = nbfp[2 * typeIndices[STATE_A][j] + 1];
+ const real c12B = nbfp[2 * typeIndices[STATE_B][j] + 1];
if (c12A > 0 && c12B > 0)
{
- preloadAlphaVdwEff[s] = 0;
- preloadAlphaCoulEff[s] = 0;
+ preloadAlphaVdwEff[j] = 0;
+ preloadAlphaCoulEff[j] = 0;
}
else
{
- preloadAlphaVdwEff[s] = alpha_vdw;
- preloadAlphaCoulEff[s] = alpha_coul;
+ preloadAlphaVdwEff[j] = alpha_vdw;
+ preloadAlphaCoulEff[j] = alpha_coul;
}
}
if constexpr (softcoreType == KernelSoftcoreType::Gapsys)
{
/* only use softcore if one of the states has a zero endstate - softcore is for avoiding infinities!*/
- const real c12A = nbfp[2 * typeIndices[STATE_A][s] + 1];
- const real c12B = nbfp[2 * typeIndices[STATE_B][s] + 1];
+ const real c12A = nbfp[2 * typeIndices[STATE_A][j] + 1];
+ const real c12B = nbfp[2 * typeIndices[STATE_B][j] + 1];
if (c12A > 0 && c12B > 0)
{
- preloadGapsysScaleLinpointVdW[s] = 0;
- preloadGapsysScaleLinpointCoul[s] = 0;
+ preloadGapsysScaleLinpointVdW[j] = 0;
+ preloadGapsysScaleLinpointCoul[j] = 0;
}
else
{
- preloadGapsysScaleLinpointVdW[s] = gapsysScaleLinpointVdW;
- preloadGapsysScaleLinpointCoul[s] = gapsysScaleLinpointCoul;
+ preloadGapsysScaleLinpointVdW[j] = gapsysScaleLinpointVdW;
+ preloadGapsysScaleLinpointCoul[j] = gapsysScaleLinpointCoul;
}
}
}
else
{
- preloadJnr[s] = jjnr[k];
- preloadPairIsValid[s] = false;
- preloadPairIncluded[s] = false;
- preloadAlphaVdwEff[s] = 0;
- preloadAlphaCoulEff[s] = 0;
- preloadGapsysScaleLinpointVdW[s] = 0;
- preloadGapsysScaleLinpointCoul[s] = 0;
-
+ preloadJnr[j] = jjnr[k];
+ preloadPairIsValid[j] = false;
+ preloadPairIncluded[j] = false;
+ preloadAlphaVdwEff[j] = 0;
+ preloadAlphaCoulEff[j] = 0;
+ preloadGapsysScaleLinpointVdW[j] = 0;
+ preloadGapsysScaleLinpointCoul[j] = 0;
+
+ typeIndices[STATE_A][j] = ntiA + typeA[jjnr[k]];
+ typeIndices[STATE_B][j] = ntiB + typeB[jjnr[k]];
for (int i = 0; i < NSTATES; i++)
{
- typeIndices[STATE_A][s] = ntiA + typeA[jjnr[k]];
- typeIndices[STATE_B][s] = ntiB + typeB[jjnr[k]];
- preloadLjPmeC6Grid[i][s] = 0;
- preloadQq[i][s] = 0;
- preloadSigma6[i][s] = 0;
- preloadSigma6VdWGapsys[i][s] = 0;
+ preloadLjPmeC6Grid[i][j] = 0;
+ preloadQq[i][j] = 0;
+ preloadSigma6[i][j] = 0;
+ preloadGapsysSigma6VdW[i][j] = 0;
}
}
}
RealType gmx_unused alphaCoulEff;
RealType gmx_unused gapsysScaleLinpointVdWEff;
RealType gmx_unused gapsysScaleLinpointCoulEff;
- RealType gmx_unused sigmaVdWGapsysEff[NSTATES];
+ RealType gmx_unused gapsysSigma6VdWEff[NSTATES];
for (int i = 0; i < NSTATES; i++)
{
gmx::gatherLoadTranspose<2>(nbfp.data(), typeIndices[i], &c6[i], &c12[i]);
}
if constexpr (softcoreType == KernelSoftcoreType::Gapsys)
{
- sigmaVdWGapsysEff[i] = gmx::load<RealType>(preloadSigma6VdWGapsys[i]);
+ gapsysSigma6VdWEff[i] = gmx::load<RealType>(preloadGapsysSigma6VdW[i]);
}
}
if constexpr (softcoreType == KernelSoftcoreType::Beutler)
if constexpr (softcoreType == KernelSoftcoreType::Gapsys)
{
- ewaldQuadraticPotential(qq[i],
- facel,
- rC,
- rCutoffCoul,
- LFC[i],
- DLF[i],
- gapsysScaleLinpointCoulEff,
- sh_ewald,
- &fScalC[i],
- &vCoul[i],
- &dvdlCoul,
- computeElecInteraction);
+ ewaldQuadraticPotential<computeForces>(qq[i],
+ facel,
+ rC,
+ rCutoffCoul,
+ LFC[i],
+ DLF[i],
+ gapsysScaleLinpointCoulEff,
+ sh_ewald,
+ &fScalC[i],
+ &vCoul[i],
+ &dvdlCoul,
+ computeElecInteraction);
}
}
else
if constexpr (softcoreType == KernelSoftcoreType::Gapsys)
{
- reactionFieldQuadraticPotential(qq[i],
- facel,
- rC,
- rCutoffCoul,
- LFC[i],
- DLF[i],
- gapsysScaleLinpointCoulEff,
- krf,
- crf,
- &fScalC[i],
- &vCoul[i],
- &dvdlCoul,
- computeElecInteraction);
+ reactionFieldQuadraticPotential<computeForces>(
+ qq[i],
+ facel,
+ rC,
+ rCutoffCoul,
+ LFC[i],
+ DLF[i],
+ gapsysScaleLinpointCoulEff,
+ krf,
+ crf,
+ &fScalC[i],
+ &vCoul[i],
+ &dvdlCoul,
+ computeElecInteraction);
}
}
if constexpr (vdwInteractionTypeIsEwald)
{
computeVdwInteraction =
- (r < rVdw && (c6[i] != 0 || c12[i] != 0) && bPairIncluded);
+ (r < rVdw && (c6[i] != zero || c12[i] != zero) && bPairIncluded);
}
else
{
computeVdwInteraction =
- (rV < rVdw && (c6[i] != 0 || c12[i] != 0) && bPairIncluded);
+ (rV < rVdw && (c6[i] != zero || c12[i] != zero) && bPairIncluded);
}
if (gmx::anyTrue(computeVdwInteraction))
{
if constexpr (softcoreType == KernelSoftcoreType::Gapsys)
{
- lennardJonesQuadraticPotential(c6[i],
- c12[i],
- r,
- rSq,
- LFV[i],
- DLF[i],
- sigmaVdWGapsysEff[i],
- gapsysScaleLinpointVdWEff,
- repulsionShift,
- dispersionShift,
- &fScalV[i],
- &vVdw[i],
- &dvdlVdw,
- computeVdwInteraction);
+ lennardJonesQuadraticPotential<computeForces>(c6[i],
+ c12[i],
+ r,
+ rSq,
+ LFV[i],
+ DLF[i],
+ gapsysSigma6VdWEff[i],
+ gapsysScaleLinpointVdWEff,
+ repulsionShift,
+ dispersionShift,
+ &fScalV[i],
+ &vVdw[i],
+ &dvdlVdw,
+ computeVdwInteraction);
}
if constexpr (vdwInteractionTypeIsEwald)
#if GMX_SIMD_HAVE_REAL && GMX_SIMD_HAVE_INT32_ARITHMETICS && GMX_USE_SIMD_KERNELS
return (nb_free_energy_kernel<SimdDataTypes, softcoreType, scLambdasOrAlphasDiffer, vdwInteractionTypeIsEwald, elecInteractionTypeIsEwald, vdwModifierIsPotSwitch, computeForces>);
#else
- return (nb_free_energy_kernel<ScalarDataTypes, softcoreType, scLambdasOrAlphasDiffer, vdwInteractionTypeIsEwald, elecInteractionTypeIsEwald, vdwModifierIsPotSwitch computeForces>);
+ return (nb_free_energy_kernel<ScalarDataTypes, softcoreType, scLambdasOrAlphasDiffer, vdwInteractionTypeIsEwald, elecInteractionTypeIsEwald, vdwModifierIsPotSwitch, computeForces>);
#endif
}
else