diff --git a/apps/benchmarks/CouetteFlow/CouetteFlow.cpp b/apps/benchmarks/CouetteFlow/CouetteFlow.cpp index a947b2a8ee6929e06c5cb0db7910180316fc1c84..84ccd95cec98693e244d6f48e48abbca18932b20 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 895ca85bc816c028af4458a8eff3bde69375dd63..6f3f8a2f4455344b5c0cabc59a1b66852435e448 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 f94561e7799a3219ff14beb13328a08a9456eb4e..2e6f5af9f3ad4f510ad7d3088f6ae46b10318dd8 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 5850db2e69254f5864222bd83138ca1a739a1f8b..68f90a8cfa0e4b27e7e1113e6455335d95c6866f 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 165f81f286ca12814ea4b616d3f3b64cff687999..dfb8eefd3ab839cf40924e6f709818bae2f0ea68 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 09d3a5a518162af644f25206f5fa814705bafa13..7bb745c3abde69740019857b5e7f286dc3bf3edc 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 b08a506b49f25aa42e494ebb39a899fbcee3372a..c270b38ca3fcd07869ba7a25842b1dd90f196c0c 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 16fc1b8869dcd8ec2b4bfd3d5e9eefca3dd83c5d..44b990d1140c6d5929562e9f42c0c94a20952a3b 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 729dfdeb0802de620b4f14b48897a61bdb00fe06..66201296835f62bb5c9d28f9180d060503bcbbb7 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 dbea75a0058945ccb631e6b9689a9ec4324338ac..a9192cac2f3946d02bf79bfb2f32c0f2293fa882 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 33bae7dc35851073d2b2e75d5d4d18031fdeb00f..ee6e03f058ea651b23bd2ce4785a91d1fae1d6de 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 c915a2e4cbb76bf37e7baa0d31af3e483239c6d0..e36d57830a396976b7411917f0eb9d3dcdedade0 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 cad85e10e07da7542f4938fc81316fdd49d64068..96717ca97ae89dca49dc9730448a264fd08fc969 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 8b7749ab88a35c697822391aacf064be975ce02f..3ccbb14f7ef2ca2842222878448e44c10e3e7dfd 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 595b6292a7505ea9d90a917dd391b758f498c3b2..fcfd72f9a76751a20f57ef6a896a08e00228e85d 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 503907b72d9c3abd1d517e7ff54c29f4a5d6f797..f80f19d5f9723e48d83c7e23d3c00df141d116de 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 417d74a395be79894d1a89e20c9a0fb570885aea..45a614eb42b87451d40418ef59e46a7b79f1815e 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 9fd31e2b2146b23fef31a8b1ae768621cadeb738..3a41f36f0615a1aa2cd244f494438faee1d740a9 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 bbae269ea245a124fe5ca0b8208d5bd408db6bb4..37517dc45f9620b0be8014ea83343851d526be4e 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 481c96bb86843ef632034bd4e301dfb6596a9d92..5e4372b1c0510c414e2ddf0545c9e3e9489cb2c3 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 22fbffba29a2bd39164ca2da6fbf0153415b13df..bf6727ab5e7b6ccbc4a0760d6775b627b617bbc9 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 5077c6431c70792c154706f1eb8bc13cd8b5c67f..0dbaf4b0ab158615fc52e95f4fad14e0a6fd991f 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 e23df588e124890272dde64456637f49add5cd38..49729ba27e8415e94dfdf2865c2cab9b2621bc07 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 b66ddc3be5b4c722b3f5455f717e46955c5655b2..1332bb8dccda6574013f348140f941974ccd3ce8 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 63c268ae6031a333d50e2720d8dacf8adeb97b93..6f29a33cfa7e15cc5b2e14f0c1e6a84e647a16bf 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 e8196c89184d85c741b0a275c1e795db30c38151..e0e2286dd1bb1b15f08bfd37ad35c9f6abfeeaca 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 1f88525b36b9def1867f9178f31cde807a349822..ebacb5e22ce4ddea2e373f5405a24e41f1e1f92e 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 366098150e5f5082439c39e93a157d908f13ecdf..9b5e2f585762aef70c64eea28863d5d6bd201c3e 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 919840085ee8b298083a7fcafa13c51488c5fd9a..4045f0eea875037d4a09178ed5e22b72a1be1c00 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 3d66078348bb8d9d2c358a35d7086d32810d0083..5ce6ad385c4d07583b9d9e1420debc399b196dec 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 2ad2e82de97f5516be70db08ba5d739538f04154..d6df0a4fb137d35fb8e4c8834d137bad99029b35 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 b08caac6a49eb3f7a0e2f024a32cc6f62d1b2505..22e5902180b3934dd2b39a40caaecb1fe3f2cbda 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 9f1e027cfd64b3edb52828d34c5d7c02ba7897c8..3d3cfa15924a0fc0642a36db1a372b72760646f0 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 9b5945630446d443c88bfd5adda6b0bf77b3fc76..8d635ab44da684fd992c4328362fa8ebd5a6e986 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 );