#include "pull_internal.h"
-static int groupPbcFromParams(const t_pull_group ¶ms)
+static int groupPbcFromParams(const t_pull_group ¶ms, bool setPbcRefToPrevStepCOM)
{
if (params.nat <= 1)
{
}
else if (params.pbcatom >= 0)
{
- return epgrppbcREFAT;
+ if (setPbcRefToPrevStepCOM)
+ {
+ return epgrppbcPREVSTEPCOM;
+ }
+ else
+ {
+ return epgrppbcREFAT;
+ }
}
else
{
* This will be fixed when the pointers are replacted by std::vector.
*/
pull_group_work_t::pull_group_work_t(const t_pull_group ¶ms,
- gmx::LocalAtomSet atomSet) :
+ gmx::LocalAtomSet atomSet,
+ bool bSetPbcRefToPrevStepCOM) :
params(params),
- epgrppbc(groupPbcFromParams(params)),
+ epgrppbc(groupPbcFromParams(params, bSetPbcRefToPrevStepCOM)),
needToCalcCom(false),
atomSet(atomSet),
mwscale(0),
/* We should participate if we have pull or pbc atoms */
if (!bMustParticipate &&
- (group.atomSet.numAtomsLocal() > 0 ||
- (group.epgrppbc == epgrppbcREFAT &&
- group.pbcAtomSet->numAtomsLocal() > 0)))
+ (group.atomSet.numAtomsLocal() > 0 || (group.epgrppbc == epgrppbcREFAT &&
+ group.pbcAtomSet->numAtomsLocal() > 0)))
{
bMustParticipate = TRUE;
}
for (int i = 0; i < pull_params->ngroup; ++i)
{
- pull->group.emplace_back(pull_params->group[i], atomSets->add({pull_params->group[i].ind, pull_params->group[i].ind+pull_params->group[i].nat}));
+ pull->group.emplace_back(pull_params->group[i], atomSets->add({pull_params->group[i].ind, pull_params->group[i].ind+pull_params->group[i].nat}),
+ pull_params->bSetPbcRefToPrevStepCOM);
}
if (cr != nullptr && DOMAINDECOMP(cr))
pull->bAngle = FALSE;
GMX_RELEASE_ASSERT(pull->group[0].params.nat == 0, "pull group 0 is an absolute reference group and should not contain atoms");
+ pull->group[0].x_prev_step[XX] = NAN;
pull->numCoordinatesWithExternalPotential = 0;
init_pull_group_index(fplog, cr, g, pgrp,
bConstraint, pulldim_con,
mtop, ir, lambda);
+
+ pgrp->x_prev_step[XX] = NAN;
}
else
{
}
}
const auto &referenceGroup = pull->group[coord.params.group[0]];
- pull->dyna.emplace_back(referenceGroup.params, referenceGroup.atomSet);
+ pull->dyna.emplace_back(referenceGroup.params, referenceGroup.atomSet, pull->params.bSetPbcRefToPrevStepCOM);
}
}