From d9f7e7fd43b92ef9efcc8920b40dc033d7cd7aad Mon Sep 17 00:00:00 2001
From: Sebastian Eibl <sebastian.eibl@fau.de>
Date: Fri, 28 Sep 2018 13:20:46 +0200
Subject: [PATCH] clang-tidy -checks=-*,performance-unnecessary-value-param

---
 apps/benchmarks/CouetteFlow/CouetteFlow.cpp   |  2 +-
 .../ForcesOnSphereNearPlaneInShearFlow.cpp    |  2 +-
 .../MotionSingleHeavySphere.cpp               |  2 +-
 .../NonUniformGrid/NonUniformGrid.cpp         |  2 +-
 .../PoiseuilleChannel/PoiseuilleChannel.cpp   |  2 +-
 .../SchaeferTurek/SchaeferTurek.cpp           |  4 ++--
 apps/benchmarks/UniformGrid/UniformGrid.cpp   |  2 +-
 .../BidisperseFluidizedBedDPM.cpp             |  2 +-
 src/blockforest/SetupBlockForest.cpp          |  2 +-
 src/blockforest/SetupBlockForest.h            |  2 +-
 src/core/config/Config.cpp                    |  2 +-
 src/core/config/Config.h                      |  2 +-
 src/core/math/equation_system/Equation.cpp    |  4 ++--
 src/core/math/equation_system/Equation.h      |  2 +-
 src/core/math/equation_system/Variable.cpp    |  2 +-
 src/core/math/equation_system/Variable.h      |  2 +-
 src/core/mpi/OpenMPBufferSystem.cpp           |  4 ++--
 src/core/mpi/OpenMPBufferSystem.h             |  4 ++--
 src/fft/Fft.cpp                               |  2 +-
 src/fft/Fft.h                                 |  2 +-
 src/geometry/bodies/Ellipsoid.cpp             |  2 +-
 src/geometry/bodies/Ellipsoid.h               |  2 +-
 src/gui/Gui.cpp                               |  2 +-
 src/gui/Gui.h                                 |  2 +-
 .../pe/rigid_body/ConvexPolyhedronFactory.cpp |  2 +-
 .../pe/rigid_body/ConvexPolyhedronFactory.h   |  2 +-
 src/pe/raytracing/Raytracer.cpp               | 19 ++++++++++---------
 src/pe/raytracing/Raytracer.h                 | 16 ++++++++--------
 src/pe/utility/CreateWorld.cpp                | 18 +++++++++---------
 src/pe/utility/CreateWorld.h                  | 14 +++++++-------
 src/vtk/Initialization.cpp                    |  4 ++--
 src/vtk/Initialization.h                      |  4 ++--
 src/vtk/VTKOutput.cpp                         |  4 ++--
 src/vtk/VTKOutput.h                           |  4 ++--
 34 files changed, 72 insertions(+), 71 deletions(-)

