*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
struct t_do_edfit *loc;
gmx_bool bFirst;
- if (edi->buf->do_edfit != NULL)
+ if (edi->buf->do_edfit != nullptr)
{
bFirst = FALSE;
}
/* Allocate space for the ED data structure */
snew(ed, 1);
- if (*EDstatePtr == NULL)
+ if (*EDstatePtr == nullptr)
{
snew(*EDstatePtr, 1);
}
eof = fgets2 (line, STRLEN, file);
- if (eof == NULL)
+ if (eof == nullptr)
{
*bEOF = TRUE;
return -1;
}
eof = fgets2 (line, STRLEN, file);
- if (eof == NULL)
+ if (eof == nullptr)
{
*bEOF = TRUE;
return -1;
snew(edi->sref.anrs, edi->sref.nr);
snew(edi->sref.x, edi->sref.nr);
snew(edi->sref.x_old, edi->sref.nr);
- edi->sref.sqrtm = NULL;
+ edi->sref.sqrtm = nullptr;
read_edx(in, edi->sref.nr, edi->sref.anrs, edi->sref.x);
/* average positions. they define which atoms will be used for ED sampling */
{
snew(edi->star.anrs, edi->star.nr);
snew(edi->star.x, edi->star.nr);
- edi->star.sqrtm = NULL;
+ edi->star.sqrtm = nullptr;
read_edx(in, edi->star.nr, edi->star.anrs, edi->star.x);
}
}
snew(edi->sori.anrs, edi->sori.nr);
snew(edi->sori.x, edi->sori.nr);
- edi->sori.sqrtm = NULL;
+ edi->sori.sqrtm = nullptr;
read_edx(in, edi->sori.nr, edi->sori.anrs, edi->sori.x);
}
}
/* Terminate the edi group list with a NULL pointer: */
- last_edi->next_edi = NULL;
+ last_edi->next_edi = nullptr;
fprintf(stderr, "ED: Found %d ED group%s.\n", edi_nr, edi_nr > 1 ? "s" : "");
/* Allocate memory the first time this routine is called for each edi group */
- if (NULL == edi->buf->fit_to_ref)
+ if (nullptr == edi->buf->fit_to_ref)
{
snew(edi->buf->fit_to_ref, 1);
snew(edi->buf->fit_to_ref->xcopy, edi->sref.nr);
rvec vec_dum;
- if (edi->buf->do_radcon != NULL)
+ if (edi->buf->do_radcon != nullptr)
{
bFirst = FALSE;
}
int i;
- if (NULL == floodvecs->refproj0)
+ if (nullptr == floodvecs->refproj0)
{
snew(floodvecs->refproj0, floodvecs->neig);
}
* groups of the checkpoint file are consistent with the provided .edi file. */
static void crosscheck_edi_file_vs_checkpoint(gmx_edsam_t ed, edsamstate_t *EDstate)
{
- t_edpar *edi = NULL; /* points to a single edi data set */
+ t_edpar *edi = nullptr; /* points to a single edi data set */
int edinum;
- if (NULL == EDstate->nref || NULL == EDstate->nav)
+ if (nullptr == EDstate->nref || nullptr == EDstate->nav)
{
gmx_fatal(FARGS, "Essential dynamics and flooding can only be switched on (or off) at the\n"
"start of a new simulation. If a simulation runs with/without ED constraints,\n"
edi = ed->edpar;
edinum = 0;
- while (edi != NULL)
+ while (edi != nullptr)
{
/* Check number of atoms in the reference and average structures */
if (EDstate->nref[edinum] != edi->sref.nr)
/* Makes a legend for the xvg output file. Call on MASTER only! */
static void write_edo_legend(gmx_edsam_t ed, int nED, const gmx_output_env_t *oenv)
{
- t_edpar *edi = NULL;
+ t_edpar *edi = nullptr;
int i;
int nr_edi, nsets, n_flood, n_edsam;
const char **setname;
char buf[STRLEN];
- char *LegendStr = NULL;
+ char *LegendStr = nullptr;
edi = ed->edpar;
matrix box,
edsamstate_t *EDstate)
{
- t_edpar *edi = NULL; /* points to a single edi data set */
+ t_edpar *edi = nullptr; /* points to a single edi data set */
int i, nr_edi, avindex;
- rvec *x_pbc = NULL; /* positions of the whole MD system with pbc removed */
- rvec *xfit = NULL, *xstart = NULL; /* dummy arrays to determine initial RMSDs */
- rvec fit_transvec; /* translation ... */
- matrix fit_rotmat; /* ... and rotation from fit to reference structure */
- rvec *ref_x_old = NULL; /* helper pointer */
+ rvec *x_pbc = nullptr; /* positions of the whole MD system with pbc removed */
+ rvec *xfit = nullptr, *xstart = nullptr; /* dummy arrays to determine initial RMSDs */
+ rvec fit_transvec; /* translation ... */
+ matrix fit_rotmat; /* ... and rotation from fit to reference structure */
+ rvec *ref_x_old = nullptr; /* helper pointer */
if (MASTER(cr))
{
fprintf(stderr, "ED: Initializing essential dynamics constraints.\n");
- if (NULL == ed)
+ if (nullptr == ed)
{
gmx_fatal(FARGS, "The checkpoint file you provided is from an essential dynamics or\n"
"flooding simulation. Please also provide the correct .edi file with -ei.\n");
* as well, but will be done in the order given in the edi file, so
* expect different results for different order of edi file concatenation! */
edi = ed->edpar;
- while (edi != NULL)
+ while (edi != nullptr)
{
init_edi(mtop, edi);
init_flood(edi, ed, ir->delta_t);
/* Remove PBC, make molecule(s) subject to ED whole. */
snew(x_pbc, mtop->natoms);
copy_rvecn(x, x_pbc, 0, mtop->natoms);
- do_pbc_first_mtop(NULL, ir->ePBC, box, mtop, x_pbc);
+ do_pbc_first_mtop(nullptr, ir->ePBC, box, mtop, x_pbc);
}
/* Reset pointer to first ED data set which contains the actual ED data */
edi = ed->edpar;
/* Loop over all ED groups (usually one) */
edi = ed->edpar;
edinr = 0;
- while (edi != NULL)
+ while (edi != nullptr)
{
edinr++;
if (bNeedDoEdsam(edi))
/* dx is the ED correction to the positions: */
rvec_sub(x_unsh, xs[edi->sav.anrs_loc[i]], dx);
- if (v != NULL)
+ if (v != nullptr)
{
/* dv is the ED correction to the velocity: */
svmul(dt_1, dx, dv);