int local_count,
const gmx_mtop_t *top_global,
const gmx_localtop_t *top_local,
- const t_state *state_local);
+ const rvec *x,
+ const matrix box);
/*! \brief Generate and store the reverse topology */
void dd_make_reverse_top(FILE *fplog,
int local_count,
const gmx_mtop_t *top_global,
const gmx_localtop_t *top_local,
- const t_state *state_local)
+ const rvec *x,
+ const matrix box)
{
int ndiff_tot, cl[F_NRE], n, ndiff, rest_global, rest_local;
int ftype, nral;
print_missing_interactions_atoms(mdlog, cr, top_global, &top_local->idef);
write_dd_pdb("dd_dump_err", 0, "dump", top_global, cr,
- -1, state_local->x.rvec_array(), state_local->box);
+ -1, x, box);
std::string errorMessage;
int totalNumberOfBondedInteractions,
const gmx_mtop_t *top_global,
const gmx_localtop_t *top_local,
- const t_state *state,
+ const rvec *x,
+ const matrix box,
bool *shouldCheckNumberOfBondedInteractions)
{
if (*shouldCheckNumberOfBondedInteractions)
{
if (totalNumberOfBondedInteractions != cr->dd->nbonded_global)
{
- dd_print_missing_interactions(mdlog, cr, totalNumberOfBondedInteractions, top_global, top_local, state); // Does not return
+ dd_print_missing_interactions(mdlog, cr, totalNumberOfBondedInteractions, top_global, top_local, x, box); // Does not return
}
*shouldCheckNumberOfBondedInteractions = false;
}
* \param[in] totalNumberOfBondedInteractions Result of the global reduction over the number of bonds treated in each domain
* \param[in] top_global Global topology for the error message
* \param[in] top_local Local topology for the error message
- * \param[in] state Global state for the error message
+ * \param[in] x Position vector for the error message
+ * \param[in] box Box matrix for the error message
* \param[in,out] shouldCheckNumberOfBondedInteractions Whether we should do the check. Always set to false.
*/
void checkNumberOfBondedInteractions(const gmx::MDLogger &mdlog,
int totalNumberOfBondedInteractions,
const gmx_mtop_t *top_global,
const gmx_localtop_t *top_local,
- const t_state *state,
+ const rvec *x,
+ const matrix box,
bool *shouldCheckNumberOfBondedInteractions);
#endif
e.g. bReadEkin is only true when restoring from checkpoint */
void compute_globals(FILE *fplog, gmx_global_stat *gstat, t_commrec *cr, t_inputrec *ir,
t_forcerec *fr, gmx_ekindata_t *ekind,
- t_state *state, t_mdatoms *mdatoms,
+ rvec *x, rvec *v, matrix box, real vdwLambda, t_mdatoms *mdatoms,
t_nrnb *nrnb, t_vcm *vcm, gmx_wallcycle_t wcycle,
gmx_enerdata_t *enerd, tensor force_vir, tensor shake_vir, tensor total_vir,
tensor pres, rvec mu_tot, gmx::Constraints *constr,
gmx::SimulationSignaller *signalCoordinator,
- matrix box, int *totalNumberOfBondedInteractions,
+ matrix lastbox, int *totalNumberOfBondedInteractions,
gmx_bool *bSumEkinhOld, int flags)
{
gmx_bool bEner, bPres, bTemp;
}
if (!bReadEkin)
{
- calc_ke_part(state, &(ir->opts), mdatoms, ekind, nrnb, bEkinAveVel);
+ calc_ke_part(
+ x, v, box,
+ &(ir->opts), mdatoms, ekind, nrnb, bEkinAveVel);
}
}
if (bStopCM)
{
calc_vcm_grp(0, mdatoms->homenr, mdatoms,
- state->x.rvec_array(), state->v.rvec_array(), vcm);
+ x, v, vcm);
}
if (bTemp || bStopCM || bPres || bEner || bConstrain || bCheckNumberOfBondedInteractions)
rvec *xPtr = nullptr;
if (vcm->mode == ecmANGULAR || (vcm->mode == ecmLINEAR_ACCELERATION_CORRECTION && !(flags & CGLO_INITIALIZATION)))
{
- xPtr = state->x.rvec_array();
+ xPtr = x;
}
do_stopcm_grp(*mdatoms,
- xPtr, state->v.rvec_array(), *vcm);
+ xPtr, v, *vcm);
inc_nrnb(nrnb, eNR_STOPCM, mdatoms->homenr);
}
* Use the box from last timestep since we already called update().
*/
- enerd->term[F_PRES] = calc_pres(fr->ePBC, ir->nwall, box, ekind->ekin, total_vir, pres);
+ enerd->term[F_PRES] = calc_pres(fr->ePBC, ir->nwall, lastbox, ekind->ekin, total_vir, pres);
}
/* ########## Long range energy information ###### */
total_vir and pres tensors */
const DispersionCorrection::Correction correction =
- fr->dispersionCorrection->calculate(box, state->lambda[efptVDW]);
+ fr->dispersionCorrection->calculate(lastbox, vdwLambda);
if (bEner)
{
void compute_globals(FILE *fplog, gmx_global_stat *gstat, t_commrec *cr, t_inputrec *ir,
t_forcerec *fr, gmx_ekindata_t *ekind,
- t_state *state, t_mdatoms *mdatoms,
+ rvec *x, rvec *v, matrix box, real vdwLambda, t_mdatoms *mdatoms,
t_nrnb *nrnb, t_vcm *vcm, gmx_wallcycle_t wcycle,
gmx_enerdata_t *enerd, tensor force_vir, tensor shake_vir, tensor total_vir,
tensor pres, rvec mu_tot, gmx::Constraints *constr,
gmx::SimulationSignaller *signalCoordinator,
- matrix box, int *totalNumberOfBondedInteractions,
+ matrix lastbox, int *totalNumberOfBondedInteractions,
gmx_bool *bSumEkinhOld, int flags);
/* Compute global variables during integration */
inc_nrnb(nrnb, eNR_EKIN, homenr);
}
-void calc_ke_part(const t_state *state, const t_grpopts *opts, const t_mdatoms *md,
- gmx_ekindata_t *ekind, t_nrnb *nrnb, gmx_bool bEkinAveVel)
+void calc_ke_part(
+ rvec *x, rvec *v, matrix box,
+ const t_grpopts *opts, const t_mdatoms *md,
+ gmx_ekindata_t *ekind, t_nrnb *nrnb, gmx_bool bEkinAveVel)
{
if (ekind->cosacc.cos_accel == 0)
{
- calc_ke_part_normal(state->v.rvec_array(), opts, md, ekind, nrnb, bEkinAveVel);
+ calc_ke_part_normal(v, opts, md, ekind, nrnb, bEkinAveVel);
}
else
{
- calc_ke_part_visc(state->box, state->x.rvec_array(), state->v.rvec_array(), opts, md, ekind, nrnb, bEkinAveVel);
+ calc_ke_part_visc(box, x, v, opts, md, ekind, nrnb, bEkinAveVel);
}
}
/* Return TRUE if OK, FALSE in case of Shake Error */
-void calc_ke_part(const t_state *state, const t_grpopts *opts, const t_mdatoms *md,
- gmx_ekindata_t *ekind, t_nrnb *nrnb, gmx_bool bEkinAveVel);
+void calc_ke_part(
+ rvec *x, rvec *v, matrix box,
+ const t_grpopts *opts, const t_mdatoms *md,
+ gmx_ekindata_t *ekind, t_nrnb *nrnb, gmx_bool bEkinAveVel);
/*
* Compute the partial kinetic energy for home particles;
* will be accumulated in the calling routine.
cglo_flags_iteration |= CGLO_STOPCM;
cglo_flags_iteration &= ~CGLO_TEMPERATURE;
}
- compute_globals(fplog, gstat, cr, ir, fr, ekind, state, mdatoms, nrnb, &vcm,
+ compute_globals(fplog, gstat, cr, ir, fr, ekind,
+ state->x.rvec_array(), state->v.rvec_array(), state->box, state->lambda[efptVDW],
+ mdatoms, nrnb, &vcm,
nullptr, enerd, force_vir, shake_vir, total_vir, pres, mu_tot,
constr, &nullSignaller, state->box,
&totalNumberOfBondedInteractions, &bSumEkinhOld, cglo_flags_iteration
| (shouldCheckNumberOfBondedInteractions ? CGLO_CHECK_NUMBER_OF_BONDED_INTERACTIONS : 0));
}
checkNumberOfBondedInteractions(mdlog, cr, totalNumberOfBondedInteractions,
- top_global, &top, state,
+ top_global, &top, state->x.rvec_array(), state->box,
&shouldCheckNumberOfBondedInteractions);
if (ir->eI == eiVVAK)
{
kinetic energy calculation. This minimized excess variables, but
perhaps loses some logic?*/
- compute_globals(fplog, gstat, cr, ir, fr, ekind, state, mdatoms, nrnb, &vcm,
+ compute_globals(fplog, gstat, cr, ir, fr, ekind,
+ state->x.rvec_array(), state->v.rvec_array(), state->box, state->lambda[efptVDW],
+ mdatoms, nrnb, &vcm,
nullptr, enerd, force_vir, shake_vir, total_vir, pres, mu_tot,
constr, &nullSignaller, state->box,
nullptr, &bSumEkinhOld,
/* We need the kinetic energy at minus the half step for determining
* the full step kinetic energy and possibly for T-coupling.*/
/* This may not be quite working correctly yet . . . . */
- compute_globals(fplog, gstat, cr, ir, fr, ekind, state, mdatoms, nrnb, &vcm,
+ compute_globals(fplog, gstat, cr, ir, fr, ekind,
+ state->x.rvec_array(), state->v.rvec_array(), state->box, state->lambda[efptVDW],
+ mdatoms, nrnb, &vcm,
wcycle, enerd, nullptr, nullptr, nullptr, nullptr, mu_tot,
constr, &nullSignaller, state->box,
&totalNumberOfBondedInteractions, &bSumEkinhOld,
CGLO_GSTAT | CGLO_TEMPERATURE | CGLO_CHECK_NUMBER_OF_BONDED_INTERACTIONS);
checkNumberOfBondedInteractions(mdlog, cr, totalNumberOfBondedInteractions,
- top_global, &top, state,
+ top_global, &top, state->x.rvec_array(), state->box,
&shouldCheckNumberOfBondedInteractions);
}
clear_mat(force_vir);
if (bGStat || do_per_step(step-1, nstglobalcomm))
{
wallcycle_stop(wcycle, ewcUPDATE);
- compute_globals(fplog, gstat, cr, ir, fr, ekind, state, mdatoms, nrnb, &vcm,
+ compute_globals(fplog, gstat, cr, ir, fr, ekind,
+ state->x.rvec_array(), state->v.rvec_array(), state->box, state->lambda[efptVDW],
+ mdatoms, nrnb, &vcm,
wcycle, enerd, force_vir, shake_vir, total_vir, pres, mu_tot,
constr, &nullSignaller, state->box,
&totalNumberOfBondedInteractions, &bSumEkinhOld,
b) If we are using EkinAveEkin for the kinetic energy for the temperature control, we still feed in
EkinAveVel because it's needed for the pressure */
checkNumberOfBondedInteractions(mdlog, cr, totalNumberOfBondedInteractions,
- top_global, &top, state,
+ top_global, &top, state->x.rvec_array(), state->box,
&shouldCheckNumberOfBondedInteractions);
wallcycle_start(wcycle, ewcUPDATE);
}
/* We need the kinetic energy at minus the half step for determining
* the full step kinetic energy and possibly for T-coupling.*/
/* This may not be quite working correctly yet . . . . */
- compute_globals(fplog, gstat, cr, ir, fr, ekind, state, mdatoms, nrnb, &vcm,
+ compute_globals(fplog, gstat, cr, ir, fr, ekind,
+ state->x.rvec_array(), state->v.rvec_array(), state->box, state->lambda[efptVDW],
+ mdatoms, nrnb, &vcm,
wcycle, enerd, nullptr, nullptr, nullptr, nullptr, mu_tot,
constr, &nullSignaller, state->box,
nullptr, &bSumEkinhOld,
{
/* erase F_EKIN and F_TEMP here? */
/* just compute the kinetic energy at the half step to perform a trotter step */
- compute_globals(fplog, gstat, cr, ir, fr, ekind, state, mdatoms, nrnb, &vcm,
+ compute_globals(fplog, gstat, cr, ir, fr, ekind,
+ state->x.rvec_array(), state->v.rvec_array(), state->box, state->lambda[efptVDW],
+ mdatoms, nrnb, &vcm,
wcycle, enerd, force_vir, shake_vir, total_vir, pres, mu_tot,
constr, &nullSignaller, lastbox,
nullptr, &bSumEkinhOld,
bool doIntraSimSignal = true;
SimulationSignaller signaller(&signals, cr, ms, doInterSimSignal, doIntraSimSignal);
- compute_globals(fplog, gstat, cr, ir, fr, ekind, state, mdatoms, nrnb, &vcm,
+ compute_globals(fplog, gstat, cr, ir, fr, ekind,
+ state->x.rvec_array(), state->v.rvec_array(), state->box, state->lambda[efptVDW],
+ mdatoms, nrnb, &vcm,
wcycle, enerd, force_vir, shake_vir, total_vir, pres, mu_tot,
constr, &signaller,
lastbox,
| (shouldCheckNumberOfBondedInteractions ? CGLO_CHECK_NUMBER_OF_BONDED_INTERACTIONS : 0)
);
checkNumberOfBondedInteractions(mdlog, cr, totalNumberOfBondedInteractions,
- top_global, &top, state,
+ top_global, &top, state->x.rvec_array(), state->box,
&shouldCheckNumberOfBondedInteractions);
}
}
CGLO_CHECK_NUMBER_OF_BONDED_INTERACTIONS : 0));
bool bSumEkinhOld = false;
t_vcm *vcm = nullptr;
- compute_globals(fplog, gstat, cr, ir, fr, ekind, state, mdatoms, nrnb, vcm,
+ compute_globals(fplog, gstat, cr, ir, fr, ekind,
+ state->x.rvec_array(), state->v.rvec_array(), state->box, state->lambda[efptVDW],
+ mdatoms, nrnb, vcm,
nullptr, enerd, force_vir, shake_vir, total_vir, pres, mu_tot,
constr, &nullSignaller, state->box,
&totalNumberOfBondedInteractions, &bSumEkinhOld, cglo_flags);
}
checkNumberOfBondedInteractions(mdlog, cr, totalNumberOfBondedInteractions,
- top_global, &top, state,
+ top_global, &top, state->x.rvec_array(), state->box,
&shouldCheckNumberOfBondedInteractions);
if (MASTER(cr))
t_vcm *vcm = nullptr;
SimulationSignaller signaller(&signals, cr, ms, doInterSimSignal, doIntraSimSignal);
- compute_globals(fplog, gstat, cr, ir, fr, ekind, state, mdatoms, nrnb, vcm,
+ compute_globals(fplog, gstat, cr, ir, fr, ekind,
+ state->x.rvec_array(), state->v.rvec_array(), state->box, state->lambda[efptVDW],
+ mdatoms, nrnb, vcm,
wcycle, enerd, nullptr, nullptr, nullptr, nullptr, mu_tot,
constr, &signaller,
state->box,
| (shouldCheckNumberOfBondedInteractions ? CGLO_CHECK_NUMBER_OF_BONDED_INTERACTIONS : 0)
);
checkNumberOfBondedInteractions(mdlog, cr, totalNumberOfBondedInteractions,
- top_global, &top, state,
+ top_global, &top, state->x.rvec_array(), state->box,
&shouldCheckNumberOfBondedInteractions);
}
(shouldCheckNumberOfBondedInteractions ? CGLO_CHECK_NUMBER_OF_BONDED_INTERACTIONS : 0));
bool bSumEkinhOld = false;
t_vcm *vcm = nullptr;
- compute_globals(fplog, gstat, cr, ir, fr, ekind, state, mdatoms, nrnb, vcm,
+ compute_globals(fplog, gstat, cr, ir, fr, ekind,
+ state->x.rvec_array(), state->v.rvec_array(), state->box, state->lambda[efptVDW],
+ mdatoms, nrnb, vcm,
nullptr, enerd, force_vir, shake_vir, total_vir, pres, mu_tot,
constr, &nullSignaller, state->box,
&totalNumberOfBondedInteractions, &bSumEkinhOld, cglo_flags);
}
checkNumberOfBondedInteractions(mdlog, cr, totalNumberOfBondedInteractions,
- top_global, &top, state,
+ top_global, &top, state->x.rvec_array(), state->box,
&shouldCheckNumberOfBondedInteractions);
if (MASTER(cr))
t_vcm *vcm = nullptr;
SimulationSignaller signaller(&signals, cr, ms, doInterSimSignal, doIntraSimSignal);
- compute_globals(fplog, gstat, cr, ir, fr, ekind, state, mdatoms, nrnb, vcm,
+ compute_globals(fplog, gstat, cr, ir, fr, ekind,
+ state->x.rvec_array(), state->v.rvec_array(), state->box, state->lambda[efptVDW],
+ mdatoms, nrnb, vcm,
wcycle, enerd, force_vir, shake_vir, total_vir, pres, mu_tot,
constr, &signaller,
state->box,
| (shouldCheckNumberOfBondedInteractions ? CGLO_CHECK_NUMBER_OF_BONDED_INTERACTIONS : 0)
);
checkNumberOfBondedInteractions(mdlog, cr, totalNumberOfBondedInteractions,
- top_global, &top, state,
+ top_global, &top, state->x.rvec_array(), state->box,
&shouldCheckNumberOfBondedInteractions);
}