/*
* This file is part of the GROMACS molecular simulation package.
*
- * 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.
void TopologyManager::requestFrame()
{
- GMX_RELEASE_ASSERT(mtop_ == NULL,
+ GMX_RELEASE_ASSERT(mtop_ == nullptr,
"Frame must be requested before initializing topology");
- if (frame_ == NULL)
+ if (frame_ == nullptr)
{
snew(frame_, 1);
}
void TopologyManager::requestVelocities()
{
- GMX_RELEASE_ASSERT(frame_ != NULL,
+ GMX_RELEASE_ASSERT(frame_ != nullptr,
"Velocities requested before requesting a frame");
frame_->bV = TRUE;
if (frame_->natoms > 0)
void TopologyManager::requestForces()
{
- GMX_RELEASE_ASSERT(frame_ != NULL,
+ GMX_RELEASE_ASSERT(frame_ != nullptr,
"Forces requested before requesting a frame");
frame_->bF = TRUE;
if (frame_->natoms > 0)
{
bool fullTopology;
int ePBC;
- rvec *xtop = NULL;
+ rvec *xtop = nullptr;
matrix box;
GMX_RELEASE_ASSERT(mtop_ == nullptr, "Topology initialized more than once");
snew(mtop_, 1);
readConfAndTopology(
gmx::test::TestFileManager::getInputFilePath(filename).c_str(),
- &fullTopology, mtop_, &ePBC, frame_ != NULL ? &xtop : NULL,
- NULL, box);
+ &fullTopology, mtop_, &ePBC, frame_ != nullptr ? &xtop : nullptr,
+ nullptr, box);
- if (frame_ != NULL)
+ if (frame_ != nullptr)
{
frame_->natoms = mtop_->natoms;
frame_->bX = TRUE;
void TopologyManager::initAtoms(int count)
{
- GMX_RELEASE_ASSERT(mtop_ == NULL, "Topology initialized more than once");
+ GMX_RELEASE_ASSERT(mtop_ == nullptr, "Topology initialized more than once");
snew(mtop_, 1);
mtop_->nmoltype = 1;
snew(mtop_->moltype, 1);
atoms.atom[i].m = (i % 3 == 0 ? 2.0 : 1.0);
}
atoms.haveMass = TRUE;
- if (frame_ != NULL)
+ if (frame_ != nullptr)
{
frame_->natoms = count;
frame_->bX = TRUE;
void TopologyManager::initUniformResidues(int residueSize)
{
- GMX_RELEASE_ASSERT(mtop_ != NULL, "Topology not initialized");
+ GMX_RELEASE_ASSERT(mtop_ != nullptr, "Topology not initialized");
t_atoms &atoms = this->atoms();
int residueIndex = -1;
for (int i = 0; i < atoms.nr; ++i)
void TopologyManager::initUniformMolecules(int moleculeSize)
{
- GMX_RELEASE_ASSERT(mtop_ != NULL, "Topology not initialized");
+ GMX_RELEASE_ASSERT(mtop_ != nullptr, "Topology not initialized");
int index = 0;
mtop_->mols.nalloc_index = (mtop_->natoms + moleculeSize - 1) / moleculeSize + 1;
srenew(mtop_->mols.index, mtop_->mols.nalloc_index);