diff --git a/apps/benchmarks/CouetteFlow/CouetteFlow.cpp b/apps/benchmarks/CouetteFlow/CouetteFlow.cpp
index a947b2a8e..84ccd95ce 100644
--- a/apps/benchmarks/CouetteFlow/CouetteFlow.cpp
+++ b/apps/benchmarks/CouetteFlow/CouetteFlow.cpp
@@ -504,7 +504,7 @@ class MyVTKOutput {
 public:
 
    MyVTKOutput( const ConstBlockDataID & pdfField, const ConstBlockDataID & flagField,
-                vtk::VTKOutput::BeforeFunction pdfGhostLayerSync, const Setup & setup ) :
+                const vtk::VTKOutput::BeforeFunction& pdfGhostLayerSync, const Setup & setup ) :
       setup_( setup ), pdfField_( pdfField ), flagField_( flagField ), pdfGhostLayerSync_( pdfGhostLayerSync ) {}
 
    void operator()( std::vector< shared_ptr<vtk::BlockCellDataWriterInterface> > & writers,
diff --git a/apps/benchmarks/ForcesOnSphereNearPlaneInShearFlow/ForcesOnSphereNearPlaneInShearFlow.cpp b/apps/benchmarks/ForcesOnSphereNearPlaneInShearFlow/ForcesOnSphereNearPlaneInShearFlow.cpp
index 895ca85bc..6f3f8a2f4 100644
--- a/apps/benchmarks/ForcesOnSphereNearPlaneInShearFlow/ForcesOnSphereNearPlaneInShearFlow.cpp
+++ b/apps/benchmarks/ForcesOnSphereNearPlaneInShearFlow/ForcesOnSphereNearPlaneInShearFlow.cpp
@@ -111,7 +111,7 @@ const FlagUID MO_CLI_Flag( "moving obstacle CLI" );
 // BLOCK STRUCTURE //
 /////////////////////
 
-static void refinementSelection( SetupBlockForest& forest, uint_t levels, AABB refinementBox )
+static void refinementSelection( SetupBlockForest& forest, uint_t levels, const AABB& refinementBox )
 {
    real_t dx = real_t(1); // dx on finest level
    for( auto block = forest.begin(); block != forest.end(); ++block )
diff --git a/apps/benchmarks/MotionSingleHeavySphere/MotionSingleHeavySphere.cpp b/apps/benchmarks/MotionSingleHeavySphere/MotionSingleHeavySphere.cpp
index f94561e77..2e6f5af9f 100644
--- a/apps/benchmarks/MotionSingleHeavySphere/MotionSingleHeavySphere.cpp
+++ b/apps/benchmarks/MotionSingleHeavySphere/MotionSingleHeavySphere.cpp
@@ -522,7 +522,7 @@ public:
 
    VTKInfoLogger( SweepTimeloop* timeloop, const shared_ptr< StructuredBlockStorage > & blocks,
                   const ConstBlockDataID & bodyStorageID, const std::string & baseFolder,
-                  const Vector3<real_t> u_infty ) :
+                  const Vector3<real_t>& u_infty ) :
    timeloop_( timeloop ), blocks_( blocks ), bodyStorageID_( bodyStorageID ), baseFolder_( baseFolder ), u_infty_( u_infty )
    { }
 
diff --git a/apps/benchmarks/NonUniformGrid/NonUniformGrid.cpp b/apps/benchmarks/NonUniformGrid/NonUniformGrid.cpp
index 5850db2e6..68f90a8cf 100644
--- a/apps/benchmarks/NonUniformGrid/NonUniformGrid.cpp
+++ b/apps/benchmarks/NonUniformGrid/NonUniformGrid.cpp
@@ -538,7 +538,7 @@ class MyVTKOutput {
 public:
 
    MyVTKOutput( const ConstBlockDataID & pdfField, const ConstBlockDataID & flagField,
-                vtk::VTKOutput::BeforeFunction pdfGhostLayerSync ) :
+                const vtk::VTKOutput::BeforeFunction& pdfGhostLayerSync ) :
       pdfField_( pdfField ), flagField_( flagField ), pdfGhostLayerSync_( pdfGhostLayerSync ) {}
 
    void operator()( std::vector< shared_ptr<vtk::BlockCellDataWriterInterface> > & writers,
diff --git a/apps/benchmarks/PoiseuilleChannel/PoiseuilleChannel.cpp b/apps/benchmarks/PoiseuilleChannel/PoiseuilleChannel.cpp
index 165f81f28..dfb8eefd3 100644
--- a/apps/benchmarks/PoiseuilleChannel/PoiseuilleChannel.cpp
+++ b/apps/benchmarks/PoiseuilleChannel/PoiseuilleChannel.cpp
@@ -657,7 +657,7 @@ class MyVTKOutput {
 public:
 
    MyVTKOutput( const ConstBlockDataID & pdfField, const ConstBlockDataID & flagField,
-                vtk::VTKOutput::BeforeFunction pdfGhostLayerSync, const Setup & setup ) :
+                const vtk::VTKOutput::BeforeFunction& pdfGhostLayerSync, const Setup & setup ) :
       setup_( setup ), pdfField_( pdfField ), flagField_( flagField ), pdfGhostLayerSync_( pdfGhostLayerSync ) {}
 
    void operator()( std::vector< shared_ptr<vtk::BlockCellDataWriterInterface> > & writers,
diff --git a/apps/benchmarks/SchaeferTurek/SchaeferTurek.cpp b/apps/benchmarks/SchaeferTurek/SchaeferTurek.cpp
index 09d3a5a51..7bb745c3a 100644
--- a/apps/benchmarks/SchaeferTurek/SchaeferTurek.cpp
+++ b/apps/benchmarks/SchaeferTurek/SchaeferTurek.cpp
@@ -1333,7 +1333,7 @@ class MyVTKOutput {
 public:
 
    MyVTKOutput( const ConstBlockDataID & pdfField, const ConstBlockDataID & flagField,
-                vtk::VTKOutput::BeforeFunction pdfGhostLayerSync ) :
+                const vtk::VTKOutput::BeforeFunction& pdfGhostLayerSync ) :
       pdfField_( pdfField ), flagField_( flagField ), pdfGhostLayerSync_( pdfGhostLayerSync ) {}
 
    void operator()( std::vector< shared_ptr<vtk::BlockCellDataWriterInterface> > & writers,
@@ -1405,7 +1405,7 @@ public:
    Evaluation( const weak_ptr< StructuredBlockStorage > & blocks, const uint_t checkFrequency,
                const BlockDataID & pdfFieldId, const BlockDataID & flagFieldId, const FlagUID & fluid, const FlagUID & obstacle,
                const Setup & setup,
-               const bool logToStream = true, const bool logToFile = true, const std::string filename = std::string("SchaeferTurek.txt"),
+               const bool logToStream = true, const bool logToFile = true, const std::string& filename = std::string("SchaeferTurek.txt"),
                const Set<SUID> & requiredSelectors = Set<SUID>::emptySet(),
                const Set<SUID> & incompatibleSelectors = Set<SUID>::emptySet() ) :
       initialized_( false ), blocks_( blocks ),
diff --git a/apps/benchmarks/UniformGrid/UniformGrid.cpp b/apps/benchmarks/UniformGrid/UniformGrid.cpp
index b08a506b4..c270b38ca 100644
--- a/apps/benchmarks/UniformGrid/UniformGrid.cpp
+++ b/apps/benchmarks/UniformGrid/UniformGrid.cpp
@@ -429,7 +429,7 @@ class MyVTKOutput {
 public:
 
    MyVTKOutput( const ConstBlockDataID & pdfField, const ConstBlockDataID & flagField,
-                vtk::VTKOutput::BeforeFunction pdfGhostLayerSync ) :
+                const vtk::VTKOutput::BeforeFunction& pdfGhostLayerSync ) :
       pdfField_( pdfField ), flagField_( flagField ), pdfGhostLayerSync_( pdfGhostLayerSync ) {}
 
    void operator()( std::vector< shared_ptr<vtk::BlockCellDataWriterInterface> > & writers,
diff --git a/apps/showcases/BidisperseFluidizedBed/BidisperseFluidizedBedDPM.cpp b/apps/showcases/BidisperseFluidizedBed/BidisperseFluidizedBedDPM.cpp
index 16fc1b886..44b990d11 100644
--- a/apps/showcases/BidisperseFluidizedBed/BidisperseFluidizedBedDPM.cpp
+++ b/apps/showcases/BidisperseFluidizedBed/BidisperseFluidizedBedDPM.cpp
@@ -594,7 +594,7 @@ private:
    uint_t numSpheres_;
 };
 
-void setBodyVelocities(const shared_ptr<StructuredBlockStorage> & blockStorage, const BlockDataID & bodyStorageID, Vector3<real_t> velocity )
+void setBodyVelocities(const shared_ptr<StructuredBlockStorage> & blockStorage, const BlockDataID & bodyStorageID, const Vector3<real_t>& velocity )
 {
    for( auto blockIt = blockStorage->begin(); blockIt != blockStorage->end(); ++blockIt )
    {
diff --git a/src/blockforest/SetupBlockForest.cpp b/src/blockforest/SetupBlockForest.cpp
index 729dfdeb0..662012968 100644
--- a/src/blockforest/SetupBlockForest.cpp
+++ b/src/blockforest/SetupBlockForest.cpp
@@ -1232,7 +1232,7 @@ void SetupBlockForest::calculateProcessDistribution_Default( const uint_t
                                                              const std::string&  sfcMethod               /* = std::string( "hilbert" ) */,
                                                              const uint_t        sfcIterations           /* = 10 */,
                                                              const bool          sortByLevel             /* = false */,
-                                                             GlobalLoadBalancing::MetisConfiguration< SetupBlock > metisConfig,
+                                                             const GlobalLoadBalancing::MetisConfiguration< SetupBlock >& metisConfig,
                                                              const bool          reorderProcessesByBFS   /* = false */,
                                                              const bool          insertBufferProcesses   /* = false */,
                                                              const real_t        bufferProcessesFraction /* = real_c(0) */ )
diff --git a/src/blockforest/SetupBlockForest.h b/src/blockforest/SetupBlockForest.h
index dbea75a00..a9192cac2 100644
--- a/src/blockforest/SetupBlockForest.h
+++ b/src/blockforest/SetupBlockForest.h
@@ -290,7 +290,7 @@ public:
                                               const std::string&  sfcMethod               = std::string( "hilbert" ),
                                               const uint_t        sfcIterations           = 10,
                                               const bool          sortByLevel             = false,
-                                              GlobalLoadBalancing::MetisConfiguration< SetupBlock > metisConfig =
+                                              const GlobalLoadBalancing::MetisConfiguration< SetupBlock >& metisConfig =
                                                  GlobalLoadBalancing::MetisConfiguration< SetupBlock >(),
                                               const bool          reorderProcessesByBFS   = false,
                                               const bool          insertBufferProcesses   = false,
diff --git a/src/core/config/Config.cpp b/src/core/config/Config.cpp
index 33bae7dc3..ee6e03f05 100644
--- a/src/core/config/Config.cpp
+++ b/src/core/config/Config.cpp
@@ -672,7 +672,7 @@ bool Config::Block::addParameter( std::string key, const std::string& value )
 // \param key The key of the new block.
 // \return Reference to the new block.
  */
-Config::Block& Config::Block::createBlock( std::string key )
+Config::Block& Config::Block::createBlock( const std::string& key )
 {
    blocks_.push_back( Block( key ) );
    return *blocks_.rbegin();
diff --git a/src/core/config/Config.h b/src/core/config/Config.h
index c915a2e4c..e36d57830 100644
--- a/src/core/config/Config.h
+++ b/src/core/config/Config.h
@@ -230,7 +230,7 @@ public:
       //@}
       //****************************************************************************************************************
 
-      Block& createBlock( std::string key );
+      Block& createBlock( const std::string& key );
 
    private:
       //**Utility functions*********************************************************************************************
diff --git a/src/core/math/equation_system/Equation.cpp b/src/core/math/equation_system/Equation.cpp
index cad85e10e..96717ca97 100644
--- a/src/core/math/equation_system/Equation.cpp
+++ b/src/core/math/equation_system/Equation.cpp
@@ -23,8 +23,8 @@
 #include "Operator.h"
 #include "Variable.h"
 
-#include <cmath>
 #include <algorithm>
+#include <cmath>
 #include <memory>
 
 
@@ -118,7 +118,7 @@ namespace math {
    /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    // EQUATION
    /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-   Equation::Equation( NodePtr root) : root_ (root)
+   Equation::Equation( const NodePtr& root) : root_ (root)
    {
       root_->collectVariables( varMap_ );
    }
diff --git a/src/core/math/equation_system/Equation.h b/src/core/math/equation_system/Equation.h
index 8b7749ab8..3ccbb14f7 100644
--- a/src/core/math/equation_system/Equation.h
+++ b/src/core/math/equation_system/Equation.h
@@ -86,7 +86,7 @@ namespace math {
       VarMap  varMap_;
 
    public:
-      Equation( NodePtr root );
+      Equation( const NodePtr& root );
 
    private:
       uint_t countUnknownVariables(){ return uint_c( root_->countUnknownVariables() ); }
diff --git a/src/core/math/equation_system/Variable.cpp b/src/core/math/equation_system/Variable.cpp
index 595b6292a..fcfd72f9a 100644
--- a/src/core/math/equation_system/Variable.cpp
+++ b/src/core/math/equation_system/Variable.cpp
@@ -28,7 +28,7 @@
 namespace walberla {
 namespace math {
 
-   Var::Var ( std::string name ) :
+   Var::Var ( const std::string& name ) :
       name_ (name),
       valid_ (false),
       value_ (FP_NAN)
diff --git a/src/core/math/equation_system/Variable.h b/src/core/math/equation_system/Variable.h
index 503907b72..f80f19d5f 100644
--- a/src/core/math/equation_system/Variable.h
+++ b/src/core/math/equation_system/Variable.h
@@ -36,7 +36,7 @@ namespace math {
       double value_;
 
    public:
-      Var ( std::string name );
+      Var ( const std::string& name );
    private:
       Var& operator=( const Var& ){ return *this; }
 
diff --git a/src/core/mpi/OpenMPBufferSystem.cpp b/src/core/mpi/OpenMPBufferSystem.cpp
index 417d74a39..45a614eb4 100644
--- a/src/core/mpi/OpenMPBufferSystem.cpp
+++ b/src/core/mpi/OpenMPBufferSystem.cpp
@@ -47,14 +47,14 @@ OpenMPBufferSystem::OpenMPBufferSystem( const MPI_Comm & communicator, int tag,
 }
 
 
-void OpenMPBufferSystem::addReceivingFunction( MPIRank rank, std::function<void ( RecvBuffer & buf ) > recvFunction )
+void OpenMPBufferSystem::addReceivingFunction( MPIRank rank, const std::function<void ( RecvBuffer & buf ) >& recvFunction )
 {
    dirty_ = true;
    recvFunctions_[rank] = recvFunction;
 }
 
 
-void OpenMPBufferSystem::addSendingFunction  ( MPIRank rank, std::function<void ( SendBuffer & buf ) > sendFunction )
+void OpenMPBufferSystem::addSendingFunction  ( MPIRank rank, const std::function<void ( SendBuffer & buf ) >& sendFunction )
 {
    dirty_ = true;
    sendRanks_.push_back( rank );
diff --git a/src/core/mpi/OpenMPBufferSystem.h b/src/core/mpi/OpenMPBufferSystem.h
index 9fd31e2b2..3a41f36f0 100644
--- a/src/core/mpi/OpenMPBufferSystem.h
+++ b/src/core/mpi/OpenMPBufferSystem.h
@@ -60,8 +60,8 @@ public:
 
    bool isSizeCommunicatedInNextStep() const          { return bs_.isSizeCommunicatedInNextStep(); }
 
-   void addReceivingFunction( MPIRank rank, std::function<void ( RecvBuffer & buf ) > recvFunction );
-   void addSendingFunction  ( MPIRank rank, std::function<void ( SendBuffer & buf ) > sendFunction );
+   void addReceivingFunction( MPIRank rank, const std::function<void ( RecvBuffer & buf ) >& recvFunction );
+   void addSendingFunction  ( MPIRank rank, const std::function<void ( SendBuffer & buf ) >& sendFunction );
 
    void clearReceivingFunctions() { dirty_ = true; recvFunctions_.clear(); }
    void clearSendingFunctions()   { dirty_ = true; sendFunctions_.clear(); sendRanks_.clear(); }
diff --git a/src/fft/Fft.cpp b/src/fft/Fft.cpp
index bbae269ea..37517dc45 100644
--- a/src/fft/Fft.cpp
+++ b/src/fft/Fft.cpp
@@ -7,7 +7,7 @@ namespace fft {
 
 template <typename Field_T>
 FourierTransform<Field_T>::FourierTransform( shared_ptr< StructuredBlockForest > & blocks, BlockDataID fieldId,
-                                             std::function<real_t(uint_t,uint_t,uint_t)> greens )
+                                             const std::function<real_t(uint_t,uint_t,uint_t)>& greens )
 : blocks_(blocks), fieldId_(fieldId), greens_()
 {
 #ifdef WALBERLA_USE_PFFT
diff --git a/src/fft/Fft.h b/src/fft/Fft.h
index 481c96bb8..5e4372b1c 100644
--- a/src/fft/Fft.h
+++ b/src/fft/Fft.h
@@ -22,7 +22,7 @@ class FourierTransform
 {
    public:
       FourierTransform( shared_ptr< StructuredBlockForest > & blocks, BlockDataID fieldId,
-                        std::function<real_t(uint_t,uint_t,uint_t)> greens = std::function<real_t(uint_t,uint_t,uint_t)>() );
+                        const std::function<real_t(uint_t,uint_t,uint_t)>& greens = std::function<real_t(uint_t,uint_t,uint_t)>() );
       void operator() ();
       
    private:
diff --git a/src/geometry/bodies/Ellipsoid.cpp b/src/geometry/bodies/Ellipsoid.cpp
index 22fbffba2..bf6727ab5 100644
--- a/src/geometry/bodies/Ellipsoid.cpp
+++ b/src/geometry/bodies/Ellipsoid.cpp
@@ -28,7 +28,7 @@ namespace geometry {
    Ellipsoid::Ellipsoid( const Vector3<real_t> & midp,
             Vector3<real_t> axis1,
             Vector3<real_t> axis2,
-            Vector3<real_t> radii )
+            const Vector3<real_t>& radii )
       : midpoint_( midp ), radii_( radii )
    {
       normalize( axis1 );
diff --git a/src/geometry/bodies/Ellipsoid.h b/src/geometry/bodies/Ellipsoid.h
index 5077c6431..0dbaf4b0a 100644
--- a/src/geometry/bodies/Ellipsoid.h
+++ b/src/geometry/bodies/Ellipsoid.h
@@ -59,7 +59,7 @@ namespace geometry {
       *  \param radii       the length of the semi axes
       *****************************************************************************************************************/
       explicit Ellipsoid( const Vector3<real_t> & midpoint,
-               Vector3<real_t> axis1, Vector3<real_t> axis2, Vector3<real_t> radii );
+               Vector3<real_t> axis1, Vector3<real_t> axis2, const Vector3<real_t>& radii );
 
 
       const AABB & boundingBox() const { return boundingBox_; }
diff --git a/src/gui/Gui.cpp b/src/gui/Gui.cpp
index e23df588e..49729ba27 100644
--- a/src/gui/Gui.cpp
+++ b/src/gui/Gui.cpp
@@ -226,7 +226,7 @@ void GUI::run() {
    timeloop_.run();
 }
 
-void GUI::registerPropertyTree( const shared_ptr<PropertyTree>  ) {}
+void GUI::registerPropertyTree( const shared_ptr<PropertyTree>&  ) {}
 
 const std::vector<shared_ptr<PropertyTree> > & GUI::getPropertyTrees() const  {
    throw( "Should not happen!" );
diff --git a/src/gui/Gui.h b/src/gui/Gui.h
index b66ddc3be..1332bb8dc 100644
--- a/src/gui/Gui.h
+++ b/src/gui/Gui.h
@@ -50,7 +50,7 @@ namespace gui {
 
       void run();
 
-      void registerPropertyTree( const shared_ptr<PropertyTree> propertyTree );
+      void registerPropertyTree( const shared_ptr<PropertyTree>& propertyTree );
 
       typedef std::function< DisplayAdaptor * ( const IBlock &, ConstBlockDataID ) > DisplayAdaptorCreatorFunc;
       void registerDisplayAdaptorCreator( const DisplayAdaptorCreatorFunc & creatorFunc );
diff --git a/src/mesh/pe/rigid_body/ConvexPolyhedronFactory.cpp b/src/mesh/pe/rigid_body/ConvexPolyhedronFactory.cpp
index 63c268ae6..6f29a33cf 100644
--- a/src/mesh/pe/rigid_body/ConvexPolyhedronFactory.cpp
+++ b/src/mesh/pe/rigid_body/ConvexPolyhedronFactory.cpp
@@ -39,7 +39,7 @@ namespace mesh {
 namespace pe {
 
 ConvexPolyhedronID createConvexPolyhedron( BodyStorage& globalStorage, BlockStorage& blocks, BlockDataID storageID,
-                                           id_t uid, Vec3 gpos, const std::vector< Vec3 > & pointCloud,
+                                           id_t uid, const Vec3& gpos, const std::vector< Vec3 > & pointCloud,
                                            MaterialID material,
                                            bool global, bool communicating, bool infiniteMass )
 {
diff --git a/src/mesh/pe/rigid_body/ConvexPolyhedronFactory.h b/src/mesh/pe/rigid_body/ConvexPolyhedronFactory.h
index e8196c891..e0e2286dd 100644
--- a/src/mesh/pe/rigid_body/ConvexPolyhedronFactory.h
+++ b/src/mesh/pe/rigid_body/ConvexPolyhedronFactory.h
@@ -69,7 +69,7 @@ namespace pe {
  *
  */
 ConvexPolyhedronID createConvexPolyhedron( BodyStorage& globalStorage, BlockStorage& blocks, BlockDataID storageID,
-                                           id_t uid, Vec3 gpos, const std::vector< Vec3 > & pointCloud,
+                                           id_t uid, const Vec3& gpos, const std::vector< Vec3 > & pointCloud,
                                            MaterialID material = Material::find("iron"),
                                            bool global = false, bool communicating = true, bool infiniteMass = false );
 //*************************************************************************************************
diff --git a/src/pe/raytracing/Raytracer.cpp b/src/pe/raytracing/Raytracer.cpp
index 1f88525b3..ebacb5e22 100644
--- a/src/pe/raytracing/Raytracer.cpp
+++ b/src/pe/raytracing/Raytracer.cpp
@@ -19,8 +19,9 @@
 //======================================================================================================================
 
 #include "Raytracer.h"
-#include "geometry/structured/extern/lodepng.h"
+
 #include "core/mpi/all.h"
+#include "geometry/structured/extern/lodepng.h"
 
 namespace walberla {
 namespace pe {
@@ -67,16 +68,16 @@ void BodyIntersectionInfo_Comparator_MPI_OP( BodyIntersectionInfo *in, BodyInter
  * \param isBodyVisibleFunc A function which returns a boolean indicating if a given body should be visible
  *                          in the final image.
  */
-Raytracer::Raytracer(const shared_ptr<BlockStorage> forest, const BlockDataID storageID,
-                     const shared_ptr<BodyStorage> globalBodyStorage,
+Raytracer::Raytracer(const shared_ptr<BlockStorage>& forest, const BlockDataID storageID,
+                     const shared_ptr<BodyStorage>& globalBodyStorage,
                      const BlockDataID ccdID,
                      uint16_t pixelsHorizontal, uint16_t pixelsVertical,
                      real_t fov_vertical, uint16_t antiAliasFactor,
                      const Vec3& cameraPosition, const Vec3& lookAtPoint, const Vec3& upVector,
                      const Lighting& lighting,
                      const Color& backgroundColor,
-                     std::function<ShadingParameters (const BodyID)> bodyToShadingParamsFunc,
-                     std::function<bool (const BodyID)> isBodyVisibleFunc)
+                     const std::function<ShadingParameters (const BodyID)>& bodyToShadingParamsFunc,
+                     const std::function<bool (const BodyID)>& isBodyVisibleFunc)
    : forest_(forest), storageID_(storageID), globalBodyStorage_(globalBodyStorage), ccdID_(ccdID),
    pixelsHorizontal_(pixelsHorizontal), pixelsVertical_(pixelsVertical),
    fov_vertical_(fov_vertical), antiAliasFactor_(antiAliasFactor),
@@ -121,12 +122,12 @@ Raytracer::Raytracer(const shared_ptr<BlockStorage> forest, const BlockDataID st
  * For the lighting a config block within the Raytracer config block named Lighting has to be defined,
  * information about its contents is in the Lighting class.
  */
-Raytracer::Raytracer(const shared_ptr<BlockStorage> forest, const BlockDataID storageID,
-                     const shared_ptr<BodyStorage> globalBodyStorage,
+Raytracer::Raytracer(const shared_ptr<BlockStorage>& forest, const BlockDataID storageID,
+                     const shared_ptr<BodyStorage>& globalBodyStorage,
                      const BlockDataID ccdID,
                      const Config::BlockHandle& config,
-                     std::function<ShadingParameters (const BodyID)> bodyToShadingParamsFunc,
-                     std::function<bool (const BodyID)> isBodyVisibleFunc)
+                     const std::function<ShadingParameters (const BodyID)>& bodyToShadingParamsFunc,
+                     const std::function<bool (const BodyID)>& isBodyVisibleFunc)
    : forest_(forest), storageID_(storageID), globalBodyStorage_(globalBodyStorage), ccdID_(ccdID),
    bodyToShadingParamsFunc_(bodyToShadingParamsFunc),
    isBodyVisibleFunc_(isBodyVisibleFunc),
diff --git a/src/pe/raytracing/Raytracer.h b/src/pe/raytracing/Raytracer.h
index 366098150..9b5e2f585 100644
--- a/src/pe/raytracing/Raytracer.h
+++ b/src/pe/raytracing/Raytracer.h
@@ -77,23 +77,23 @@ public:
    
    /*!\name Constructors */
    //@{
-   explicit Raytracer(const shared_ptr<BlockStorage> forest, const BlockDataID storageID,
-                      const shared_ptr<BodyStorage> globalBodyStorage,
+   explicit Raytracer(const shared_ptr<BlockStorage>& forest, const BlockDataID storageID,
+                      const shared_ptr<BodyStorage>& globalBodyStorage,
                       const BlockDataID ccdID,
                       uint16_t pixelsHorizontal, uint16_t pixelsVertical,
                       real_t fov_vertical, uint16_t antiAliasFactor,
                       const Vec3& cameraPosition, const Vec3& lookAtPoint, const Vec3& upVector,
                       const Lighting& lighting,
                       const Color& backgroundColor = Color(real_t(0.1), real_t(0.1), real_t(0.1)),
-                      std::function<ShadingParameters (const BodyID)> bodyToShadingParamsFunc = defaultBodyTypeDependentShadingParams,
-                      std::function<bool (const BodyID)> isBodyVisibleFunc = defaultIsBodyVisible);
+                      const std::function<ShadingParameters (const BodyID)>& bodyToShadingParamsFunc = defaultBodyTypeDependentShadingParams,
+                      const std::function<bool (const BodyID)>& isBodyVisibleFunc = defaultIsBodyVisible);
 
-   explicit Raytracer(const shared_ptr<BlockStorage> forest, const BlockDataID storageID,
-                      const shared_ptr<BodyStorage> globalBodyStorage,
+   explicit Raytracer(const shared_ptr<BlockStorage>& forest, const BlockDataID storageID,
+                      const shared_ptr<BodyStorage>& globalBodyStorage,
                       const BlockDataID ccdID,
                       const Config::BlockHandle& config,
-                      std::function<ShadingParameters (const BodyID)> bodyToShadingParamsFunction = defaultBodyTypeDependentShadingParams,
-                      std::function<bool (const BodyID)> isBodyVisibleFunc = defaultIsBodyVisible);
+                      const std::function<ShadingParameters (const BodyID)>& bodyToShadingParamsFunction = defaultBodyTypeDependentShadingParams,
+                      const std::function<bool (const BodyID)>& isBodyVisibleFunc = defaultIsBodyVisible);
    //@}
 
 private:
diff --git a/src/pe/utility/CreateWorld.cpp b/src/pe/utility/CreateWorld.cpp
index 919840085..4045f0eea 100644
--- a/src/pe/utility/CreateWorld.cpp
+++ b/src/pe/utility/CreateWorld.cpp
@@ -51,9 +51,9 @@ private:
    uint_t level_;
 };
 
-std::unique_ptr<SetupBlockForest> createSetupBlockForest(const math::AABB simulationDomain,
+std::unique_ptr<SetupBlockForest> createSetupBlockForest(const math::AABB& simulationDomain,
                                                          Vector3<uint_t> blocks,
-                                                         const Vector3<bool> isPeriodic,
+                                                         const Vector3<bool>& isPeriodic,
                                                          const uint_t numberOfProcesses,
                                                          const uint_t initialRefinementLevel)
 {
@@ -90,9 +90,9 @@ std::unique_ptr<SetupBlockForest> createSetupBlockForest(const math::AABB simula
    return sforest;
 }
 
-shared_ptr<BlockForest> createBlockForest(const math::AABB simulationDomain,
-                                          Vector3<uint_t> blocks,
-                                          const Vector3<bool> isPeriodic,
+shared_ptr<BlockForest> createBlockForest(const math::AABB& simulationDomain,
+                                          const Vector3<uint_t>& blocks,
+                                          const Vector3<bool>& isPeriodic,
                                           const uint_t numberOfProcesses,
                                           const uint_t initialRefinementLevel)
 {
@@ -106,11 +106,11 @@ shared_ptr<BlockForest> createBlockForest(const math::AABB simulationDomain,
    return std::make_shared< BlockForest >( uint_c( MPIManager::instance()->rank() ), *sforest, false );
 }
 
-shared_ptr<BlockForest> createBlockForest(const math::AABB simulationDomain,
-                                          Vector3<uint_t> blocks,
-                                          const Vector3<bool> isPeriodic,
+shared_ptr<BlockForest> createBlockForest(const math::AABB& simulationDomain,
+                                          const Vector3<uint_t>& blocks,
+                                          const Vector3<bool>& isPeriodic,
                                           const bool setupRun,
-                                          const std::string sbffile,
+                                          const std::string& sbffile,
                                           const uint_t numberOfProcesses,
                                           const uint_t initialRefinementLevel)
 {
diff --git a/src/pe/utility/CreateWorld.h b/src/pe/utility/CreateWorld.h
index 3d6607834..5ce6ad385 100644
--- a/src/pe/utility/CreateWorld.h
+++ b/src/pe/utility/CreateWorld.h
@@ -31,16 +31,16 @@
 namespace walberla {
 namespace pe {
 
-shared_ptr<BlockForest> createBlockForest(const math::AABB simulationDomain,
-                                          Vector3<uint_t> blocks,
-                                          const Vector3<bool> isPeriodic,
+shared_ptr<BlockForest> createBlockForest(const math::AABB& simulationDomain,
+                                          const Vector3<uint_t>& blocks,
+                                          const Vector3<bool>& isPeriodic,
                                           const uint_t numberOfProcesses = uint_c(mpi::MPIManager::instance()->numProcesses()),
                                           const uint_t initialRefinementLevel = uint_t(0));
-shared_ptr<BlockForest> createBlockForest(const math::AABB simulationDomain,
-                                          Vector3<uint_t> blocks,
-                                          const Vector3<bool> isPeriodic,
+shared_ptr<BlockForest> createBlockForest(const math::AABB& simulationDomain,
+                                          const Vector3<uint_t>& blocks,
+                                          const Vector3<bool>& isPeriodic,
                                           const bool setupRun,
-                                          const std::string sbffile,
+                                          const std::string& sbffile,
                                           const uint_t numberOfProcesses = uint_c(mpi::MPIManager::instance()->numProcesses()),
                                           const uint_t initialRefinementLevel = uint_t(0));
 shared_ptr<BlockForest> createBlockForestFromConfig(const Config::BlockHandle& mainConf);
diff --git a/src/vtk/Initialization.cpp b/src/vtk/Initialization.cpp
index 2ad2e82de..d6df0a4fb 100644
--- a/src/vtk/Initialization.cpp
+++ b/src/vtk/Initialization.cpp
@@ -565,7 +565,7 @@ void initializeVTKOutput( std::map< std::string, SelectableOutputFunction > & ou
 *   \param configBlockName           Name of the block in the configuration that is used to setup the VTK output
 */
 //**********************************************************************************************************************
-void initializeVTKOutput( std::map< std::string, SelectableOutputFunction > & outputFunctions, RegisterVTKOutputFunction registerVTKOutputFunction,
+void initializeVTKOutput( std::map< std::string, SelectableOutputFunction > & outputFunctions, const RegisterVTKOutputFunction& registerVTKOutputFunction,
                           const shared_ptr< const StructuredBlockStorage > & storage, const shared_ptr< Config > & config,
                           const std::string & configBlockName )
 {
@@ -575,7 +575,7 @@ void initializeVTKOutput( std::map< std::string, SelectableOutputFunction > & ou
 
 
 
-void initializeVTKOutput( std::map< std::string, SelectableOutputFunction > & outputFunctions, RegisterVTKOutputFunction registerVTKOutputFunction,
+void initializeVTKOutput( std::map< std::string, SelectableOutputFunction > & outputFunctions, const RegisterVTKOutputFunction& registerVTKOutputFunction,
                           const shared_ptr< const StructuredBlockStorage > & storage, const Config::BlockHandle & parentBlockHandle,
                           const std::string & configBlockName )
 {
diff --git a/src/vtk/Initialization.h b/src/vtk/Initialization.h
index b08caac6a..22e590218 100644
--- a/src/vtk/Initialization.h
+++ b/src/vtk/Initialization.h
@@ -80,11 +80,11 @@ typedef std::function< void ( std::vector< shared_ptr< BlockCellDataWriterInterf
                                 std::map< std::string, VTKOutput::CellFilter > &            filters,
                                 std::map< std::string, VTKOutput::BeforeFunction > &        beforeFunctions ) > RegisterVTKOutputFunction;
 
-void initializeVTKOutput( std::map< std::string, SelectableOutputFunction > & outputFunctions, RegisterVTKOutputFunction registerVTKOutputFunction,
+void initializeVTKOutput( std::map< std::string, SelectableOutputFunction > & outputFunctions, const RegisterVTKOutputFunction& registerVTKOutputFunction,
                           const shared_ptr< const StructuredBlockStorage > & storage, const shared_ptr< Config > & config,
                           const std::string & configBlockName = std::string("VTK") );
 
-void initializeVTKOutput( std::map< std::string, SelectableOutputFunction > & outputFunctions, RegisterVTKOutputFunction registerVTKOutputFunction,
+void initializeVTKOutput( std::map< std::string, SelectableOutputFunction > & outputFunctions, const RegisterVTKOutputFunction& registerVTKOutputFunction,
                           const shared_ptr< const StructuredBlockStorage > & storage, const Config::BlockHandle & parentBlockHandle,
                           const std::string & configBlockName = std::string("VTK") );
 
diff --git a/src/vtk/VTKOutput.cpp b/src/vtk/VTKOutput.cpp
index 9f1e027cf..3d3cfa159 100644
--- a/src/vtk/VTKOutput.cpp
+++ b/src/vtk/VTKOutput.cpp
@@ -81,7 +81,7 @@ VTKOutput::VTKOutput( const StructuredBlockStorage & sbs, const std::string & id
 
 
 
-VTKOutput::VTKOutput( const shared_ptr< PointDataSource > pds, const std::string & identifier, const uint_t writeFrequency,
+VTKOutput::VTKOutput( const shared_ptr< PointDataSource >& pds, const std::string & identifier, const uint_t writeFrequency,
                       const std::string & baseFolder, const std::string & executionFolder,
                       const bool continuousNumbering, const bool binary, const bool littleEndian, const bool useMPIIO,
                       const uint_t initialExecutionCount ) :
@@ -102,7 +102,7 @@ VTKOutput::VTKOutput( const shared_ptr< PointDataSource > pds, const std::string
 
 
 
-VTKOutput::VTKOutput( const shared_ptr< PolylineDataSource > pds, const std::string & identifier, const uint_t writeFrequency,
+VTKOutput::VTKOutput( const shared_ptr< PolylineDataSource >& pds, const std::string & identifier, const uint_t writeFrequency,
                       const std::string & baseFolder, const std::string & executionFolder,
                       const bool continuousNumbering, const bool binary, const bool littleEndian, const bool useMPIIO,
                       const uint_t initialExecutionCount ) :
diff --git a/src/vtk/VTKOutput.h b/src/vtk/VTKOutput.h
index 9b5945630..8d635ab44 100644
--- a/src/vtk/VTKOutput.h
+++ b/src/vtk/VTKOutput.h
@@ -198,13 +198,13 @@ private:
               const uint_t ghostLayers, const bool forcePVTU, const uint_t initialExecutionCount = 0 );
 
    /// creates a VTKOutput object that is supposed to output arbitrary point data
-   VTKOutput( const shared_ptr< PointDataSource > pds, const std::string & identifier, const uint_t writeFrequency,
+   VTKOutput( const shared_ptr< PointDataSource >& pds, const std::string & identifier, const uint_t writeFrequency,
               const std::string & baseFolder, const std::string & executionFolder,
               const bool continuousNumbering, const bool binary, const bool littleEndian, const bool useMPIIO,
               const uint_t initialExecutionCount = 0 );
 
    /// creates a VTKOutput object that is supposed to output arbitrary polyline data
-   VTKOutput( const shared_ptr< PolylineDataSource > pds, const std::string & identifier, const uint_t writeFrequency,
+   VTKOutput( const shared_ptr< PolylineDataSource >& pds, const std::string & identifier, const uint_t writeFrequency,
               const std::string & baseFolder, const std::string & executionFolder,
               const bool continuousNumbering, const bool binary, const bool littleEndian, const bool useMPIIO,
               const uint_t initialExecutionCount = 0 );
-- 
GitLab