The bool variable edi->bNeedDoEdsam is used to signal whether any essential
dynamics constraints have to be evaluated for the ED group. This variable
was evaluated at the beginning of an ED simulation in write_edo_legend().
The latter is however not called if continuing from checkpoint. To
get rid of having to remember whether edi->bNeedDoEdsam was already
initialized, there is now a function bNeedDoEdsam(edi) that is evaluated
every time when called.
Also corrected a few typos.
Change-Id: Iab899a677a85ee8270354859c98cc9e5a9db34b7
real *xproj; /* instantaneous x projections */
real *fproj; /* instantaneous f projections */
real radius; /* instantaneous radius */
real *xproj; /* instantaneous x projections */
real *fproj; /* instantaneous f projections */
real radius; /* instantaneous radius */
- real *refproj; /* starting or target projecions */
+ real *refproj; /* starting or target projections */
/* When using flooding as harmonic restraint: The current reference projection
* is at each step calculated from the initial refproj0 and the slope. */
real *refproj0, *refprojslope;
/* When using flooding as harmonic restraint: The current reference projection
* is at each step calculated from the initial refproj0 and the slope. */
real *refproj0, *refprojslope;
t_edvecs vecs; /* eigenvectors */
real slope; /* minimal slope in acceptance radexp */
t_edvecs vecs; /* eigenvectors */
real slope; /* minimal slope in acceptance radexp */
- gmx_bool bNeedDoEdsam; /* if any of the options mon, linfix, ...
- * is used (i.e. apart from flooding) */
t_edflood flood; /* parameters especially for flooding */
struct t_ed_buffer *buf; /* handle to local buffers */
struct edpar *next_edi; /* Pointer to another ED group */
t_edflood flood; /* parameters especially for flooding */
struct t_ed_buffer *buf; /* handle to local buffers */
struct edpar *next_edi; /* Pointer to another ED group */
/* End function declarations */
/* End function declarations */
+/* Do we have to perform essential dynamics constraints or possibly only flooding
+ * for any of the ED groups? */
+static gmx_bool bNeedDoEdsam(t_edpar *edi)
+{
+ return edi->vecs.mon.neig
+ || edi->vecs.linfix.neig
+ || edi->vecs.linacc.neig
+ || edi->vecs.radfix.neig
+ || edi->vecs.radacc.neig
+ || edi->vecs.radcon.neig;
+}
+
+
/* Multiple ED groups will be labeled with letters instead of numbers
* to avoid confusion with eigenvector indices */
static char get_EDgroupChar(int nr_edi, int nED)
/* Multiple ED groups will be labeled with letters instead of numbers
* to avoid confusion with eigenvector indices */
static char get_EDgroupChar(int nr_edi, int nED)
t_edpar *edi) /* edi data set */
{
/* It is not more work to subtract the average position in every
t_edpar *edi) /* edi data set */
{
/* It is not more work to subtract the average position in every
- * subroutine again, because these routines are rarely used simultanely */
+ * subroutine again, because these routines are rarely used simultaneously */
project_to_eigvectors(x, &edi->vecs.mon, edi);
project_to_eigvectors(x, &edi->vecs.linfix, edi);
project_to_eigvectors(x, &edi->vecs.linacc, edi);
project_to_eigvectors(x, &edi->vecs.mon, edi);
project_to_eigvectors(x, &edi->vecs.linfix, edi);
project_to_eigvectors(x, &edi->vecs.linacc, edi);
for (nr_edi = 1; nr_edi <= nED; nr_edi++)
{
for (nr_edi = 1; nr_edi <= nED; nr_edi++)
{
- /* Remember for each ED group whether we have to do essential dynamics
- * constraints or possibly only flooding */
- edi->bNeedDoEdsam = edi->vecs.mon.neig
- || edi->vecs.linfix.neig
- || edi->vecs.linacc.neig
- || edi->vecs.radfix.neig
- || edi->vecs.radacc.neig
- || edi->vecs.radcon.neig;
-
fprintf(ed->edo, "#\n");
fprintf(ed->edo, "# Summary of applied con/restraints for the ED group %c\n", get_EDgroupChar(nr_edi, nED));
fprintf(ed->edo, "# Atoms in average structure: %d\n", edi->sav.nr);
fprintf(ed->edo, "#\n");
fprintf(ed->edo, "# Summary of applied con/restraints for the ED group %c\n", get_EDgroupChar(nr_edi, nED));
fprintf(ed->edo, "# Atoms in average structure: %d\n", edi->sav.nr);
edi = ed->edpar;
for (nr_edi = 1; nr_edi <= nED; nr_edi++)
{
edi = ed->edpar;
for (nr_edi = 1; nr_edi <= nED; nr_edi++)
{
- if (edi->bNeedDoEdsam) /* Only print ED legend if at least one ED option is on */
+ if ( bNeedDoEdsam(edi) ) /* Only print ED legend if at least one ED option is on */
{
nice_legend(&setname, &nsets, &LegendStr, "RMSD to ref", "nm", get_EDgroupChar(nr_edi, nED) );
{
nice_legend(&setname, &nsets, &LegendStr, "RMSD to ref", "nm", get_EDgroupChar(nr_edi, nED) );
while (edi != NULL)
{
edinr++;
while (edi != NULL)
{
edinr++;
+ if ( bNeedDoEdsam(edi) )
{
buf = edi->buf->do_edsam;
if (ed->bFirst)
{
{
buf = edi->buf->do_edsam;
if (ed->bFirst)
{
- /* initialise radacc radius for slope criterion */
+ /* initialize radacc radius for slope criterion */
buf->oldrad = calc_radius(&edi->vecs.radacc);
}
buf->oldrad = calc_radius(&edi->vecs.radacc);
}
copy_rvec(x_unsh, xs[edi->sav.anrs_loc[i]]);
}
}
copy_rvec(x_unsh, xs[edi->sav.anrs_loc[i]]);
}
}
- } /* END of if (edi->bNeedDoEdsam) */
+ } /* END of if ( bNeedDoEdsam(edi) ) */
/* Prepare for the next ED group */
edi = edi->next_edi;
/* Prepare for the next ED group */
edi = edi->next_edi;