} // namespace gmx
using gmx::ArrayRef;
+using gmx::RVec;
static int groupPbcFromParams(const t_pull_group& params, bool setPbcRefToPrevStepCOM)
{
}
/* Apply forces in a mass weighted fashion for part of the pull group */
-static void apply_forces_grp_part(const pull_group_work_t& pgrp,
- int ind_start,
- int ind_end,
- gmx::ArrayRef<const real> masses,
- const dvec f_pull,
- const int sign,
- rvec* f)
+static void apply_forces_grp_part(const pull_group_work_t& pgrp,
+ int ind_start,
+ int ind_end,
+ ArrayRef<const real> masses,
+ const dvec f_pull,
+ const int sign,
+ rvec* f)
{
const double inv_wm = pgrp.mwscale;
}
/* Apply forces in a mass weighted fashion */
-static void apply_forces_grp(const pull_group_work_t& pgrp,
- gmx::ArrayRef<const real> masses,
- const dvec f_pull,
- const int sign,
- rvec* f)
+static void apply_forces_grp(const pull_group_work_t& pgrp,
+ ArrayRef<const real> masses,
+ const dvec f_pull,
+ const int sign,
+ rvec* f)
{
auto localAtomIndices = pgrp.atomSet.localIndex();
}
/* Apply forces in a mass weighted fashion to a cylinder group */
-static void apply_forces_cyl_grp(const pull_group_work_t& pgrp,
- const double dv_corr,
- gmx::ArrayRef<const real> masses,
- const dvec f_pull,
- double f_scal,
- const int sign,
- rvec* f)
+static void apply_forces_cyl_grp(const pull_group_work_t& pgrp,
+ const double dv_corr,
+ ArrayRef<const real> masses,
+ const dvec f_pull,
+ double f_scal,
+ const int sign,
+ rvec* f)
{
const double inv_wm = pgrp.mwscale;
*/
static void apply_forces_vec_torque(const pull_coord_work_t& pcrd,
ArrayRef<const pull_group_work_t> pullGroups,
- gmx::ArrayRef<const real> masses,
+ ArrayRef<const real> masses,
rvec* f)
{
const PullCoordSpatialData& spatialData = pcrd.spatialData;
static void apply_forces_coord(const pull_coord_work_t& pcrd,
ArrayRef<const pull_group_work_t> pullGroups,
const PullCoordVectorForces& forces,
- gmx::ArrayRef<const real> masses,
+ ArrayRef<const real> masses,
rvec* f)
{
/* Here it would be more efficient to use one large thread-parallel
}
/* Apply constraint using SHAKE */
-static void do_constraint(struct pull_t* pull,
- t_pbc* pbc,
- gmx::ArrayRef<gmx::RVec> x,
- gmx::ArrayRef<gmx::RVec> v,
- gmx_bool bMaster,
- tensor vir,
- double dt,
- double t)
+static void do_constraint(struct pull_t* pull,
+ t_pbc* pbc,
+ ArrayRef<RVec> x,
+ ArrayRef<RVec> v,
+ gmx_bool bMaster,
+ tensor vir,
+ double dt,
+ double t)
{
dvec* r_ij; /* x[i] com of i in prev. step. Obeys constr. -> r_ij[i] */
* potential energy is added either to the pull term or to a term
* specific to the external module.
*/
-void apply_external_pull_coord_force(struct pull_t* pull,
- int coord_index,
- double coord_force,
- gmx::ArrayRef<const real> masses,
- gmx::ForceWithVirial* forceWithVirial)
+void apply_external_pull_coord_force(struct pull_t* pull,
+ int coord_index,
+ double coord_force,
+ ArrayRef<const real> masses,
+ gmx::ForceWithVirial* forceWithVirial)
{
pull_coord_work_t* pcrd;
return pullCoordForces;
}
-real pull_potential(struct pull_t* pull,
- gmx::ArrayRef<const real> masses,
- t_pbc* pbc,
- const t_commrec* cr,
- double t,
- real lambda,
- gmx::ArrayRef<const gmx::RVec> x,
- gmx::ForceWithVirial* force,
- real* dvdlambda)
+real pull_potential(struct pull_t* pull,
+ ArrayRef<const real> masses,
+ t_pbc* pbc,
+ const t_commrec* cr,
+ double t,
+ real lambda,
+ ArrayRef<const RVec> x,
+ gmx::ForceWithVirial* force,
+ real* dvdlambda)
{
real V = 0;
return (MASTER(cr) ? V : 0.0);
}
-void pull_constraint(struct pull_t* pull,
- gmx::ArrayRef<const real> masses,
- t_pbc* pbc,
- const t_commrec* cr,
- double dt,
- double t,
- gmx::ArrayRef<gmx::RVec> x,
- gmx::ArrayRef<gmx::RVec> xp,
- gmx::ArrayRef<gmx::RVec> v,
- tensor vir)
+void pull_constraint(struct pull_t* pull,
+ ArrayRef<const real> masses,
+ t_pbc* pbc,
+ const t_commrec* cr,
+ double dt,
+ double t,
+ ArrayRef<RVec> x,
+ ArrayRef<RVec> xp,
+ ArrayRef<RVec> v,
+ tensor vir)
{
assert(pull != nullptr);
delete pull;
}
-void preparePrevStepPullCom(const t_inputrec* ir,
- pull_t* pull_work,
- gmx::ArrayRef<const real> masses,
- t_state* state,
- const t_state* state_global,
- const t_commrec* cr,
- bool startingFromCheckpoint)
+void preparePrevStepPullCom(const t_inputrec* ir,
+ pull_t* pull_work,
+ ArrayRef<const real> masses,
+ t_state* state,
+ const t_state* state_global,
+ const t_commrec* cr,
+ bool startingFromCheckpoint)
{
if (!ir->pull || !ir->pull->bSetPbcRefToPrevStepCOM)
{
#include "pull_internal.h"
+using gmx::ArrayRef;
+using gmx::RVec;
+
#if GMX_MPI
// Helper function to deduce MPI datatype from the type of data
/* Copies the coordinates of the PBC atom of pgrp to x_pbc.
* When those coordinates are not available on this rank, clears x_pbc.
*/
-static void setPbcAtomCoords(const pull_group_work_t& pgrp, gmx::ArrayRef<const gmx::RVec> x, rvec x_pbc)
+static void setPbcAtomCoords(const pull_group_work_t& pgrp, ArrayRef<const RVec> x, rvec x_pbc)
{
if (pgrp.pbcAtomSet != nullptr)
{
}
}
-static void pull_set_pbcatoms(const t_commrec* cr,
- struct pull_t* pull,
- gmx::ArrayRef<const gmx::RVec> x,
- gmx::ArrayRef<gmx::RVec> x_pbc)
+static void pull_set_pbcatoms(const t_commrec* cr, struct pull_t* pull, ArrayRef<const RVec> x, ArrayRef<RVec> x_pbc)
{
int numPbcAtoms = 0;
for (size_t g = 0; g < pull->group.size(); g++)
}
}
-static void make_cyl_refgrps(const t_commrec* cr,
- pull_t* pull,
- gmx::ArrayRef<const real> masses,
- t_pbc* pbc,
- double t,
- gmx::ArrayRef<const gmx::RVec> x)
+static void make_cyl_refgrps(const t_commrec* cr,
+ pull_t* pull,
+ ArrayRef<const real> masses,
+ t_pbc* pbc,
+ double t,
+ ArrayRef<const RVec> x)
{
pull_comm_t* comm = &pull->comm;
return a;
}
-static void sum_com_part(const pull_group_work_t* pgrp,
- int ind_start,
- int ind_end,
- gmx::ArrayRef<const gmx::RVec> x,
- gmx::ArrayRef<const gmx::RVec> xp,
- gmx::ArrayRef<const real> mass,
- const t_pbc* pbc,
- const rvec x_pbc,
- ComSums* sum_com)
+static void sum_com_part(const pull_group_work_t* pgrp,
+ int ind_start,
+ int ind_end,
+ ArrayRef<const RVec> x,
+ ArrayRef<const RVec> xp,
+ ArrayRef<const real> mass,
+ const t_pbc* pbc,
+ const rvec x_pbc,
+ ComSums* sum_com)
{
double sum_wm = 0;
double sum_wwm = 0;
}
}
-static void sum_com_part_cosweight(const pull_group_work_t* pgrp,
- int ind_start,
- int ind_end,
- int cosdim,
- real twopi_box,
- gmx::ArrayRef<const gmx::RVec> x,
- gmx::ArrayRef<const gmx::RVec> xp,
- gmx::ArrayRef<const real> mass,
- ComSums* sum_com)
+static void sum_com_part_cosweight(const pull_group_work_t* pgrp,
+ int ind_start,
+ int ind_end,
+ int cosdim,
+ real twopi_box,
+ ArrayRef<const RVec> x,
+ ArrayRef<const RVec> xp,
+ ArrayRef<const real> mass,
+ ComSums* sum_com)
{
/* Cosine weighting geometry */
double sum_cm = 0;
}
/* calculates center of mass of selection index from all coordinates x */
-void pull_calc_coms(const t_commrec* cr,
- pull_t* pull,
- gmx::ArrayRef<const real> masses,
- t_pbc* pbc,
- double t,
- gmx::ArrayRef<const gmx::RVec> x,
- gmx::ArrayRef<gmx::RVec> xp)
+void pull_calc_coms(const t_commrec* cr,
+ pull_t* pull,
+ ArrayRef<const real> masses,
+ t_pbc* pbc,
+ double t,
+ ArrayRef<const RVec> x,
+ ArrayRef<RVec> xp)
{
real twopi_box = 0;
pull_comm_t* comm;
using BoolVec = gmx::BasicVector<bool>;
/* Returns whether the pull group obeys the PBC restrictions */
-static bool pullGroupObeysPbcRestrictions(const pull_group_work_t& group,
- const BoolVec& dimUsed,
- gmx::ArrayRef<const gmx::RVec> x,
- const t_pbc& pbc,
- const gmx::RVec& x_pbc,
- const real pbcMargin)
+static bool pullGroupObeysPbcRestrictions(const pull_group_work_t& group,
+ const BoolVec& dimUsed,
+ ArrayRef<const RVec> x,
+ const t_pbc& pbc,
+ const RVec& x_pbc,
+ const real pbcMargin)
{
/* Determine which dimensions are relevant for PBC */
BoolVec dimUsesPbc = { false, false, false };
return true;
}
-int pullCheckPbcWithinGroups(const pull_t& pull, gmx::ArrayRef<const gmx::RVec> x, const t_pbc& pbc, real pbcMargin)
+int pullCheckPbcWithinGroups(const pull_t& pull, ArrayRef<const RVec> x, const t_pbc& pbc, real pbcMargin)
{
if (pbc.pbcType == PbcType::No)
{
return -1;
}
-bool pullCheckPbcWithinGroup(const pull_t& pull,
- gmx::ArrayRef<const gmx::RVec> x,
- const t_pbc& pbc,
- int groupNr,
- real pbcMargin)
+bool pullCheckPbcWithinGroup(const pull_t& pull, ArrayRef<const RVec> x, const t_pbc& pbc, int groupNr, real pbcMargin)
{
if (pbc.pbcType == PbcType::No)
{
}
}
-void initPullComFromPrevStep(const t_commrec* cr,
- pull_t* pull,
- gmx::ArrayRef<const real> masses,
- t_pbc* pbc,
- gmx::ArrayRef<const gmx::RVec> x)
+void initPullComFromPrevStep(const t_commrec* cr,
+ pull_t* pull,
+ ArrayRef<const real> masses,
+ t_pbc* pbc,
+ ArrayRef<const RVec> x)
{
pull_comm_t* comm = &pull->comm;
size_t ngroup = pull->group.size();
"Groups with no atoms, or only one atom, should not "
"use the COM from the previous step as reference.");
- gmx::RVec x_pbc = { 0, 0, 0 };
+ RVec x_pbc = { 0, 0, 0 };
copy_rvec(comm->pbcAtomBuffer[g], x_pbc);
if (debug)