double totalMassA = 0.0;
double totalMassB = 0.0;
+ md->haveVsites = FALSE;
gmx_mtop_atomloop_block_t aloop = gmx_mtop_atomloop_block_init(&mtop);
const t_atom *atom;
int nmol;
totalMassA += nmol*atom->m;
totalMassB += nmol*atom->mB;
+ if (atom->ptype == eptVSite)
+ {
+ md->haveVsites = TRUE;
+ }
+
if (ir.efep != efepNO && PERTURBED(*atom))
{
md->nPerturbed++;
do_per_step(step + ir->nstpcouple - offset, ir->nstpcouple));
}
+/*! \brief Sets the velocities of virtual sites to zero */
+static void clearVsiteVelocities(int start,
+ int nrend,
+ const unsigned short *particleType,
+ rvec * gmx_restrict v)
+{
+ for (int a = start; a < nrend; a++)
+ {
+ if (particleType[a] == eptVSite)
+ {
+ clear_rvec(v[a]);
+ }
+ }
+}
+
/*! \brief Sets the number of different temperature coupling values */
enum class NumTempScaleValues
{
}
else
{
+ /* Use a simple and thus more efficient integration loop. */
+ /* The simple loop does not check for particle type (so it can
+ * be vectorized), which means we need to clear the velocities
+ * of virtual sites in advance, when present. Note that vsite
+ * velocities are computed after update and constraints from
+ * their displacement.
+ */
+ if (md->haveVsites)
+ {
+ /* Note: The overhead of this loop is completely neligible */
+ clearVsiteVelocities(start, nrend, md->ptype, v);
+ }
+
/* We determine if we have a single T-coupling lambda value for all
* atoms. That allows for better SIMD acceleration in the template.
* If we do not do temperature coupling (in the run or this step),
int nenergrp;
//! Do we have multiple center of mass motion removal groups
gmx_bool bVCMgrps;
+ //! Do we have any virtual sites?
+ gmx_bool haveVsites;
//! Do we have atoms that are frozen along 1 or 2 (not 3) dimensions?
gmx_bool havePartiallyFrozenAtoms;
//! Number of perturbed atoms