From 2d663b748e9e1b86f4ea32009b9e7c772c279e15 Mon Sep 17 00:00:00 2001
From: Sebastian Eibl <sebastian.eibl@fau.de>
Date: Fri, 3 Aug 2018 10:57:22 +0200
Subject: [PATCH] clang-tidy -checks=-*,modernize-make-shared

---
 apps/benchmarks/CouetteFlow/CouetteFlow.cpp   |  9 +++++----
 .../NonUniformGrid/NonUniformGrid.cpp         | 13 +++++++------
 .../PoiseuilleChannel/PoiseuilleChannel.cpp   |  9 +++++----
 .../SchaeferTurek/SchaeferTurek.cpp           |  9 +++++----
 apps/benchmarks/UniformGrid/UniformGrid.cpp   |  7 ++++---
 src/blockforest/BlockForest.cpp               |  9 +++++----
 src/blockforest/Initialization.cpp            | 13 +++++++------
 src/blockforest/PhantomBlockForest.cpp        | 13 +++++++------
 src/core/math/equation_system/Equation.cpp    |  5 +++--
 .../math/equation_system/EquationParser.cpp   | 19 ++++++++++---------
 src/geometry/bodies/BodyFromConfig.cpp        | 14 ++++++++------
 tests/blockforest/SaveLoadTest.cpp            |  4 +++-
 .../timing/SweepTimeloopTimerReduction.cpp    |  4 ++--
 tests/geometry/ScalarFieldFromBodyTest.cpp    |  5 +++--
 .../ScalarFieldFromGrayScaleImageTest.cpp     |  5 +++--
 .../SegreSilberbergPSM.cpp                    |  5 +++--
 16 files changed, 80 insertions(+), 63 deletions(-)

diff --git a/apps/benchmarks/CouetteFlow/CouetteFlow.cpp b/apps/benchmarks/CouetteFlow/CouetteFlow.cpp
index 979a211d0..48fe122e9 100644
--- a/apps/benchmarks/CouetteFlow/CouetteFlow.cpp
+++ b/apps/benchmarks/CouetteFlow/CouetteFlow.cpp
@@ -100,6 +100,7 @@
 #include <cstring>
 #include <functional>
 #include <iostream>
+#include <memory>
 #include <utility>
 #include <vector>
 
