*
* Also ensure that all the molecules in this group have this number of atoms.
*/
-static int get_group_apm_check(int igroup, t_swap* s, gmx_bool bVerbose, gmx_mtop_t* mtop)
+static int get_group_apm_check(int igroup, t_swap* s, gmx_bool bVerbose, const gmx_mtop_t& mtop)
{
t_swapgrp* g = &s->group[igroup];
const int* ind = s->group[igroup].atomset.globalIndex().data();
* first solvent atom: */
int molb = 0;
mtopGetMolblockIndex(mtop, ind[0], &molb, nullptr, nullptr);
- int apm = mtop->moleculeBlockIndices[molb].numAtomsPerMolecule;
+ int apm = mtop.moleculeBlockIndices[molb].numAtomsPerMolecule;
if (bVerbose)
{
for (int i = 1; i < nat; i++)
{
mtopGetMolblockIndex(mtop, ind[i], &molb, nullptr, nullptr);
- if (apm != mtop->moleculeBlockIndices[molb].numAtomsPerMolecule)
+ if (apm != mtop.moleculeBlockIndices[molb].numAtomsPerMolecule)
{
gmx_fatal(FARGS, "Not all molecules of swap group %d consist of %d atoms.", igroup, apm);
}
* If this is not correct, the ion counts per channel will be very likely
* wrong.
*/
-static void outputStartStructureIfWanted(gmx_mtop_t* mtop, rvec* x, PbcType pbcType, const matrix box)
+static void outputStartStructureIfWanted(const gmx_mtop_t& mtop, rvec* x, PbcType pbcType, const matrix box)
{
char* env = getenv("GMX_COMPELDUMP");
SwSEmpty);
write_sto_conf_mtop(
- "CompELAssumedWholeConfiguration.pdb", *mtop->name, mtop, x, nullptr, pbcType, box);
+ "CompELAssumedWholeConfiguration.pdb", *mtop.name, mtop, x, nullptr, pbcType, box);
}
}
static void init_swapstate(swaphistory_t* swapstate,
t_swapcoords* sc,
t_swap* s,
- gmx_mtop_t* mtop,
+ const gmx_mtop_t& mtop,
const rvec* x, /* the initial positions */
const matrix box,
const t_inputrec* ir)
/* Extract the initial split group positions. */
/* Remove pbc, make molecule whole. */
- snew(x_pbc, mtop->natoms);
- copy_rvecn(x, x_pbc, 0, mtop->natoms);
+ snew(x_pbc, mtop.natoms);
+ copy_rvecn(x, x_pbc, 0, mtop.natoms);
/* This can only make individual molecules whole, not multimers */
- do_pbc_mtop(ir->pbcType, box, mtop, x_pbc);
+ do_pbc_mtop(ir->pbcType, box, &mtop, x_pbc);
/* Output the starting structure? */
outputStartStructureIfWanted(mtop, x_pbc, ir->pbcType, box);
* #4 cations - empty before conversion
*
*/
-static void convertOldToNewGroupFormat(t_swapcoords* sc, gmx_mtop_t* mtop, gmx_bool bVerbose, t_commrec* cr)
+static void convertOldToNewGroupFormat(t_swapcoords* sc, const gmx_mtop_t& mtop, gmx_bool bVerbose, t_commrec* cr)
{
t_swapGroup* g = &sc->grp[3];
t_swap* init_swapcoords(FILE* fplog,
const t_inputrec* ir,
const char* fn,
- gmx_mtop_t* mtop,
+ const gmx_mtop_t& mtop,
const t_state* globalState,
ObservablesHistory* oh,
t_commrec* cr,
}
/* Check for overlapping atoms */
- check_swap_groups(s, mtop->natoms, bVerbose && MASTER(cr));
+ check_swap_groups(s, mtop.natoms, bVerbose && MASTER(cr));
/* Allocate space for the collective arrays for all groups */
/* For the collective position array */