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);
}
}
t_mde_delta_h* dh; /* the delta h data */
int ndh; /* the number of delta_h structures */
- int nlambda; /* number of bar dU delta_h structures */
- t_mde_delta_h* dh_du; /* the delta h data (pointer into dh) */
+ int nlambda; /* number of bar dU delta_h structures */
+ int dh_du_index; /* the delta h data (index into dh) */
- int ndhdl; /* number of bar dU delta_h structures */
- t_mde_delta_h* dh_dhdl; /* the dhdl data (pointer into dh) */
+ int ndhdl; /* number of bar dU delta_h structures */
+ int dh_dhdl_index; /* the dhdl data (index into dh) */
- t_mde_delta_h* dh_energy; /* energy output block (pointer into dh) */
- t_mde_delta_h* dh_pv; /* pV output block (pointer into dh) */
- t_mde_delta_h* dh_expanded; /* expanded ensemble output block (pointer
- into dh) */
+ int dh_energy_index; /* energy output block (index into dh) */
+ int dh_pv_index; /* pV output block (index into dh) */
+ int dh_expanded_index; /* expanded ensemble output block (index into dh) */
double start_time; /* start time of the current dh collection */
double delta_time; /* time difference between samples */
double* subblock_d; /* for writing a metadata mdebin subblock for I/O */
int* subblock_i; /* for writing a metadata mdebin subblock for I/O */
-
- double* lambda_vec_subblock; /* native lambda vector data subblock for
- I/O */
- int* lambda_index_subblock; /* lambda vector index data subblock for I/O */
};