static const char *tpx_tag = TPX_TAG_RELEASE;
/* This number should be increased whenever the file format changes! */
-static const int tpx_version = 91;
+static const int tpx_version = 92;
/* This number should only be increased when you edit the TOPOLOGY section
* or the HEADER of the tpx format.
}
}
-static void do_expandedvals(t_fileio *fio,t_expanded *expand,int n_lambda, gmx_bool bRead, int file_version)
+static void do_expandedvals(t_fileio *fio,t_expanded *expand,t_lambda *fepvals, gmx_bool bRead, int file_version)
{
/* i is used in the ndo_double macro*/
int i;
real fv;
gmx_bool bDum=TRUE;
real rdum;
+ int n_lambda=fepvals->n_lambda;
+ /* reset the lambda calculation window */
+ fepvals->lambda_start_n = 0;
+ fepvals->lambda_stop_n = n_lambda;
if (file_version >= 79)
{
if (n_lambda>0)
real rdum;
/* free energy values */
+
if (file_version >= 79)
{
gmx_fio_do_int(fio,fepvals->init_fep_state);
else if (file_version >= 64)
{
gmx_fio_do_int(fio,fepvals->n_lambda);
- snew(fepvals->all_lambda,efptNR);
if (bRead)
{
- snew(fepvals->all_lambda[efptFEP],fepvals->n_lambda);
+ int g;
+
+ snew(fepvals->all_lambda,efptNR);
+ /* still allocate the all_lambda array's contents. */
+ for(g=0;g<efptNR;g++)
+ {
+ if (fepvals->n_lambda > 0) {
+ snew(fepvals->all_lambda[g],fepvals->n_lambda);
+ }
+ }
}
- bDum=gmx_fio_ndo_double(fio,fepvals->all_lambda[efptFEP],fepvals->n_lambda);
+ bDum=gmx_fio_ndo_double(fio,fepvals->all_lambda[efptFEP],
+ fepvals->n_lambda);
if (fepvals->init_lambda >= 0)
{
+ int g,h;
+
fepvals->separate_dvdl[efptFEP] = TRUE;
- }
- /* still allocate the all_lambda array's contents. */
- for (g=0;g<efptNR;g++)
- {
- if (fepvals->n_lambda > 0) {
- if (bRead)
+
+ if (bRead)
+ {
+ /* copy the contents of the efptFEP lambda component to all
+ the other components */
+ for(g=0;g<efptNR;g++)
{
- snew(fepvals->all_lambda[g],fepvals->n_lambda);
+ for(h=0;h<fepvals->n_lambda;h++)
+ {
+ if (g!=efptFEP)
+ {
+ fepvals->all_lambda[g][h] =
+ fepvals->all_lambda[efptFEP][h];
+ }
+ }
}
}
}
{
fepvals->bPrintEnergy = FALSE;
}
+
+ /* handle lambda_neighbors */
+ if ((file_version >= 83 && file_version < 90) || file_version >= 92 )
+ {
+ gmx_fio_do_int(fio,fepvals->lambda_neighbors);
+ if ( (fepvals->lambda_neighbors >= 0) && (fepvals->init_fep_state>=0) &&
+ (fepvals->init_lambda < 0) )
+ {
+ fepvals->lambda_start_n = (fepvals->init_fep_state -
+ fepvals->lambda_neighbors);
+ fepvals->lambda_stop_n = (fepvals->init_fep_state +
+ fepvals->lambda_neighbors + 1);
+ if (fepvals->lambda_start_n < 0)
+ {
+ fepvals->lambda_start_n = 0;;
+ }
+ if (fepvals->lambda_stop_n >= fepvals->n_lambda)
+ {
+ fepvals->lambda_stop_n = fepvals->n_lambda;
+ }
+ }
+ else
+ {
+ fepvals->lambda_start_n = 0;
+ fepvals->lambda_stop_n = fepvals->n_lambda;
+ }
+ }
+ else
+ {
+ fepvals->lambda_start_n = 0;
+ fepvals->lambda_stop_n = fepvals->n_lambda;
+ }
}
static void do_pull(t_fileio *fio, t_pull *pull,gmx_bool bRead, int file_version)
}
if (ir->bExpanded)
{
- do_expandedvals(fio,ir->expandedvals,ir->fepvals->n_lambda,bRead,file_version);
+ do_expandedvals(fio,ir->expandedvals,ir->fepvals,bRead,file_version);
}
if (file_version >= 57) {
gmx_fio_do_int(fio,ir->eDisre);