Pass members of t_mdatoms directly in many places in listed_forces.
Part of work on making refactor of t_mdatoms easier.
dr[clust_id].aver_6[ndr] += disresdata->Rt_6[label];
snew(fshift, SHIFTS);
dr[clust_id].aver_6[ndr] += disresdata->Rt_6[label];
snew(fshift, SHIFTS);
- ta_disres(n, &forceatoms[i], forceparams.data(), x, f, fshift, pbc, lam, &dvdl, nullptr, nullptr, disresdata, nullptr, nullptr);
+ ta_disres(n, &forceatoms[i], forceparams.data(), x, f, fshift, pbc, lam, &dvdl, {}, nullptr, disresdata, nullptr, nullptr);
sfree(fshift);
viol = disresdata->sumviol;
sfree(fshift);
viol = disresdata->sumviol;
#include "gromacs/simd/simd.h"
#include "gromacs/simd/simd_math.h"
#include "gromacs/simd/vector_operations.h"
#include "gromacs/simd/simd.h"
#include "gromacs/simd/simd_math.h"
#include "gromacs/simd/vector_operations.h"
+#include "gromacs/utility/arrayref.h"
#include "gromacs/utility/basedefinitions.h"
#include "gromacs/utility/enumerationhelpers.h"
#include "gromacs/utility/fatalerror.h"
#include "gromacs/utility/basedefinitions.h"
#include "gromacs/utility/enumerationhelpers.h"
#include "gromacs/utility/fatalerror.h"
{
//! Type of CPU function to compute a bonded interaction.
{
//! Type of CPU function to compute a bonded interaction.
-using BondedFunction = real (*)(int nbonds,
- const t_iatom iatoms[],
- const t_iparams iparams[],
- const rvec x[],
- rvec4 f[],
- rvec fshift[],
- const t_pbc* pbc,
- real lambda,
- real* dvdlambda,
- const t_mdatoms* md,
- t_fcdata* fcd,
- t_disresdata* disresdata,
- t_oriresdata* oriresdata,
- int* ddgatindex);
+using BondedFunction = real (*)(int nbonds,
+ const t_iatom iatoms[],
+ const t_iparams iparams[],
+ const rvec x[],
+ rvec4 f[],
+ rvec fshift[],
+ const t_pbc* pbc,
+ real lambda,
+ real* dvdlambda,
+ gmx::ArrayRef<const real> charge,
+ t_fcdata* fcd,
+ t_disresdata* disresdata,
+ t_oriresdata* oriresdata,
+ int* ddgatindex);
/*! \brief Mysterious CMAP coefficient matrix */
const int cmap_coeff_matrix[] = {
/*! \brief Mysterious CMAP coefficient matrix */
const int cmap_coeff_matrix[] = {
const t_pbc* pbc,
real lambda,
real* dvdlambda,
const t_pbc* pbc,
real lambda,
real* dvdlambda,
- const t_mdatoms gmx_unused* md,
+ gmx::ArrayRef<const real> /*charge*/,
t_fcdata gmx_unused* fcd,
t_disresdata gmx_unused* disresdata,
t_oriresdata gmx_unused* oriresdata,
t_fcdata gmx_unused* fcd,
t_disresdata gmx_unused* disresdata,
t_oriresdata gmx_unused* oriresdata,
const t_pbc* pbc,
real gmx_unused lambda,
real gmx_unused* dvdlambda,
const t_pbc* pbc,
real gmx_unused lambda,
real gmx_unused* dvdlambda,
- const t_mdatoms gmx_unused* md,
+ gmx::ArrayRef<const real> /*charge*/,
t_fcdata gmx_unused* fcd,
t_disresdata gmx_unused* disresdata,
t_oriresdata gmx_unused* oriresdata,
t_fcdata gmx_unused* fcd,
t_disresdata gmx_unused* disresdata,
t_oriresdata gmx_unused* oriresdata,
const t_pbc* pbc,
real gmx_unused lambda,
real gmx_unused* dvdlambda,
const t_pbc* pbc,
real gmx_unused lambda,
real gmx_unused* dvdlambda,
- const t_mdatoms gmx_unused* md,
+ gmx::ArrayRef<const real> /*charge*/,
t_fcdata gmx_unused* fcd,
t_disresdata gmx_unused* disresdata,
t_oriresdata gmx_unused* oriresdata,
t_fcdata gmx_unused* fcd,
t_disresdata gmx_unused* disresdata,
t_oriresdata gmx_unused* oriresdata,
const t_pbc* pbc,
real lambda,
real* dvdlambda,
const t_pbc* pbc,
real lambda,
real* dvdlambda,
- const t_mdatoms gmx_unused* md,
+ gmx::ArrayRef<const real> /*charge*/,
t_fcdata gmx_unused* fcd,
t_disresdata gmx_unused* disresdata,
t_oriresdata gmx_unused* oriresdata,
t_fcdata gmx_unused* fcd,
t_disresdata gmx_unused* disresdata,
t_oriresdata gmx_unused* oriresdata,
const t_pbc* pbc,
real gmx_unused lambda,
real gmx_unused* dvdlambda,
const t_pbc* pbc,
real gmx_unused lambda,
real gmx_unused* dvdlambda,
- const t_mdatoms gmx_unused* md,
+ gmx::ArrayRef<const real> /*charge*/,
t_fcdata gmx_unused* fcd,
t_disresdata gmx_unused* disresdata,
t_oriresdata gmx_unused* oriresdata,
t_fcdata gmx_unused* fcd,
t_disresdata gmx_unused* disresdata,
t_oriresdata gmx_unused* oriresdata,
const t_pbc* pbc,
real lambda,
real* dvdlambda,
const t_pbc* pbc,
real lambda,
real* dvdlambda,
- const t_mdatoms gmx_unused* md,
+ gmx::ArrayRef<const real> /*charge*/,
t_fcdata gmx_unused* fcd,
t_disresdata gmx_unused* disresdata,
t_oriresdata gmx_unused* oriresdata,
t_fcdata gmx_unused* fcd,
t_disresdata gmx_unused* disresdata,
t_oriresdata gmx_unused* oriresdata,
}
template<BondedKernelFlavor flavor>
}
template<BondedKernelFlavor flavor>
-real polarize(int nbonds,
- const t_iatom forceatoms[],
- const t_iparams forceparams[],
- const rvec x[],
- rvec4 f[],
- rvec fshift[],
- const t_pbc* pbc,
- real lambda,
- real* dvdlambda,
- const t_mdatoms* md,
+real polarize(int nbonds,
+ const t_iatom forceatoms[],
+ const t_iparams forceparams[],
+ const rvec x[],
+ rvec4 f[],
+ rvec fshift[],
+ const t_pbc* pbc,
+ real lambda,
+ real* dvdlambda,
+ gmx::ArrayRef<const real> charge,
t_fcdata gmx_unused* fcd,
t_disresdata gmx_unused* disresdata,
t_oriresdata gmx_unused* oriresdata,
t_fcdata gmx_unused* fcd,
t_disresdata gmx_unused* disresdata,
t_oriresdata gmx_unused* oriresdata,
type = forceatoms[i++];
ai = forceatoms[i++];
aj = forceatoms[i++];
type = forceatoms[i++];
ai = forceatoms[i++];
aj = forceatoms[i++];
- ksh = gmx::square(md->chargeA[aj]) * gmx::c_one4PiEps0 / forceparams[type].polarize.alpha;
+ ksh = gmx::square(charge[aj]) * gmx::c_one4PiEps0 / forceparams[type].polarize.alpha;
ki = pbc_rvec_sub(pbc, x[ai], x[aj], dx); /* 3 */
dr2 = iprod(dx, dx); /* 5 */
ki = pbc_rvec_sub(pbc, x[ai], x[aj], dx); /* 3 */
dr2 = iprod(dx, dx); /* 5 */
}
template<BondedKernelFlavor flavor>
}
template<BondedKernelFlavor flavor>
-real anharm_polarize(int nbonds,
- const t_iatom forceatoms[],
- const t_iparams forceparams[],
- const rvec x[],
- rvec4 f[],
- rvec fshift[],
- const t_pbc* pbc,
- real lambda,
- real* dvdlambda,
- const t_mdatoms* md,
+real anharm_polarize(int nbonds,
+ const t_iatom forceatoms[],
+ const t_iparams forceparams[],
+ const rvec x[],
+ rvec4 f[],
+ rvec fshift[],
+ const t_pbc* pbc,
+ real lambda,
+ real* dvdlambda,
+ gmx::ArrayRef<const real> charge,
t_fcdata gmx_unused* fcd,
t_disresdata gmx_unused* disresdata,
t_oriresdata gmx_unused* oriresdata,
t_fcdata gmx_unused* fcd,
t_disresdata gmx_unused* disresdata,
t_oriresdata gmx_unused* oriresdata,
type = forceatoms[i++];
ai = forceatoms[i++];
aj = forceatoms[i++];
type = forceatoms[i++];
ai = forceatoms[i++];
aj = forceatoms[i++];
- ksh = gmx::square(md->chargeA[aj]) * gmx::c_one4PiEps0 / forceparams[type].anharm_polarize.alpha; /* 7*/
+ ksh = gmx::square(charge[aj]) * gmx::c_one4PiEps0 / forceparams[type].anharm_polarize.alpha; /* 7*/
khyp = forceparams[type].anharm_polarize.khyp;
drcut = forceparams[type].anharm_polarize.drcut;
khyp = forceparams[type].anharm_polarize.khyp;
drcut = forceparams[type].anharm_polarize.drcut;
rvec gmx_unused fshift[],
const t_pbc gmx_unused* pbc,
real gmx_unused lambda,
rvec gmx_unused fshift[],
const t_pbc gmx_unused* pbc,
real gmx_unused lambda,
- real gmx_unused* dvdlambda,
- const t_mdatoms gmx_unused* md,
+ real gmx_unused* dvdlambda,
+ gmx::ArrayRef<const real> charge,
t_fcdata gmx_unused* fcd,
t_disresdata gmx_unused* disresdata,
t_oriresdata gmx_unused* oriresdata,
t_fcdata gmx_unused* fcd,
t_disresdata gmx_unused* disresdata,
t_oriresdata gmx_unused* oriresdata,
{
type0 = forceatoms[0];
aS = forceatoms[5];
{
type0 = forceatoms[0];
aS = forceatoms[5];
kk[XX] = gmx::square(qS) * gmx::c_one4PiEps0 / forceparams[type0].wpol.al_x;
kk[YY] = gmx::square(qS) * gmx::c_one4PiEps0 / forceparams[type0].wpol.al_y;
kk[ZZ] = gmx::square(qS) * gmx::c_one4PiEps0 / forceparams[type0].wpol.al_z;
kk[XX] = gmx::square(qS) * gmx::c_one4PiEps0 / forceparams[type0].wpol.al_x;
kk[YY] = gmx::square(qS) * gmx::c_one4PiEps0 / forceparams[type0].wpol.al_y;
kk[ZZ] = gmx::square(qS) * gmx::c_one4PiEps0 / forceparams[type0].wpol.al_z;
rvec fshift[],
const t_pbc* pbc,
real gmx_unused lambda,
rvec fshift[],
const t_pbc* pbc,
real gmx_unused lambda,
- real gmx_unused* dvdlambda,
- const t_mdatoms* md,
+ real gmx_unused* dvdlambda,
+ gmx::ArrayRef<const real> charge,
t_fcdata gmx_unused* fcd,
t_disresdata gmx_unused* disresdata,
t_oriresdata gmx_unused* oriresdata,
t_fcdata gmx_unused* fcd,
t_disresdata gmx_unused* disresdata,
t_oriresdata gmx_unused* oriresdata,
da1 = forceatoms[i++];
a2 = forceatoms[i++];
da2 = forceatoms[i++];
da1 = forceatoms[i++];
a2 = forceatoms[i++];
da2 = forceatoms[i++];
- q1 = md->chargeA[da1];
- q2 = md->chargeA[da2];
+ q1 = charge[da1];
+ q2 = charge[da2];
a = forceparams[type].thole.a;
al1 = forceparams[type].thole.alpha1;
al2 = forceparams[type].thole.alpha2;
a = forceparams[type].thole.a;
al1 = forceparams[type].thole.alpha1;
al2 = forceparams[type].thole.alpha2;
const t_pbc* pbc,
real lambda,
real* dvdlambda,
const t_pbc* pbc,
real lambda,
real* dvdlambda,
- const t_mdatoms gmx_unused* md,
+ gmx::ArrayRef<const real> /*charge*/,
t_fcdata gmx_unused* fcd,
t_disresdata gmx_unused* disresdata,
t_oriresdata gmx_unused* oriresdata,
t_fcdata gmx_unused* fcd,
t_disresdata gmx_unused* disresdata,
t_oriresdata gmx_unused* oriresdata,
const t_pbc* pbc,
real gmx_unused lambda,
real gmx_unused* dvdlambda,
const t_pbc* pbc,
real gmx_unused lambda,
real gmx_unused* dvdlambda,
- const t_mdatoms gmx_unused* md,
+ gmx::ArrayRef<const real> /*charge*/,
t_fcdata gmx_unused* fcd,
t_disresdata gmx_unused* disresdata,
t_oriresdata gmx_unused* oriresdata,
t_fcdata gmx_unused* fcd,
t_disresdata gmx_unused* disresdata,
t_oriresdata gmx_unused* oriresdata,
const t_pbc* pbc,
real lambda,
real* dvdlambda,
const t_pbc* pbc,
real lambda,
real* dvdlambda,
- const t_mdatoms gmx_unused* md,
+ gmx::ArrayRef<const real> /*charge*/,
t_fcdata gmx_unused* fcd,
t_disresdata gmx_unused* disresdata,
t_oriresdata gmx_unused* oriresdata,
t_fcdata gmx_unused* fcd,
t_disresdata gmx_unused* disresdata,
t_oriresdata gmx_unused* oriresdata,
const t_pbc* pbc,
real lambda,
real* dvdlambda,
const t_pbc* pbc,
real lambda,
real* dvdlambda,
- const t_mdatoms gmx_unused* md,
+ gmx::ArrayRef<const real> /*charge*/,
t_fcdata gmx_unused* fcd,
t_disresdata gmx_unused* disresdata,
t_oriresdata gmx_unused* oriresdata,
t_fcdata gmx_unused* fcd,
t_disresdata gmx_unused* disresdata,
t_oriresdata gmx_unused* oriresdata,
const t_pbc* pbc,
real gmx_unused lambda,
real gmx_unused* dvdlambda,
const t_pbc* pbc,
real gmx_unused lambda,
real gmx_unused* dvdlambda,
- const t_mdatoms gmx_unused* md,
+ gmx::ArrayRef<const real> /*charge*/,
t_fcdata gmx_unused* fcd,
t_disresdata gmx_unused* disresdata,
t_oriresdata gmx_unused* oriresdata,
t_fcdata gmx_unused* fcd,
t_disresdata gmx_unused* disresdata,
t_oriresdata gmx_unused* oriresdata,
const t_pbc* pbc,
real gmx_unused lambda,
real gmx_unused* dvdlambda,
const t_pbc* pbc,
real gmx_unused lambda,
real gmx_unused* dvdlambda,
- const t_mdatoms gmx_unused* md,
+ gmx::ArrayRef<const real> /*charge*/,
t_fcdata gmx_unused* fcd,
t_disresdata gmx_unused* disresdata,
t_oriresdata gmx_unused* oriresdata,
t_fcdata gmx_unused* fcd,
t_disresdata gmx_unused* disresdata,
t_oriresdata gmx_unused* oriresdata,
const t_pbc* pbc,
real lambda,
real* dvdlambda,
const t_pbc* pbc,
real lambda,
real* dvdlambda,
- const t_mdatoms gmx_unused* md,
+ gmx::ArrayRef<const real> /*charge*/,
t_fcdata gmx_unused* fcd,
t_disresdata gmx_unused* disresdata,
t_oriresdata gmx_unused* oriresdata,
t_fcdata gmx_unused* fcd,
t_disresdata gmx_unused* disresdata,
t_oriresdata gmx_unused* oriresdata,
const t_pbc* pbc,
real gmx_unused lambda,
real gmx_unused* dvdlambda,
const t_pbc* pbc,
real gmx_unused lambda,
real gmx_unused* dvdlambda,
- const t_mdatoms gmx_unused* md,
+ gmx::ArrayRef<const real> /*charge*/,
t_fcdata gmx_unused* fcd,
t_disresdata gmx_unused* disresdata,
t_oriresdata gmx_unused* oriresdata,
t_fcdata gmx_unused* fcd,
t_disresdata gmx_unused* disresdata,
t_oriresdata gmx_unused* oriresdata,
const t_pbc* pbc,
real gmx_unused lambda,
real gmx_unused* dvdlambda,
const t_pbc* pbc,
real gmx_unused lambda,
real gmx_unused* dvdlambda,
- const t_mdatoms gmx_unused* md,
+ gmx::ArrayRef<const real> /*charge*/,
t_fcdata gmx_unused* fcd,
t_disresdata gmx_unused* disresdata,
t_oriresdata gmx_unused* oriresdata,
t_fcdata gmx_unused* fcd,
t_disresdata gmx_unused* disresdata,
t_oriresdata gmx_unused* oriresdata,
const t_pbc* pbc,
real lambda,
real* dvdlambda,
const t_pbc* pbc,
real lambda,
real* dvdlambda,
- const t_mdatoms gmx_unused* md,
+ gmx::ArrayRef<const real> /*charge*/,
t_fcdata gmx_unused* fcd,
t_disresdata gmx_unused* disresdata,
t_oriresdata gmx_unused* oriresdata,
t_fcdata gmx_unused* fcd,
t_disresdata gmx_unused* disresdata,
t_oriresdata gmx_unused* oriresdata,
const t_pbc* pbc,
real lambda,
real* dvdlambda,
const t_pbc* pbc,
real lambda,
real* dvdlambda,
- const t_mdatoms gmx_unused* md,
+ gmx::ArrayRef<const real> /*charge*/,
t_fcdata gmx_unused* fcd,
t_disresdata gmx_unused* disresdata,
t_oriresdata gmx_unused* oriresdata,
t_fcdata gmx_unused* fcd,
t_disresdata gmx_unused* disresdata,
t_oriresdata gmx_unused* oriresdata,
const t_pbc* pbc,
real lambda,
real* dvdlambda,
const t_pbc* pbc,
real lambda,
real* dvdlambda,
- const t_mdatoms gmx_unused* md,
+ gmx::ArrayRef<const real> /*charge*/,
t_fcdata gmx_unused* fcd,
t_disresdata gmx_unused* disresdata,
t_oriresdata gmx_unused* oriresdata,
t_fcdata gmx_unused* fcd,
t_disresdata gmx_unused* disresdata,
t_oriresdata gmx_unused* oriresdata,
const t_pbc* pbc,
real lambda,
real* dvdlambda,
const t_pbc* pbc,
real lambda,
real* dvdlambda,
- const t_mdatoms gmx_unused* md,
+ gmx::ArrayRef<const real> /*charge*/,
t_fcdata gmx_unused* fcd,
t_disresdata gmx_unused* disresdata,
t_oriresdata gmx_unused* oriresdata,
t_fcdata gmx_unused* fcd,
t_disresdata gmx_unused* disresdata,
t_oriresdata gmx_unused* oriresdata,
const t_pbc gmx_unused* pbc,
real gmx_unused lambda,
real gmx_unused* dvdlambda,
const t_pbc gmx_unused* pbc,
real gmx_unused lambda,
real gmx_unused* dvdlambda,
- const t_mdatoms gmx_unused* md,
+ gmx::ArrayRef<const real> /*charge*/,
t_fcdata gmx_unused* fcd,
t_disresdata gmx_unused* disresdata,
t_oriresdata gmx_unused* oriresdata,
t_fcdata gmx_unused* fcd,
t_disresdata gmx_unused* disresdata,
t_oriresdata gmx_unused* oriresdata,
const t_pbc* pbc,
real gmx_unused lambda,
real gmx_unused* dvdlambda,
const t_pbc* pbc,
real gmx_unused lambda,
real gmx_unused* dvdlambda,
- const t_mdatoms gmx_unused* md,
+ gmx::ArrayRef<const real> /*charge*/,
t_fcdata gmx_unused* fcd,
t_disresdata gmx_unused* disresdata,
t_oriresdata gmx_unused* oriresdata,
t_fcdata gmx_unused* fcd,
t_disresdata gmx_unused* disresdata,
t_oriresdata gmx_unused* oriresdata,
const t_pbc* pbc,
real gmx_unused lambda,
real gmx_unused* dvlambda,
const t_pbc* pbc,
real gmx_unused lambda,
real gmx_unused* dvlambda,
- const t_mdatoms gmx_unused* md,
+ gmx::ArrayRef<const real> /*charge*/,
t_fcdata gmx_unused* fcd,
t_disresdata gmx_unused* disresdata,
t_oriresdata gmx_unused* oriresdata,
t_fcdata gmx_unused* fcd,
t_disresdata gmx_unused* disresdata,
t_oriresdata gmx_unused* oriresdata,
const t_pbc* pbc,
real gmx_unused lambda,
real gmx_unused* dvdlambda,
const t_pbc* pbc,
real gmx_unused lambda,
real gmx_unused* dvdlambda,
- const t_mdatoms gmx_unused* md,
+ gmx::ArrayRef<const real> /*charge*/,
t_fcdata gmx_unused* fcd,
t_disresdata gmx_unused* disresdata,
t_oriresdata gmx_unused* oriresdata,
t_fcdata gmx_unused* fcd,
t_disresdata gmx_unused* disresdata,
t_oriresdata gmx_unused* oriresdata,
const t_pbc* pbc,
real lambda,
real* dvdlambda,
const t_pbc* pbc,
real lambda,
real* dvdlambda,
- const t_mdatoms gmx_unused* md,
+ gmx::ArrayRef<const real> /*charge*/,
t_fcdata gmx_unused* fcd,
t_disresdata gmx_unused* disresdata,
t_oriresdata gmx_unused* oriresdata,
t_fcdata gmx_unused* fcd,
t_disresdata gmx_unused* disresdata,
t_oriresdata gmx_unused* oriresdata,
const struct t_pbc* pbc,
real gmx_unused lambda,
real gmx_unused* dvdlambda,
const struct t_pbc* pbc,
real gmx_unused lambda,
real gmx_unused* dvdlambda,
- const t_mdatoms gmx_unused* md,
+ gmx::ArrayRef<const real> /*charge*/,
t_fcdata gmx_unused* fcd,
t_disresdata gmx_unused* disresdata,
t_oriresdata gmx_unused* oriresdata,
t_fcdata gmx_unused* fcd,
t_disresdata gmx_unused* disresdata,
t_oriresdata gmx_unused* oriresdata,
const t_pbc* pbc,
real lambda,
real* dvdlambda,
const t_pbc* pbc,
real lambda,
real* dvdlambda,
- const t_mdatoms gmx_unused* md,
+ gmx::ArrayRef<const real> /*charge*/,
t_fcdata gmx_unused* fcd,
t_disresdata gmx_unused* disresdata,
t_oriresdata gmx_unused* oriresdata,
t_fcdata gmx_unused* fcd,
t_disresdata gmx_unused* disresdata,
t_oriresdata gmx_unused* oriresdata,
const t_pbc* pbc,
real lambda,
real* dvdlambda,
const t_pbc* pbc,
real lambda,
real* dvdlambda,
- const t_mdatoms gmx_unused* md,
+ gmx::ArrayRef<const real> /*charge*/,
t_fcdata gmx_unused* fcd,
t_disresdata gmx_unused* disresdata,
t_oriresdata gmx_unused* oriresdata,
t_fcdata gmx_unused* fcd,
t_disresdata gmx_unused* disresdata,
t_oriresdata gmx_unused* oriresdata,
const t_pbc* pbc,
real gmx_unused lambda,
real gmx_unused* dvdlambda,
const t_pbc* pbc,
real gmx_unused lambda,
real gmx_unused* dvdlambda,
- const t_mdatoms gmx_unused* md,
+ gmx::ArrayRef<const real> /*charge*/,
t_fcdata gmx_unused* fcd,
t_disresdata gmx_unused* disresdata,
t_oriresdata gmx_unused* oriresdata,
t_fcdata gmx_unused* fcd,
t_disresdata gmx_unused* disresdata,
t_oriresdata gmx_unused* oriresdata,
const t_pbc* pbc,
real gmx_unused lambda,
real gmx_unused* dvdlambda,
const t_pbc* pbc,
real gmx_unused lambda,
real gmx_unused* dvdlambda,
- const t_mdatoms gmx_unused* md,
+ gmx::ArrayRef<const real> /*charge*/,
t_fcdata gmx_unused* fcd,
t_disresdata gmx_unused* disresdata,
t_oriresdata gmx_unused* oriresdata,
t_fcdata gmx_unused* fcd,
t_disresdata gmx_unused* disresdata,
t_oriresdata gmx_unused* oriresdata,
const t_pbc* pbc,
real lambda,
real* dvdlambda,
const t_pbc* pbc,
real lambda,
real* dvdlambda,
- const t_mdatoms gmx_unused* md,
- t_fcdata* fcd,
+ gmx::ArrayRef<const real> /*charge*/,
+ t_fcdata* fcd,
t_disresdata gmx_unused* disresdata,
t_oriresdata gmx_unused* oriresdata,
int gmx_unused* global_atom_index)
t_disresdata gmx_unused* disresdata,
t_oriresdata gmx_unused* oriresdata,
int gmx_unused* global_atom_index)
const t_pbc* pbc,
real lambda,
real* dvdlambda,
const t_pbc* pbc,
real lambda,
real* dvdlambda,
- const t_mdatoms gmx_unused* md,
- t_fcdata* fcd,
+ gmx::ArrayRef<const real> /*charge*/,
+ t_fcdata* fcd,
t_disresdata gmx_unused* disresdata,
t_oriresdata gmx_unused* oriresdata,
int gmx_unused* global_atom_index)
t_disresdata gmx_unused* disresdata,
t_oriresdata gmx_unused* oriresdata,
int gmx_unused* global_atom_index)
const t_pbc* pbc,
real lambda,
real* dvdlambda,
const t_pbc* pbc,
real lambda,
real* dvdlambda,
- const t_mdatoms gmx_unused* md,
- t_fcdata* fcd,
+ gmx::ArrayRef<const real> /*charge*/,
+ t_fcdata* fcd,
t_disresdata gmx_unused* disresdata,
t_oriresdata gmx_unused* oriresdata,
int gmx_unused* global_atom_index)
t_disresdata gmx_unused* disresdata,
t_oriresdata gmx_unused* oriresdata,
int gmx_unused* global_atom_index)
-real calculateSimpleBond(const int ftype,
- const int numForceatoms,
- const t_iatom forceatoms[],
- const t_iparams forceparams[],
- const rvec x[],
- rvec4 f[],
- rvec fshift[],
- const struct t_pbc* pbc,
- const real lambda,
- real* dvdlambda,
- const t_mdatoms* md,
- t_fcdata* fcd,
- t_disresdata* disresdata,
- t_oriresdata* oriresdata,
+real calculateSimpleBond(const int ftype,
+ const int numForceatoms,
+ const t_iatom forceatoms[],
+ const t_iparams forceparams[],
+ const rvec x[],
+ rvec4 f[],
+ rvec fshift[],
+ const struct t_pbc* pbc,
+ const real lambda,
+ real* dvdlambda,
+ gmx::ArrayRef<const real> charge,
+ t_fcdata* fcd,
+ t_disresdata* disresdata,
+ t_oriresdata* oriresdata,
int gmx_unused* global_atom_index,
const BondedKernelFlavor bondedKernelFlavor)
{
const BondedInteractions& bonded = c_bondedInteractionFunctionsPerFlavor[bondedKernelFlavor][ftype];
real v = bonded.function(
int gmx_unused* global_atom_index,
const BondedKernelFlavor bondedKernelFlavor)
{
const BondedInteractions& bonded = c_bondedInteractionFunctionsPerFlavor[bondedKernelFlavor][ftype];
real v = bonded.function(
- numForceatoms, forceatoms, forceparams, x, f, fshift, pbc, lambda, dvdlambda, md, fcd, disresdata, oriresdata, global_atom_index);
+ numForceatoms, forceatoms, forceparams, x, f, fshift, pbc, lambda, dvdlambda, charge, fcd, disresdata, oriresdata, global_atom_index);
struct gmx_cmap_t;
struct t_fcdata;
struct gmx_cmap_t;
struct t_fcdata;
struct t_nrnb;
struct t_pbc;
struct t_disresdata;
struct t_nrnb;
struct t_pbc;
struct t_disresdata;
{
template<typename EnumType, typename DataType, EnumType ArraySize>
struct EnumerationArray;
{
template<typename EnumType, typename DataType, EnumType ArraySize>
struct EnumerationArray;
+template<typename>
+class ArrayRef;
} // namespace gmx
/*! \brief Calculate bond-angle. No PBC is taken into account (use mol-shift) */
} // namespace gmx
/*! \brief Calculate bond-angle. No PBC is taken into account (use mol-shift) */
const struct t_pbc* pbc,
real gmx_unused lambda,
real gmx_unused* dvdlambda,
const struct t_pbc* pbc,
real gmx_unused lambda,
real gmx_unused* dvdlambda,
- const t_mdatoms gmx_unused* md,
+ gmx::ArrayRef<const real> /*charge*/,
t_fcdata gmx_unused* fcd,
t_disresdata gmx_unused* disresdata,
t_oriresdata gmx_unused* oriresdata,
t_fcdata gmx_unused* fcd,
t_disresdata gmx_unused* disresdata,
t_oriresdata gmx_unused* oriresdata,
* All pointers should be non-null, except for pbc and g which can be nullptr.
* \returns the energy or 0 when \p bondedKernelFlavor did not request the energy.
*/
* All pointers should be non-null, except for pbc and g which can be nullptr.
* \returns the energy or 0 when \p bondedKernelFlavor did not request the energy.
*/
-real calculateSimpleBond(int ftype,
- int numForceatoms,
- const t_iatom forceatoms[],
- const t_iparams forceparams[],
- const rvec x[],
- rvec4 f[],
- rvec fshift[],
- const struct t_pbc* pbc,
- real lambda,
- real* dvdlambda,
- const t_mdatoms* md,
- t_fcdata* fcd,
- t_disresdata* disresdata,
- t_oriresdata* oriresdata,
+real calculateSimpleBond(int ftype,
+ int numForceatoms,
+ const t_iatom forceatoms[],
+ const t_iparams forceparams[],
+ const rvec x[],
+ rvec4 f[],
+ rvec fshift[],
+ const struct t_pbc* pbc,
+ real lambda,
+ real* dvdlambda,
+ gmx::ArrayRef<const real> charge,
+ t_fcdata* fcd,
+ t_disresdata* disresdata,
+ t_oriresdata* oriresdata,
int gmx_unused* global_atom_index,
BondedKernelFlavor bondedKernelFlavor);
int gmx_unused* global_atom_index,
BondedKernelFlavor bondedKernelFlavor);
#include "gromacs/mdtypes/commrec.h"
#include "gromacs/mdtypes/fcdata.h"
#include "gromacs/mdtypes/inputrec.h"
#include "gromacs/mdtypes/commrec.h"
#include "gromacs/mdtypes/fcdata.h"
#include "gromacs/mdtypes/inputrec.h"
+#include "gromacs/mdtypes/mdatom.h"
#include "gromacs/mdtypes/md_enums.h"
#include "gromacs/mdtypes/state.h"
#include "gromacs/pbcutil/ishift.h"
#include "gromacs/pbcutil/pbc.h"
#include "gromacs/topology/mtop_util.h"
#include "gromacs/topology/topology.h"
#include "gromacs/mdtypes/md_enums.h"
#include "gromacs/mdtypes/state.h"
#include "gromacs/pbcutil/ishift.h"
#include "gromacs/pbcutil/pbc.h"
#include "gromacs/topology/mtop_util.h"
#include "gromacs/topology/topology.h"
+#include "gromacs/utility/arrayref.h"
#include "gromacs/utility/fatalerror.h"
#include "gromacs/utility/futil.h"
#include "gromacs/utility/gmxassert.h"
#include "gromacs/utility/fatalerror.h"
#include "gromacs/utility/futil.h"
#include "gromacs/utility/gmxassert.h"
const t_pbc* pbc,
real gmx_unused lambda,
real gmx_unused* dvdlambda,
const t_pbc* pbc,
real gmx_unused lambda,
real gmx_unused* dvdlambda,
- const t_mdatoms gmx_unused* md,
+ gmx::ArrayRef<const real> /*charge*/,
t_fcdata gmx_unused* fcd,
t_disresdata* disresdata,
t_oriresdata gmx_unused* oriresdata,
t_fcdata gmx_unused* fcd,
t_disresdata* disresdata,
t_oriresdata gmx_unused* oriresdata,
enum class DDRole;
enum class NumRanks;
enum class DDRole;
enum class NumRanks;
+namespace gmx
+{
+template<typename>
+class ArrayRef;
+} // namespace gmx
+
//! Whether distance restraints are called from mdrun or from an analysis tool
enum class DisResRunMode
{
//! Whether distance restraints are called from mdrun or from an analysis tool
enum class DisResRunMode
{
const history_t* hist);
//! Calculates the distance restraint forces, return the potential.
const history_t* hist);
//! Calculates the distance restraint forces, return the potential.
-real ta_disres(int nfa,
- const t_iatom* forceatoms,
- const t_iparams* ip,
- const rvec* x,
- rvec4* f,
- rvec* fshift,
- const t_pbc* pbc,
- real lambda,
- real* dvdlambda,
- const t_mdatoms* md,
+real ta_disres(int nfa,
+ const t_iatom* forceatoms,
+ const t_iparams* ip,
+ const rvec* x,
+ rvec4* f,
+ rvec* fshift,
+ const t_pbc* pbc,
+ real lambda,
+ real* dvdlambda,
+ gmx::ArrayRef<const real> charge,
t_fcdata gmx_unused* fcd,
t_disresdata* disresdata,
t_oriresdata gmx_unused* oriresdata,
t_fcdata gmx_unused* fcd,
t_disresdata* disresdata,
t_oriresdata gmx_unused* oriresdata,
#include "gromacs/mdlib/force.h"
#include "gromacs/mdlib/gmx_omp_nthreads.h"
#include "gromacs/mdtypes/commrec.h"
#include "gromacs/mdlib/force.h"
#include "gromacs/mdlib/gmx_omp_nthreads.h"
#include "gromacs/mdtypes/commrec.h"
+#include "gromacs/mdtypes/mdatom.h"
#include "gromacs/mdtypes/fcdata.h"
#include "gromacs/mdtypes/forceoutput.h"
#include "gromacs/mdtypes/forcerec.h"
#include "gromacs/mdtypes/fcdata.h"
#include "gromacs/mdtypes/forceoutput.h"
#include "gromacs/mdtypes/forcerec.h"
pbc,
lambda[static_cast<int>(efptFTYPE)],
&(dvdl[static_cast<int>(efptFTYPE)]),
pbc,
lambda[static_cast<int>(efptFTYPE)],
&(dvdl[static_cast<int>(efptFTYPE)]),
+ gmx::arrayRefFromArray(md->chargeA, md->nr),
pbc,
lambda[static_cast<int>(efptFTYPE)],
&(dvdl[static_cast<int>(efptFTYPE)]),
pbc,
lambda[static_cast<int>(efptFTYPE)],
&(dvdl[static_cast<int>(efptFTYPE)]),
+ gmx::arrayRefFromArray(md->chargeA, md->nr),
fcd,
fcd->disres,
fcd->orires,
fcd,
fcd->disres,
fcd->orires,
+ mtot = 0;
+ int j = 0;
+ auto massT = md->massT;
+ auto cORF = md->cORF;
for (int i = 0; i < md->nr; i++)
{
for (int i = 0; i < md->nr; i++)
{
{
copy_rvec(xWholeMolecules[i], xtmp[j]);
{
copy_rvec(xWholeMolecules[i], xtmp[j]);
- mref[j] = md->massT[i];
for (int d = 0; d < DIM; d++)
{
com[d] += mref[j] * xtmp[j][d];
for (int d = 0; d < DIM; d++)
{
com[d] += mref[j] * xtmp[j][d];
const t_pbc* pbc,
real gmx_unused lambda,
real gmx_unused* dvdlambda,
const t_pbc* pbc,
real gmx_unused lambda,
real gmx_unused* dvdlambda,
- const t_mdatoms gmx_unused* md,
+ gmx::ArrayRef<const real> /*charge*/,
t_fcdata gmx_unused* fcd,
t_disresdata gmx_unused* disresdata,
t_oriresdata* oriresdata,
t_fcdata gmx_unused* fcd,
t_disresdata gmx_unused* disresdata,
t_oriresdata* oriresdata,
struct t_disresdata;
struct t_fcdata;
class t_state;
struct t_disresdata;
struct t_fcdata;
class t_state;
void print_orires_log(FILE* log, t_oriresdata* od);
//! Calculates the orientation restraint forces.
void print_orires_log(FILE* log, t_oriresdata* od);
//! Calculates the orientation restraint forces.
-real orires(int nfa,
- const t_iatom forceatoms[],
- const t_iparams ip[],
- const rvec x[],
- rvec4 f[],
- rvec fshift[],
- const t_pbc* pbc,
- real lambda,
- real* dvdlambda,
- const t_mdatoms* md,
- t_fcdata* fcd,
- t_disresdata* disresdata,
- t_oriresdata* oriresdata,
- int* global_atom_index);
+real orires(int nfa,
+ const t_iatom forceatoms[],
+ const t_iparams ip[],
+ const rvec x[],
+ rvec4 f[],
+ rvec fshift[],
+ const t_pbc* pbc,
+ real lambda,
+ real* dvdlambda,
+ gmx::ArrayRef<const real> charge,
+ t_fcdata* fcd,
+ t_disresdata* disresdata,
+ t_oriresdata* oriresdata,
+ int* global_atom_index);
//! Copies the new time averages that have been calculated in calc_orires_dev.
void update_orires_history(const t_oriresdata& oriresdata, history_t* hist);
//! Copies the new time averages that have been calculated in calc_orires_dev.
void update_orires_history(const t_oriresdata& oriresdata, history_t* hist);
#include "gromacs/mdtypes/forcerec.h"
#include "gromacs/mdtypes/group.h"
#include "gromacs/mdtypes/interaction_const.h"
#include "gromacs/mdtypes/forcerec.h"
#include "gromacs/mdtypes/group.h"
#include "gromacs/mdtypes/interaction_const.h"
-#include "gromacs/mdtypes/md_enums.h"
#include "gromacs/mdtypes/mdatom.h"
#include "gromacs/mdtypes/mdatom.h"
+#include "gromacs/mdtypes/md_enums.h"
#include "gromacs/mdtypes/nblist.h"
#include "gromacs/mdtypes/simulation_workload.h"
#include "gromacs/pbcutil/ishift.h"
#include "gromacs/mdtypes/nblist.h"
#include "gromacs/mdtypes/simulation_workload.h"
#include "gromacs/pbcutil/ishift.h"
const real epsfac = fr->ic->epsfac;
const real epsfac = fr->ic->epsfac;
+ bFreeEnergy = FALSE;
+ auto cENER = md->cENER;
+ auto bPerturbed = md->bPerturbed;
+ auto chargeA = md->chargeA;
+ auto chargeB = md->chargeB;
for (i = 0; (i < nbonds);)
{
itype = iatoms[i++];
ai = iatoms[i++];
aj = iatoms[i++];
for (i = 0; (i < nbonds);)
{
itype = iatoms[i++];
ai = iatoms[i++];
aj = iatoms[i++];
- gid = GID(md->cENER[ai], md->cENER[aj], md->nenergrp);
+ gid = GID(cENER[ai], cENER[aj], md->nenergrp);
/* Get parameters */
switch (ftype)
{
case F_LJ14:
bFreeEnergy = (fr->efep != FreeEnergyPerturbationType::No
/* Get parameters */
switch (ftype)
{
case F_LJ14:
bFreeEnergy = (fr->efep != FreeEnergyPerturbationType::No
- && (((md->nPerturbed != 0) && (md->bPerturbed[ai] || md->bPerturbed[aj]))
+ && ((md->bPerturbed && (bPerturbed[ai] || bPerturbed[aj]))
|| iparams[itype].lj14.c6A != iparams[itype].lj14.c6B
|| iparams[itype].lj14.c12A != iparams[itype].lj14.c12B));
|| iparams[itype].lj14.c6A != iparams[itype].lj14.c6B
|| iparams[itype].lj14.c12A != iparams[itype].lj14.c12B));
- qq = md->chargeA[ai] * md->chargeA[aj] * epsfac * fr->fudgeQQ;
+ qq = chargeA[ai] * chargeA[aj] * epsfac * fr->fudgeQQ;
c6 = iparams[itype].lj14.c6A;
c12 = iparams[itype].lj14.c12A;
break;
c6 = iparams[itype].lj14.c6A;
c12 = iparams[itype].lj14.c12A;
break;
if (bFreeEnergy)
{
/* Currently free energy is only supported for F_LJ14, so no need to check for that if we got here */
if (bFreeEnergy)
{
/* Currently free energy is only supported for F_LJ14, so no need to check for that if we got here */
- qqB = md->chargeB[ai] * md->chargeB[aj] * epsfac * fr->fudgeQQ;
+ qqB = chargeB[ai] * chargeB[aj] * epsfac * fr->fudgeQQ;
c6B = iparams[itype].lj14.c6B * 6.0;
c12B = iparams[itype].lj14.c12B * 12.0;
c6B = iparams[itype].lj14.c6B * 6.0;
c12B = iparams[itype].lj14.c12B * 12.0;
std::int32_t aj[pack_size];
real coeff[3 * pack_size];
#endif
std::int32_t aj[pack_size];
real coeff[3 * pack_size];
#endif
+ auto chargeA = md->chargeA;
/* nbonds is #pairs*nfa1, here we step pack_size pairs */
for (int i = 0; i < nbonds; i += pack_size * nfa1)
/* nbonds is #pairs*nfa1, here we step pack_size pairs */
for (int i = 0; i < nbonds; i += pack_size * nfa1)
{
coeff[0 * pack_size + s] = iparams[itype].lj14.c6A;
coeff[1 * pack_size + s] = iparams[itype].lj14.c12A;
{
coeff[0 * pack_size + s] = iparams[itype].lj14.c6A;
coeff[1 * pack_size + s] = iparams[itype].lj14.c12A;
- coeff[2 * pack_size + s] = md->chargeA[ai[s]] * md->chargeA[aj[s]];
+ coeff[2 * pack_size + s] = chargeA[ai[s]] * chargeA[aj[s]];
/* Avoid indexing the iatoms array out of bounds.
* We pad the coordinate indices with the last atom pair.
/* Avoid indexing the iatoms array out of bounds.
* We pad the coordinate indices with the last atom pair.
* This file is part of the GROMACS molecular simulation package.
*
* Copyright (c) 2014,2015,2016,2017,2018 by the GROMACS development team.
* This file is part of the GROMACS molecular simulation package.
*
* Copyright (c) 2014,2015,2016,2017,2018 by the GROMACS development team.
- * Copyright (c) 2019,2020, by the GROMACS development team, led by
+ * Copyright (c) 2019,2020,2021, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
struct gmx_grppairener_t;
struct t_forcerec;
struct t_pbc;
struct gmx_grppairener_t;
struct t_forcerec;
struct t_pbc;
namespace gmx
{
class StepWorkload;
namespace gmx
{
class StepWorkload;
/*! \brief Calculate VdW/charge listed pair interactions (usually 1-4
* interactions).
/*! \brief Calculate VdW/charge listed pair interactions (usually 1-4
* interactions).
{
SCOPED_TRACE(std::string("Testing PBC type: ") + c_pbcTypeNames[pbcType_]);
std::vector<int> ddgatindex = { 0, 1, 2, 3 };
{
SCOPED_TRACE(std::string("Testing PBC type: ") + c_pbcTypeNames[pbcType_]);
std::vector<int> ddgatindex = { 0, 1, 2, 3 };
- std::vector<real> chargeA = { 1.5, -2.0, 1.5, -1.0 };
- t_mdatoms mdatoms = { 0 };
- mdatoms.chargeA = chargeA.data();
+ std::vector<real> charge = { 1.5, -2.0, 1.5, -1.0 };
/* Here we run both the standard, plain-C force+shift-forces+energy+free-energy
* kernel flavor and the potentially optimized, with SIMD and less output,
* force only kernels. Note that we also run the optimized kernel for free-energy
/* Here we run both the standard, plain-C force+shift-forces+energy+free-energy
* kernel flavor and the potentially optimized, with SIMD and less output,
* force only kernels. Note that we also run the optimized kernel for free-energy
&pbc_,
lambda,
&output.dvdlambda,
&pbc_,
lambda,
&output.dvdlambda,
/* struct t_fcdata * */ nullptr,
nullptr,
nullptr,
/* struct t_fcdata * */ nullptr,
nullptr,
nullptr,