/* Main flooding routine, called from do_force */
-extern void do_flood(const t_commrec* cr,
- const t_inputrec& ir,
- const rvec x[],
- rvec force[],
- gmx_edsam* ed,
- const matrix box,
- int64_t step,
- gmx_bool bNS)
+void do_flood(const t_commrec* cr,
+ const t_inputrec& ir,
+ const rvec x[],
+ rvec force[],
+ gmx_edsam* ed,
+ const matrix box,
+ int64_t step,
+ bool bNS)
{
/* Write time to edo, when required. Output the time anyhow since we need
* it in the output file for ED constraints. */
/* init-routine called for every *.edi-cycle, initialises t_edpar structure */
-static void init_edi(const gmx_mtop_t* mtop, t_edpar* edi)
+static void init_edi(const gmx_mtop_t& mtop, t_edpar* edi)
{
int i;
real totalmass = 0.0;
{
if (edi->fitmas)
{
- edi->sref.m[i] = mtopGetAtomMass(mtop, edi->sref.anrs[i], &molb);
+ edi->sref.m[i] = mtopGetAtomMass(&mtop, edi->sref.anrs[i], &molb);
}
else
{
snew(edi->sav.m, edi->sav.nr);
for (i = 0; i < edi->sav.nr; i++)
{
- edi->sav.m[i] = mtopGetAtomMass(mtop, edi->sav.anrs[i], &molb);
+ edi->sav.m[i] = mtopGetAtomMass(&mtop, edi->sav.anrs[i], &molb);
if (edi->pcamas)
{
edi->sav.sqrtm[i] = sqrt(edi->sav.m[i]);
std::unique_ptr<gmx::EssentialDynamics> init_edsam(const gmx::MDLogger& mdlog,
const char* ediFileName,
const char* edoFileName,
- const gmx_mtop_t* mtop,
- const t_inputrec* ir,
+ const gmx_mtop_t& mtop,
+ const t_inputrec& ir,
const t_commrec* cr,
gmx::Constraints* constr,
const t_state* globalState,
"gmx grompp and the related .mdp options may change also.");
/* Open input and output files, allocate space for ED data structure */
- auto edHandle = ed_open(mtop->natoms, oh, ediFileName, edoFileName, startingBehavior, oenv, cr);
+ auto edHandle = ed_open(mtop.natoms, oh, ediFileName, edoFileName, startingBehavior, oenv, cr);
auto ed = edHandle->getLegacyED();
GMX_RELEASE_ASSERT(constr != nullptr, "Must have valid constraints object");
constr->saveEdsamPointer(ed);
for (auto& edi : ed->edpar)
{
init_edi(mtop, &edi);
- init_flood(&edi, ed, ir->delta_t);
+ init_flood(&edi, ed, ir.delta_t);
}
}
if (!EDstate->bFromCpt)
{
/* Remove PBC, make molecule(s) subject to ED whole. */
- snew(x_pbc, mtop->natoms);
- copy_rvecn(globalState->x.rvec_array(), x_pbc, 0, mtop->natoms);
- do_pbc_first_mtop(nullptr, ir->pbcType, globalState->box, mtop, x_pbc);
+ snew(x_pbc, mtop.natoms);
+ copy_rvecn(globalState->x.rvec_array(), x_pbc, 0, mtop.natoms);
+ do_pbc_first_mtop(nullptr, ir.pbcType, globalState->box, &mtop, x_pbc);
}
/* Reset pointer to first ED data set which contains the actual ED data */
auto edi = ed->edpar.begin();