-misc-misplaced-const,\
-misc-incorrect-roundings,-misc-macro-parentheses,-readability-function-size,-readability-else-after-return,\
-readability-inconsistent-declaration-parameter-name,-misc-throw-by-value-catch-by-reference,\
- -readability-non-const-parameter,-readability-implicit-bool-conversion;-warnings-as-errors=*;-fix")
+ -readability-non-const-parameter,-readability-implicit-bool-conversion,\
+ modernize-use-nullptr,modernize-use-emplace;-warnings-as-errors=*;-fix")
endif()
gmx_write_installed_header_list()
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2016,2017,2018, 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.
bool
AnalysisDataStorageImpl::isMultipoint() const
{
- GMX_ASSERT(data_ != NULL, "isMultipoint() called too early");
+ GMX_ASSERT(data_ != nullptr, "isMultipoint() called too early");
return data_->isMultipoint();
}
GMX_RELEASE_ASSERT(awhDimParams.eCoordProvider == eawhcoordproviderPULL, "Currently only the pull code is supported as coordinate provider");
const t_pull_coord &pullCoord = inputRecord.pull->coord[awhDimParams.coordIndex];
double conversionFactor = pull_coordinate_is_angletype(&pullCoord) ? DEG2RAD : 1;
- dimParams.push_back(DimParams(conversionFactor, awhDimParams.forceConstant, beta));
+ dimParams.emplace_back(conversionFactor, awhDimParams.forceConstant, beta);
pullCoordIndex.push_back(awhDimParams.coordIndex);
}
}
for (int b = 0; b < outputTypeNumBlock[outputType]; b++)
{
- block_.push_back(AwhEnergyBlock(numPoints,
- pair.second,
- getNormalizationValue(outputType, bias, b)));
+ block_.emplace_back(numPoints,
+ pair.second,
+ getNormalizationValue(outputType, bias, b));
}
}
}
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2015,2016,2017,2018, 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.
for (int n = 0; n < numBlockData; n++)
{
- blockDataList_.push_back(CorrelationBlockData(numDim, scaling*blockLengthInit));
+ blockDataList_.emplace_back(numDim, scaling*blockLengthInit);
scaling <<= 1; /* Double block length */
}
}
period[d] = dimParams[d].scaleUserInputToInternal(awhDimParams[d].period);
static_assert(c_numPointsPerSigma >= 1.0, "The number of points per sigma should be at least 1.0 to get a uniformly covering the reaction using Gaussians");
double pointDensity = std::sqrt(dimParams[d].betak)*c_numPointsPerSigma;
- axis_.push_back(GridAxis(origin, end, period[d], pointDensity));
+ axis_.emplace_back(origin, end, period[d], pointDensity);
numPoints *= axis_[d].numPoints();
}
/* The data grid has the data that was read and the properties of the AWH grid */
for (int d = 0; d < grid.numDimensions(); d++)
{
- axis_.push_back(GridAxis(data[d][0], data[d][numDataPoints - 1],
- grid.axis(d).period(), numPoints[d]));
+ axis_.emplace_back(data[d][0], data[d][numDataPoints - 1],
+ grid.axis(d).period(), numPoints[d]);
}
/* Map each grid point to a data point. No interpolation, just pick the nearest one.
* when read_awhParams is called (in get ir).
* It is known first after do_index has been called in grompp.cpp.
*/
- if (inputrecGroupOptions->ref_t == NULL ||
+ if (inputrecGroupOptions->ref_t == nullptr ||
inputrecGroupOptions->ref_t[0] <= 0)
{
gmx_fatal(FARGS, "AWH biasing is only supported for temperatures > 0");
{
/* fshift should always be defined if this function is
* called when bShiftForcesNeedPbc is true */
- assert(NULL != fshift);
+ assert(nullptr != fshift);
for (int g : ind.index)
{
for (int j : atomGrouping.block(g))
}
/* Reset pointer to first ED data set which contains the actual ED data */
edi = ed->edpar;
- GMX_ASSERT(NULL != edi,
+ GMX_ASSERT(nullptr != edi,
"The pointer to the essential dynamics parameters is undefined");
nED = EDstate->nED;
std::list<std::string> errorReasons;
if (GMX_DOUBLE)
{
- errorReasons.push_back("double precision");
+ errorReasons.emplace_back("double precision");
}
if (GMX_GPU != GMX_GPU_CUDA)
{
- errorReasons.push_back("non-CUDA build of GROMACS");
+ errorReasons.emplace_back("non-CUDA build of GROMACS");
}
return addMessageIfNotSupported(errorReasons, error);
}
std::list<std::string> errorReasons;
if (!EEL_PME(ir->coulombtype))
{
- errorReasons.push_back("systems that do not use PME for electrostatics");
+ errorReasons.emplace_back("systems that do not use PME for electrostatics");
}
if (ir->pme_order != 4)
{
- errorReasons.push_back("interpolation orders other than 4");
+ errorReasons.emplace_back("interpolation orders other than 4");
}
if (ir->efep != efepNO)
{
- errorReasons.push_back("free energy calculations (multiple grids)");
+ errorReasons.emplace_back("free energy calculations (multiple grids)");
}
if (EVDW_PME(ir->vdwtype))
{
- errorReasons.push_back("Lennard-Jones PME");
+ errorReasons.emplace_back("Lennard-Jones PME");
}
if (ir->cutoff_scheme == ecutsGROUP)
{
- errorReasons.push_back("group cutoff scheme");
+ errorReasons.emplace_back("group cutoff scheme");
}
if (EI_TPI(ir->eI))
{
- errorReasons.push_back("test particle insertion");
+ errorReasons.emplace_back("test particle insertion");
}
return addMessageIfNotSupported(errorReasons, error);
}
std::list<std::string> errorReasons;
if (pme->nnodes != 1)
{
- errorReasons.push_back("PME decomposition");
+ errorReasons.emplace_back("PME decomposition");
}
if (pme->pme_order != 4)
{
- errorReasons.push_back("interpolation orders other than 4");
+ errorReasons.emplace_back("interpolation orders other than 4");
}
if (pme->bFEP)
{
- errorReasons.push_back("free energy calculations (multiple grids)");
+ errorReasons.emplace_back("free energy calculations (multiple grids)");
}
if (pme->doLJ)
{
- errorReasons.push_back("Lennard-Jones PME");
+ errorReasons.emplace_back("Lennard-Jones PME");
}
if (GMX_DOUBLE)
{
- errorReasons.push_back("double precision");
+ errorReasons.emplace_back("double precision");
}
if (GMX_GPU != GMX_GPU_CUDA)
{
- errorReasons.push_back("non-CUDA build of GROMACS");
+ errorReasons.emplace_back("non-CUDA build of GROMACS");
}
return addMessageIfNotSupported(errorReasons, error);
(do_cpt_enerhist(gmx_fio_getxdr(fp), FALSE, flags_enh, enerhist, nullptr) < 0) ||
(do_cpt_df_hist(gmx_fio_getxdr(fp), flags_dfh, nlambda, &state->dfhist, nullptr) < 0) ||
(do_cpt_EDstate(gmx_fio_getxdr(fp), FALSE, nED, edsamhist, nullptr) < 0) ||
- (do_cpt_awh(gmx_fio_getxdr(fp), FALSE, flags_awhh, state->awhHistory.get(), NULL) < 0) ||
+ (do_cpt_awh(gmx_fio_getxdr(fp), FALSE, flags_awhh, state->awhHistory.get(), nullptr) < 0) ||
(do_cpt_swapstate(gmx_fio_getxdr(fp), FALSE, eSwapCoords, swaphist, nullptr) < 0) ||
(do_cpt_files(gmx_fio_getxdr(fp), FALSE, &outputfiles, nullptr,
headerContents.file_version) < 0))
state->awhHistory = std::shared_ptr<gmx::AwhHistory>(new gmx::AwhHistory());
}
ret = do_cpt_awh(gmx_fio_getxdr(fp), TRUE,
- headerContents->flags_awhh, state->awhHistory.get(), NULL);
+ headerContents->flags_awhh, state->awhHistory.get(), nullptr);
if (ret)
{
cp_error();
}
ret = do_cpt_awh(gmx_fio_getxdr(fp), TRUE,
- headerContents.flags_awhh, state->awhHistory.get(), NULL);
+ headerContents.flags_awhh, state->awhHistory.get(), nullptr);
if (ret)
{
cp_error();
we call this routine... */
if (!cur->bRead && cur->iFTP != efCPT)
{
- outputfiles.push_back(gmx_file_position_t {});
+ outputfiles.emplace_back();
std::strncpy(outputfiles.back().filename, cur->fn, STRLEN - 1);
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017,2018, 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.
oenv->xvg_format = xvg_format;
oenv->verbosity = verbosity;
const char *env = getenv("GMX_TRAJECTORY_IO_VERBOSITY");
- oenv->trajectory_io_verbosity = (env != nullptr ? strtol(env, NULL, 10) : 1);
+ oenv->trajectory_io_verbosity = (env != nullptr ? strtol(env, nullptr, 10) : 1);
}
GMX_CATCH_ALL_AND_EXIT_WITH_FATAL_ERROR;
if (found_index == -1)
{
/* add a new item */
- inp.push_back(t_inpfile(0, 1, false, false, false,
- tokens[0], tokens[1]));
+ inp.emplace_back(0, 1, false, false, false,
+ tokens[0], tokens[1]);
}
else
{
if (i == -1)
{
notfound = true;
- inpRef.push_back(t_inpfile(0, 0, false, true, false,
- name, ""));
+ inpRef.emplace_back(0, 0, false, true, false,
+ name, "");
i = inpRef.size() - 1;
if (inpRef.size() == 1)
{
{
std::string tmp("\n; ");
tmp.append(line);
- get_estr(inp, tmp.c_str(), NULL);
+ get_estr(inp, tmp.c_str(), nullptr);
}
void
{
std::string tmp("; ");
tmp.append(line);
- get_estr(inp, tmp.c_str(), NULL);
+ get_estr(inp, tmp.c_str(), nullptr);
}
void
setStringEntry(std::vector<t_inpfile> *inp, const char *name, char *newName, const char *def)
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017,2018, 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.
// know that dih[j][i] is always valid. Since it occurs in the innermost
// loop over angles and will only trigger on coding errors, we
// only enable it for debug builds.
- GMX_ASSERT(dih != NULL && dih[j] != NULL, "Incorrect dihedral array data");
+ GMX_ASSERT(dih != nullptr && dih[j] != nullptr, "Incorrect dihedral array data");
x[k][l] = (m == 0) ? std::cos(dih[j][i]) : std::sin(dih[j][i]);
l++;
if (l == DIM)
"Instantaneous"
};
- FILE /* *out = NULL,*/ *out_disre = NULL, *fp_pairs = NULL, *fort = NULL, *fodt = NULL, *foten = NULL;
+ FILE /* *out = NULL,*/ *out_disre = nullptr, *fp_pairs = nullptr, *fort = nullptr, *fodt = nullptr, *foten = nullptr;
ener_file_t fp;
int timecheck = 0;
gmx_mtop_t mtop;
t_enxframe fr;
int nre, teller, teller_disre;
int nor = 0, nex = 0, norfr = 0, enx_i = 0;
- real *bounds = NULL, *violaver = NULL, *oobs = NULL, *orient = NULL, *odrms = NULL;
- int *index = NULL, *pair = NULL, norsel = 0, *orsel = NULL, *or_label = NULL;
+ real *bounds = nullptr, *violaver = nullptr, *oobs = nullptr, *orient = nullptr, *odrms = nullptr;
+ int *index = nullptr, *pair = nullptr, norsel = 0, *orsel = nullptr, *or_label = nullptr;
int nbounds = 0, npairs;
gmx_bool bDisRe, bDRAll, bORA, bORT, bODA, bODR, bODT, bORIRE, bOTEN;
gmx_bool bCont;
double sumaver, sumt;
- int *set = NULL, i, j, k, nset, sss;
+ int *set = nullptr, i, j, k, nset, sss;
char **pairleg, **odtleg, **otenleg;
char **leg = nullptr;
const char *anm_j, *anm_k, *resnm_j, *resnm_k;
Vc = kernel_data->energygrp_elec;
Vvdw = kernel_data->energygrp_vdw;
- if (aadata == NULL)
+ if (aadata == nullptr)
{
setup_aadata(&aadata, excl, natoms, type, fr->ntype, fr->nbfp);
fr->AllvsAll_work = aadata;
* a priori if the number of atoms in confin matches what we expect.
*/
state->flags |= (1 << estX);
- if (v != NULL)
+ if (v != nullptr)
{
state->flags |= (1 << estV);
}
}
/* ignore the following deprecated commands */
- replace_inp_entry(inp, "title", NULL);
- replace_inp_entry(inp, "cpp", NULL);
- replace_inp_entry(inp, "domain-decomposition", NULL);
- replace_inp_entry(inp, "andersen-seed", NULL);
- replace_inp_entry(inp, "dihre", NULL);
- replace_inp_entry(inp, "dihre-fc", NULL);
- replace_inp_entry(inp, "dihre-tau", NULL);
- replace_inp_entry(inp, "nstdihreout", NULL);
- replace_inp_entry(inp, "nstcheckpoint", NULL);
- replace_inp_entry(inp, "optimize-fft", NULL);
- replace_inp_entry(inp, "adress_type", NULL);
- replace_inp_entry(inp, "adress_const_wf", NULL);
- replace_inp_entry(inp, "adress_ex_width", NULL);
- replace_inp_entry(inp, "adress_hy_width", NULL);
- replace_inp_entry(inp, "adress_ex_forcecap", NULL);
- replace_inp_entry(inp, "adress_interface_correction", NULL);
- replace_inp_entry(inp, "adress_site", NULL);
- replace_inp_entry(inp, "adress_reference_coords", NULL);
- replace_inp_entry(inp, "adress_tf_grp_names", NULL);
- replace_inp_entry(inp, "adress_cg_grp_names", NULL);
- replace_inp_entry(inp, "adress_do_hybridpairs", NULL);
- replace_inp_entry(inp, "rlistlong", NULL);
- replace_inp_entry(inp, "nstcalclr", NULL);
- replace_inp_entry(inp, "pull-print-com2", NULL);
- replace_inp_entry(inp, "gb-algorithm", NULL);
- replace_inp_entry(inp, "nstgbradii", NULL);
- replace_inp_entry(inp, "rgbradii", NULL);
- replace_inp_entry(inp, "gb-epsilon-solvent", NULL);
- replace_inp_entry(inp, "gb-saltconc", NULL);
- replace_inp_entry(inp, "gb-obc-alpha", NULL);
- replace_inp_entry(inp, "gb-obc-beta", NULL);
- replace_inp_entry(inp, "gb-obc-gamma", NULL);
- replace_inp_entry(inp, "gb-dielectric-offset", NULL);
- replace_inp_entry(inp, "sa-algorithm", NULL);
- replace_inp_entry(inp, "sa-surface-tension", NULL);
+ replace_inp_entry(inp, "title", nullptr);
+ replace_inp_entry(inp, "cpp", nullptr);
+ replace_inp_entry(inp, "domain-decomposition", nullptr);
+ replace_inp_entry(inp, "andersen-seed", nullptr);
+ replace_inp_entry(inp, "dihre", nullptr);
+ replace_inp_entry(inp, "dihre-fc", nullptr);
+ replace_inp_entry(inp, "dihre-tau", nullptr);
+ replace_inp_entry(inp, "nstdihreout", nullptr);
+ replace_inp_entry(inp, "nstcheckpoint", nullptr);
+ replace_inp_entry(inp, "optimize-fft", nullptr);
+ replace_inp_entry(inp, "adress_type", nullptr);
+ replace_inp_entry(inp, "adress_const_wf", nullptr);
+ replace_inp_entry(inp, "adress_ex_width", nullptr);
+ replace_inp_entry(inp, "adress_hy_width", nullptr);
+ replace_inp_entry(inp, "adress_ex_forcecap", nullptr);
+ replace_inp_entry(inp, "adress_interface_correction", nullptr);
+ replace_inp_entry(inp, "adress_site", nullptr);
+ replace_inp_entry(inp, "adress_reference_coords", nullptr);
+ replace_inp_entry(inp, "adress_tf_grp_names", nullptr);
+ replace_inp_entry(inp, "adress_cg_grp_names", nullptr);
+ replace_inp_entry(inp, "adress_do_hybridpairs", nullptr);
+ replace_inp_entry(inp, "rlistlong", nullptr);
+ replace_inp_entry(inp, "nstcalclr", nullptr);
+ replace_inp_entry(inp, "pull-print-com2", nullptr);
+ replace_inp_entry(inp, "gb-algorithm", nullptr);
+ replace_inp_entry(inp, "nstgbradii", nullptr);
+ replace_inp_entry(inp, "rgbradii", nullptr);
+ replace_inp_entry(inp, "gb-epsilon-solvent", nullptr);
+ replace_inp_entry(inp, "gb-saltconc", nullptr);
+ replace_inp_entry(inp, "gb-obc-alpha", nullptr);
+ replace_inp_entry(inp, "gb-obc-beta", nullptr);
+ replace_inp_entry(inp, "gb-obc-gamma", nullptr);
+ replace_inp_entry(inp, "gb-dielectric-offset", nullptr);
+ replace_inp_entry(inp, "sa-algorithm", nullptr);
+ replace_inp_entry(inp, "sa-surface-tension", nullptr);
/* replace the following commands with the clearer new versions*/
replace_inp_entry(inp, "unconstrained-start", "continuation");
{
return;
}
- GMX_ASSERT(pr->nr != 0 || pr->param == NULL, "Invalid t_params object");
+ GMX_ASSERT(pr->nr != 0 || pr->param == nullptr, "Invalid t_params object");
if (pr->nr+extra > pr->maxnr)
{
pr->maxnr = std::max(static_cast<int>(1.2*pr->maxnr), pr->maxnr + extra);
else
{
GMX_ASSERT(vsnral != 0, "nvsite > 1 must have vsnral != 0");
- GMX_ASSERT(first_atoms != NULL, "nvsite > 1 must have first_atoms != NULL");
+ GMX_ASSERT(first_atoms != nullptr, "nvsite > 1 must have first_atoms != NULL");
/* if it is not the first then
check if this vsite is constructed from the same atoms */
if (vsnral == NRAL(pindex[atom].ftype)-1)
bUsed = FALSE;
for (m = 0; (m < vsnral) && !bUsed; m++)
{
- GMX_ASSERT(first_atoms != NULL, "If we've seen a vsite before, we know what its first atom index was");
+ GMX_ASSERT(first_atoms != nullptr, "If we've seen a vsite before, we know what its first atom index was");
if (atom == first_atoms[m])
{
else
{
GMX_ASSERT(vsnral != 0, "If we've seen a vsite before, we know how many constructing atoms it had");
- GMX_ASSERT(first_atoms != NULL, "If we've seen a vsite before, we know what its first atom index was");
+ GMX_ASSERT(first_atoms != nullptr, "If we've seen a vsite before, we know what its first atom index was");
/* check if this vsite is constructed from the same atoms */
if (vsnral == NRAL(pindex[atom].ftype)-1)
{
bUsed = FALSE;
for (m = 0; (m < vsnral) && !bUsed; m++)
{
- GMX_ASSERT(first_atoms != NULL, "If we've seen a vsite before, we know what its first atom index was");
+ GMX_ASSERT(first_atoms != nullptr, "If we've seen a vsite before, we know what its first atom index was");
if (atom == first_atoms[m])
{
else
{
GMX_ASSERT(vsnral != 0, "If we've seen a vsite before, we know how many constructing atoms it had");
- GMX_ASSERT(first_atoms != NULL, "If we've seen a vsite before, we know what its first atom index was");
+ GMX_ASSERT(first_atoms != nullptr, "If we've seen a vsite before, we know what its first atom index was");
/* check if this vsite is constructed from the same atoms */
if (vsnral == NRAL(pindex[atom].ftype)-1)
{
for (k = 0; (k < 4) && !bKeep; k++) /* for all atoms in the dihedral */
{
GMX_ASSERT(vsnral != 0, "If we've seen a vsite before, we know how many constructing atoms it had");
- GMX_ASSERT(first_atoms != NULL, "If we've seen a vsite before, we know what its first atom index was");
+ GMX_ASSERT(first_atoms != nullptr, "If we've seen a vsite before, we know what its first atom index was");
atom = ps->param[i].a[k];
if (vsite_type[atom] == NOTSET)
{
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2008, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017,2018, 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.
};
#define NFILE asize(fnm)
real kb = 4e5, kt = 400, kp = 5;
- t_restp rtp_header_settings = { 0 };
+ t_restp rtp_header_settings = { nullptr };
gmx_bool bRemoveDihedralIfWithImproper = FALSE;
gmx_bool bGenerateHH14Interactions = TRUE;
gmx_bool bKeepAllGeneratedDihedrals = FALSE;
Rtav_6[res] *= invn;
}
- GMX_ASSERT(cr != NULL && ms != NULL, "We need multisim with nsystems>1");
+ GMX_ASSERT(cr != nullptr && ms != nullptr, "We need multisim with nsystems>1");
gmx_sum_sim(2*dd->nres, dd->Rt_6, ms);
if (DOMAINDECOMP(cr))
particle_distance = std::cbrt(boxvol*std::sqrt(2)/mtop->natoms);
get_verlet_buffer_atomtypes(mtop, &att, &natt, n_nonlin_vsite);
- assert(att != NULL && natt >= 0);
+ assert(att != nullptr && natt >= 0);
if (debug)
{
gmx_edsam_t ed = nullptr;
//! Thread-local virial contribution.
- tensor *vir_r_m_dr_th = {0};
+ tensor *vir_r_m_dr_th = {nullptr};
//! Did a settle error occur?
bool *bSettleErrorHasOccurred = nullptr;
bUsesSimpleTables = TRUE;
break;
case ecutsVERLET:
- assert(NULL != nbv && NULL != nbv->grp);
+ assert(nullptr != nbv);
grp_index = (group < 0) ? 0 : (nbv->ngrp - 1);
bUsesSimpleTables = nbnxn_kernel_pairlist_simple(nbv->grp[grp_index].kernel_type);
break;
if (ic->eeltype != eelGRF)
{
calc_rffac(fp, ic->eeltype, ic->epsilon_r, ic->epsilon_rf,
- ic->rcoulomb, 0, 0, NULL,
+ ic->rcoulomb, 0, 0, nullptr,
&ic->k_rf, &ic->c_rf);
}
if (!usingDomDec && ir->ePBC != epbcNONE && !fr->bMolPBC)
{
- GMX_ASSERT(graph != NULL, "We use a graph with PBC (no periodic mols) and without DD");
+ GMX_ASSERT(graph != nullptr, "We use a graph with PBC (no periodic mols) and without DD");
*graph = mk_graph(nullptr, &(top->idef), 0, top_global->natoms, FALSE, FALSE);
}
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2017, by the GROMACS development team, led by
+ * Copyright (c) 2017,2018, 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.
listParams->nstlistPrune = tunedNstlistPrune;
calc_verlet_buffer_size(mtop, det(box), ir,
tunedNstlistPrune, listLifetime,
- -1, &listSetup, NULL,
+ -1, &listSetup, nullptr,
&listParams->rlistInner);
/* On the GPU we apply the dynamic pruning in a rolling fashion
const bool useGpu = (nbnxnKernelType == nbnxnk8x8x8_GPU);
if (supportsDynamicPairlistGenerationInterval(*ir) &&
- getenv("GMX_DISABLE_DYNAMICPRUNING") == NULL)
+ getenv("GMX_DISABLE_DYNAMICPRUNING") == nullptr)
{
/* Note that nstlistPrune can have any value independently of nstlist.
* Actually applying rolling pruning is only useful when
* nstlistPrune < nstlist -1
*/
char *env = getenv("GMX_NSTLIST_DYNAMICPRUNING");
- bool userSetNstlistPrune = (env != NULL);
+ bool userSetNstlistPrune = (env != nullptr);
if (userSetNstlistPrune)
{
{
real V = 0;
- assert(pull != NULL);
+ assert(pull != nullptr);
/* Ideally we should check external potential registration only during
* the initialization phase, but that requires another function call
const t_commrec *cr, double dt, double t,
rvec *x, rvec *xp, rvec *v, tensor vir)
{
- assert(pull != NULL);
+ assert(pull != nullptr);
if (pull->comm.bParticipate)
{
/* This might be an extremely expensive operation, so we try
* to avoid this splitting as much as possible.
*/
- assert(dd != NULL);
+ assert(dd != nullptr);
MPI_Comm_split(dd->mpi_comm_all, bWillParticipate ? 0 : 1, dd->rank,
&comm->mpi_comm_com);
#endif
for (int c = 0; c < pull->params.ncoord; c++)
{
/* Construct a pull coordinate, copying all coordinate parameters */
- pull->coord.push_back(pull_params->coord[c]);
+ pull->coord.emplace_back(pull_params->coord[c]);
pull_coord_work_t *pcrd = &pull->coord.back();
pgrp->nat_loc == 1 &&
md->massT[pgrp->ind_loc[0]] == 0)
{
- GMX_ASSERT(xp == NULL, "We should not have groups with zero mass with constraints, i.e. xp!=NULL");
+ GMX_ASSERT(xp == nullptr, "We should not have groups with zero mass with constraints, i.e. xp!=NULL");
/* Copy the single atom coordinate */
for (int d = 0; d < DIM; d++)
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2009,2010,2011,2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2009,2010,2011,2012,2013,2014,2015,2016,2017,2018, 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 void
init_item_evaloutput(const SelectionTreeElementPointer &sel)
{
- GMX_ASSERT(!(sel->child == NULL &&
+ GMX_ASSERT(!(sel->child == nullptr &&
(sel->type == SEL_SUBEXPRREF || sel->type == SEL_SUBEXPR)),
"Subexpression elements should always have a child element");
static void
postprocess_item_subexpressions(const SelectionTreeElementPointer &sel)
{
- GMX_ASSERT(!(sel->child == NULL &&
+ GMX_ASSERT(!(sel->child == nullptr &&
(sel->type == SEL_SUBEXPRREF || sel->type == SEL_SUBEXPR)),
"Subexpression elements should always have a child element");
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2009,2010,2011,2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2009,2010,2011,2012,2013,2014,2015,2016,2017,2018, 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.
std::vector<real> *masses,
std::vector<real> *charges)
{
- GMX_ASSERT(top != NULL, "Should not have been called with NULL topology");
+ GMX_ASSERT(top != nullptr, "Should not have been called with NULL topology");
masses->clear();
charges->clear();
int molb = 0;
maxentries += 1024;
srenew(b->a, maxentries);
}
- assert(b->a != NULL); // for clang analyzer
+ assert(b->a != nullptr); // for clang analyzer
b->a[i] = strtol(str, nullptr, 10)-1;
b->index[b->nr]++;
(b->nra)++;
for (i = 0; (i < b->nr); i++)
{
- assert(b->a != NULL); // for clang analyzer
+ assert(b->a != nullptr); // for clang analyzer
for (j = b->index[i]; (j < b->index[i+1]); j++)
{
if (b->a[j] < 0)