/* We always copy cTC with domain decomposition */
}
srenew(md->cENER, md->nalloc);
- if (opts->nFreeze
- && (opts->ngfrz > 1 || opts->nFreeze[0][XX] || opts->nFreeze[0][YY] || opts->nFreeze[0][ZZ]))
+ if (inputrecFrozenAtoms(ir))
{
srenew(md->cFREEZE, md->nalloc);
}
try
{
const bool useUpdateGroups = cr->dd ? ddUsesUpdateGroups(*cr->dd) : false;
+ const bool haveFrozenAtoms = inputrecFrozenAtoms(inputrec.get());
useGpuForUpdate = decideWhetherToUseGpuForUpdate(useDomainDecomposition,
useUpdateGroups,
doEssentialDynamics,
gmx_mtop_ftype_count(mtop, F_ORIRES) > 0,
replExParams.exchangeInterval > 0,
- inputrec->opts.nFreeze != nullptr,
+ haveFrozenAtoms,
doRerun,
devFlags,
mdlog);
return (ir->pbcType == PbcType::XY && ir->nwall == 2);
}
+bool inputrecFrozenAtoms(const t_inputrec* ir)
+{
+ return ((ir->opts.nFreeze != nullptr)
+ && (ir->opts.ngfrz > 1 || ir->opts.nFreeze[0][XX] != 0 || ir->opts.nFreeze[0][YY] != 0
+ || ir->opts.nFreeze[0][ZZ] != 0));
+}
+
bool integratorHasConservedEnergyQuantity(const t_inputrec* ir)
{
if (!EI_MD(ir->eI))
/*! \brief Return true if the simulation is 2D periodic with two walls. */
bool inputrecPbcXY2Walls(const t_inputrec* ir);
+//! \brief Return true if the simulation has frozen atoms (non-trivial freeze groups).
+bool inputrecFrozenAtoms(const t_inputrec* ir);
+
/*! \brief Returns true for MD integator with T and/or P-coupling that supports
* calculating a conserved energy quantity.
*
"Acceleration is not supported by the modular simulator.");
isInputCompatible =
isInputCompatible
- && conditionalAssert(inputrec->opts.ngfrz == 1 && inputrec->opts.nFreeze[0][XX] == 0
- && inputrec->opts.nFreeze[0][YY] == 0
- && inputrec->opts.nFreeze[0][ZZ] == 0,
+ && conditionalAssert(!inputrecFrozenAtoms(inputrec),
"Freeze groups are not supported by the modular simulator.");
isInputCompatible =
isInputCompatible