delete pull;
}
+void preparePrevStepPullComNewSimulation(const t_commrec* cr,
+ pull_t* pull_work,
+ ArrayRef<const real> masses,
+ ArrayRef<const RVec> x,
+ const matrix box,
+ PbcType pbcType,
+ std::optional<gmx::ArrayRef<double>>&& comPreviousStep)
+{
+ t_pbc pbc;
+ set_pbc(&pbc, pbcType, box);
+ initPullComFromPrevStep(cr, pull_work, masses, pbc, x);
+ updatePrevStepPullCom(pull_work, comPreviousStep);
+}
+
void preparePrevStepPullCom(const t_inputrec* ir,
pull_t* pull_work,
ArrayRef<const real> masses,
}
else
{
- t_pbc pbc;
- set_pbc(&pbc, ir->pbcType, state->box);
- initPullComFromPrevStep(
- cr, pull_work, masses, pbc, state->x.arrayRefWithPadding().unpaddedArrayRef());
- updatePrevStepPullCom(pull_work, state);
+ preparePrevStepPullComNewSimulation(cr,
+ pull_work,
+ masses,
+ state->x.arrayRefWithPadding().unpaddedArrayRef(),
+ state->box,
+ ir->pbcType,
+ state->pull_com_prev_step);
}
}