snew(dhc->subblock_i, c_subblockINumPreEntries + dhc->n_lambda_vec);
/* now decide which data to write out */
- dhc->nlambda = 0;
- dhc->ndhdl = 0;
- dhc->dh_expanded = nullptr;
- dhc->dh_energy = nullptr;
- dhc->dh_pv = nullptr;
+ dhc->nlambda = 0;
+ dhc->ndhdl = 0;
+ dhc->dh_expanded_index = -1;
+ dhc->dh_energy_index = -1;
+ dhc->dh_pv_index = -1;
/* total number of raw data point collections in the sample */
dhc->ndh = 0;
n = 0;
if (bExpanded)
{
- dhc->dh_expanded = dhc->dh + n;
+ dhc->dh_expanded_index = n;
mde_delta_h_init(dhc->dh + n,
inputrec.fepvals->dh_hist_size,
inputrec.fepvals->dh_hist_spacing,
}
if (bEnergy)
{
- dhc->dh_energy = dhc->dh + n;
+ dhc->dh_energy_index = n;
mde_delta_h_init(dhc->dh + n,
inputrec.fepvals->dh_hist_size,
inputrec.fepvals->dh_hist_spacing,
n_lambda_components = 0;
if (fep->dhdl_derivatives == DhDlDerivativeCalculation::Yes)
{
- dhc->dh_dhdl = dhc->dh + n;
+ dhc->dh_dhdl_index = n;
for (auto i : keysOf(fep->separate_dvdl))
{
if (inputrec.fepvals->separate_dvdl[i])
}
}
/* add the lambdas */
- dhc->dh_du = dhc->dh + n;
+ dhc->dh_du_index = n;
snew(lambda_vec, n_lambda_components);
for (i = inputrec.fepvals->lambda_start_n; i < inputrec.fepvals->lambda_stop_n; i++)
{
sfree(lambda_vec);
if (bPV)
{
- dhc->dh_pv = dhc->dh + n;
+ dhc->dh_pv_index = n;
mde_delta_h_init(dhc->dh + n,
inputrec.fepvals->dh_hist_size,
inputrec.fepvals->dh_hist_spacing,
for (i = 0; i < dhc->ndhdl; i++)
{
- mde_delta_h_add_dh(dhc->dh_dhdl + i, dhdl[i]);
+ mde_delta_h_add_dh(&dhc->dh[dhc->dh_dhdl_index + i], dhdl[i]);
}
for (i = 0; i < dhc->nlambda; i++)
{
- mde_delta_h_add_dh(dhc->dh_du + i, foreign_dU[i]);
+ mde_delta_h_add_dh(&dhc->dh[dhc->dh_du_index + i], foreign_dU[i]);
}
- if (dhc->dh_pv != nullptr)
+ if (dhc->dh_pv_index >= 0)
{
- mde_delta_h_add_dh(dhc->dh_pv, pV);
+ mde_delta_h_add_dh(&dhc->dh[dhc->dh_pv_index], pV);
}
- if (dhc->dh_energy != nullptr)
+ if (dhc->dh_energy_index >= 0)
{
- mde_delta_h_add_dh(dhc->dh_energy, energy);
+ mde_delta_h_add_dh(&dhc->dh[dhc->dh_energy_index], energy);
}
- if (dhc->dh_expanded != nullptr)
+ if (dhc->dh_expanded_index >= 0)
{
- mde_delta_h_add_dh(dhc->dh_expanded, fep_state);
+ mde_delta_h_add_dh(&dhc->dh[dhc->dh_expanded_index], fep_state);
}
}