Commit ac0c1891 authored by Sebastian Eibl's avatar Sebastian Eibl
Browse files

clang-tidy -checks=-*,modernize-use-nullptr

parent d466ac5b
......@@ -459,7 +459,7 @@ public:
typedef lbm::PdfField< LatticeModel_T > PdfField_T;
ErrorVTKWriter( const ConstBlockDataID & pdfFieldId, const std::string & id, const Setup & setup ) :
vtk::BlockCellDataWriter< OutputType, 3 >( id ), bdid_( pdfFieldId ), pdf_( NULL ), setup_( setup ) {}
vtk::BlockCellDataWriter< OutputType, 3 >( id ), bdid_( pdfFieldId ), pdf_( nullptr ), setup_( setup ) {}
protected:
......@@ -994,7 +994,7 @@ int main( int argc, char **argv )
//WALBERLA_ROOT_SECTION() { logging::Logging::instance()->setLogLevel( logging::Logging::PROGRESS ); }
#ifdef _OPENMP
if( std::getenv( "OMP_NUM_THREADS" ) == NULL )
if( std::getenv( "OMP_NUM_THREADS" ) == nullptr )
WALBERLA_ABORT( "If you are using a version of the program that was compiled with OpenMP you have to "
"specify the environment variable \'OMP_NUM_THREADS\' accordingly!" );
#endif
......
......@@ -578,7 +578,7 @@ int main( int argc, char **argv )
// set up synchronization procedure
const real_t overlap = real_t( 1.5 ) * dx;
std::function<void(void)> syncCall = std::bind( pe::syncShadowOwners<BodyTypeTuple>, std::ref(blocks->getBlockForest()), bodyStorageID, static_cast<WcTimingTree*>(NULL), overlap, false );
std::function<void(void)> syncCall = std::bind( pe::syncShadowOwners<BodyTypeTuple>, std::ref(blocks->getBlockForest()), bodyStorageID, static_cast<WcTimingTree*>(nullptr), overlap, false );
// create pe bodies
......@@ -610,7 +610,7 @@ int main( int argc, char **argv )
BlockDataID flagFieldID = field::addFlagFieldToStorage<FlagField_T>( blocks, "flag field", FieldGhostLayers );
// add body field
BlockDataID bodyFieldID = field::addToStorage<BodyField_T>( blocks, "body field", NULL, field::zyxf, FieldGhostLayers );
BlockDataID bodyFieldID = field::addToStorage<BodyField_T>( blocks, "body field", nullptr, field::zyxf, FieldGhostLayers );
// add boundary handling
BlockDataID boundaryHandlingID = blocks->addStructuredBlockData< BoundaryHandling_T >( MyBoundaryHandling( flagFieldID, pdfFieldID, bodyFieldID ), "boundary handling" );
......
......@@ -806,15 +806,15 @@ int main( int argc, char **argv )
// set up collision response, here DEM solver
// in this test case, it is only used for the time integration
pe::cr::DEM cr(globalBodyStorage, blocks->getBlockStoragePointer(), bodyStorageID, ccdID, fcdID, NULL);
pe::cr::DEM cr(globalBodyStorage, blocks->getBlockStoragePointer(), bodyStorageID, ccdID, fcdID, nullptr);
// set up synchronization procedure
const real_t overlap = real_t( 1.5 ) * dx;
std::function<void(void)> syncCall;
if( XBlocks <= uint_t(4) )
syncCall = std::bind( pe::syncNextNeighbors<BodyTypeTuple>, std::ref(blocks->getBlockForest()), bodyStorageID, static_cast<WcTimingTree*>(NULL), overlap, false );
syncCall = std::bind( pe::syncNextNeighbors<BodyTypeTuple>, std::ref(blocks->getBlockForest()), bodyStorageID, static_cast<WcTimingTree*>(nullptr), overlap, false );
else
syncCall = std::bind( pe::syncShadowOwners<BodyTypeTuple>, std::ref(blocks->getBlockForest()), bodyStorageID, static_cast<WcTimingTree*>(NULL), overlap, false );
syncCall = std::bind( pe::syncShadowOwners<BodyTypeTuple>, std::ref(blocks->getBlockForest()), bodyStorageID, static_cast<WcTimingTree*>(nullptr), overlap, false );
real_t xParticle = real_t(0);
......@@ -832,7 +832,7 @@ int main( int argc, char **argv )
else if( int(Galileo) == 250 )
{
// add random perturbance for chaotic regime
walberla::math::seedRandomGenerator( std::mt19937::result_type(std::time(0)) );
walberla::math::seedRandomGenerator( std::mt19937::result_type(std::time(nullptr)) );
xParticle = real_c( xlength ) * real_t(0.5) + walberla::math::realRandom( real_t(-0.5), real_t(0.5) );
yParticle = real_c( ylength ) * real_t(0.5) + walberla::math::realRandom( real_t(-0.5), real_t(0.5) );
......@@ -883,7 +883,7 @@ int main( int argc, char **argv )
BlockDataID flagFieldID = field::addFlagFieldToStorage< FlagField_T >( blocks, "flag field" );
// add body field
BlockDataID bodyFieldID = field::addToStorage<BodyField_T>( blocks, "body field", NULL, field::zyxf );
BlockDataID bodyFieldID = field::addToStorage<BodyField_T>( blocks, "body field", nullptr, field::zyxf );
// add body and volume fraction field
BlockDataID bodyAndVolumeFractionFieldID = field::addToStorage< BodyAndVolumeFractionField_T >( blocks, "body and volume fraction field",
......
......@@ -1152,7 +1152,7 @@ int main( int argc, char **argv )
logging::Logging::printHeaderOnStream();
#ifdef _OPENMP
if( std::getenv( "OMP_NUM_THREADS" ) == NULL )
if( std::getenv( "OMP_NUM_THREADS" ) == nullptr )
WALBERLA_ABORT( "If you are using a version of the benchmark that was compiled with OpenMP you have to "
"specify the environment variable \'OMP_NUM_THREADS\' accordingly!" );
#endif
......
......@@ -77,7 +77,7 @@ int main( int argc, char ** argv )
WALBERLA_LOG_INFO_ON_ROOT("*** READING CONFIG FILE ***");
auto cfg = env.config();
if (cfg == NULL) WALBERLA_ABORT("No config specified!");
if (cfg == nullptr) WALBERLA_ABORT("No config specified!");
const Config::BlockHandle mainConf = cfg->getBlock( "PeriodicGranularGas" );
int simulationSteps = mainConf.getParameter<int>("simulationSteps", 10 );
......@@ -160,11 +160,11 @@ int main( int argc, char ** argv )
std::function<void(void)> syncCallWithoutTT;
if (bNN)
{
syncCallWithoutTT = std::bind( pe::syncNextNeighbors<BodyTuple>, boost::ref(*forest), storageID, static_cast<WcTimingTree*>(NULL), real_c(0.1), false );
syncCallWithoutTT = std::bind( pe::syncNextNeighbors<BodyTuple>, boost::ref(*forest), storageID, static_cast<WcTimingTree*>(nullptr), real_c(0.1), false );
WALBERLA_LOG_INFO_ON_ROOT("Using NextNeighbor sync!");
} else if (bSO)
{
syncCallWithoutTT = std::bind( pe::syncShadowOwners<BodyTuple>, boost::ref(*forest), storageID, static_cast<WcTimingTree*>(NULL), real_c(0.1), false );
syncCallWithoutTT = std::bind( pe::syncShadowOwners<BodyTuple>, boost::ref(*forest), storageID, static_cast<WcTimingTree*>(nullptr), real_c(0.1), false );
WALBERLA_LOG_INFO_ON_ROOT("Using ShadowOwner sync!");
} else
{
......@@ -193,7 +193,7 @@ int main( int argc, char ** argv )
for (auto it = grid_generator::SCIterator(currentBlock.getAABB().getIntersection(generationDomain), Vector3<real_t>(spacing, spacing, spacing) * real_c(0.5), spacing); it != grid_generator::SCIterator(); ++it)
{
SphereID sp = pe::createSphere( *globalBodyStorage, *forest, storageID, 0, *it, radius, material);
if (sp != NULL) ++numParticles;
if (sp != nullptr) ++numParticles;
}
}
mpi::reduceInplace(numParticles, mpi::SUM);
......
......@@ -589,7 +589,7 @@ public:
typedef lbm::PdfField< LatticeModel_T > PdfField_T;
ErrorVTKWriter( const ConstBlockDataID & pdfFieldId, const std::string & id, const Setup & setup ) :
vtk::BlockCellDataWriter< OutputType, 3 >( id ), bdid_( pdfFieldId ), pdf_( NULL ), setup_( setup ) {}
vtk::BlockCellDataWriter< OutputType, 3 >( id ), bdid_( pdfFieldId ), pdf_( nullptr ), setup_( setup ) {}
protected:
......@@ -1106,7 +1106,7 @@ int main( int argc, char **argv )
//WALBERLA_ROOT_SECTION() { logging::Logging::instance()->setLogLevel( logging::Logging::PROGRESS ); }
#ifdef _OPENMP
if( std::getenv( "OMP_NUM_THREADS" ) == NULL )
if( std::getenv( "OMP_NUM_THREADS" ) == nullptr )
WALBERLA_ABORT( "If you are using a version of the program that was compiled with OpenMP you have to "
"specify the environment variable \'OMP_NUM_THREADS\' accordingly!" );
#endif
......
......@@ -1101,7 +1101,7 @@ void VorticityRefinement< VectorField_T, Filter_T, Pseudo2D >::operator()( std::
const Block * const block = it->first;
const VectorField_T * u = block->template getData< VectorField_T >( fieldId_ );
if( u == NULL )
if( u == nullptr )
{
it->second = uint_t(0);
continue;
......@@ -1532,7 +1532,7 @@ void Evaluation< LatticeModel_T >::operator()()
if( setup_.evaluateStrouhal )
{
auto block = blocks->getBlock( setup_.pStrouhal );
if( block != NULL )
if( block != nullptr )
{
const PdfField_T * const pdfField = block->template getData< PdfField_T >( pdfFieldId_ );
const auto cell = blocks->getBlockLocalCell( *block, setup_.pStrouhal );
......@@ -2012,7 +2012,7 @@ void Evaluation< LatticeModel_T >::refresh()
int omega( 0 );
auto block = blocks->getBlock( setup_.pAlpha );
if( block != NULL )
if( block != nullptr )
{
const FlagField_T * const flagField = block->template getData< FlagField_T >( flagFieldId_ );
......@@ -2036,7 +2036,7 @@ void Evaluation< LatticeModel_T >::refresh()
}
block = blocks->getBlock( setup_.pOmega );
if( block != NULL )
if( block != nullptr )
{
const FlagField_T * const flagField = block->template getData< FlagField_T >( flagFieldId_ );
......@@ -2065,7 +2065,7 @@ void Evaluation< LatticeModel_T >::refresh()
if( alpha == 0 )
{
block = blocks->getBlock( setup_.pAlpha );
if( block != NULL )
if( block != nullptr )
{
const FlagField_T * const flagField = block->template getData< FlagField_T >( flagFieldId_ );
......@@ -2085,7 +2085,7 @@ void Evaluation< LatticeModel_T >::refresh()
if( omega == 0 )
{
block = blocks->getBlock( setup_.pOmega );
if( block != NULL )
if( block != nullptr )
{
const FlagField_T * const flagField = block->template getData< FlagField_T >( flagFieldId_ );
......@@ -2121,7 +2121,7 @@ void Evaluation< LatticeModel_T >::refresh()
int strouhal( 0 );
auto block = blocks->getBlock( setup_.pStrouhal );
if( block != NULL )
if( block != nullptr )
{
const FlagField_T * const flagField = block->template getData< FlagField_T >( flagFieldId_ );
......@@ -2181,7 +2181,7 @@ void Evaluation< LatticeModel_T >::evaluate( real_t & cDRealArea, real_t & cLRea
if( setup_.evaluatePressure )
{
auto block = blocks->getBlock( setup_.pAlpha );
if( block != NULL )
if( block != nullptr )
{
const PdfField_T * const pdfField = block->template getData< PdfField_T >( pdfFieldId_ );
const auto cell = blocks->getBlockLocalCell( *block, setup_.pAlpha );
......@@ -2190,7 +2190,7 @@ void Evaluation< LatticeModel_T >::evaluate( real_t & cDRealArea, real_t & cLRea
}
block = blocks->getBlock( setup_.pOmega );
if( block != NULL )
if( block != nullptr )
{
const PdfField_T * const pdfField = block->template getData< PdfField_T >( pdfFieldId_ );
const auto cell = blocks->getBlockLocalCell( *block, setup_.pOmega );
......@@ -3007,7 +3007,7 @@ int main( int argc, char **argv )
//WALBERLA_ROOT_SECTION() { logging::Logging::instance()->setLogLevel( logging::Logging::PROGRESS ); }
#ifdef _OPENMP
if( std::getenv( "OMP_NUM_THREADS" ) == NULL )
if( std::getenv( "OMP_NUM_THREADS" ) == nullptr )
WALBERLA_ABORT( "If you are using a version of the program that was compiled with OpenMP you have to "
"specify the environment variable \'OMP_NUM_THREADS\' accordingly!" );
#endif
......
......@@ -286,7 +286,7 @@ void createSetupBlockForest( blockforest::SetupBlockForest & sforest, const Conf
{
MPIManager::instance()->useWorldComm();
sforest.balanceLoad( blockforest::CartesianDistribution( numberOfXProcesses, numberOfYProcesses, numberOfZProcesses, NULL ),
sforest.balanceLoad( blockforest::CartesianDistribution( numberOfXProcesses, numberOfYProcesses, numberOfZProcesses, nullptr ),
numberOfXProcesses * numberOfYProcesses * numberOfZProcesses, real_t(0), 0, true );
}
......@@ -847,7 +847,7 @@ int main( int argc, char **argv )
//WALBERLA_ROOT_SECTION() { logging::Logging::instance()->setLogLevel( logging::Logging::PROGRESS ); }
#ifdef _OPENMP
if( std::getenv( "OMP_NUM_THREADS" ) == NULL )
if( std::getenv( "OMP_NUM_THREADS" ) == nullptr )
WALBERLA_ABORT( "If you are using a version of the benchmark that was compiled with OpenMP you have to "
"specify the environment variable \'OMP_NUM_THREADS\' accordingly!" );
#endif
......
......@@ -890,7 +890,7 @@ int main( int argc, char **argv ) {
// connect to pe
const real_t overlap = real_t(1.5) * dx;
auto syncCall = std::bind(pe::syncNextNeighbors<BodyTypeTuple>, std::ref(blocks->getBlockForest()),
bodyStorageID, static_cast<WcTimingTree *>(NULL), overlap, false);
bodyStorageID, static_cast<WcTimingTree *>(nullptr), overlap, false);
shared_ptr<CollisionPropertiesEvaluator> collisionPropertiesEvaluator = walberla::make_shared<CollisionPropertiesEvaluator>(*cr);
// create the spheres
......
......@@ -120,8 +120,8 @@ int main( int argc, char ** argv )
{
SphereID sp = createSphere( *globalBodyStorage, *forest, storageID, 0, *it, radius, material);
Vec3 rndVel(math::realRandom<real_t>(-vMax, vMax), math::realRandom<real_t>(-vMax, vMax), math::realRandom<real_t>(-vMax, vMax));
if (sp != NULL) sp->setLinearVel(rndVel);
if (sp != NULL) ++numParticles;
if (sp != nullptr) sp->setLinearVel(rndVel);
if (sp != nullptr) ++numParticles;
}
}
WALBERLA_LOG_INFO_ON_ROOT("#particles created: " << numParticles);
......
......@@ -66,7 +66,7 @@ int main( int argc, char ** argv )
WALBERLA_LOG_INFO_ON_ROOT("*** READING CONFIG FILE ***");
auto cfg = env.config();
if (cfg == NULL) WALBERLA_ABORT("No config specified!");
if (cfg == nullptr) WALBERLA_ABORT("No config specified!");
const Config::BlockHandle mainConf = cfg->getBlock( "ConfinedGasExtended" );
const std::string sqlFile = mainConf.getParameter< std::string >( "sqlFile", "ConfinedGas.sqlite" );
......@@ -164,10 +164,10 @@ int main( int argc, char ** argv )
std::function<void(void)> syncCallWithoutTT;
if (!syncShadowOwners)
{
syncCallWithoutTT = std::bind( pe::syncNextNeighbors<BodyTuple>, std::ref(*forest), storageID, static_cast<WcTimingTree*>(NULL), real_c(0.0), false );
syncCallWithoutTT = std::bind( pe::syncNextNeighbors<BodyTuple>, std::ref(*forest), storageID, static_cast<WcTimingTree*>(nullptr), real_c(0.0), false );
} else
{
syncCallWithoutTT = std::bind( pe::syncShadowOwners<BodyTuple>, std::ref(*forest), storageID, static_cast<WcTimingTree*>(NULL), real_c(0.0), false );
syncCallWithoutTT = std::bind( pe::syncShadowOwners<BodyTuple>, std::ref(*forest), storageID, static_cast<WcTimingTree*>(nullptr), real_c(0.0), false );
}
//! [Bind Sync Call]
......@@ -216,8 +216,8 @@ int main( int argc, char ** argv )
{
SphereID sp = pe::createSphere( *globalBodyStorage, *forest, storageID, 0, *it, radius, material);
Vec3 rndVel(math::realRandom<real_t>(-vMax, vMax), math::realRandom<real_t>(-vMax, vMax), math::realRandom<real_t>(-vMax, vMax));
if (sp != NULL) sp->setLinearVel(rndVel);
if (sp != NULL) ++numParticles;
if (sp != nullptr) sp->setLinearVel(rndVel);
if (sp != nullptr) ++numParticles;
}
}
mpi::reduceInplace(numParticles, mpi::SUM);
......
......@@ -164,7 +164,7 @@ bool BlockForest::BlockInformation::getId( BlockID & id, const real_t x, const r
const BlockForest::BlockInformation::Node * BlockForest::BlockInformation::getNode( const BlockID & id ) const
{
if( nodes_.empty() )
return NULL;
return nullptr;
const uint_t treeIdDigits = forest_.getTreeIdDigits();
......@@ -185,13 +185,13 @@ const BlockForest::BlockInformation::Node * BlockForest::BlockInformation::getNo
const uint_t index = blockId.getTreeIndex();
if( index >= nodes_.size() || !(nodes_[index]) )
return NULL;
return nullptr;
auto node = nodes_[index];
for( uint_t i = 0; i != levels; ++i ) {
if( node->children_.empty() )
return NULL;
return nullptr;
WALBERLA_ASSERT_NOT_NULLPTR( node->children_[ branchId[i] ] );
node = node->children_[ branchId[i] ];
}
......@@ -206,7 +206,7 @@ const BlockForest::BlockInformation::Node * BlockForest::BlockInformation::getNo
const AABB & domain = forest_.getDomain();
if( nodes_.empty() || !domain.contains(x,y,z) )
return NULL;
return nullptr;
const real_t rootBlockXSize = forest_.getRootBlockXSize();
const real_t rootBlockYSize = forest_.getRootBlockYSize();
......@@ -225,7 +225,7 @@ const BlockForest::BlockInformation::Node * BlockForest::BlockInformation::getNo
auto node = nodes_[index];
if( !node )
return NULL;
return nullptr;
AABB aabb = AABB::createFromMinMaxCorner( domain.xMin() + static_cast< real_t >( xi ) * rootBlockXSize,
domain.yMin() + static_cast< real_t >( yi ) * rootBlockYSize,
......@@ -647,7 +647,7 @@ void BlockForest::getBlockID( IBlockID& id, const real_t x, const real_t y, cons
}
else {
const Block* const block = getBlock(x,y,z);
if( block == NULL ) {
if( block == nullptr ) {
WALBERLA_ABORT( "Getting block ID failed: Locally, there exists no block at global location (" << x << "," << y << "," << z <<")!\n"
" (for simulation global information you have to explicitly construct the block forest to "
"contain global knowledge)");
......@@ -671,7 +671,7 @@ void BlockForest::getAABB( AABB& aabb, const IBlockID& id ) const {
}
else {
const Block* const block = getBlock( id );
if( block == NULL )
if( block == nullptr )
{
const BlockID& bid = *static_cast< const BlockID* >( &id );
aabb = getAABBFromBlockId( bid );
......@@ -696,7 +696,7 @@ void BlockForest::getState( Set<SUID>& state, const IBlockID& id ) const {
}
else {
const Block* const block = getBlock( id );
if( block == NULL ) {
if( block == nullptr ) {
WALBERLA_ABORT( "Getting block state failed: Locally, there exists no block with block ID \'" << id << "\'\n"
" (for simulation global information you have to explicitly construct "
"the block forest to contain global knowledge)" );
......@@ -718,7 +718,7 @@ void BlockForest::getProcessRank( uint_t& rank, const IBlockID& id ) const {
}
else {
const Block* const block = getBlock( id );
if( block == NULL ) {
if( block == nullptr ) {
WALBERLA_ABORT( "Getting block process rank failed: Locally, there exists no block with block ID \'" << id << "\'\n"
" (for simulation global information you have to explicitly construct "
"the block forest to contain global knowledge)" );
......@@ -750,7 +750,7 @@ void BlockForest::getRootBlockAABB( AABB& aabb, const uint_t x, const uint_t y,
}
else {
const Block* const block = getRootBlock(x,y,z);
if( block == NULL ) {
if( block == nullptr ) {
WALBERLA_ABORT( "Getting root block AABB failed: Locally, there exists no root block [" << x << "," << y << "," << z <<"]!\n"
" (for simulation global information you have to explicitly construct "
"the block forest to contain global knowledge)" );
......@@ -770,7 +770,7 @@ void BlockForest::getRootBlockState( Set<SUID>& state, const uint_t x, const uin
}
else {
const Block* const block = getRootBlock(x,y,z);
if( block == NULL ) {
if( block == nullptr ) {
WALBERLA_ABORT( "Getting root block state failed: Locally, there exists no root block [" << x << "," << y << "," << z <<"]!\n"
" (for simulation global information you have to explicitly construct "
"the block forest to contain global knowledge)" );
......@@ -790,7 +790,7 @@ void BlockForest::getRootBlockProcessRank( uint_t& rank, const uint_t x, const u
}
else {
const Block* const block = getRootBlock(x,y,z);
if( block == NULL ) {
if( block == nullptr ) {
WALBERLA_ABORT( "Getting root block process rank failed: Locally, there exists no root block [" << x << "," << y << "," << z <<"]!\n"
" (for simulation global information you have to explicitly construct "
"the block forest to contain global knowledge)" );
......@@ -1208,7 +1208,7 @@ void BlockForest::restoreSnapshot( const SnapshotRestorenFunction & processMappi
}
else
{
addBlockData( block, dataItem->getId(), NULL );
addBlockData( block, dataItem->getId(), nullptr );
}
}
}
......@@ -1419,7 +1419,7 @@ void BlockForest::constructBlockInformation( const SetupBlockForest & forest )
if( index.size() == 1 ) {
node->setChild( index.top(), make_shared< BlockInformation::Node >( block->getProcess(), block->getState() ) );
}
else if( index.top() >= node->children_.size() || node->children_[ index.top() ] == NULL ) {
else if( index.top() >= node->children_.size() || node->children_[ index.top() ] == nullptr ) {
node->setChild( index.top(), make_shared< BlockInformation::Node >() );
}
......@@ -1475,7 +1475,7 @@ void BlockForest::constructBlockInformation( const std::vector< BlockID > & ids,
if( index.size() == 1 ) {
node->setChild( index.top(), nodes[i] );
}
else if( index.top() >= node->children_.size() || node->children_[ index.top() ] == NULL ) {
else if( index.top() >= node->children_.size() || node->children_[ index.top() ] == nullptr ) {
node->setChild( index.top(), make_shared< BlockInformation::Node >() );
}
......@@ -2545,7 +2545,7 @@ void BlockForest::update( PhantomBlockForest & phantomForest )
{
auto & bufferPtrs = blocksToUnpack[ block ];
if( bufferPtrs.empty() )
bufferPtrs.resize( uint_t(8), std::make_pair( Set<SUID>::emptySet(), static_cast< mpi::RecvBuffer * >(NULL) ) );
bufferPtrs.resize( uint_t(8), std::make_pair( Set<SUID>::emptySet(), static_cast< mpi::RecvBuffer * >(nullptr) ) );
WALBERLA_ASSERT_EQUAL( sId.getUsedBits(), rId.getUsedBits() + uint_t(3) );
bufferPtrs[ sId.getBranchId() ] = std::make_pair( state, &(*buffer) );
}
......@@ -2627,7 +2627,7 @@ void BlockForest::update( PhantomBlockForest & phantomForest )
if( blockDataHandlingWrapper )
addBlockData( block, dataItem->getId(), blockDataHandlingWrapper->deserialize( block ) );
else
addBlockData( block, dataItem->getId(), NULL );
addBlockData( block, dataItem->getId(), nullptr );
}
// fill with sent data
{
......@@ -2664,7 +2664,7 @@ void BlockForest::update( PhantomBlockForest & phantomForest )
addBlockData( block, dataItem->getId(), downcastBlockDataHandlingWrapper->deserializeCoarseToFine( block ) );
}
else
addBlockData( block, dataItem->getId(), NULL );
addBlockData( block, dataItem->getId(), nullptr );
}
// fill with sent data
{
......@@ -2712,7 +2712,7 @@ void BlockForest::update( PhantomBlockForest & phantomForest )
addBlockData( block, dataItem->getId(), downcastBlockDataHandlingWrapper->deserializeFineToCoarse( block ) );
}
else
addBlockData( block, dataItem->getId(), NULL );
addBlockData( block, dataItem->getId(), nullptr );
}
// fill with sent data
for( uint_t c = uint_t(0); c != uint_t(8); ++c )
......
......@@ -220,7 +220,7 @@ createBlockForest( const AABB& domainAABB,
// if possible, create Cartesian MPI communicator
std::vector< uint_t >* processIdMap = NULL;
std::vector< uint_t >* processIdMap = nullptr;
WALBERLA_MPI_SECTION()
{
......@@ -249,7 +249,7 @@ createBlockForest( const AABB& domainAABB,
sforest.balanceLoad( blockforest::CartesianDistribution( numberOfXProcesses, numberOfYProcesses, numberOfZProcesses, processIdMap ),
numberOfXProcesses * numberOfYProcesses * numberOfZProcesses );
if( processIdMap != NULL ) delete processIdMap;
if( processIdMap != nullptr ) delete processIdMap;
// create StructuredBlockForest (encapsulates a newly created BlockForest)
......
......@@ -73,7 +73,7 @@ uint_t SetupBlockForest::getNumberOfBlocks( const uint_t level ) const
for( uint_t i = 0; i != forest_.size(); ++i ) {
if( forest_[i] == NULL )
if( forest_[i] == nullptr )
continue;
std::stack< SetupBlock* > stack;
......@@ -103,12 +103,12 @@ uint_t SetupBlockForest::getNumberOfBlocks( const uint_t level ) const
const SetupBlock* SetupBlockForest::getFirstBlock() const {
SetupBlock* block = NULL;
for( uint_t i = 0; i != forest_.size() && block == NULL; ++i )
SetupBlock* block = nullptr;
for( uint_t i = 0; i != forest_.size() && block == nullptr; ++i )
block = forest_[i];
if( block == NULL )
return NULL;
if( block == nullptr )
return nullptr;
while( block->hasChildren() )
block = block->getChild(0);
......@@ -120,12 +120,12 @@ const SetupBlock* SetupBlockForest::getFirstBlock() const {
SetupBlock* SetupBlockForest::getFirstBlock() {
SetupBlock* block = NULL;
for( uint_t i = 0; i != forest_.size() && block == NULL; ++i )
SetupBlock* block = nullptr;
for( uint_t i = 0; i != forest_.size() && block == nullptr; ++i )
block = forest_[i];
if( block == NULL )
return NULL;
if( block == nullptr )
return nullptr;
while( block->hasChildren() )
block = block->getChild(0);
......@@ -137,8 +137,8 @@ SetupBlock* SetupBlockForest::getFirstBlock() {
const SetupBlock* SetupBlockForest::getNextBlock( const SetupBlock* block ) const {
if( block == NULL )
return NULL;
if( block == nullptr )
return nullptr;
// ASCEND
......@@ -162,10 +162,10 @@ const SetupBlock* SetupBlockForest::getNextBlock( const SetupBlock* block ) cons
WALBERLA_ASSERT_LESS( treeIndex-1 ,forest_.size() );
WALBERLA_ASSERT_EQUAL( block, forest_[ treeIndex-1 ] );
while( treeIndex < forest_.size() && forest_[ treeIndex ] == NULL ) ++treeIndex;
while( treeIndex < forest_.size() && forest_[ treeIndex ] == nullptr ) ++treeIndex;
if( treeIndex == forest_.size() )
return NULL;
return nullptr;
block = forest_[ treeIndex ];
}
......@@ -184,8 +184,8 @@ const SetupBlock* SetupBlockForest::getNextBlock( const SetupBlock* block ) cons
SetupBlock* SetupBlockForest::getNextBlock( const SetupBlock* block ) {
if( block == NULL )
return NULL;
if( block == nullptr )
return nullptr;
// ASCEND
......@@ -209,10 +209,10 @@ SetupBlock* SetupBlockForest::getNextBlock( const SetupBlock* block ) {
WALBERLA_ASSERT_LESS( treeIndex-1, forest_.size() );
WALBERLA_ASSERT_EQUAL( block, forest_[ treeIndex-1 ] );
while( treeIndex < forest_.size() && forest_[ treeIndex ] == NULL ) ++treeIndex;
while( treeIndex < forest_.size() && forest_[ treeIndex ] == nullptr ) ++treeIndex;
if( treeIndex == forest_.size() )
return NULL;
return nullptr;
block = forest_[ treeIndex ];
}
......@@ -269,7 +269,7 @@ void SetupBlockForest::getBlocks( std::vector< const SetupBlock* >& blocks ) con
for( uint_t i = 0; i != forest_.size(); ++i ) {
if( forest_[i] == NULL )
if( forest_[i] == nullptr )
continue;
// depth-first search
......@@ -302,7 +302,7 @@ void SetupBlockForest::getBlocks( std::vector< SetupBlock* >& blocks ) {
for( uint_t i = 0; i != forest_.size(); ++i ) {
if( forest_[i] == NULL )
if( forest_[i] == nullptr )
continue;
// depth-first search
......@@ -335,7 +335,7 @@ void SetupBlockForest: