*
* 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.
int natoms, ind_min[2] = {0, 0}, ind_mini = 0, ind_minj = 0;
real rmin, rmax, rmint, tmint;
gmx_bool bFirst;
- gmx_rmpbc_t gpbc = NULL;
+ gmx_rmpbc_t gpbc = nullptr;
natoms = read_first_x(oenv, &status, trxfn, &t, &x, box);
- check_index(NULL, n, index, NULL, natoms);
+ check_index(nullptr, n, index, nullptr, natoms);
out = xvgropen(outfn, "Minimum distance to periodic image",
output_env_get_time_label(oenv), "Distance (nm)", oenv);
rmint = box[XX][XX];
tmint = 0;
- if (NULL != top)
+ if (nullptr != top)
{
gpbc = gmx_rmpbc_init(&top->idef, ePBC, natoms);
}
bFirst = TRUE;
do
{
- if (NULL != top)
+ if (nullptr != top)
{
gmx_rmpbc(gpbc, natoms, box, x);
}
}
while (read_next_x(oenv, status, &t, x, box));
- if (NULL != top)
+ if (nullptr != top)
{
gmx_rmpbc_done(gpbc);
}
for (j = 0; (j < j1); j++)
{
jx = index3[j];
- if (index2 == NULL)
+ if (index2 == nullptr)
{
i0 = j + 1;
}
t_trxstatus *trxout;
char buf[256];
char **leg;
- real t, dmin, dmax, **mindres = NULL, **maxdres = NULL;
+ real t, dmin, dmax, **mindres = nullptr, **maxdres = nullptr;
int nmin, nmax;
t_trxstatus *status;
int i = -1, j, k;
rvec *x0;
matrix box;
gmx_bool bFirst;
- FILE *respertime = NULL;
+ FILE *respertime = nullptr;
if (read_first_x(oenv, &status, fn, &t, &x0, box) == 0)
{
sprintf(buf, "%simum Distance", bMin ? "Min" : "Max");
dist = xvgropen(dfile, buf, output_env_get_time_label(oenv), "Distance (nm)", oenv);
sprintf(buf, "Number of Contacts %s %g nm", bMin ? "<" : ">", rcut);
- num = nfile ? xvgropen(nfile, buf, output_env_get_time_label(oenv), "Number", oenv) : NULL;
- atm = afile ? gmx_ffopen(afile, "w") : NULL;
- trxout = xfile ? open_trx(xfile, "w") : NULL;
+ num = nfile ? xvgropen(nfile, buf, output_env_get_time_label(oenv), "Number", oenv) : nullptr;
+ atm = afile ? gmx_ffopen(afile, "w") : nullptr;
+ trxout = xfile ? open_trx(xfile, "w") : nullptr;
if (bMat)
{
{
oindex[0] = bMin ? min1 : max1;
oindex[1] = bMin ? min2 : max2;
- write_trx(trxout, 2, oindex, atoms, i, t, box, x0, NULL, NULL);
+ write_trx(trxout, 2, oindex, atoms, i, t, box, x0, nullptr, nullptr);
}
bFirst = FALSE;
/*dmin should be minimum distance for residue and group*/
"Write residue names" }
};
gmx_output_env_t *oenv;
- t_topology *top = NULL;
+ t_topology *top = nullptr;
int ePBC = -1;
rvec *x;
matrix box;
const char *trxfnm, *tpsfnm, *ndxfnm, *distfnm, *numfnm, *atmfnm, *oxfnm, *resfnm;
char **grpname;
int *gnx;
- int **index, *residues = NULL;
+ int **index, *residues = nullptr;
t_filenm fnm[] = {
- { efTRX, "-f", NULL, ffREAD },
- { efTPS, NULL, NULL, ffOPTRD },
- { efNDX, NULL, NULL, ffOPTRD },
+ { efTRX, "-f", nullptr, ffREAD },
+ { efTPS, nullptr, nullptr, ffOPTRD },
+ { efNDX, nullptr, nullptr, ffOPTRD },
{ efXVG, "-od", "mindist", ffWRITE },
{ efXVG, "-on", "numcont", ffOPTWR },
{ efOUT, "-o", "atm-pair", ffOPTWR },
if (!parse_common_args(&argc, argv,
PCA_CAN_VIEW | PCA_CAN_TIME | PCA_TIME_UNIT,
- NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, NULL, &oenv))
+ NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, nullptr, &oenv))
{
return 0;
}
atmfnm = ftp2fn_null(efOUT, NFILE, fnm);
oxfnm = opt2fn_null("-ox", NFILE, fnm);
resfnm = opt2fn_null("-or", NFILE, fnm);
- if (bPI || resfnm != NULL)
+ if (bPI || resfnm != nullptr)
{
/* We need a tps file */
tpsfnm = ftp2fn(efTPS, NFILE, fnm);
if (tpsfnm || resfnm || !ndxfnm)
{
snew(top, 1);
- bTop = read_tps_conf(tpsfnm, top, &ePBC, &x, NULL, box, FALSE);
+ bTop = read_tps_conf(tpsfnm, top, &ePBC, &x, nullptr, box, FALSE);
if (bPI && !bTop)
{
printf("\nWARNING: Without a run input file a trajectory with broken molecules will not give the correct periodic image distance\n\n");
}
}
- get_index(top ? &(top->atoms) : NULL, ndxfnm, ng, gnx, index, grpname);
+ get_index(top ? &(top->atoms) : nullptr, ndxfnm, ng, gnx, index, grpname);
if (bMat && (ng == 1))
{
if (resfnm)
{
- GMX_RELEASE_ASSERT(top != NULL, "top pointer cannot be NULL when finding residues");
+ GMX_RELEASE_ASSERT(top != nullptr, "top pointer cannot be NULL when finding residues");
nres = find_residues(&(top->atoms), gnx[0], index[0], &residues);
if (debug)
else
{
dist_plot(trxfnm, atmfnm, distfnm, numfnm, resfnm, oxfnm,
- rcutoff, bMat, top ? &(top->atoms) : NULL,
+ rcutoff, bMat, top ? &(top->atoms) : nullptr,
ng, index, gnx, grpname, bSplit, !bMax, nres, residues, bPBC, ePBC,
bGroup, bEachResEachTime, bPrintResName, oenv);
}