}
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);
}
}