@@ -334,9 +335,9 @@ shared_ptr< blockforest::StructuredBlockForest > createStructuredBlockForest( co
 
       MPIManager::instance()->useWorldComm();
 
-      auto bf = shared_ptr< BlockForest >( new BlockForest( uint_c( MPIManager::instance()->rank() ), sbffile.c_str(), true, false ) );
+      auto bf = std::make_shared< BlockForest >( uint_c( MPIManager::instance()->rank() ), sbffile.c_str(), true, false );
 
-      auto sbf = shared_ptr< StructuredBlockForest >( new StructuredBlockForest( bf, setup.xCells, setup.yCells, setup.zCells ) );
+      auto sbf = std::make_shared< StructuredBlockForest >( bf, setup.xCells, setup.yCells, setup.zCells );
       sbf->createCellBoundingBoxes();
 
       return sbf;
@@ -349,9 +350,9 @@ shared_ptr< blockforest::StructuredBlockForest > createStructuredBlockForest( co
                                                                     memoryPerCell, processMemoryLimit,
                                                                     configBlock.getParameter< bool >( "outputSetupForest", false ) );
 
-   auto bf = shared_ptr< blockforest::BlockForest >( new blockforest::BlockForest( uint_c( MPIManager::instance()->rank() ), *sforest, false ) );
+   auto bf = std::make_shared< blockforest::BlockForest >( uint_c( MPIManager::instance()->rank() ), *sforest, false );
 
-   auto sbf = shared_ptr< blockforest::StructuredBlockForest >( new blockforest::StructuredBlockForest( bf, setup.xCells, setup.yCells, setup.zCells ) );
+   auto sbf = std::make_shared< blockforest::StructuredBlockForest >( bf, setup.xCells, setup.yCells, setup.zCells );
    sbf->createCellBoundingBoxes();
    
    return sbf;
diff --git a/apps/benchmarks/NonUniformGrid/NonUniformGrid.cpp b/apps/benchmarks/NonUniformGrid/NonUniformGrid.cpp
index d427399bf..9bfa2c771 100644
--- a/apps/benchmarks/NonUniformGrid/NonUniformGrid.cpp
+++ b/apps/benchmarks/NonUniformGrid/NonUniformGrid.cpp
@@ -78,6 +78,7 @@
 #include <cstdlib>
 #include <functional>
 #include <iostream>
+#include <memory>
 
 
 
@@ -322,11 +323,11 @@ shared_ptr< blockforest::StructuredBlockForest > createStructuredBlockForest( co
 
       MPIManager::instance()->useWorldComm();
 
-      auto bf = shared_ptr< BlockForest >( new BlockForest( uint_c( MPIManager::instance()->rank() ), sbffile.c_str(), true, false ) );
+      auto bf = std::make_shared< BlockForest >( uint_c( MPIManager::instance()->rank() ), sbffile.c_str(), true, false );
 
-      auto sbf = shared_ptr< StructuredBlockForest >( new StructuredBlockForest( bf, numberOfXCellsPerBlock,
+      auto sbf = std::make_shared< StructuredBlockForest >( bf, numberOfXCellsPerBlock,
                                                                                      numberOfYCellsPerBlock,
-                                                                                     numberOfZCellsPerBlock ) );
+                                                                                     numberOfZCellsPerBlock );
       sbf->createCellBoundingBoxes();
 
       return sbf;
@@ -337,11 +338,11 @@ shared_ptr< blockforest::StructuredBlockForest > createStructuredBlockForest( co
    blockforest::SetupBlockForest sforest;
    createSetupBlockForest( sforest, configBlock, uint_c( MPIManager::instance()->numProcesses() ) );
 
-   auto bf = shared_ptr< blockforest::BlockForest >( new blockforest::BlockForest( uint_c( MPIManager::instance()->rank() ), sforest, false ) );
+   auto bf = std::make_shared< blockforest::BlockForest >( uint_c( MPIManager::instance()->rank() ), sforest, false );
 
-   auto sbf = shared_ptr< blockforest::StructuredBlockForest >( new blockforest::StructuredBlockForest( bf, numberOfXCellsPerBlock,
+   auto sbf = std::make_shared< blockforest::StructuredBlockForest >( bf, numberOfXCellsPerBlock,
                                                                                                             numberOfYCellsPerBlock,
-                                                                                                            numberOfZCellsPerBlock ) );
+                                                                                                            numberOfZCellsPerBlock );
    sbf->createCellBoundingBoxes();
 
    return sbf;
diff --git a/apps/benchmarks/PoiseuilleChannel/PoiseuilleChannel.cpp b/apps/benchmarks/PoiseuilleChannel/PoiseuilleChannel.cpp
index 2e31d6064..5b1938bf4 100644
--- a/apps/benchmarks/PoiseuilleChannel/PoiseuilleChannel.cpp
+++ b/apps/benchmarks/PoiseuilleChannel/PoiseuilleChannel.cpp
@@ -94,6 +94,7 @@
 #include <cstring>
 #include <functional>
 #include <iostream>
+#include <memory>
 #include <utility>
 #include <vector>
 
@@ -342,9 +343,9 @@ shared_ptr< blockforest::StructuredBlockForest > createStructuredBlockForest( co
 
       MPIManager::instance()->useWorldComm();
 
-      auto bf = shared_ptr< BlockForest >( new BlockForest( uint_c( MPIManager::instance()->rank() ), sbffile.c_str(), true, false ) );
+      auto bf = std::make_shared< BlockForest >( uint_c( MPIManager::instance()->rank() ), sbffile.c_str(), true, false );
 
-      auto sbf = shared_ptr< StructuredBlockForest >( new StructuredBlockForest( bf, setup.xCells, setup.yCells, setup.zCells ) );
+      auto sbf = std::make_shared< StructuredBlockForest >( bf, setup.xCells, setup.yCells, setup.zCells );
       sbf->createCellBoundingBoxes();
 
       return sbf;
@@ -357,9 +358,9 @@ shared_ptr< blockforest::StructuredBlockForest > createStructuredBlockForest( co
                                                                     memoryPerCell, processMemoryLimit,
                                                                     configBlock.getParameter< bool >( "outputSetupForest", false ) );
 
-   auto bf = shared_ptr< blockforest::BlockForest >( new blockforest::BlockForest( uint_c( MPIManager::instance()->rank() ), *sforest, false ) );
+   auto bf = std::make_shared< blockforest::BlockForest >( uint_c( MPIManager::instance()->rank() ), *sforest, false );
 
-   auto sbf = shared_ptr< blockforest::StructuredBlockForest >( new blockforest::StructuredBlockForest( bf, setup.xCells, setup.yCells, setup.zCells ) );
+   auto sbf = std::make_shared< blockforest::StructuredBlockForest >( bf, setup.xCells, setup.yCells, setup.zCells );
    sbf->createCellBoundingBoxes();
    
    return sbf;
diff --git a/apps/benchmarks/SchaeferTurek/SchaeferTurek.cpp b/apps/benchmarks/SchaeferTurek/SchaeferTurek.cpp
index 714e7d1a9..648f6834a 100644
--- a/apps/benchmarks/SchaeferTurek/SchaeferTurek.cpp
+++ b/apps/benchmarks/SchaeferTurek/SchaeferTurek.cpp
@@ -113,6 +113,7 @@
 #include <cstring>
 #include <functional>
 #include <iostream>
+#include <memory>
 #include <utility>
 #include <vector>
 
@@ -695,9 +696,9 @@ shared_ptr< blockforest::StructuredBlockForest > createStructuredBlockForest( co
 
       MPIManager::instance()->useWorldComm();
 
-      auto bf = shared_ptr< BlockForest >( new BlockForest( uint_c( MPIManager::instance()->rank() ), sbffile.c_str(), true, false ) );
+      auto bf = std::make_shared< BlockForest >( uint_c( MPIManager::instance()->rank() ), sbffile.c_str(), true, false );
 
-      auto sbf = shared_ptr< StructuredBlockForest >( new StructuredBlockForest( bf, setup.xCells, setup.yzCells, setup.pseudo2D ? uint_t(1) : setup.yzCells ) );
+      auto sbf = std::make_shared< StructuredBlockForest >( bf, setup.xCells, setup.yzCells, setup.pseudo2D ? uint_t(1) : setup.yzCells );
       sbf->createCellBoundingBoxes();
 
       return sbf;
@@ -710,9 +711,9 @@ shared_ptr< blockforest::StructuredBlockForest > createStructuredBlockForest( co
                                                                     memoryPerCell, processMemoryLimit,
                                                                     configBlock.getParameter< bool >( "outputSetupForest", false ) );
 
-   auto bf = shared_ptr< blockforest::BlockForest >( new blockforest::BlockForest( uint_c( MPIManager::instance()->rank() ), *sforest, false ) );
+   auto bf = std::make_shared< blockforest::BlockForest >( uint_c( MPIManager::instance()->rank() ), *sforest, false );
 
-   auto sbf = shared_ptr< blockforest::StructuredBlockForest >( new blockforest::StructuredBlockForest( bf, setup.xCells, setup.yzCells, setup.pseudo2D ? uint_t(1) : setup.yzCells ) );
+   auto sbf = std::make_shared< blockforest::StructuredBlockForest >( bf, setup.xCells, setup.yzCells, setup.pseudo2D ? uint_t(1) : setup.yzCells );
    sbf->createCellBoundingBoxes();
    
    return sbf;
diff --git a/apps/benchmarks/UniformGrid/UniformGrid.cpp b/apps/benchmarks/UniformGrid/UniformGrid.cpp
index d3be97872..0f389f121 100644
--- a/apps/benchmarks/UniformGrid/UniformGrid.cpp
+++ b/apps/benchmarks/UniformGrid/UniformGrid.cpp
@@ -83,6 +83,7 @@
 
 #include <cstdlib>
 #include <iostream>
+#include <memory>
 
 
 
@@ -316,11 +317,11 @@ shared_ptr< blockforest::StructuredBlockForest > createStructuredBlockForest( co
    blockforest::SetupBlockForest sforest;
    createSetupBlockForest( sforest, configBlock, uint_c( MPIManager::instance()->numProcesses() ), blocksPerProcess );
 
-   auto bf = shared_ptr< blockforest::BlockForest >( new blockforest::BlockForest( uint_c( MPIManager::instance()->rank() ), sforest, false ) );
+   auto bf = std::make_shared< blockforest::BlockForest >( uint_c( MPIManager::instance()->rank() ), sforest, false );
 
-   auto sbf = shared_ptr< blockforest::StructuredBlockForest >( new blockforest::StructuredBlockForest( bf, numberOfXCellsPerBlock,
+   auto sbf = std::make_shared< blockforest::StructuredBlockForest >( bf, numberOfXCellsPerBlock,
                                                                                                             numberOfYCellsPerBlock,
-                                                                                                            numberOfZCellsPerBlock ) );
+                                                                                                            numberOfZCellsPerBlock );
    sbf->createCellBoundingBoxes();
 
    return sbf;
diff --git a/src/blockforest/BlockForest.cpp b/src/blockforest/BlockForest.cpp
index e13ff9706..9b16b57bb 100644
--- a/src/blockforest/BlockForest.cpp
+++ b/src/blockforest/BlockForest.cpp
@@ -33,6 +33,7 @@
 #include "core/mpi/MPIManager.h"
 
 #include <fstream>
+#include <memory>
 #include <set>
 #include <stack>
 #include <utility>
@@ -296,7 +297,7 @@ BlockForest::BlockForest( const uint_t process, const SetupBlockForest& forest,
 
          WALBERLA_ASSERT( blocks_.find( blocks[i]->getId() ) == blocks_.end() );
 
-         blocks_[ blocks[i]->getId() ] = shared_ptr< Block >( new Block( *this, blocks[i] ) );
+         blocks_[ blocks[i]->getId() ] = std::make_shared< Block >( *this, blocks[i] );
 
          for( uint_t j = 0; j != blocks[i]->getNeighborhoodSize(); ++j )
             if( blocks[i]->getNeighbor(j)->getProcess() != process )
@@ -595,7 +596,7 @@ BlockForest::BlockForest( const uint_t process, const char* const filename, cons
          AABB aabb;
          const uint_t level = aabbReconstruction( aabb, id );
 
-         auto block = shared_ptr< Block >( new Block( *this, id, aabb, state, level, neighborhoodReconstruction, neighbors ) );
+         auto block = std::make_shared< Block >( *this, id, aabb, state, level, neighborhoodReconstruction, neighbors );
 
          blocks_[ id ] = block;
       }
@@ -1195,7 +1196,7 @@ void BlockForest::restoreSnapshot( const SnapshotRestorenFunction & processMappi
             const uint_t level = getAABBFromBlockId( aabb, id );
 
             WALBERLA_ASSERT( blocks_.find( id ) == blocks_.end() );
-            blocks_[ id ] = shared_ptr< Block >( new Block( *this, id, aabb, level, buffer, processMapping ) );
+            blocks_[ id ] = std::make_shared< Block >( *this, id, aabb, level, buffer, processMapping );
 
             Block * block = blocks_[ id ].get();
             for( auto dataItem = blockDataItem_.begin(); dataItem != blockDataItem_.end(); ++dataItem )
@@ -2390,7 +2391,7 @@ void BlockForest::update( PhantomBlockForest & phantomForest )
       if( pBlock->getSourceLevel() != pBlock->getLevel() || pBlock->getSourceProcess()[0] != process_ )
       {
          WALBERLA_ASSERT( blocks_.find( pBlock->getId() ) == blocks_.end() );
-         blocks_[ pBlock->getId() ] = shared_ptr< Block >( new Block( *this, *pBlock ) );
+         blocks_[ pBlock->getId() ] = std::make_shared< Block >( *this, *pBlock );
       }
       else // update neighborhood of existing blocks
       {
diff --git a/src/blockforest/Initialization.cpp b/src/blockforest/Initialization.cpp
index 5e3f7cfd2..acb638acc 100644
--- a/src/blockforest/Initialization.cpp
+++ b/src/blockforest/Initialization.cpp
@@ -32,6 +32,7 @@
 #include "stencil/D3Q19.h"
 
 #include <functional>
+#include <memory>
 
 namespace walberla {
 namespace blockforest {
@@ -253,7 +254,7 @@ createBlockForest(      const AABB& domainAABB,
 
    // create StructuredBlockForest (encapsulates a newly created BlockForest)
 
-   return shared_ptr< BlockForest >( new BlockForest( uint_c( MPIManager::instance()->rank() ), sforest, keepGlobalBlockInformation ) );
+   return std::make_shared< BlockForest >( uint_c( MPIManager::instance()->rank() ), sforest, keepGlobalBlockInformation );
 }
 
 
@@ -306,7 +307,7 @@ createUniformBlockGrid( const AABB& domainAABB,
             zPeriodic,
             keepGlobalBlockInformation);
 
-   auto sbf = shared_ptr< StructuredBlockForest >( new StructuredBlockForest( bf, numberOfXCellsPerBlock, numberOfYCellsPerBlock, numberOfZCellsPerBlock ) );
+   auto sbf = std::make_shared< StructuredBlockForest >( bf, numberOfXCellsPerBlock, numberOfYCellsPerBlock, numberOfZCellsPerBlock );
    sbf->createCellBoundingBoxes();
 
    return sbf;
@@ -514,9 +515,9 @@ createUniformBlockGrid( const AABB& domainAABB,
 
    // create StructuredBlockForest (encapsulates a newly created BlockForest)
 
-   auto bf = shared_ptr< BlockForest >( new BlockForest( uint_c( MPIManager::instance()->rank() ), sforest, keepGlobalBlockInformation ) );
+   auto bf = std::make_shared< BlockForest >( uint_c( MPIManager::instance()->rank() ), sforest, keepGlobalBlockInformation );
 
-   auto sbf = shared_ptr< StructuredBlockForest >( new StructuredBlockForest( bf, numberOfXCellsPerBlock, numberOfYCellsPerBlock, numberOfZCellsPerBlock ) );
+   auto sbf = std::make_shared< StructuredBlockForest >( bf, numberOfXCellsPerBlock, numberOfYCellsPerBlock, numberOfZCellsPerBlock );
    sbf->createCellBoundingBoxes();
 
    return sbf;
@@ -600,12 +601,12 @@ createUniformBlockGrid( const std::string& filename,
    if( !MPIManager::instance()->rankValid() )
       MPIManager::instance()->useWorldComm();
 
-   auto bf = shared_ptr< BlockForest >( new BlockForest( uint_c( MPIManager::instance()->rank() ), filename.c_str(), true, keepGlobalBlockInformation ) );
+   auto bf = std::make_shared< BlockForest >( uint_c( MPIManager::instance()->rank() ), filename.c_str(), true, keepGlobalBlockInformation );
 
    if( !bf->storesUniformBlockGrid() )
       WALBERLA_ABORT( "The block forest loaded from file \'" << filename << "\' does not contain a uniform block grid!" );
 
-   auto sbf = shared_ptr< StructuredBlockForest >( new StructuredBlockForest( bf, numberOfXCellsPerBlock, numberOfYCellsPerBlock, numberOfZCellsPerBlock ) );
+   auto sbf = std::make_shared< StructuredBlockForest >( bf, numberOfXCellsPerBlock, numberOfYCellsPerBlock, numberOfZCellsPerBlock );
    sbf->createCellBoundingBoxes();
 
    return sbf;
diff --git a/src/blockforest/PhantomBlockForest.cpp b/src/blockforest/PhantomBlockForest.cpp
index 196ba5529..68a8e1a70 100644
--- a/src/blockforest/PhantomBlockForest.cpp
+++ b/src/blockforest/PhantomBlockForest.cpp
@@ -31,6 +31,7 @@
 #include "core/mpi/MPIManager.h"
 #include "core/mpi/Reduce.h"
 
+#include <memory>
 #include <set>
 
 
@@ -77,8 +78,8 @@ void PhantomBlockForest::initialize( const BlockStateDeterminationFunction & fun
       {
          auto cstate = function ? function( std::vector< std::pair< BlockID, Set<SUID> > >( 1, std::make_pair( id, state ) ), id ) : state;
 
-         auto phantom = shared_ptr< PhantomBlock >( new PhantomBlock( *this, id, cstate, aabb, targetLevel, level,
-                                                                      std::vector< uint_t >( uint_t(1), process ), process ) );
+         auto phantom = std::make_shared< PhantomBlock >( *this, id, cstate, aabb, targetLevel, level,
+                                                                      std::vector< uint_t >( uint_t(1), process ), process );
          blocks_[ phantom->getId() ] = phantom;
 
          block->addTargetProcess( process );
@@ -106,8 +107,8 @@ void PhantomBlockForest::initialize( const BlockStateDeterminationFunction & fun
                         ( ( c & 2 ) ? aabb.yMax() : yMid ),
                         ( ( c & 4 ) ? aabb.zMax() : zMid ) );
 
-            auto phantom = shared_ptr< PhantomBlock >( new PhantomBlock( *this, cid, cstate, caabb, targetLevel, level,
-                                                                         std::vector< uint_t >( uint_t(1), process ), process ) );
+            auto phantom = std::make_shared< PhantomBlock >( *this, cid, cstate, caabb, targetLevel, level,
+                                                                         std::vector< uint_t >( uint_t(1), process ), process );
             blocks_[ phantom->getId() ] = phantom;
 
             block->addTargetProcess( process );
@@ -146,7 +147,7 @@ void PhantomBlockForest::initialize( const BlockStateDeterminationFunction & fun
                                                                        sourceStates[3].second + sourceStates[4].second + sourceStates[5].second +
                                                                        sourceStates[6].second + sourceStates[7].second );
 
-            auto phantom = shared_ptr< PhantomBlock >( new PhantomBlock( *this, fid, cstate, faabb, targetLevel, level, sourceProcesses, process ) );
+            auto phantom = std::make_shared< PhantomBlock >( *this, fid, cstate, faabb, targetLevel, level, sourceProcesses, process );
             blocks_[ phantom->getId() ] = phantom;
 
             block->addTargetProcess( process );
@@ -465,7 +466,7 @@ void PhantomBlockForest::migrate( const PhantomBlockDataPackFunction & packBlock
             ++sourceLevel;
          }
 
-         auto phantom = shared_ptr< PhantomBlock >( new PhantomBlock( *this, id, state, aabb, level, sourceLevel, sp, process ) );
+         auto phantom = std::make_shared< PhantomBlock >( *this, id, state, aabb, level, sourceLevel, sp, process );
          blocks_[ id ] = phantom;
 
          phantom->clearNeighborhood();
diff --git a/src/core/math/equation_system/Equation.cpp b/src/core/math/equation_system/Equation.cpp
index 53bef41aa..cad85e10e 100644
--- a/src/core/math/equation_system/Equation.cpp
+++ b/src/core/math/equation_system/Equation.cpp
@@ -25,6 +25,7 @@
 
 #include <cmath>
 #include <algorithm>
+#include <memory>
 
 
 namespace walberla {
@@ -201,7 +202,7 @@ namespace math {
    void Equation::rotate(bool flip, OpType& leftOp, OpType& rightOp){
       NodePtr newNode;
       if ( root_->left_->nodeDir_ == ND_LEFT ){
-         newNode = NodePtr( new Node( leftOp ) );
+         newNode = std::make_shared<Node>( leftOp );
          if (flip){
             newNode->left_  = root_->left_->right_;
             newNode->right_ = root_->right_;
@@ -211,7 +212,7 @@ namespace math {
          }
          root_->left_ = root_->left_->left_;
       } else {
-         newNode = NodePtr( new Node( rightOp ) );
+         newNode = std::make_shared<Node>( rightOp );
          if (flip){
             newNode->right_ = root_->left_->left_;
             newNode->left_  = root_->right_;
diff --git a/src/core/math/equation_system/EquationParser.cpp b/src/core/math/equation_system/EquationParser.cpp
index 6f4b379b6..9f03f55e7 100644
--- a/src/core/math/equation_system/EquationParser.cpp
+++ b/src/core/math/equation_system/EquationParser.cpp
@@ -26,6 +26,7 @@
 
 #include <boost/algorithm/string/trim.hpp>
 #include <boost/lexical_cast.hpp>
+#include <memory>
 
 
 #define E_VAL 2.71828182845904523536
@@ -75,7 +76,7 @@ NodePtr EquationParser::parseNumber( const std::string& str, size_t& index ) con
       value = boost::lexical_cast< double >( str.substr(start, index-start) );
    }
 
-   return NodePtr ( new Node(value) );
+   return std::make_shared<Node>( value );
 }
 
 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -127,7 +128,7 @@ NodePtr EquationParser::parseVariable( const std::string& str, size_t& index ) c
    if ( es_.varMap_.find(name) != es_.varMap_.end() ){
       varPtr = es_.varMap_[name];
    } else {
-      varPtr = VarPtr( new Var ( name ) );
+      varPtr = std::make_shared<Var>( name );
       es_.varMap_[name] = varPtr;
    }
 
@@ -177,19 +178,19 @@ NodePtr EquationParser::parseFunction( const std::string& str, size_t& index ) c
    switch(opFunc)
    {
    case OP_FUNC_EXP:
-      funcPtr = NodePtr( new Node( OP_PROD ) );
-      funcPtr->left()  = NodePtr( new Node( E_VAL  ) );
+      funcPtr = std::make_shared<Node>( OP_PROD );
+      funcPtr->left()  = std::make_shared<Node>( E_VAL  );
       funcPtr->right() = nodePtr;
       return funcPtr;
    case OP_FUNC_LN:
-      funcPtr = NodePtr( new Node( OP_LOG ) );
-      funcPtr->right() = NodePtr( new Node( E_VAL  ) );
+      funcPtr = std::make_shared<Node>( OP_LOG );
+      funcPtr->right() = std::make_shared<Node>( E_VAL  );
       funcPtr->left()  = nodePtr;
       return funcPtr;
    case OP_FUNC_SQRT:
-      funcPtr = NodePtr( new Node( OP_PROD ) );
+      funcPtr = std::make_shared<Node>( OP_PROD );
       funcPtr->left()  = nodePtr;
-      funcPtr->right() = NodePtr( new Node( 0.5 ) );
+      funcPtr->right() = std::make_shared<Node>( 0.5 );
       return funcPtr;
    default:
       WALBERLA_ABORT( "Function not yet defined" );
@@ -327,7 +328,7 @@ EquationPtr EquationParser::parseEquation( const std::string& str, size_t& index
    nodePtr->left()  = leftPtr;
    nodePtr->right() = rightPtr;
 
-   return EquationPtr ( new Equation(nodePtr) );
+   return std::make_shared<Equation>( nodePtr );
 }
 
 } // namespace math
diff --git a/src/geometry/bodies/BodyFromConfig.cpp b/src/geometry/bodies/BodyFromConfig.cpp
index 6ad56cfa8..0b9d1947c 100644
--- a/src/geometry/bodies/BodyFromConfig.cpp
+++ b/src/geometry/bodies/BodyFromConfig.cpp
@@ -20,6 +20,8 @@
 //======================================================================================================================
 
 #include "BodyFromConfig.h"
+
+#include <memory>
 #include "core/Abort.h"
 
 
@@ -107,8 +109,8 @@ BodyLogicalAND<Sphere,AABB> sphereSliceFromConfig ( const Config::BlockHandle &
 {
    Sphere sphere = sphereFromConfig(block.getOneBlock("Sphere"));
    AABB box = AABBFromConfig  (block.getOneBlock("Box"));
-   auto spherePtr = shared_ptr<Sphere>( new Sphere(sphere) );
-   auto boxPtr    = shared_ptr<AABB>  ( new AABB(box) );
+   auto spherePtr = std::make_shared<Sphere>( sphere );
+   auto boxPtr    = std::make_shared<AABB>  ( box );
    
    return BodyLogicalAND<Sphere,AABB>(spherePtr, boxPtr);
 }
@@ -122,10 +124,10 @@ BodyLogicalAND<Sphere,BodyLogicalNOT<Sphere> > hollowSphereFromConfig ( const Co
    if ( ! block.isDefined( "outer_radius" ) )
       WALBERLA_ABORT( "Missing parameter 'outer_radius' for sphere defined in block " << block.getKey() );
 
-   auto inner     = shared_ptr<Sphere>(  new Sphere( block.getParameter<Vector3<real_t> > ( "midpoint" ),
-                  							              block.getParameter<real_t          > ( "inner_radius"   ) ) );
-   auto outer     = shared_ptr<Sphere>(  new Sphere ( block.getParameter<Vector3<real_t> > ( "midpoint" ),
-                  			                           block.getParameter<real_t          > ( "outer_radius"   ) ) );
+   auto inner     = std::make_shared<Sphere>(  block.getParameter<Vector3<real_t> > ( "midpoint" ),
+                  							              block.getParameter<real_t          > ( "inner_radius"   ) );
+   auto outer     = std::make_shared<Sphere>(  block.getParameter<Vector3<real_t> > ( "midpoint" ),
+                  			                           block.getParameter<real_t          > ( "outer_radius"   ) );
 
    auto not_inner = make_shared<BodyLogicalNOT<Sphere> >(inner);
 	
diff --git a/tests/blockforest/SaveLoadTest.cpp b/tests/blockforest/SaveLoadTest.cpp
index 677d7531c..12e41b44a 100644
--- a/tests/blockforest/SaveLoadTest.cpp
+++ b/tests/blockforest/SaveLoadTest.cpp
@@ -19,6 +19,8 @@
 //======================================================================================================================
 
 
+#include <memory>
+
 #include "blockforest/all.h"
 #include "core/all.h"
 #include "core/math/IntegerFactorization.h"
@@ -58,7 +60,7 @@ void blockForestSaveLoadTest(const BlockForest::FileIOMode ioMode, const bool br
 
    check.clear();
 
-   auto forestCheck = shared_ptr< BlockForest >( new BlockForest( uint_c( MPIManager::instance()->rank() ), "SerializeDeserialize.sbf", broadcast ) );
+   auto forestCheck = std::make_shared< BlockForest >( uint_c( MPIManager::instance()->rank() ), "SerializeDeserialize.sbf", broadcast );
 
    for (auto blockIt = forestCheck->begin(); blockIt != forestCheck->end(); ++blockIt)
    {
diff --git a/tests/core/timing/SweepTimeloopTimerReduction.cpp b/tests/core/timing/SweepTimeloopTimerReduction.cpp
index 7fcc4f17f..d071b0503 100644
--- a/tests/core/timing/SweepTimeloopTimerReduction.cpp
+++ b/tests/core/timing/SweepTimeloopTimerReduction.cpp
@@ -63,8 +63,8 @@ int main( int argc, char ** argv )
    walberla::MPIManager::instance()->useWorldComm();
 
    // create StructuredBlockForest (encapsulates a newly created BlockForest)
-   auto bf = walberla::shared_ptr< BlockForest >( new BlockForest( walberla::uint_c( walberla::MPIManager::instance()->rank() ), sforest, true ) );
-   auto sbf = walberla::shared_ptr< StructuredBlockForest >( new StructuredBlockForest( bf, 10, 10, 10 ) );
+   auto bf = std::make_shared< BlockForest >( walberla::uint_c( walberla::MPIManager::instance()->rank() ), sforest, true );
+   auto sbf = std::make_shared< StructuredBlockForest >( bf, 10, 10, 10 );
    sbf->createCellBoundingBoxes();
 
 
diff --git a/tests/geometry/ScalarFieldFromBodyTest.cpp b/tests/geometry/ScalarFieldFromBodyTest.cpp
index 095f411e3..d6c29f3d1 100644
--- a/tests/geometry/ScalarFieldFromBodyTest.cpp
+++ b/tests/geometry/ScalarFieldFromBodyTest.cpp
@@ -38,6 +38,7 @@
 #include "timeloop/SweepTimeloop.h"
 
 #include <fstream>
+#include <memory>
 
 
 namespace walberla {
@@ -269,8 +270,8 @@ int main( int argc, char ** argv )
 
    using namespace geometry::initializer;
 
-   auto geometryInitializationManager = shared_ptr<InitializationManager> ( new InitializationManager( blocks->getBlockStorage() ) );
-   auto freeSurfaceInitializer        = shared_ptr<OverlapFieldFromBody> ( new OverlapFieldFromBody( *blocks, scalarFieldID, "drop", "bubble" ) );
+   auto geometryInitializationManager = std::make_shared<InitializationManager> ( blocks->getBlockStorage() );
+   auto freeSurfaceInitializer        = std::make_shared<OverlapFieldFromBody> ( *blocks, scalarFieldID, "drop", "bubble" );
 
    geometryInitializationManager->registerInitializer( "FreeSurface", freeSurfaceInitializer );
 
diff --git a/tests/geometry/ScalarFieldFromGrayScaleImageTest.cpp b/tests/geometry/ScalarFieldFromGrayScaleImageTest.cpp
index ec63490c6..ea753bab2 100644
--- a/tests/geometry/ScalarFieldFromGrayScaleImageTest.cpp
+++ b/tests/geometry/ScalarFieldFromGrayScaleImageTest.cpp
@@ -35,6 +35,7 @@
 #include "timeloop/SweepTimeloop.h"
 
 #include <fstream>
+#include <memory>
 
 
 namespace walberla {
@@ -66,8 +67,8 @@ int main( int argc, char ** argv )
    // Geometry Initialization from config file
    using namespace geometry::initializer;
 
-   auto geometryInitializationManager = shared_ptr<InitializationManager> ( new InitializationManager( blocks->getBlockStorage() ) );
-   auto freeSurfaceInitializer        = shared_ptr<ScalarFieldFromGrayScaleImage> ( new ScalarFieldFromGrayScaleImage( *blocks, scalarFieldID ) );
+   auto geometryInitializationManager = std::make_shared<InitializationManager> ( blocks->getBlockStorage() );
+   auto freeSurfaceInitializer        = std::make_shared<ScalarFieldFromGrayScaleImage> ( *blocks, scalarFieldID );
 
    geometryInitializationManager->registerInitializer( "FreeSurfaceImage", freeSurfaceInitializer );
 
diff --git a/tests/pe_coupling/partially_saturated_cells_method/SegreSilberbergPSM.cpp b/tests/pe_coupling/partially_saturated_cells_method/SegreSilberbergPSM.cpp
index f16525daa..6cc579090 100644
--- a/tests/pe_coupling/partially_saturated_cells_method/SegreSilberbergPSM.cpp
+++ b/tests/pe_coupling/partially_saturated_cells_method/SegreSilberbergPSM.cpp
@@ -65,6 +65,7 @@
 #include "lbm/vtk/all.h"
 
 #include <functional>
+#include <memory>
 
 namespace segre_silberberg_psm
 {
@@ -632,8 +633,8 @@ int main( int argc, char **argv )
    timeloop.addFuncAfterTimeStep( pe_coupling::TimeStep( blocks, bodyStorageID, cr, syncCall, dt_pe, pe_interval ), "pe Time Step" );
 
    // check for convergence of the particle position
-   shared_ptr< SteadyStateCheck > check = shared_ptr< SteadyStateCheck >( new SteadyStateCheck( &timeloop, &setup, blocks, bodyStorageID,
-                                                                                                fileIO, SC1W1, SC2W1, SC3W1, SC1W2, SC2W2, SC3W2 ) );
+   shared_ptr< SteadyStateCheck > check = std::make_shared< SteadyStateCheck >( &timeloop, &setup, blocks, bodyStorageID,
+                                                                                                fileIO, SC1W1, SC2W1, SC3W1, SC1W2, SC2W2, SC3W2 );
    timeloop.addFuncAfterTimeStep( SharedFunctor< SteadyStateCheck >( check ), "steady state check" );
 
    if( vtkIO )
-- 
GitLab