{
/*! \brief Do test particle insertion.
- \copydoc integrator_t (FILE *fplog, t_commrec *cr, const gmx::MDLogger &mdlog,
+ \copydoc integrator_t (FILE *fplog, t_commrec *cr,
+ const gmx_multi_sim_t *,
+ const gmx::MDLogger &mdlog,
int nfile, const t_filenm fnm[],
const gmx_output_env_t *oenv,
const MdrunOptions &mdrunOptions,
gmx_membed_t gmx_unused *membed,
gmx_walltime_accounting_t walltime_accounting)
*/
-double do_tpi(FILE *fplog, t_commrec *cr, const gmx::MDLogger gmx_unused &mdlog,
+double do_tpi(FILE *fplog, t_commrec *cr,
+ const gmx_multisim_t *ms,
+ const gmx::MDLogger gmx_unused &mdlog,
int nfile, const t_filenm fnm[],
const gmx_output_env_t *oenv,
const MdrunOptions &mdrunOptions,
* out of the box. */
/* Make do_force do a single node force calculation */
cr->nnodes = 1;
- do_force(fplog, cr, inputrec,
+ do_force(fplog, cr, ms, inputrec,
step, nrnb, wcycle, top, &top_global->groups,
state_global->box, state_global->x, &state_global->hist,
f, force_vir, mdatoms, enerd, fcd,
state_global->lambda,
- nullptr, fr, nullptr, mu_tot, t, nullptr, FALSE,
+ nullptr, fr, nullptr, mu_tot, t, nullptr,
GMX_FORCE_NONBONDED | GMX_FORCE_ENERGY |
(bNS ? GMX_FORCE_DYNAMICBOX | GMX_FORCE_NS : 0) |
(bStateChanged ? GMX_FORCE_STATECHANGED : 0),
}
else
{
- embU = exp(-beta*epot);
+ // Exponent argument is fine in SP range, but output can be in DP range
+ embU = exp(static_cast<double>(-beta*epot));
sum_embU += embU;
/* Determine the weighted energy contributions of each energy group */
e = 0;
{
fprintf(fplog, "\n");
fprintf(fplog, " <V> = %12.5e nm^3\n", V_all/frame);
- fprintf(fplog, " <mu> = %12.5e kJ/mol\n", -log(VembU_all/V_all)/beta);
+ const double mu = -log(VembU_all/V_all)/beta;
+ fprintf(fplog, " <mu> = %12.5e kJ/mol\n", mu);
+
+ if (!std::isfinite(mu))
+ {
+ fprintf(fplog, "\nThe computed chemical potential is not finite - consider increasing the number of steps and/or the number of frames to insert into.\n");
+ }
}
/* Write the Boltzmann factor histogram */