int homenr,
bool havePartiallyFrozenAtoms,
gmx::ArrayRef<const ParticleType> ptype,
- gmx::ArrayRef<const unsigned short> cFREEZE,
- gmx::ArrayRef<const unsigned short> cTC,
gmx::ArrayRef<const real> invMass,
gmx::ArrayRef<rvec> invMassPerDim,
t_state* state,
gmx_wallcycle_t wcycle,
bool haveConstraints);
- void update_sd_second_half(const t_inputrec& inputRecord,
- int64_t step,
- real* dvdlambda,
- int homenr,
- gmx::ArrayRef<const ParticleType> ptype,
- gmx::ArrayRef<const unsigned short> cFREEZE,
- gmx::ArrayRef<const unsigned short> cTC,
- gmx::ArrayRef<const real> invMass,
- t_state* state,
- const t_commrec* cr,
- t_nrnb* nrnb,
- gmx_wallcycle_t wcycle,
- gmx::Constraints* constr,
- bool do_log,
- bool do_ene);
+ void update_sd_second_half(const t_inputrec& inputRecord,
+ int64_t step,
+ real* dvdlambda,
+ int homenr,
+ gmx::ArrayRef<const ParticleType> ptype,
+ gmx::ArrayRef<const real> invMass,
+ t_state* state,
+ const t_commrec* cr,
+ t_nrnb* nrnb,
+ gmx_wallcycle_t wcycle,
+ gmx::Constraints* constr,
+ bool do_log,
+ bool do_ene);
void update_for_constraint_virial(const t_inputrec& inputRecord,
int homenr,
BoxDeformation* deform() const { return deform_; }
+ //! Group index for freezing
+ gmx::ArrayRef<const unsigned short> cFREEZE_;
+ //! Group index for temperature coupling
+ gmx::ArrayRef<const unsigned short> cTC_;
+
private:
//! stochastic dynamics struct
gmx_stochd_t sd_;
md->homenr,
md->havePartiallyFrozenAtoms,
gmx::arrayRefFromArray(md->ptype, md->nr),
- md->cFREEZE ? gmx::arrayRefFromArray(md->cFREEZE, md->nr)
- : gmx::ArrayRef<const unsigned short>(),
- md->cTC ? gmx::arrayRefFromArray(md->cTC, md->nr)
- : gmx::ArrayRef<const unsigned short>(),
gmx::arrayRefFromArray(md->invmass, md->nr),
gmx::arrayRefFromArray(md->invMassPerDim, md->nr),
state,
dvdlambda,
md->homenr,
gmx::arrayRefFromArray(md->ptype, md->nr),
- md->cFREEZE ? gmx::arrayRefFromArray(md->cFREEZE, md->nr)
- : gmx::ArrayRef<const unsigned short>(),
- md->cTC ? gmx::arrayRefFromArray(md->cTC, md->nr)
- : gmx::ArrayRef<const unsigned short>(),
gmx::arrayRefFromArray(md->invmass, md->nr),
state,
cr,
xp_.resizeWithPadding(0);
}
-void Update::setNumAtoms(int numAtoms)
+void Update::updateAfterPartition(int numAtoms,
+ gmx::ArrayRef<const unsigned short> cFREEZE,
+ gmx::ArrayRef<const unsigned short> cTC)
{
impl_->xp()->resizeWithPadding(numAtoms);
+ impl_->cFREEZE_ = cFREEZE;
+ impl_->cTC_ = cTC;
}
/*! \brief Sets the SD update type */
}
}
-void Update::Impl::update_sd_second_half(const t_inputrec& inputRecord,
- int64_t step,
- real* dvdlambda,
- int homenr,
- gmx::ArrayRef<const ParticleType> ptype,
- gmx::ArrayRef<const unsigned short> cFREEZE,
- gmx::ArrayRef<const unsigned short> cTC,
- gmx::ArrayRef<const real> invMass,
- t_state* state,
- const t_commrec* cr,
- t_nrnb* nrnb,
- gmx_wallcycle_t wcycle,
- gmx::Constraints* constr,
- bool do_log,
- bool do_ene)
+void Update::Impl::update_sd_second_half(const t_inputrec& inputRecord,
+ int64_t step,
+ real* dvdlambda,
+ int homenr,
+ gmx::ArrayRef<const ParticleType> ptype,
+ gmx::ArrayRef<const real> invMass,
+ t_state* state,
+ const t_commrec* cr,
+ t_nrnb* nrnb,
+ gmx_wallcycle_t wcycle,
+ gmx::Constraints* constr,
+ bool do_log,
+ bool do_ene)
{
if (!constr)
{
gmx::arrayRefFromArray(inputRecord.opts.nFreeze, inputRecord.opts.ngfrz),
invMass,
ptype,
- cFREEZE,
- cTC,
+ cFREEZE_,
+ cTC_,
state->x.rvec_array(),
xp_.rvec_array(),
state->v.rvec_array(),
wallcycle_stop(wcycle, ewcUPDATE);
}
-void Update::Impl::update_coords(const t_inputrec& inputRecord,
- int64_t step,
- int homenr,
- bool havePartiallyFrozenAtoms,
- gmx::ArrayRef<const ParticleType> ptype,
- gmx::ArrayRef<const unsigned short> cFREEZE,
- gmx::ArrayRef<const unsigned short> cTC,
- gmx::ArrayRef<const real> invMass,
- gmx::ArrayRef<rvec> invMassPerDim,
- t_state* state,
+void Update::Impl::update_coords(const t_inputrec& inputRecord,
+ int64_t step,
+ int homenr,
+ bool havePartiallyFrozenAtoms,
+ gmx::ArrayRef<const ParticleType> ptype,
+ gmx::ArrayRef<const real> invMass,
+ gmx::ArrayRef<rvec> invMassPerDim,
+ t_state* state,
const gmx::ArrayRefWithPadding<const gmx::RVec>& f,
const t_fcdata& fcdata,
const gmx_ekindata_t* ekind,
inputRecord.epc,
inputRecord.nsttcouple,
inputRecord.nstpcouple,
- cTC,
+ cTC_,
invMass,
invMassPerDim,
ekind,
gmx::arrayRefFromArray(inputRecord.opts.nFreeze, inputRecord.opts.ngfrz),
invMass,
ptype,
- cFREEZE,
- cTC,
+ cFREEZE_,
+ cTC_,
inputRecord.ld_seed,
cr,
sd_,
gmx::arrayRefFromArray(inputRecord.opts.nFreeze, inputRecord.opts.ngfrz),
invMass,
ptype,
- cFREEZE,
- cTC,
+ cFREEZE_,
+ cTC_,
inputRecord.bd_fric,
sd_.bd_rf.data(),
inputRecord.ld_seed,
inputRecord.opts.ngfrz),
invMass,
ptype,
- cFREEZE,
+ cFREEZE_,
v_rvec,
f_rvec,
bExtended,
gmx::arrayRefFromArray(inputRecord.opts.nFreeze,
inputRecord.opts.ngfrz),
ptype,
- cFREEZE,
+ cFREEZE_,
x_rvec,
xp_rvec,
v_rvec,
auto mdatoms = mdAtoms->mdatoms();
- ForceBuffers f(fr->useMts,
+ ForceBuffers f(fr->useMts,
((useGpuForNonbonded && useGpuForBufferOps) || useGpuForUpdate)
? PinningPolicy::PinnedIfSupported
: PinningPolicy::CannotBePinned);
+ const t_mdatoms* md = mdAtoms->mdatoms();
if (DOMAINDECOMP(cr))
{
stateInstance = std::make_unique<t_state>();
nrnb,
nullptr,
FALSE);
- upd.setNumAtoms(state->natoms);
+ upd.updateAfterPartition(state->natoms,
+ md->cFREEZE ? gmx::arrayRefFromArray(md->cFREEZE, md->nr)
+ : gmx::ArrayRef<const unsigned short>(),
+ md->cTC ? gmx::arrayRefFromArray(md->cTC, md->nr)
+ : gmx::ArrayRef<const unsigned short>());
}
else
{
/* Generate and initialize new topology */
mdAlgorithmsSetupAtomData(cr, *ir, top_global, &top, fr, &f, mdAtoms, constr, vsite, shellfc);
- upd.setNumAtoms(state->natoms);
+ upd.updateAfterPartition(state->natoms,
+ md->cFREEZE ? gmx::arrayRefFromArray(md->cFREEZE, md->nr)
+ : gmx::ArrayRef<const unsigned short>(),
+ md->cTC ? gmx::arrayRefFromArray(md->cTC, md->nr)
+ : gmx::ArrayRef<const unsigned short>());
}
std::unique_ptr<UpdateConstrainGpu> integrator;
nrnb,
wcycle,
do_verbose && !bPMETunePrinting);
- upd.setNumAtoms(state->natoms);
+ upd.updateAfterPartition(state->natoms,
+ md->cFREEZE ? gmx::arrayRefFromArray(md->cFREEZE, md->nr)
+ : gmx::ArrayRef<const unsigned short>(),
+ md->cTC ? gmx::arrayRefFromArray(md->cTC, md->nr)
+ : gmx::ArrayRef<const unsigned short>());
}
}
nrnb,
wcycle,
FALSE);
- upd.setNumAtoms(state->natoms);
+ upd.updateAfterPartition(state->natoms,
+ md->cFREEZE ? gmx::arrayRefFromArray(md->cFREEZE, md->nr)
+ : gmx::ArrayRef<const unsigned short>(),
+ md->cTC ? gmx::arrayRefFromArray(md->cTC, md->nr)
+ : gmx::ArrayRef<const unsigned short>());
}
bFirstStep = FALSE;