gmx_localtop_t top(top_global.ffparams);
- auto mdatoms = mdAtoms->mdatoms();
-
ForceBuffers f(fr->useMts,
((useGpuForNonbonded && useGpuForBufferOps) || useGpuForUpdate)
? PinningPolicy::PinnedIfSupported
|| ir->epc == PressureCoupling::Berendsen || ir->epc == PressureCoupling::CRescale,
"Only Parrinello-Rahman, Berendsen, and C-rescale pressure coupling are supported "
"with the GPU update.\n");
- GMX_RELEASE_ASSERT(!mdatoms->haveVsites,
+ GMX_RELEASE_ASSERT(!md->haveVsites,
"Virtual sites are not supported with the GPU update.\n");
GMX_RELEASE_ASSERT(ed == nullptr,
"Essential dynamics is not supported with the GPU update.\n");
// the global state to file and potentially for replica exchange.
// (Global topology should persist.)
- update_mdatoms(mdatoms, state->lambda[FreeEnergyPerturbationCouplingType::Mass]);
+ update_mdatoms(mdAtoms->mdatoms(), state->lambda[FreeEnergyPerturbationCouplingType::Mass]);
if (ir->bExpanded)
{
preparePrevStepPullCom(ir,
pull_work,
- gmx::arrayRefFromArray(mdatoms->massT, mdatoms->nr),
+ gmx::arrayRefFromArray(md->massT, md->nr),
state,
state_global,
cr,
{
auto v = makeArrayRef(state->v);
/* Set the velocities of vsites, shells and frozen atoms to zero */
- for (i = 0; i < mdatoms->homenr; i++)
+ for (i = 0; i < md->homenr; i++)
{
- if (mdatoms->ptype[i] == ParticleType::Shell)
+ if (md->ptype[i] == ParticleType::Shell)
{
clear_rvec(v[i]);
}
- else if (mdatoms->cFREEZE)
+ else if (md->cFREEZE)
{
for (m = 0; m < DIM; m++)
{
- if (ir->opts.nFreeze[mdatoms->cFREEZE[i]][m])
+ if (ir->opts.nFreeze[md->cFREEZE[i]][m])
{
v[i][m] = 0;
}
do_constrain_first(fplog,
constr,
ir,
- mdatoms->nr,
- mdatoms->homenr,
+ md->nr,
+ md->homenr,
state->x.arrayRefWithPadding(),
state->v.arrayRefWithPadding(),
state->box,
makeConstArrayRef(state->x),
makeConstArrayRef(state->v),
state->box,
- mdatoms,
+ md,
nrnb,
&vcm,
nullptr,
auto x = (vcm.mode == ComRemovalAlgorithm::LinearAccelerationCorrection)
? ArrayRef<RVec>()
: makeArrayRef(state->x);
- process_and_stopcm_grp(fplog, &vcm, *mdatoms, x, makeArrayRef(state->v));
- inc_nrnb(nrnb, eNR_STOPCM, mdatoms->homenr);
+ process_and_stopcm_grp(fplog, &vcm, *md, x, makeArrayRef(state->v));
+ inc_nrnb(nrnb, eNR_STOPCM, md->homenr);
}
}
if (DOMAINDECOMP(cr))
makeConstArrayRef(state->x),
makeConstArrayRef(state->v),
state->box,
- mdatoms,
+ md,
nrnb,
&vcm,
nullptr,
if (ir->efep != FreeEnergyPerturbationType::No)
{
- update_mdatoms(mdatoms, state->lambda[FreeEnergyPerturbationCouplingType::Mass]);
+ update_mdatoms(mdAtoms->mdatoms(), state->lambda[FreeEnergyPerturbationCouplingType::Mass]);
}
if (bExchanged)
makeConstArrayRef(state->x),
makeConstArrayRef(state->v),
state->box,
- mdatoms,
+ md,
nrnb,
&vcm,
wcycle,
&state->hist,
&f.view(),
force_vir,
- *mdatoms,
+ *md,
nrnb,
wcycle,
shellfc,
&state->hist,
&f.view(),
force_vir,
- mdatoms,
+ md,
enerd,
state->lambda,
fr,
fr,
cr,
state,
- mdatoms,
+ mdAtoms->mdatoms(),
fcdata,
&MassQ,
&vcm,
state->dfhist,
step,
state->v.rvec_array(),
- mdatoms);
+ md);
/* history is maintained in state->dfhist, but state_global is what is sent to trajectory and log output */
if (MASTER(cr))
{
if (ETC_ANDERSEN(ir->etc)) /* keep this outside of update_tcouple because of the extra info required to pass */
{
gmx_bool bIfRandomize;
- bIfRandomize = update_randomize_velocities(ir, step, cr, mdatoms, state->v, &upd, constr);
+ bIfRandomize = update_randomize_velocities(ir, step, cr, md, state->v, &upd, constr);
/* if we have constraints, we have to remove the kinetic energy parallel to the bonds */
if (constr && bIfRandomize)
{
/* UPDATE PRESSURE VARIABLES IN TROTTER FORMULATION WITH CONSTRAINTS */
if (bTrotter)
{
- trotter_update(ir, step, ekind, enerd, state, total_vir, mdatoms, &MassQ, trotter_seq, ettTSEQ3);
+ trotter_update(ir, step, ekind, enerd, state, total_vir, md, &MassQ, trotter_seq, ettTSEQ3);
/* We can only do Berendsen coupling after we have summed
* the kinetic energy or virial. Since the happens
* in global_state after update, we should only do it at
}
else
{
- update_tcouple(step, ir, state, ekind, &MassQ, mdatoms);
+ update_tcouple(step, ir, state, ekind, &MassQ, md);
update_pcouple_before_coordinates(fplog, step, ir, state, pressureCouplingMu, M, bInitStep);
}
fr,
cr,
state,
- mdatoms,
+ mdAtoms->mdatoms(),
fcdata,
&MassQ,
&vcm,
stateGpu->getVelocities(),
stateGpu->getForces(),
top.idef,
- *mdatoms);
+ *md);
// Copy data to the GPU after buffers might have being reinitialized
stateGpu->copyVelocitiesToGpu(state->v, AtomLocality::Local);
*/
if (fr->useMts && bCalcVir && constr != nullptr)
{
- upd.update_for_constraint_virial(
- *ir,
- mdatoms->homenr,
- mdatoms->havePartiallyFrozenAtoms,
- gmx::arrayRefFromArray(mdatoms->invmass, mdatoms->nr),
- gmx::arrayRefFromArray(mdatoms->invMassPerDim, mdatoms->nr),
- *state,
- f.view().forceWithPadding(),
- *ekind);
+ upd.update_for_constraint_virial(*ir,
+ md->homenr,
+ md->havePartiallyFrozenAtoms,
+ gmx::arrayRefFromArray(md->invmass, md->nr),
+ gmx::arrayRefFromArray(md->invMassPerDim, md->nr),
+ *state,
+ f.view().forceWithPadding(),
+ *ekind);
constrain_coordinates(constr,
do_log,
: f.view().forceWithPadding();
upd.update_coords(*ir,
step,
- mdatoms->homenr,
- mdatoms->havePartiallyFrozenAtoms,
+ md->homenr,
+ md->havePartiallyFrozenAtoms,
gmx::arrayRefFromArray(md->ptype, md->nr),
gmx::arrayRefFromArray(md->invmass, md->nr),
gmx::arrayRefFromArray(md->invMassPerDim, md->nr),
upd.update_sd_second_half(*ir,
step,
&dvdl_constr,
- mdatoms->homenr,
+ md->homenr,
gmx::arrayRefFromArray(md->ptype, md->nr),
gmx::arrayRefFromArray(md->invmass, md->nr),
state,
do_log,
do_ene);
upd.finish_update(
- *ir, mdatoms->havePartiallyFrozenAtoms, mdatoms->homenr, state, wcycle, constr != nullptr);
+ *ir, md->havePartiallyFrozenAtoms, md->homenr, state, wcycle, constr != nullptr);
}
if (ir->bPull && ir->pull->bSetPbcRefToPrevStepCOM)
makeConstArrayRef(state->x),
makeConstArrayRef(state->v),
state->box,
- mdatoms,
+ md,
nrnb,
&vcm,
wcycle,
if (!EI_VV(ir->eI) && bStopCM)
{
process_and_stopcm_grp(
- fplog, &vcm, *mdatoms, makeArrayRef(state->x), makeArrayRef(state->v));
- inc_nrnb(nrnb, eNR_STOPCM, mdatoms->homenr);
+ fplog, &vcm, *md, makeArrayRef(state->x), makeArrayRef(state->v));
+ inc_nrnb(nrnb, eNR_STOPCM, md->homenr);
// TODO: The special case of removing CM motion should be dealt more gracefully
if (useGpuForUpdate)
}
update_pcouple_after_coordinates(
- fplog, step, ir, mdatoms, pres, force_vir, shake_vir, pressureCouplingMu, state, nrnb, upd.deform(), !useGpuForUpdate);
+ fplog, step, ir, md, pres, force_vir, shake_vir, pressureCouplingMu, state, nrnb, upd.deform(), !useGpuForUpdate);
const bool doBerendsenPressureCoupling = (inputrec->epc == PressureCoupling::Berendsen
&& do_per_step(step, inputrec->nstpcouple));
energyOutput.addDataAtEnergyStep(bDoDHDL,
bCalcEnerStep,
t,
- mdatoms->tmass,
+ md->tmass,
enerd,
ir->fepvals.get(),
ir->expandedvals.get(),