*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2008, 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.
static double** allocate_square_matrix(int dim)
{
int i;
- double** mat = NULL;
+ double** mat = nullptr;
snew(mat, dim);
} /* END of loop over slabs */
/* Output on the master */
- if ( (NULL != out_slabs) && bOutStep)
+ if ( (nullptr != out_slabs) && bOutStep)
{
fprintf(out_slabs, "%12.3e%6d", time, g);
for (j = erg->slab_first; j <= erg->slab_last; j++)
char buf[50], buf2[75];
gmx_enfrotgrp_t erg; /* Pointer to enforced rotation group data */
gmx_bool bFlex;
- char *LegendStr = NULL;
+ char *LegendStr = nullptr;
if (rot->enfrot->Flags & MD_APPENDFILES)
int i, j, k;
rvec zet = {0.0, 0.0, 1.0};
rvec rot_axis = {0.0, 0.0, 0.0};
- rvec *rotated_str = NULL;
+ rvec *rotated_str = nullptr;
real ooanorm;
real angle;
matrix rotmat;
rvec axis)
{
int i, j, k;
- rvec *ref_s_1 = NULL;
- rvec *act_s_1 = NULL;
+ rvec *ref_s_1 = nullptr;
+ rvec *act_s_1 = nullptr;
rvec shift;
double **Rmat, **RtR, **eigvec;
double eigval[3];
}
/* Weight positions with sqrt(weight) */
- if (NULL != weight)
+ if (nullptr != weight)
{
weigh_coords(ref_s_1, weight, natoms);
weigh_coords(act_s_1, weight, natoms);
static real flex_fit_angle(t_rotgrp *rotg)
{
int i;
- rvec *fitcoords = NULL;
+ rvec *fitcoords = nullptr;
rvec center; /* Center of positions passed to the fit routine */
real fitangle; /* Angle of the rotation group derived by fitting */
rvec coord;
/* Remember how many we allocated */
erg->nslabs_alloc = nslabs;
- if ( (NULL != fplog) && bVerbose)
+ if ( (nullptr != fplog) && bVerbose)
{
fprintf(fplog, "%s allocating memory to store data for %d slabs (rotation group %d).\n",
RotStr, nslabs, g);
}
else
{
- erg->PotAngleFit = NULL;
+ erg->PotAngleFit = nullptr;
}
/* xc_ref_ind needs to be set to identity in the serial case */
t_rot *rot;
t_rotgrp *rotg;
int g;
- int nat_max = 0; /* Size of biggest rotation group */
- gmx_enfrot_t er; /* Pointer to the enforced rotation buffer variables */
- gmx_enfrotgrp_t erg; /* Pointer to enforced rotation group data */
- rvec *x_pbc = NULL; /* Space for the pbc-correct atom positions */
+ int nat_max = 0; /* Size of biggest rotation group */
+ gmx_enfrot_t er; /* Pointer to the enforced rotation buffer variables */
+ gmx_enfrotgrp_t erg; /* Pointer to enforced rotation group data */
+ rvec *x_pbc = nullptr; /* Space for the pbc-correct atom positions */
if (MASTER(cr) && bVerbose)
/* Output every step for reruns */
if (er->Flags & MD_RERUN)
{
- if (NULL != fplog)
+ if (nullptr != fplog)
{
fprintf(fplog, "%s rerun - will write rotation output every available step.\n", RotStr);
}
rot->nstsout = 1;
}
- er->out_slabs = NULL;
+ er->out_slabs = nullptr;
if (MASTER(cr) && HaveFlexibleGroups(rot) )
{
er->out_slabs = open_slab_out(opt2fn("-rs", nfile, fnm), rot);
* When ir->bContinuation=TRUE this has already been done, but ok. */
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);
/* All molecules will be whole now, but not necessarily in the home box.
* Additionally, if a rotation group consists of more than one molecule
* (e.g. two strands of DNA), each one of them can end up in a different
{
rotg = &rot->grp[g];
- if (NULL != fplog)
+ if (nullptr != fplog)
{
fprintf(fplog, "%s group %d type '%s'\n", RotStr, g, erotg_names[rotg->eType]);
}
{
erg->nat_loc = 0;
erg->nalloc_loc = 0;
- erg->ind_loc = NULL;
+ erg->ind_loc = nullptr;
}
else
{
else
{
er->mpi_bufsize = 0;
- er->mpi_inbuf = NULL;
- er->mpi_outbuf = NULL;
+ er->mpi_inbuf = nullptr;
+ er->mpi_outbuf = nullptr;
}
/* Only do I/O on the MASTER */
- er->out_angles = NULL;
- er->out_rot = NULL;
- er->out_torque = NULL;
+ er->out_angles = nullptr;
+ er->out_rot = nullptr;
+ er->out_torque = nullptr;
if (MASTER(cr))
{
er->out_rot = open_rot_out(opt2fn("-ro", nfile, fnm), rot, oenv);
t_rotgrp *rotg;
gmx_bool outstep_slab, outstep_rot;
gmx_bool bColl;
- gmx_enfrot_t er; /* Pointer to the enforced rotation buffer variables */
- gmx_enfrotgrp_t erg; /* Pointer to enforced rotation group data */
+ gmx_enfrot_t er; /* Pointer to the enforced rotation buffer variables */
+ gmx_enfrotgrp_t erg; /* Pointer to enforced rotation group data */
rvec transvec;
- t_gmx_potfit *fit = NULL; /* For fit type 'potential' determine the fit
- angle via the potential minimum */
+ t_gmx_potfit *fit = nullptr; /* For fit type 'potential' determine the fit
+ angle via the potential minimum */
/* Enforced rotation cycle counting: */
gmx_cycles_t cycles_comp; /* Cycles for the enf. rotation computation