/* Main flooding routine, called from do_force */
extern void do_flood(const t_commrec* cr,
- const t_inputrec* ir,
+ const t_inputrec& ir,
const rvec x[],
rvec force[],
gmx_edsam* ed,
* it in the output file for ED constraints. */
if (MASTER(cr) && do_per_step(step, ed->edpar.begin()->outfrq))
{
- fprintf(ed->edo, "\n%12f", ir->init_t + step * ir->delta_t);
+ fprintf(ed->edo, "\n%12f", ir.init_t + step * ir.delta_t);
}
if (ed->eEDtype != EssentialDynamicsType::Flooding)
* \param bNS Are we in a neighbor searching step?
*/
void do_flood(const t_commrec* cr,
- const t_inputrec* ir,
+ const t_inputrec& ir,
const rvec x[],
rvec force[],
gmx_edsam* ed,
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
* Copyright (c) 2013,2014,2015,2017,2018 by the GROMACS development team.
- * Copyright (c) 2019,2020, by the GROMACS development team, led by
+ * Copyright (c) 2019,2020,2021, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
t_complex *tab_xy, *tab_qxyz;
};
-void init_ewald_tab(struct gmx_ewald_tab_t** et, const t_inputrec* ir, FILE* fp)
+void init_ewald_tab(struct gmx_ewald_tab_t** et, const t_inputrec& ir, FILE* fp)
{
snew(*et, 1);
if (fp)
fprintf(fp, "Will do ordinary reciprocal space Ewald sum.\n");
}
- (*et)->nx = ir->nkx + 1;
- (*et)->ny = ir->nky + 1;
- (*et)->nz = ir->nkz + 1;
+ (*et)->nx = ir.nkx + 1;
+ (*et)->ny = ir.nky + 1;
+ (*et)->nz = ir.nkz + 1;
(*et)->kmax = std::max((*et)->nx, std::max((*et)->ny, (*et)->nz));
(*et)->eir = nullptr;
(*et)->tab_xy = nullptr;
}
}
-real do_ewald(const t_inputrec* ir,
+real do_ewald(const t_inputrec& ir,
const rvec x[],
rvec f[],
const real chargeA[],
/* Scale box with Ewald wall factor */
matrix scaledBox;
- EwaldBoxZScaler boxScaler(*ir);
+ EwaldBoxZScaler boxScaler(ir);
boxScaler.scaleBox(box, scaledBox);
rvec boxDiag;
}
/* 1/(Vol*e0) */
- real scaleRecip = 4.0 * M_PI / (boxDiag[XX] * boxDiag[YY] * boxDiag[ZZ]) * ONE_4PI_EPS0 / ir->epsilon_r;
+ real scaleRecip = 4.0 * M_PI / (boxDiag[XX] * boxDiag[YY] * boxDiag[ZZ]) * ONE_4PI_EPS0 / ir.epsilon_r;
if (!et->eir) /* allocate if we need to */
{
snew(et->tab_qxyz, natoms);
}
- bFreeEnergy = (ir->efep != efepNO);
+ bFreeEnergy = (ir.efep != efepNO);
clear_mat(lrvir);
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
* Copyright (c) 2013,2014,2015,2017,2018 by the GROMACS development team.
- * Copyright (c) 2019,2020, by the GROMACS development team, led by
+ * Copyright (c) 2019,2020,2021, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
struct gmx_ewald_tab_t;
/*! \brief Initialize the tables used in the Ewald long-ranged part */
-void init_ewald_tab(struct gmx_ewald_tab_t** et, const t_inputrec* ir, FILE* fp);
+void init_ewald_tab(struct gmx_ewald_tab_t** et, const t_inputrec& ir, FILE* fp);
/*! \brief Do the long-ranged part of an Ewald calculation */
-real do_ewald(const t_inputrec* ir,
+real do_ewald(const t_inputrec& ir,
const rvec x[],
rvec f[],
const real chargeA[],
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
* Copyright (c) 2013,2014,2015,2016,2017 by the GROMACS development team.
- * Copyright (c) 2018,2019,2020, by the GROMACS development team, led by
+ * Copyright (c) 2018,2019,2020,2021, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
}
void calculateLongRangeNonbondeds(t_forcerec* fr,
- const t_inputrec* ir,
+ const t_inputrec& ir,
const t_commrec* cr,
t_nrnb* nrnb,
gmx_wallcycle_t wcycle,
&& thisRankHasDuty(cr, DUTY_PME)
&& (pme_run_mode(fr->pmedata) == PmeRunMode::CPU);
- const bool haveEwaldSurfaceTerm = haveEwaldSurfaceContribution(*ir);
+ const bool haveEwaldSurfaceTerm = haveEwaldSurfaceContribution(ir);
/* Do long-range electrostatics and/or LJ-PME
* and compute PME surface terms when necessary.
nthreads,
t,
*fr,
- *ir,
+ ir,
md->chargeA,
md->chargeB,
(md->nChargePerturbed != 0),
void do_force(FILE* log,
const t_commrec* cr,
const gmx_multisim_t* ms,
- const t_inputrec* inputrec,
+ const t_inputrec& inputrec,
gmx::Awh* awh,
gmx_enfrot* enforcedRotation,
gmx::ImdSession* imdSession,
* on whether the PME-mesh contribution is computed on a separate PME rank or on a GPU.
*/
void calculateLongRangeNonbondeds(t_forcerec* fr,
- const t_inputrec* ir,
+ const t_inputrec& ir,
const t_commrec* cr,
t_nrnb* nrnb,
gmx_wallcycle* wcycle,
/*! \brief Print Coulomb Ewald citations and set ewald coefficients */
static void initCoulombEwaldParameters(FILE* fp,
- const t_inputrec* ir,
+ const t_inputrec& ir,
bool systemHasNetCharge,
interaction_const_t* ic)
{
- if (!EEL_PME_EWALD(ir->coulombtype))
+ if (!EEL_PME_EWALD(ir.coulombtype))
{
return;
}
{
fprintf(fp, "Will do PME sum in reciprocal space for electrostatic interactions.\n");
- if (ir->coulombtype == eelP3M_AD)
+ if (ir.coulombtype == eelP3M_AD)
{
please_cite(fp, "Hockney1988");
please_cite(fp, "Ballenegger2012");
please_cite(fp, "Essmann95a");
}
- if (ir->ewald_geometry == eewg3DC)
+ if (ir.ewald_geometry == eewg3DC)
{
if (fp)
{
}
}
- ic->ewaldcoeff_q = calc_ewaldcoeff_q(ir->rcoulomb, ir->ewald_rtol);
+ ic->ewaldcoeff_q = calc_ewaldcoeff_q(ir.rcoulomb, ir.ewald_rtol);
if (fp)
{
fprintf(fp, "Using a Gaussian width (1/beta) of %g nm for Ewald\n", 1 / ic->ewaldcoeff_q);
}
/*! \brief Print Van der Waals Ewald citations and set ewald coefficients */
-static void initVdwEwaldParameters(FILE* fp, const t_inputrec* ir, interaction_const_t* ic)
+static void initVdwEwaldParameters(FILE* fp, const t_inputrec& ir, interaction_const_t* ic)
{
- if (!EVDW_PME(ir->vdwtype))
+ if (!EVDW_PME(ir.vdwtype))
{
return;
}
fprintf(fp, "Will do PME sum in reciprocal space for LJ dispersion interactions.\n");
please_cite(fp, "Essmann95a");
}
- ic->ewaldcoeff_lj = calc_ewaldcoeff_lj(ir->rvdw, ir->ewald_rtol_lj);
+ ic->ewaldcoeff_lj = calc_ewaldcoeff_lj(ir.rvdw, ir.ewald_rtol_lj);
if (fp)
{
fprintf(fp, "Using a Gaussian width (1/beta) of %g nm for LJ Ewald\n", 1 / ic->ewaldcoeff_lj);
*/
static void init_interaction_const(FILE* fp,
interaction_const_t** interaction_const,
- const t_inputrec* ir,
+ const t_inputrec& ir,
const gmx_mtop_t* mtop,
bool systemHasNetCharge)
{
ic->vdwEwaldTables = std::make_unique<EwaldCorrectionTables>();
/* Lennard-Jones */
- ic->vdwtype = ir->vdwtype;
- ic->vdw_modifier = ir->vdw_modifier;
+ ic->vdwtype = ir.vdwtype;
+ ic->vdw_modifier = ir.vdw_modifier;
ic->reppow = mtop->ffparams.reppow;
- ic->rvdw = cutoff_inf(ir->rvdw);
- ic->rvdw_switch = ir->rvdw_switch;
- ic->ljpme_comb_rule = ir->ljpme_combination_rule;
+ ic->rvdw = cutoff_inf(ir.rvdw);
+ ic->rvdw_switch = ir.rvdw_switch;
+ ic->ljpme_comb_rule = ir.ljpme_combination_rule;
ic->useBuckingham = (mtop->ffparams.functype[0] == F_BHAM);
if (ic->useBuckingham)
{
}
/* Electrostatics */
- ic->eeltype = ir->coulombtype;
- ic->coulomb_modifier = ir->coulomb_modifier;
- ic->rcoulomb = cutoff_inf(ir->rcoulomb);
- ic->rcoulomb_switch = ir->rcoulomb_switch;
- ic->epsilon_r = ir->epsilon_r;
+ ic->eeltype = ir.coulombtype;
+ ic->coulomb_modifier = ir.coulomb_modifier;
+ ic->rcoulomb = cutoff_inf(ir.rcoulomb);
+ ic->rcoulomb_switch = ir.rcoulomb_switch;
+ ic->epsilon_r = ir.epsilon_r;
/* Set the Coulomb energy conversion factor */
if (ic->epsilon_r != 0)
if (EEL_RF(ic->eeltype))
{
GMX_RELEASE_ASSERT(ic->eeltype != eelGRF_NOTUSED, "GRF is no longer supported");
- ic->epsilon_rf = ir->epsilon_rf;
+ ic->epsilon_rf = ir.epsilon_rf;
calc_rffac(fp, ic->epsilon_r, ic->epsilon_rf, ic->rcoulomb, &ic->k_rf, &ic->c_rf);
}
/* For plain cut-off we might use the reaction-field kernels */
ic->epsilon_rf = ic->epsilon_r;
ic->k_rf = 0;
- if (ir->coulomb_modifier == eintmodPOTSHIFT)
+ if (ir.coulomb_modifier == eintmodPOTSHIFT)
{
ic->c_rf = 1 / ic->rcoulomb;
}
fprintf(fp, "\n");
}
- if (ir->efep != efepNO)
+ if (ir.efep != efepNO)
{
- GMX_RELEASE_ASSERT(ir->fepvals, "ir->fepvals should be set wth free-energy");
- ic->softCoreParameters = std::make_unique<interaction_const_t::SoftCoreParameters>(*ir->fepvals);
+ GMX_RELEASE_ASSERT(ir.fepvals, "ir.fepvals should be set wth free-energy");
+ ic->softCoreParameters = std::make_unique<interaction_const_t::SoftCoreParameters>(*ir.fepvals);
}
*interaction_const = ic;
void init_forcerec(FILE* fp,
const gmx::MDLogger& mdlog,
t_forcerec* fr,
- const t_inputrec* ir,
+ const t_inputrec& ir,
const gmx_mtop_t* mtop,
const t_commrec* cr,
matrix box,
/* The CMake default turns SIMD kernels on, but it might be turned off further down... */
fr->use_simd_kernels = GMX_USE_SIMD_KERNELS;
- if (check_box(ir->pbcType, box))
+ if (check_box(ir.pbcType, box))
{
- gmx_fatal(FARGS, "%s", check_box(ir->pbcType, box));
+ gmx_fatal(FARGS, "%s", check_box(ir.pbcType, box));
}
/* Test particle insertion ? */
- if (EI_TPI(ir->eI))
+ if (EI_TPI(ir.eI))
{
/* Set to the size of the molecule to be inserted (the last one) */
gmx::RangePartitioning molecules = gmx_mtop_molecules(*mtop);
fr->n_tpi = 0;
}
- if (ir->coulombtype == eelRF_NEC_UNSUPPORTED || ir->coulombtype == eelGRF_NOTUSED)
+ if (ir.coulombtype == eelRF_NEC_UNSUPPORTED || ir.coulombtype == eelGRF_NOTUSED)
{
- gmx_fatal(FARGS, "%s electrostatics is no longer supported", eel_names[ir->coulombtype]);
+ gmx_fatal(FARGS, "%s electrostatics is no longer supported", eel_names[ir.coulombtype]);
}
- if (ir->bAdress)
+ if (ir.bAdress)
{
gmx_fatal(FARGS, "AdResS simulations are no longer supported");
}
- if (ir->useTwinRange)
+ if (ir.useTwinRange)
{
gmx_fatal(FARGS, "Twin-range simulations are no longer supported");
}
/* Copy the user determined parameters */
- fr->userint1 = ir->userint1;
- fr->userint2 = ir->userint2;
- fr->userint3 = ir->userint3;
- fr->userint4 = ir->userint4;
- fr->userreal1 = ir->userreal1;
- fr->userreal2 = ir->userreal2;
- fr->userreal3 = ir->userreal3;
- fr->userreal4 = ir->userreal4;
+ fr->userint1 = ir.userint1;
+ fr->userint2 = ir.userint2;
+ fr->userint3 = ir.userint3;
+ fr->userint4 = ir.userint4;
+ fr->userreal1 = ir.userreal1;
+ fr->userreal2 = ir.userreal2;
+ fr->userreal3 = ir.userreal3;
+ fr->userreal4 = ir.userreal4;
/* Shell stuff */
- fr->fc_stepsize = ir->fc_stepsize;
+ fr->fc_stepsize = ir.fc_stepsize;
/* Free energy */
- fr->efep = ir->efep;
+ fr->efep = ir.efep;
if ((getenv("GMX_DISABLE_SIMD_KERNELS") != nullptr) || (getenv("GMX_NOOPTIMIZEDKERNELS") != nullptr))
{
fr->bBHAM = (mtop->ffparams.functype[0] == F_BHAM);
/* Neighbour searching stuff */
- fr->pbcType = ir->pbcType;
+ fr->pbcType = ir.pbcType;
/* Determine if we will do PBC for distances in bonded interactions */
if (fr->pbcType == PbcType::No)
}
else
{
- const bool useEwaldSurfaceCorrection =
- (EEL_PME_EWALD(ir->coulombtype) && ir->epsilon_surface != 0);
+ const bool useEwaldSurfaceCorrection = (EEL_PME_EWALD(ir.coulombtype) && ir.epsilon_surface != 0);
const bool haveOrientationRestraints = (gmx_mtop_ftype_count(mtop, F_ORIRES) > 0);
if (!DOMAINDECOMP(cr))
{
if (useEwaldSurfaceCorrection || haveOrientationRestraints)
{
fr->wholeMoleculeTransform =
- std::make_unique<gmx::WholeMoleculeTransform>(*mtop, ir->pbcType);
+ std::make_unique<gmx::WholeMoleculeTransform>(*mtop, ir.pbcType);
}
}
else
}
}
- fr->rc_scaling = ir->refcoord_scaling;
- copy_rvec(ir->posres_com, fr->posres_com);
- copy_rvec(ir->posres_comB, fr->posres_comB);
- fr->rlist = cutoff_inf(ir->rlist);
- fr->ljpme_combination_rule = ir->ljpme_combination_rule;
+ fr->rc_scaling = ir.refcoord_scaling;
+ copy_rvec(ir.posres_com, fr->posres_com);
+ copy_rvec(ir.posres_comB, fr->posres_comB);
+ fr->rlist = cutoff_inf(ir.rlist);
+ fr->ljpme_combination_rule = ir.ljpme_combination_rule;
/* This now calculates sum for q and c6*/
bool systemHasNetCharge = set_chargesum(fp, fr, mtop);
/* fr->ic is used both by verlet and group kernels (to some extent) now */
init_interaction_const(fp, &fr->ic, ir, mtop, systemHasNetCharge);
- init_interaction_const_tables(fp, fr->ic, fr->rlist, ir->tabext);
+ init_interaction_const_tables(fp, fr->ic, fr->rlist, ir.tabext);
const interaction_const_t* ic = fr->ic;
/* TODO: Replace this Ewald table or move it into interaction_const_t */
- if (ir->coulombtype == eelEWALD)
+ if (ir.coulombtype == eelEWALD)
{
init_ewald_tab(&(fr->ewald_table), ir, fp);
}
*/
if (EEL_USER(fr->ic->eeltype))
{
- gmx_fatal(FARGS, "Electrostatics type %s is currently not supported", eel_names[ir->coulombtype]);
+ gmx_fatal(FARGS, "Electrostatics type %s is currently not supported", eel_names[ir.coulombtype]);
}
fr->bvdwtab = FALSE;
fr->fudgeQQ = mtop->ffparams.fudgeQQ;
// Multiple time stepping
- fr->useMts = ir->useMts;
+ fr->useMts = ir.useMts;
if (fr->useMts)
{
- GMX_ASSERT(gmx::checkMtsRequirements(*ir).empty(),
- "All MTS requirements should be met here");
+ GMX_ASSERT(gmx::checkMtsRequirements(ir).empty(), "All MTS requirements should be met here");
}
- const bool haveDirectVirialContributionsFast =
- fr->forceProviders->hasForceProvider() || gmx_mtop_ftype_count(mtop, F_POSRES) > 0
- || gmx_mtop_ftype_count(mtop, F_FBPOSRES) > 0 || ir->nwall > 0 || ir->bPull || ir->bRot
- || ir->bIMD;
+ const bool haveDirectVirialContributionsFast = fr->forceProviders->hasForceProvider()
+ || gmx_mtop_ftype_count(mtop, F_POSRES) > 0
+ || gmx_mtop_ftype_count(mtop, F_FBPOSRES) > 0
+ || ir.nwall > 0 || ir.bPull || ir.bRot || ir.bIMD;
const bool haveDirectVirialContributionsSlow = EEL_FULL(ic->eeltype) || EVDW_PME(ic->vdwtype);
for (int i = 0; i < (fr->useMts ? 2 : 1); i++)
{
}
/* Copy the energy group exclusions */
- fr->egp_flags = ir->opts.egp_flags;
+ fr->egp_flags = ir.opts.egp_flags;
/* Van der Waals stuff */
if ((ic->vdwtype != evdwCUT) && (ic->vdwtype != evdwUSER) && !fr->bBHAM)
gmx_fatal(FARGS, "The Verlet cutoff-scheme does not (yet) support Buckingham");
}
- if (ir->implicit_solvent)
+ if (ir.implicit_solvent)
{
gmx_fatal(FARGS, "Implict solvation is no longer supported.");
}
* in that case grompp should already have checked that we do not need
* normal tables and we only generate tables for 1-4 interactions.
*/
- real rtab = ir->rlist + ir->tabext;
+ real rtab = ir.rlist + ir.tabext;
/* We want to use unmodified tables for 1-4 coulombic
* interactions, so we must in general have an extra set of
}
/* Wall stuff */
- fr->nwall = ir->nwall;
- if (ir->nwall && ir->wall_type == ewtTABLE)
+ fr->nwall = ir.nwall;
+ if (ir.nwall && ir.wall_type == ewtTABLE)
{
make_wall_tables(fp, ir, tabfn, &mtop->groups, fr);
}
{
// Add one ListedForces object for each MTS level
bool isFirstLevel = true;
- for (const auto& mtsLevel : ir->mtsLevels)
+ for (const auto& mtsLevel : ir.mtsLevels)
{
ListedForces::InteractionSelection interactionSelection;
const auto& forceGroups = mtsLevel.forceGroups;
}
// QM/MM initialization if requested
- if (ir->bQMMM)
+ if (ir.bQMMM)
{
gmx_incons("QM/MM was requested, but is no longer available in GROMACS");
}
fr->nthread_ewc = gmx_omp_nthreads_get(emntBonded);
snew(fr->ewc_t, fr->nthread_ewc);
- if (ir->eDispCorr != edispcNO)
+ if (ir.eDispCorr != edispcNO)
{
fr->dispersionCorrection = std::make_unique<DispersionCorrection>(
- *mtop, *ir, fr->bBHAM, fr->ntype, fr->nbfp, *fr->ic, tabfn);
+ *mtop, ir, fr->bBHAM, fr->ntype, fr->nbfp, *fr->ic, tabfn);
fr->dispersionCorrection->print(mdlog);
}
void init_forcerec(FILE* fplog,
const gmx::MDLogger& mdlog,
t_forcerec* fr,
- const t_inputrec* ir,
+ const t_inputrec& ir,
const gmx_mtop_t* mtop,
const t_commrec* cr,
matrix box,
}
static void pull_potential_wrapper(const t_commrec* cr,
- const t_inputrec* ir,
+ const t_inputrec& ir,
const matrix box,
gmx::ArrayRef<const gmx::RVec> x,
gmx::ForceWithVirial* force,
* which is why pull_potential is called close to other communication.
*/
wallcycle_start(wcycle, ewcPULLPOT);
- set_pbc(&pbc, ir->pbcType, box);
+ set_pbc(&pbc, ir.pbcType, box);
dvdl = 0;
enerd->term[F_COM_PULL] += pull_potential(
pull_work, mdatoms->massT, &pbc, cr, t, lambda[efptRESTRAINT], as_rvec_array(x.data()), force, &dvdl);
*/
static void computeSpecialForces(FILE* fplog,
const t_commrec* cr,
- const t_inputrec* inputrec,
+ const t_inputrec& inputrec,
gmx::Awh* awh,
gmx_enfrot* enforcedRotation,
gmx::ImdSession* imdSession,
forceProviders->calculateForces(forceProviderInput, &forceProviderOutput);
}
- if (inputrec->bPull && pull_have_potential(*pull_work))
+ if (inputrec.bPull && pull_have_potential(*pull_work))
{
- const int mtsLevel = forceGroupMtsLevel(inputrec->mtsLevels, gmx::MtsForceGroups::Pull);
+ const int mtsLevel = forceGroupMtsLevel(inputrec.mtsLevels, gmx::MtsForceGroups::Pull);
if (mtsLevel == 0 || stepWork.computeSlowForces)
{
auto& forceWithVirial = (mtsLevel == 0) ? forceWithVirialMtsLevel0 : forceWithVirialMtsLevel1;
}
if (awh)
{
- const int mtsLevel = forceGroupMtsLevel(inputrec->mtsLevels, gmx::MtsForceGroups::Pull);
+ const int mtsLevel = forceGroupMtsLevel(inputrec.mtsLevels, gmx::MtsForceGroups::Pull);
if (mtsLevel == 0 || stepWork.computeSlowForces)
{
const bool needForeignEnergyDifferences = awh->needForeignEnergyDifferences(step);
if (needForeignEnergyDifferences)
{
enerd->foreignLambdaTerms.finalizePotentialContributions(
- enerd->dvdl_lin, lambda, *inputrec->fepvals);
+ enerd->dvdl_lin, lambda, *inputrec.fepvals);
std::tie(foreignLambdaDeltaH, foreignLambdaDhDl) = enerd->foreignLambdaTerms.getTerms(cr);
}
auto& forceWithVirial = (mtsLevel == 0) ? forceWithVirialMtsLevel0 : forceWithVirialMtsLevel1;
- enerd->term[F_COM_PULL] += awh->applyBiasForcesAndUpdateBias(inputrec->pbcType,
+ enerd->term[F_COM_PULL] += awh->applyBiasForcesAndUpdateBias(inputrec.pbcType,
mdatoms->massT,
foreignLambdaDeltaH,
foreignLambdaDhDl,
rvec* f = as_rvec_array(forceWithVirialMtsLevel0->force_.data());
/* Add the forces from enforced rotation potentials (if any) */
- if (inputrec->bRot)
+ if (inputrec.bRot)
{
wallcycle_start(wcycle, ewcROTadd);
enerd->term[F_COM_PULL] += add_rot_forces(enforcedRotation, f, cr, step, t);
}
/* Add forces from interactive molecular dynamics (IMD), if any */
- if (inputrec->bIMD && stepWork.computeForces)
+ if (inputrec.bIMD && stepWork.computeForces)
{
imdSession->applyForces(f);
}
void do_force(FILE* fplog,
const t_commrec* cr,
const gmx_multisim_t* ms,
- const t_inputrec* inputrec,
+ const t_inputrec& inputrec,
gmx::Awh* awh,
gmx_enfrot* enforcedRotation,
gmx::ImdSession* imdSession,
const SimulationWorkload& simulationWork = runScheduleWork->simulationWork;
runScheduleWork->stepWork = setupStepWorkload(
- legacyFlags, inputrec->mtsLevels, step, simulationWork, thisRankHasDuty(cr, DUTY_PME));
+ legacyFlags, inputrec.mtsLevels, step, simulationWork, thisRankHasDuty(cr, DUTY_PME));
const StepWorkload& stepWork = runScheduleWork->stepWork;
const bool useGpuPmeOnThisRank =
// Need to run after the GPU-offload bonded interaction lists
// are set up to be able to determine whether there is bonded work.
runScheduleWork->domainWork = setupDomainLifetimeWorkload(
- *inputrec, *fr, pull_work, ed, *mdatoms, simulationWork, stepWork);
+ inputrec, *fr, pull_work, ed, *mdatoms, simulationWork, stepWork);
wallcycle_start_nocount(wcycle, ewcNS);
wallcycle_sub_start(wcycle, ewcsNBS_SEARCH_LOCAL);
setupGpuForceReductions(runScheduleWork, cr, fr);
}
}
- else if (!EI_TPI(inputrec->eI) && stepWork.computeNonbondedForces)
+ else if (!EI_TPI(inputrec.eI) && stepWork.computeNonbondedForces)
{
if (stepWork.useGpuXBufferOps)
{
stateGpu->waitCoordinatesReadyOnHost(AtomLocality::Local);
}
- if (inputrec->bRot)
+ if (inputrec.bRot)
{
wallcycle_start(wcycle, ewcROT);
do_rotation(cr, enforcedRotation, box, as_rvec_array(x.unpaddedArrayRef().data()), t, step, stepWork.doNeighborSearch);
ForceOutputs* forceOutNonbonded = nonbondedAtMtsLevel1 ? forceOutMtsLevel1 : &forceOutMtsLevel0;
- if (inputrec->bPull && pull_have_constraint(*pull_work))
+ if (inputrec.bPull && pull_have_constraint(*pull_work))
{
clear_pull_forces(pull_work);
}
as_rvec_array(x.unpaddedArrayRef().data()),
&forceOutNonbonded->forceWithShiftForces(),
*mdatoms,
- inputrec->fepvals,
+ inputrec.fepvals,
lambda,
enerd,
stepWork,
as_rvec_array(x.unpaddedArrayRef().data()),
&forceOutNonbonded->forceWithShiftForces(),
*mdatoms,
- inputrec->fepvals,
+ inputrec.fepvals,
lambda,
enerd,
stepWork,
// Compute wall interactions, when present.
// Note: should be moved to special forces.
- if (inputrec->nwall && stepWork.computeNonbondedForces)
+ if (inputrec.nwall && stepWork.computeNonbondedForces)
{
/* foreign lambda component for walls */
- real dvdl_walls = do_walls(*inputrec,
+ real dvdl_walls = do_walls(inputrec,
*fr,
box,
*mdatoms,
ForceOutputs& forceOut = (mtsIndex == 0 ? forceOutMtsLevel0 : *forceOutMtsLevel1);
listedForces.calculate(wcycle,
box,
- inputrec->fepvals,
+ inputrec.fepvals,
cr,
ms,
x,
combineMtsForces(numAtoms,
force.unpaddedArrayRef(),
forceView->forceMtsCombined(),
- inputrec->mtsLevels[1].stepFactor);
+ inputrec.mtsLevels[1].stepFactor);
}
if (havePPDomainDecomposition(cr))
combineMtsForces(mdatoms->homenr,
force.unpaddedArrayRef(),
forceView->forceMtsCombined(),
- inputrec->mtsLevels[1].stepFactor);
+ inputrec.mtsLevels[1].stepFactor);
}
}
if (stepWork.computeEnergy)
{
/* Compute the final potential energy terms */
- accumulatePotentialEnergies(enerd, lambda, inputrec->fepvals);
+ accumulatePotentialEnergies(enerd, lambda, inputrec.fepvals);
- if (!EI_TPI(inputrec->eI))
+ if (!EI_TPI(inputrec.eI))
{
- checkPotentialEnergyValidity(step, *enerd, *inputrec);
+ checkPotentialEnergyValidity(step, *enerd, inputrec);
}
}
#include "gromacs/utility/smalloc.h"
void make_wall_tables(FILE* fplog,
- const t_inputrec* ir,
+ const t_inputrec& ir,
const char* tabfn,
const SimulationGroups* groups,
t_forcerec* fr)
int negp_pp;
char buf[STRLEN];
- negp_pp = ir->opts.ngener - ir->nwall;
+ negp_pp = ir.opts.ngener - ir.nwall;
gmx::ArrayRef<const int> nm_ind = groups->groups[SimulationAtomGroupType::EnergyOutput];
if (fplog)
{
- fprintf(fplog, "Reading user tables for %d energy groups with %d walls\n", negp_pp, ir->nwall);
+ fprintf(fplog, "Reading user tables for %d energy groups with %d walls\n", negp_pp, ir.nwall);
}
- fr->wall_tab.resize(ir->nwall);
- for (int w = 0; w < ir->nwall; w++)
+ fr->wall_tab.resize(ir.nwall);
+ for (int w = 0; w < ir.nwall; w++)
{
fr->wall_tab[w].resize(negp_pp);
for (int egp = 0; egp < negp_pp; egp++)
{
/* If the energy group pair is excluded, we don't need a table */
- if (!(fr->egp_flags[egp * ir->opts.ngener + negp_pp + w] & EGP_EXCL))
+ if (!(fr->egp_flags[egp * ir.opts.ngener + negp_pp + w] & EGP_EXCL))
{
sprintf(buf, "%s", tabfn);
sprintf(buf + strlen(tabfn) - strlen(ftp2ext(efXVG)) - 1,
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2018,2019,2020, by the GROMACS development team, led by
+ * Copyright (c) 2018,2019,2020,2021, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
} // namespace gmx
void make_wall_tables(FILE* fplog,
- const t_inputrec* ir,
+ const t_inputrec& ir,
const char* tabfn,
const SimulationGroups* groups,
t_forcerec* fr);
do_force(fplog,
cr,
ms,
- ir,
+ *ir,
awh.get(),
enforcedRotation,
imdSession,
do_force(fplog,
cr,
ms,
- ir,
+ *ir,
awh,
enforcedRotation,
imdSession,
do_force(fplog,
cr,
ms,
- inputrec,
+ *inputrec,
nullptr,
nullptr,
imdSession,
do_force(fplog,
cr,
ms,
- ir,
+ *ir,
awh,
enforcedRotation,
imdSession,
init_forcerec(fplog,
mdlog,
fr,
- inputrec.get(),
+ *inputrec,
&mtop,
cr,
box,
do_force(fplog,
cr,
ms,
- inputrec,
+ *inputrec,
nullptr,
enforcedRotation,
imdSession,
do_force(fplog,
cr,
ms,
- inputrec,
+ *inputrec,
nullptr,
enforcedRotation,
imdSession,
do_force(fplog,
cr,
ms,
- inputrec,
+ *inputrec,
nullptr,
nullptr,
imdSession,
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2019,2020, by the GROMACS development team, led by
+ * Copyright (c) 2019,2020,2021, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
do_force(fplog_,
cr_,
ms,
- inputrec_,
+ *inputrec_,
awh,
enforcedRotation_,
imdSession_,