diff --git a/apps/benchmarks/ForcesOnSphereNearPlaneInShearFlow/ForcesOnSphereNearPlaneInShearFlow.cpp b/apps/benchmarks/ForcesOnSphereNearPlaneInShearFlow/ForcesOnSphereNearPlaneInShearFlow.cpp index e10ef4cb98df3a2f6995966817ac09755f718833..62cd5258d085e029eedce2f53940177244d7d187 100644 --- a/apps/benchmarks/ForcesOnSphereNearPlaneInShearFlow/ForcesOnSphereNearPlaneInShearFlow.cpp +++ b/apps/benchmarks/ForcesOnSphereNearPlaneInShearFlow/ForcesOnSphereNearPlaneInShearFlow.cpp @@ -576,7 +576,7 @@ int main( int argc, char **argv ) // set up synchronization procedure const real_t overlap = real_t( 1.5 ) * dx; - boost::function<void(void)> syncCall = boost::bind( pe::syncShadowOwners<BodyTypeTuple>, boost::ref(blocks->getBlockForest()), bodyStorageID, static_cast<WcTimingTree*>(NULL), overlap, false ); + std::function<void(void)> syncCall = boost::bind( pe::syncShadowOwners<BodyTypeTuple>, boost::ref(blocks->getBlockForest()), bodyStorageID, static_cast<WcTimingTree*>(NULL), overlap, false ); // create pe bodies @@ -635,7 +635,7 @@ int main( int argc, char **argv ) /////////////// // setup of the LBM communication for synchronizing the pdf field between neighboring blocks - boost::function< void () > commFunction; + std::function< void () > commFunction; blockforest::communication::UniformBufferedScheme< Stencil_T > scheme( blocks ); scheme.addPackInfo( make_shared< lbm::PdfFieldPackInfo< LatticeModel_T > >( pdfFieldID ) ); commFunction = scheme; diff --git a/apps/benchmarks/MotionSingleHeavySphere/MotionSingleHeavySphere.cpp b/apps/benchmarks/MotionSingleHeavySphere/MotionSingleHeavySphere.cpp index 90e2b3479e6147974feccb5fda9ffa55e997ab4d..10c97a06f7ce15460d7b93b625a50a813e0beb6c 100644 --- a/apps/benchmarks/MotionSingleHeavySphere/MotionSingleHeavySphere.cpp +++ b/apps/benchmarks/MotionSingleHeavySphere/MotionSingleHeavySphere.cpp @@ -809,7 +809,7 @@ int main( int argc, char **argv ) // set up synchronization procedure const real_t overlap = real_t( 1.5 ) * dx; - boost::function<void(void)> syncCall; + std::function<void(void)> syncCall; if( XBlocks <= uint_t(4) ) syncCall = boost::bind( pe::syncNextNeighbors<BodyTypeTuple>, boost::ref(blocks->getBlockForest()), bodyStorageID, static_cast<WcTimingTree*>(NULL), overlap, false ); else @@ -949,7 +949,7 @@ int main( int argc, char **argv ) boost::filesystem::create_directory( tpath ); // setup of the LBM communication for synchronizing the pdf field between neighboring blocks - boost::function< void () > commFunction; + std::function< void () > commFunction; blockforest::communication::UniformBufferedScheme< Stencil_T > scheme( blocks ); scheme.addPackInfo( make_shared< lbm::PdfFieldPackInfo< LatticeModel_T > >( pdfFieldID ) ); diff --git a/apps/benchmarks/UniformGrid/UniformGrid.cpp b/apps/benchmarks/UniformGrid/UniformGrid.cpp index 15c75b3f84f5524b1b61cc32e5d913de9073721f..396faa8300a9e4a54b47c7f909bf40a929e6a7f6 100644 --- a/apps/benchmarks/UniformGrid/UniformGrid.cpp +++ b/apps/benchmarks/UniformGrid/UniformGrid.cpp @@ -495,7 +495,7 @@ struct AddLB { // setup of the LB communication for synchronizing the pdf field between neighboring blocks - boost::function< void () > commFunction; + std::function< void () > commFunction; if( directComm ) { if( fullComm ) @@ -599,7 +599,7 @@ struct AddLB< LatticeModel_T, typename boost::enable_if_c< boost::mpl::or_< { // setup of the LB communication for synchronizing the pdf field between neighboring blocks - boost::function< void () > commFunction; + std::function< void () > commFunction; if( directComm ) { diff --git a/apps/showcases/BidisperseFluidizedBed/BidisperseFluidizedBedDPM.cpp b/apps/showcases/BidisperseFluidizedBed/BidisperseFluidizedBedDPM.cpp index 1d65e398765707869220e565cd283dde393a8dc5..7e5cab12994f667faf9e42ddcfdf5383b2aabd54 100644 --- a/apps/showcases/BidisperseFluidizedBed/BidisperseFluidizedBedDPM.cpp +++ b/apps/showcases/BidisperseFluidizedBed/BidisperseFluidizedBedDPM.cpp @@ -1093,7 +1093,7 @@ int main( int argc, char **argv ) { ///////////////////////////////// // drag correlation function - boost::function<Vector3<real_t> ( const Vector3<real_t>&, const Vector3<real_t> &, real_t, real_t, real_t, real_t)> dragCorrelationFunction; + std::function<Vector3<real_t> ( const Vector3<real_t>&, const Vector3<real_t> &, real_t, real_t, real_t, real_t)> dragCorrelationFunction; if( dragCorr == DragCorrelation::ErgunWenYu ) { dragCorrelationFunction = pe_coupling::discrete_particle_methods::dragForceErgunWenYu; @@ -1124,7 +1124,7 @@ int main( int argc, char **argv ) { } // lift correlation function - boost::function<Vector3<real_t> ( const Vector3<real_t> &, const Vector3<real_t> &, const Vector3<real_t> &, real_t, real_t, real_t )> liftCorrelationFunction; + std::function<Vector3<real_t> ( const Vector3<real_t> &, const Vector3<real_t> &, const Vector3<real_t> &, real_t, real_t, real_t )> liftCorrelationFunction; if( liftCorr == LiftCorrelation::NoLift ) { liftCorrelationFunction = pe_coupling::discrete_particle_methods::noLiftForce; @@ -1139,7 +1139,7 @@ int main( int argc, char **argv ) { } // added mass correlation function - boost::function<Vector3<real_t> ( const Vector3<real_t> &, const Vector3<real_t> &, real_t, real_t )> addedMassCorrelationFunction; + std::function<Vector3<real_t> ( const Vector3<real_t> &, const Vector3<real_t> &, real_t, real_t )> addedMassCorrelationFunction; if( addedMassCorr == AddedMassCorrelation::NoAM ) { addedMassCorrelationFunction = pe_coupling::discrete_particle_methods::noAddedMassForce; @@ -1154,7 +1154,7 @@ int main( int argc, char **argv ) { } // set up effective viscosity calculation - boost::function<real_t ( real_t, real_t)> effectiveViscosityFunction; + std::function<real_t ( real_t, real_t)> effectiveViscosityFunction; if( effVisc == EffectiveViscosity::None ) { effectiveViscosityFunction = pe_coupling::discrete_particle_methods::calculateUnchangedEffectiveViscosity; @@ -1186,7 +1186,7 @@ int main( int argc, char **argv ) { (*bodyVelocityTimeDerivativeEvaluator)(); // function used to evaluate the interaction force between fluid and particles - boost::function<void(void)> dragAndPressureForceEvaluationFunction; + std::function<void(void)> dragAndPressureForceEvaluationFunction; if( dpm == DPMethod::GNS ) { if (interpol == Interpolation::INearestNeighbor) { if (dist == Distribution::DNearestNeighbor) { @@ -1251,7 +1251,7 @@ int main( int argc, char **argv ) { // function to evaluate the lift force contribution - boost::function<void(void)> liftForceEvaluationFunction; + std::function<void(void)> liftForceEvaluationFunction; if( interpol == Interpolation::INearestNeighbor ) { if( dist == Distribution::DNearestNeighbor ) @@ -1311,7 +1311,7 @@ int main( int argc, char **argv ) { } // function to evaluate the added mass contribution - boost::function<void(void)> addedMassEvaluationFunction; + std::function<void(void)> addedMassEvaluationFunction; if( interpol == Interpolation::INearestNeighbor ) { if( dist == Distribution::DNearestNeighbor ) @@ -1371,7 +1371,7 @@ int main( int argc, char **argv ) { } // function to evaluate lubrication forces - boost::function<void(void)> lubricationEvaluationFunction; + std::function<void(void)> lubricationEvaluationFunction; if( lubricationCutOffDistance > real_t(0) ) { typedef pe_coupling::discrete_particle_methods::LubricationForceEvaluator LE_T; diff --git a/apps/tutorials/pe/02_ConfinedGasExtended.cpp b/apps/tutorials/pe/02_ConfinedGasExtended.cpp index c58d14c2f13d7ce22f84bd83386ae5791ffc26b8..b1ac3e4a380c915c1883213706edead118920b9a 100644 --- a/apps/tutorials/pe/02_ConfinedGasExtended.cpp +++ b/apps/tutorials/pe/02_ConfinedGasExtended.cpp @@ -147,7 +147,7 @@ int main( int argc, char ** argv ) cr.setGlobalLinearAcceleration( Vec3(0,0,0) ); WALBERLA_LOG_INFO_ON_ROOT("*** SYNCCALL ***"); - boost::function<void(void)> syncCall; + std::function<void(void)> syncCall; if (!syncShadowOwners) { syncCall = boost::bind( pe::syncNextNeighbors<BodyTuple>, boost::ref(*forest), storageID, &tt, real_c(0.0), false ); @@ -157,7 +157,7 @@ int main( int argc, char ** argv ) } //! [Bind Sync Call] - boost::function<void(void)> syncCallWithoutTT; + std::function<void(void)> syncCallWithoutTT; if (!syncShadowOwners) { syncCallWithoutTT = boost::bind( pe::syncNextNeighbors<BodyTuple>, boost::ref(*forest), storageID, static_cast<WcTimingTree*>(NULL), real_c(0.0), false ); diff --git a/src/blockforest/Block.cpp b/src/blockforest/Block.cpp index d4d081c33fc20c485e5ae817c65ccfceaffbfc47..d13ba9de7b7057dda04927ad9bb9240d98637f2b 100644 --- a/src/blockforest/Block.cpp +++ b/src/blockforest/Block.cpp @@ -97,7 +97,7 @@ Block::Block( BlockForest & forest, const PhantomBlock & phantom ) : Block::Block( BlockForest & forest, const BlockID & id, const AABB & aabb, const uint_t level, mpi::RecvBuffer & buffer, - const boost::function< uint_t ( const uint_t ) > & processMapping ) : + const std::function< uint_t ( const uint_t ) > & processMapping ) : IBlock( forest, aabb, id.getID() ), diff --git a/src/blockforest/Block.h b/src/blockforest/Block.h index 5f1a089ffa34149547d9da5105f4305c78328eff..39d958b7e8ecad45bd56d7113f1eebb8412fb41f 100644 --- a/src/blockforest/Block.h +++ b/src/blockforest/Block.h @@ -77,7 +77,7 @@ public: const std::vector< BlockReconstruction::NeighborhoodReconstructionBlock > & neighbors ); Block( BlockForest & forest, const PhantomBlock & phantom ); Block( BlockForest & forest, const BlockID & id, const AABB & aabb, const uint_t level, mpi::RecvBuffer & buffer, - const boost::function< uint_t ( const uint_t ) > & processMapping = boost::function< uint_t ( const uint_t ) >() ); + const std::function< uint_t ( const uint_t ) > & processMapping = std::function< uint_t ( const uint_t ) >() ); virtual ~Block() {} diff --git a/src/blockforest/BlockForest.h b/src/blockforest/BlockForest.h index af1a1f8aff95d4463dc3e152f9536d59f450250c..42d1081e1feb7d6af47aba14e398966cdf055066 100644 --- a/src/blockforest/BlockForest.h +++ b/src/blockforest/BlockForest.h @@ -49,16 +49,16 @@ class BlockForest : public BlockStorage { public: - typedef boost::function< void ( std::vector< std::pair< const Block *, uint_t > > & minTargetLevels, + typedef std::function< void ( std::vector< std::pair< const Block *, uint_t > > & minTargetLevels, std::vector< const Block * > & blocksAlreadyMarkedForRefinement, const BlockForest & forest ) > RefreshMinTargetLevelDeterminationFunction; - typedef boost::function< void ( BlockForest & forest, const PhantomBlockForest & phantomForest ) > RefreshCallbackFunction; + typedef std::function< void ( BlockForest & forest, const PhantomBlockForest & phantomForest ) > RefreshCallbackFunction; - typedef boost::function< void ( std::vector<uint_t> & sendTo, std::vector<uint_t> & recvFrom ) > SnapshotCreationFunction; - typedef boost::function< uint_t ( const uint_t ) > SnapshotRestorenFunction; - typedef boost::function< void () > SnapshotRestoreCallbackFunction; + typedef std::function< void ( std::vector<uint_t> & sendTo, std::vector<uint_t> & recvFrom ) > SnapshotCreationFunction; + typedef std::function< uint_t ( const uint_t ) > SnapshotRestorenFunction; + typedef std::function< void () > SnapshotRestoreCallbackFunction; enum FileIOMode { MPI_PARALLEL, MASTER_SLAVE, SERIALIZED_DISTRIBUTED }; @@ -87,7 +87,7 @@ public: class RefreshCallbackWrappper { public: - typedef boost::function< void () > Functor_T; + typedef std::function< void () > Functor_T; RefreshCallbackWrappper( const Functor_T & functor ) : functor_( functor ) {} void operator()( BlockForest &, const PhantomBlockForest & ) { functor_(); } private: @@ -354,7 +354,7 @@ public: const Set<SUID> & incompatibleSelectors = Set<SUID>::emptySet() ); template< typename T > - inline BlockDataID addBlockData( boost::function< T* ( IBlock* const block ) > function, + inline BlockDataID addBlockData( std::function< T* ( IBlock* const block ) > function, const std::string & identifier = std::string(), const Set<SUID> & requiredSelectors = Set<SUID>::emptySet(), const Set<SUID> & incompatibleSelectors = Set<SUID>::emptySet() ) @@ -452,7 +452,7 @@ public: void setRefreshPhantomBlockDataPackFunction( const PhantomBlockForest::PhantomBlockDataPackFunction & f ) { refreshPhantomBlockDataPackFunction_ = f; } void setRefreshPhantomBlockDataUnpackFunction( const PhantomBlockForest::PhantomBlockDataUnpackFunction & f ) { refreshPhantomBlockDataUnpackFunction_ = f; } - inline bool loadBalancingFunctionRegistered() const { return !refreshPhantomBlockMigrationPreparationFunction_.empty(); } + inline bool loadBalancingFunctionRegistered() const { return static_cast<bool>(refreshPhantomBlockMigrationPreparationFunction_); } /// get number of "setRefreshPhantomBlockMigrationPreparationFunction" calls inline uint_t phantomBlockMigrationIterations() const { return phantomBlockMigrationIterations_; } diff --git a/src/blockforest/GlobalLoadBalancing.h b/src/blockforest/GlobalLoadBalancing.h index 23f79d7b5d3618d50e9d8d9e0cf2f4a4d1c2e137..d14e98291fa555a6da3d47e63a563517b6d56e87 100644 --- a/src/blockforest/GlobalLoadBalancing.h +++ b/src/blockforest/GlobalLoadBalancing.h @@ -32,7 +32,7 @@ #include "core/load_balancing/MetisWrapper.h" #include "core/math/KahanSummation.h" -#include <boost/function.hpp> +#include <functional> #include <algorithm> #include <list> @@ -55,7 +55,7 @@ public: class MetisConfiguration { public: - typedef boost::function< memory_t ( const BLOCK* const, const BLOCK* const ) > CommunicationFunction; + typedef std::function< memory_t ( const BLOCK* const, const BLOCK* const ) > CommunicationFunction; MetisConfiguration( const bool _includeMetis = false, const bool _forceMetis = false, CommunicationFunction _communicationFunction = 0, const real_t _maxUbvec = real_c(1.5), const uint_t _iterations = uint_c(10) ) : diff --git a/src/blockforest/PhantomBlockForest.cpp b/src/blockforest/PhantomBlockForest.cpp index 4dce58b48c010129ca81ea30e0b5724e607c9c25..691cfe744bffa45cf7c790c86699f7a5e84dcba5 100644 --- a/src/blockforest/PhantomBlockForest.cpp +++ b/src/blockforest/PhantomBlockForest.cpp @@ -405,7 +405,7 @@ void PhantomBlockForest::migrate( const PhantomBlockDataPackFunction & packBlock if( packBlockData ) { - WALBERLA_ASSERT( unpackBlockData ); + WALBERLA_ASSERT( static_cast<bool>(unpackBlockData) ); packBlockData( buffer, *pBlock ); } @@ -483,7 +483,7 @@ void PhantomBlockForest::migrate( const PhantomBlockDataPackFunction & packBlock if( unpackBlockData ) { - WALBERLA_ASSERT( packBlockData ); + WALBERLA_ASSERT( static_cast<bool>(packBlockData) ); boost::any data; unpackBlockData( buffer, *phantom, data ); phantom->addData( data ); diff --git a/src/blockforest/PhantomBlockForest.h b/src/blockforest/PhantomBlockForest.h index 5e263158d666d839302d33beda6fcdcf90d1f2b1..797a29cbe28ee0a0463d69a9cd5417e90347a8b6 100644 --- a/src/blockforest/PhantomBlockForest.h +++ b/src/blockforest/PhantomBlockForest.h @@ -42,23 +42,23 @@ class PhantomBlockForest { public: - typedef boost::function< Set<SUID> ( const std::vector< std::pair< BlockID, Set<SUID> > > & source, const BlockID & destintation ) > + typedef std::function< Set<SUID> ( const std::vector< std::pair< BlockID, Set<SUID> > > & source, const BlockID & destintation ) > BlockStateDeterminationFunction; - typedef boost::function< void ( std::vector< std::pair< const PhantomBlock *, boost::any > > & blockData, + typedef std::function< void ( std::vector< std::pair< const PhantomBlock *, boost::any > > & blockData, const PhantomBlockForest & phantomForest ) > PhantomBlockDataAssignmentFunction; /// \param iteration execution counter of this callback /// \return should the callback rerun after phantom block migration? - typedef boost::function< bool ( std::vector< std::pair< const PhantomBlock *, uint_t > > & targetProcess, + typedef std::function< bool ( std::vector< std::pair< const PhantomBlock *, uint_t > > & targetProcess, std::set< uint_t > & processesToRecvFrom, const PhantomBlockForest & phantomForest, const uint_t iteration ) > MigrationPreparationFunction; // = load balancing - typedef boost::function< void ( mpi::SendBuffer & buffer, const PhantomBlock & block ) > PhantomBlockDataPackFunction; - typedef boost::function< void ( mpi::RecvBuffer & buffer, const PhantomBlock & block, boost::any & data ) > PhantomBlockDataUnpackFunction; + typedef std::function< void ( mpi::SendBuffer & buffer, const PhantomBlock & block ) > PhantomBlockDataPackFunction; + typedef std::function< void ( mpi::RecvBuffer & buffer, const PhantomBlock & block, boost::any & data ) > PhantomBlockDataUnpackFunction; diff --git a/src/blockforest/SetupBlockForest.h b/src/blockforest/SetupBlockForest.h index 01a1379a319bc3c948708eb8481fa0aaab56d794..dbea75a0058945ccb631e6b9689a9ec4324338ac 100644 --- a/src/blockforest/SetupBlockForest.h +++ b/src/blockforest/SetupBlockForest.h @@ -31,7 +31,7 @@ #include "core/math/AABB.h" #include "core/uid/SUID.h" -#include <boost/function.hpp> +#include <functional> #include <set> #include <string> #include <vector> @@ -45,7 +45,7 @@ class SetupBlockForest : private NonCopyable { public: - typedef boost::function< uint_t ( SetupBlockForest & forest, const uint_t numberOfProcesses, const memory_t perProcessMemoryLimit ) > + typedef std::function< uint_t ( SetupBlockForest & forest, const uint_t numberOfProcesses, const memory_t perProcessMemoryLimit ) > TargetProcessAssignmentFunction; // returns number of processes (may be lower than numberOfProcesses) @@ -72,14 +72,14 @@ public: // Do not use a vector of bool's! Due to the implementation of this vector in the standard library, parallel access to a // vector of bool's - even on different elements - is not thread-safe! - typedef boost::function< void ( std::vector<uint8_t>& excludeBlock, const RootBlockAABB& aabb ) > RootBlockExclusionFunction; + typedef std::function< void ( std::vector<uint8_t>& excludeBlock, const RootBlockAABB& aabb ) > RootBlockExclusionFunction; - typedef boost::function< void ( SetupBlockForest& forest ) > RefinementSelectionFunction; - typedef boost::function< void ( SetupBlockForest& forest ) > WorkloadMemorySUIDAssignmentFunction; + typedef std::function< void ( SetupBlockForest& forest ) > RefinementSelectionFunction; + typedef std::function< void ( SetupBlockForest& forest ) > WorkloadMemorySUIDAssignmentFunction; typedef std::vector< std::pair< const SetupBlock*, const SetupBlock* > > CommunicationPairs; typedef std::vector< real_t > CommunicationWeights; - typedef boost::function< void ( const CommunicationPairs &, CommunicationWeights & ) > CommunicationWeightFunction; + typedef std::function< void ( const CommunicationPairs &, CommunicationWeights & ) > CommunicationWeightFunction; inline static void NullCommunicationWeightFunction( const CommunicationPairs &, CommunicationWeights & ) { diff --git a/src/blockforest/StructuredBlockForest.h b/src/blockforest/StructuredBlockForest.h index 19de504b62ee54e2aa91bdd9c739cbe0899b362f..82f4e810d1444d18ebbb1f47e9cd19a42d2ab2c2 100644 --- a/src/blockforest/StructuredBlockForest.h +++ b/src/blockforest/StructuredBlockForest.h @@ -138,7 +138,7 @@ public: { return blockForest_->addBlockData( dataHandling, identifier, requiredSelectors, incompatibleSelectors ); } template< typename T > - inline BlockDataID addBlockData( boost::function< T* ( IBlock* const block ) > function, + inline BlockDataID addBlockData( std::function< T* ( IBlock* const block ) > function, const std::string& identifier = std::string(), const Set<SUID>& requiredSelectors = Set<SUID>::emptySet(), const Set<SUID>& incompatibleSelectors = Set<SUID>::emptySet() ) diff --git a/src/blockforest/communication/NonUniformBufferedScheme.h b/src/blockforest/communication/NonUniformBufferedScheme.h index 12d059fc6b2914f4e57c3399a8fe79007731f405..e2eca543d736d543748d115ee645f91b12323e01 100644 --- a/src/blockforest/communication/NonUniformBufferedScheme.h +++ b/src/blockforest/communication/NonUniformBufferedScheme.h @@ -37,7 +37,7 @@ #include "core/uid/SUID.h" #include <boost/bind.hpp> -#include <boost/function.hpp> +#include <functional> #include <map> #include <set> @@ -60,8 +60,8 @@ public: typedef mpi::RecvBuffer RecvBuffer; typedef shared_ptr< blockforest::communication::NonUniformPackInfo > PackInfo; - typedef boost::function<void ()> VoidFunction; - typedef boost::function<void ( SendBuffer & buffer )> SendBufferFunction; + typedef std::function<void ()> VoidFunction; + typedef std::function<void ( SendBuffer & buffer )> SendBufferFunction; //**Construction & Destruction*************************************************************************************** /*! \name Construction & Destruction */ @@ -110,7 +110,7 @@ public: //@{ void startCommunication() { startCommunicateEqualLevel(); startCommunicateCoarseToFine(); startCommunicateFineToCoarse(); } - boost::function<void()> getStartCommunicateFunctor() { return boost::bind( &NonUniformBufferedScheme::startCommunication, this ); } + std::function<void()> getStartCommunicateFunctor() { return boost::bind( &NonUniformBufferedScheme::startCommunication, this ); } inline void startCommunicateEqualLevel(); inline void startCommunicateCoarseToFine(); @@ -121,7 +121,7 @@ public: inline void startCommunicateFineToCoarse( const uint_t fineLevel ); void wait() { waitCommunicateEqualLevel(); waitCommunicateCoarseToFine(); waitCommunicateFineToCoarse(); } - boost::function<void() > getWaitFunctor() { return boost::bind( &NonUniformBufferedScheme::wait, this ); } + std::function<void() > getWaitFunctor() { return boost::bind( &NonUniformBufferedScheme::wait, this ); } inline void waitCommunicateEqualLevel(); inline void waitCommunicateCoarseToFine(); diff --git a/src/blockforest/communication/UniformBufferedScheme.h b/src/blockforest/communication/UniformBufferedScheme.h index 5fc500e20c7fb6aa710b2dd87d047c4777762a05..393301f6c78039790a97c6f752798e344c1c07a0 100644 --- a/src/blockforest/communication/UniformBufferedScheme.h +++ b/src/blockforest/communication/UniformBufferedScheme.h @@ -39,7 +39,7 @@ #include "core/uid/SUID.h" #include <boost/bind.hpp> -#include <boost/function.hpp> +#include <functional> #include <map> #include <vector> @@ -89,8 +89,8 @@ public: typedef shared_ptr< walberla::communication::UniformPackInfo > PackInfo; - typedef boost::function<void ()> VoidFunction; - typedef boost::function<void ( SendBuffer & buffer )> SendBufferFunction; + typedef std::function<void ()> VoidFunction; + typedef std::function<void ( SendBuffer & buffer )> SendBufferFunction; typedef walberla::communication::UniformPackInfo CommunicationItemInfo; @@ -161,8 +161,8 @@ public: void startCommunication(); void wait(); - boost::function<void()> getStartCommunicateFunctor(); - boost::function<void()> getWaitFunctor(); + std::function<void()> getStartCommunicateFunctor(); + std::function<void()> getWaitFunctor(); //@} //******************************************************************************************************************* @@ -537,13 +537,13 @@ void UniformBufferedScheme<Stencil>::localBufferUnpacking( const uint_t index, c } template< typename Stencil > -boost::function<void()> UniformBufferedScheme<Stencil>::getStartCommunicateFunctor() +std::function<void()> UniformBufferedScheme<Stencil>::getStartCommunicateFunctor() { return boost::bind( &UniformBufferedScheme::startCommunication, this ); } template< typename Stencil > -boost::function<void()> UniformBufferedScheme<Stencil>::getWaitFunctor() +std::function<void()> UniformBufferedScheme<Stencil>::getWaitFunctor() { return boost::bind( &UniformBufferedScheme::wait, this ); } diff --git a/src/blockforest/communication/UniformDirectScheme.h b/src/blockforest/communication/UniformDirectScheme.h index 4c2e0a4de906279f784d1dd2144d9c3deb17f65d..16d6e9fdda939275ba60ce3ef22aa98b5db9f143 100644 --- a/src/blockforest/communication/UniformDirectScheme.h +++ b/src/blockforest/communication/UniformDirectScheme.h @@ -112,8 +112,8 @@ public: void startCommunication(); void wait(); - boost::function<void()> getStartCommunicateFunctor() { return boost::bind( &UniformDirectScheme::startCommunication, this ); } - boost::function<void()> getWaitFunctor() { return boost::bind( &UniformDirectScheme::wait, this ); } + std::function<void()> getStartCommunicateFunctor() { return boost::bind( &UniformDirectScheme::startCommunication, this ); } + std::function<void()> getWaitFunctor() { return boost::bind( &UniformDirectScheme::wait, this ); } //@} //******************************************************************************************************************* diff --git a/src/blockforest/loadbalancing/StaticParMetis.h b/src/blockforest/loadbalancing/StaticParMetis.h index 85012654d1d170899034d09a50e529e2d78218e9..0e77baf45b72be5a6f6991fed3c8cc49891f94f9 100644 --- a/src/blockforest/loadbalancing/StaticParMetis.h +++ b/src/blockforest/loadbalancing/StaticParMetis.h @@ -41,7 +41,7 @@ public: enum WeightsToUse { PARMETIS_NO_WEIGHTS = 0, PARMETIS_EDGE_WEIGHTS = 1, PARMETIS_VERTEX_WEIGHTS = 2, PARMETIS_BOTH_WEIGHTS = 3 }; typedef std::pair< const SetupBlock *, const SetupBlock * > BlockPair; - typedef boost::function<void (const std::vector< BlockPair > & edges, std::vector< int64_t > & weights ) > CommWeightFunction; + typedef std::function<void (const std::vector< BlockPair > & edges, std::vector< int64_t > & weights ) > CommWeightFunction; StaticLevelwiseParMetis( const Algorithm algorithm = PARMETIS_PART_GEOM_KWAY ) : algorithm_( algorithm ), weightsToUse_( PARMETIS_VERTEX_WEIGHTS ) {} diff --git a/src/core/Abort.h b/src/core/Abort.h index 3fa01308bd24c40baa1283691cee7bdb3c380afd..8c52f6783d8539613492498be0bd66ae7858b1a6 100644 --- a/src/core/Abort.h +++ b/src/core/Abort.h @@ -23,7 +23,7 @@ #include "core/singleton/Singleton.h" -#include <boost/function.hpp> +#include <functional> #include <cstdlib> #include <sstream> #include <stdexcept> @@ -40,7 +40,7 @@ class Abort : public singleton::Singleton<Abort> public: - typedef boost::function<void ( const std::string & message, const std::string & callerPath, const int line, bool withDebugInfo )> AbortFunction; + typedef std::function<void ( const std::string & message, const std::string & callerPath, const int line, bool withDebugInfo )> AbortFunction; void resetAbortFunction( const AbortFunction & function = AbortFunction() ) { abortFunction_ = function; } diff --git a/src/core/debug/Debug.h b/src/core/debug/Debug.h index 8bca728a3a9af53e395ec413a069095409bd56e3..3ea4bcd054c16039fb2adedfaf4e8043ed38ff5c 100644 --- a/src/core/debug/Debug.h +++ b/src/core/debug/Debug.h @@ -25,7 +25,7 @@ #ifndef NDEBUG # include "CheckFunctions.h" -# include <boost/function.hpp> +# include <functional> # include <boost/bind.hpp> # include <string> #endif @@ -255,12 +255,12 @@ void myAssert(const char * const file, const int line); class ConditionalExec { public: - ConditionalExec( bool cond, const boost::function<void (void)> & function ) : cond_(cond), function_(function) { } + ConditionalExec( bool cond, const std::function<void (void)> & function ) : cond_(cond), function_(function) { } ~ConditionalExec() { if(cond_) function_(); } operator bool() const { return cond_; } private: bool cond_; - boost::function<void (void)> function_; + std::function<void (void)> function_; }; /// \endcond diff --git a/src/core/logging/Logging.h b/src/core/logging/Logging.h index 0f7a88319dfa29625b18ee6faa59a3179538a7bf..603b944142e3dd564bd57ffaa7b2e03b5dc1e84a 100644 --- a/src/core/logging/Logging.h +++ b/src/core/logging/Logging.h @@ -31,7 +31,7 @@ #include "core/Regex.h" #include <boost/algorithm/string/replace.hpp> -#include <boost/function.hpp> +#include <functional> #include <cmath> #include <fstream> diff --git a/src/core/mpi/OpenMPBufferSystem.cpp b/src/core/mpi/OpenMPBufferSystem.cpp index afdc66b1af087e43b9195f59d47e571cee161a0d..54471ccf415c82cd2403d0a4db3c122de9ced943 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, boost::function<void ( RecvBuffer & buf ) > recvFunction ) +void OpenMPBufferSystem::addReceivingFunction( MPIRank rank, std::function<void ( RecvBuffer & buf ) > recvFunction ) { dirty_ = true; recvFunctions_[rank] = recvFunction; } -void OpenMPBufferSystem::addSendingFunction ( MPIRank rank, boost::function<void ( SendBuffer & buf ) > sendFunction ) +void OpenMPBufferSystem::addSendingFunction ( MPIRank rank, 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 f38f471608cdf00f36a3c7d062149c14500b7eee..9fd31e2b2146b23fef31a8b1ae768621cadeb738 100644 --- a/src/core/mpi/OpenMPBufferSystem.h +++ b/src/core/mpi/OpenMPBufferSystem.h @@ -23,7 +23,7 @@ #include "BufferSystem.h" -#include <boost/function.hpp> +#include <functional> #include <map> @@ -60,8 +60,8 @@ public: bool isSizeCommunicatedInNextStep() const { return bs_.isSizeCommunicatedInNextStep(); } - void addReceivingFunction( MPIRank rank, boost::function<void ( RecvBuffer & buf ) > recvFunction ); - void addSendingFunction ( MPIRank rank, boost::function<void ( SendBuffer & buf ) > sendFunction ); + void addReceivingFunction( MPIRank rank, std::function<void ( RecvBuffer & buf ) > recvFunction ); + void addSendingFunction ( MPIRank rank, std::function<void ( SendBuffer & buf ) > sendFunction ); void clearReceivingFunctions() { dirty_ = true; recvFunctions_.clear(); } void clearSendingFunctions() { dirty_ = true; sendFunctions_.clear(); sendRanks_.clear(); } @@ -86,11 +86,11 @@ private: bool sizeChangesEverytime_; - std::map<MPIRank, boost::function<void ( RecvBuffer & )> > recvFunctions_; + std::map<MPIRank, std::function<void ( RecvBuffer & )> > recvFunctions_; std::vector<MPIRank> sendRanks_; - std::vector< boost::function<void ( SendBuffer & )> > sendFunctions_; + std::vector< std::function<void ( SendBuffer & )> > sendFunctions_; void startCommunicationOpenMP(); void startCommunicationSerial(); diff --git a/src/cuda/FieldCopy.h b/src/cuda/FieldCopy.h index 87af5060d139cefd2ef529ab4c51878bc5f72816..07fd04c808032fccd21c3f00f98600294b124a9b 100644 --- a/src/cuda/FieldCopy.h +++ b/src/cuda/FieldCopy.h @@ -49,7 +49,7 @@ namespace cuda { } template<typename DstType, typename SrcType> - boost::function<void()> fieldCpyFunctor( const shared_ptr< StructuredBlockStorage > & blocks, + std::function<void()> fieldCpyFunctor( const shared_ptr< StructuredBlockStorage > & blocks, BlockDataID dstID, ConstBlockDataID srcID ) { return boost::bind( fieldCpy<DstType,SrcType>, blocks, dstID, srcID ); @@ -66,7 +66,7 @@ namespace cuda { } template<typename DstType, typename SrcType> - boost::function<void(IBlock*)> fieldCpyFunctor( BlockDataID dstID, ConstBlockDataID srcID ) + std::function<void(IBlock*)> fieldCpyFunctor( BlockDataID dstID, ConstBlockDataID srcID ) { return boost::bind( fieldCpySweepFunction<DstType,SrcType>, dstID, srcID, _1 ); } diff --git a/src/domain_decomposition/BlockDataHandling.h b/src/domain_decomposition/BlockDataHandling.h index c9e74212e1132d8f6f1f1546ba93e4102d23b7cb..4bd96dae090d6c09d5c43498d61343600803312b 100644 --- a/src/domain_decomposition/BlockDataHandling.h +++ b/src/domain_decomposition/BlockDataHandling.h @@ -82,7 +82,7 @@ class BlockDataHandlingFunctionAdaptor : public BlockDataHandling<T> { public: - typedef boost::function< T* ( IBlock * const block ) > Function; + typedef std::function< T* ( IBlock * const block ) > Function; BlockDataHandlingFunctionAdaptor( const Function & function ) : function_( function ) {} @@ -130,7 +130,7 @@ struct BlockDataCreator requiredSelectors_( requiredSelectors ), incompatibleSelectors_( incompatibleSelectors ) {} - BlockDataCreator( const boost::function< T* ( IBlock * const block ) > & function, + BlockDataCreator( const std::function< T* ( IBlock * const block ) > & function, const std::string & identifier = std::string(), const Set<SUID> & requiredSelectors = Set<SUID>::emptySet(), const Set<SUID> & incompatibleSelectors = Set<SUID>::emptySet() ) : diff --git a/src/domain_decomposition/BlockStorage.h b/src/domain_decomposition/BlockStorage.h index 4d3292e21e0d6a8e7f87ae2c42c3271ade5fed79..fb778309aae9853272eef2c8402d3d553d6a2e7a 100644 --- a/src/domain_decomposition/BlockStorage.h +++ b/src/domain_decomposition/BlockStorage.h @@ -34,7 +34,7 @@ #include "core/uid/GlobalState.h" #include "core/uid/SUID.h" -#include <boost/function.hpp> +#include <functional> //#include <boost/type_traits/is_base_of.hpp> #include <string> #include <vector> @@ -472,7 +472,7 @@ public: const Set<SUID> & incompatibleSelectors = Set<SUID>::emptySet() ); template< typename T > - inline BlockDataID addBlockData( boost::function< T* ( IBlock* const block ) > function, + inline BlockDataID addBlockData( std::function< T* ( IBlock* const block ) > function, const std::string & identifier = std::string(), const Set<SUID> & requiredSelectors = Set<SUID>::emptySet(), const Set<SUID> & incompatibleSelectors = Set<SUID>::emptySet() ); @@ -676,7 +676,7 @@ inline BlockDataID BlockStorage::addBlockData( const shared_ptr< T > & dataHandl */ //********************************************************************************************************************** template< typename T > -inline BlockDataID BlockStorage::addBlockData( boost::function< T* ( IBlock* const block ) > function, const std::string & identifier, +inline BlockDataID BlockStorage::addBlockData( std::function< T* ( IBlock* const block ) > function, const std::string & identifier, const Set<SUID> & requiredSelectors, const Set<SUID> & incompatibleSelectors ) { internal::SelectableBlockDataHandlingWrapper dataHandling( diff --git a/src/domain_decomposition/MakeBlockDataInitFunction.h b/src/domain_decomposition/MakeBlockDataInitFunction.h index 2f82ea473cba060f1994e3df0520e6496cc08b3f..466f944c110341acdde00a786e45fa39d3764e05 100644 --- a/src/domain_decomposition/MakeBlockDataInitFunction.h +++ b/src/domain_decomposition/MakeBlockDataInitFunction.h @@ -24,7 +24,7 @@ #include "IBlock.h" #include <boost/bind.hpp> -#include <boost/function.hpp> +#include <functional> namespace walberla { @@ -91,61 +91,61 @@ namespace internal template<class T> -boost::function< T* ( const IBlock* const block ) > +std::function< T* ( const IBlock* const block ) > makeBlockDataInitFunction() { return boost::bind( internal::newFunc<T>, _1); } template<class T, class P1> -boost::function< T* ( const IBlock* const block ) > +std::function< T* ( const IBlock* const block ) > makeBlockDataInitFunction(const P1 & p1) { return boost::bind( internal::newFunc<T,P1>, _1,p1); } template<class T, class P1, class P2> -boost::function< T* ( const IBlock* const block ) > +std::function< T* ( const IBlock* const block ) > makeBlockDataInitFunction(const P1 & p1, const P2 & p2) { return boost::bind( internal::newFunc<T,P1,P2>, _1,p1,p2); } template<class T, class P1, class P2, class P3> -boost::function< T* ( const IBlock* const block ) > +std::function< T* ( const IBlock* const block ) > makeBlockDataInitFunction(const P1 & p1, const P2 & p2, const P3 & p3) { return boost::bind( internal::newFunc<T,P1,P2,P3>, _1,p1,p2,p3); } template<class T, class P1, class P2, class P3, class P4> -boost::function< T* ( const IBlock* const block ) > +std::function< T* ( const IBlock* const block ) > makeBlockDataInitFunction(const P1 & p1, const P2 & p2, const P3 & p3, const P4 & p4) { return boost::bind( internal::newFunc<T,P1,P2,P3,P4>, _1,p1,p2,p3,p4); } template<class T, class P1, class P2, class P3, class P4, class P5> -boost::function< T* ( const IBlock* const block ) > +std::function< T* ( const IBlock* const block ) > makeBlockDataInitFunction(const P1 & p1, const P2 & p2, const P3 & p3, const P4 & p4, const P5 & p5) { return boost::bind( internal::newFunc<T,P1,P2,P3,P4,P5>, _1,p1,p2,p3,p4,p5); } template<class T, class P1, class P2, class P3, class P4, class P5, class P6> -boost::function< T* ( const IBlock* const block ) > +std::function< T* ( const IBlock* const block ) > makeBlockDataInitFunction(const P1 & p1, const P2 & p2, const P3 & p3, const P4 & p4, const P5 & p5, const P6 & p6) { return boost::bind( internal::newFunc<T,P1,P2,P3,P4,P5,P6>, _1,p1,p2,p3,p4,p5,p6); } template<class T, class P1, class P2, class P3, class P4, class P5, class P6, class P7> -boost::function< T* ( const IBlock* const block ) > +std::function< T* ( const IBlock* const block ) > makeBlockDataInitFunction(const P1 & p1, const P2 & p2, const P3 & p3, const P4 & p4, const P5 & p5, const P6 & p6, const P7 & p7) { return boost::bind( internal::newFunc<T,P1,P2,P3,P4,P5,P6,P7>, _1,p1,p2,p3,p4,p5,p6,p7); } template<class T, class P1, class P2, class P3, class P4, class P5, class P6, class P7, class P8> -boost::function< T* ( const IBlock* const block ) > +std::function< T* ( const IBlock* const block ) > makeBlockDataInitFunction(const P1 & p1, const P2 & p2, const P3 & p3, const P4 & p4, const P5 & p5, const P6 & p6, const P7 & p7, const P8 & p8) { return boost::bind( internal::newFunc<T,P1,P2,P3,P4,P5,P6,P7,P8>, _1,p1,p2,p3,p4,p5,p6,p7,p8); } template<class T, class P1, class P2, class P3, class P4, class P5, class P6, class P7, class P8, class P9> -boost::function< T* ( const IBlock* const block ) > +std::function< T* ( const IBlock* const block ) > makeBlockDataInitFunction(const P1 & p1, const P2 & p2, const P3 & p3, const P4 & p4, const P5 & p5, const P6 & p6, const P7 & p7, const P8 & p8, const P9 & p9) { return boost::bind( internal::newFunc<T,P1,P2,P3,P4,P5,P6,P7,P8,P9>, _1,p1,p2,p3,p4,p5,p6,p7,p8,p9); } diff --git a/src/domain_decomposition/StructuredBlockStorage.h b/src/domain_decomposition/StructuredBlockStorage.h index 8fbd4fb04abfcd0c1aba0dea8229abafea802635..4315429d285f3189e82d367f75d0a2f48bd895c8 100644 --- a/src/domain_decomposition/StructuredBlockStorage.h +++ b/src/domain_decomposition/StructuredBlockStorage.h @@ -43,14 +43,14 @@ template< typename T > struct StructuredBlockDataCreator { StructuredBlockDataCreator( - const boost::function< T * ( IBlock * const block, StructuredBlockStorage * const storage ) > & function, + const std::function< T * ( IBlock * const block, StructuredBlockStorage * const storage ) > & function, const std::string & identifier = std::string(), const Set<SUID> & requiredSelectors = Set<SUID>::emptySet(), const Set<SUID> & incompatibleSelectors = Set<SUID>::emptySet() ) : function_( function ), identifier_( identifier ), requiredSelectors_( requiredSelectors ), incompatibleSelectors_( incompatibleSelectors ) {} - boost::function< T * ( IBlock * const block, StructuredBlockStorage * const storage ) > function_; + std::function< T * ( IBlock * const block, StructuredBlockStorage * const storage ) > function_; std::string identifier_; Set<SUID> requiredSelectors_; @@ -243,7 +243,7 @@ public: { return blockStorage_->addBlockData( dataHandling, identifier, requiredSelectors, incompatibleSelectors ); } template< typename T > - inline BlockDataID addBlockData( boost::function< T* ( IBlock* const block ) > function, + inline BlockDataID addBlockData( std::function< T* ( IBlock* const block ) > function, const std::string& identifier = std::string(), const Set<SUID>& requiredSelectors = Set<SUID>::emptySet(), const Set<SUID>& incompatibleSelectors = Set<SUID>::emptySet() ) @@ -413,7 +413,7 @@ public: { return StructuredBlockDataAdder( *this, identifier ); } template< typename T > - inline BlockDataID addStructuredBlockData( boost::function< T* ( IBlock* const block, StructuredBlockStorage* const storage ) > function, + inline BlockDataID addStructuredBlockData( std::function< T* ( IBlock* const block, StructuredBlockStorage* const storage ) > function, const std::string& identifier = std::string(), const Set<SUID>& requiredSelectors = Set<SUID>::emptySet(), const Set<SUID>& incompatibleSelectors = Set<SUID>::emptySet() ); @@ -1072,7 +1072,7 @@ inline void StructuredBlockStorage::transformBlockLocalToGlobalCellInterval( Cel //********************************************************************************************************************** template< typename T > inline BlockDataID StructuredBlockStorage::addStructuredBlockData( - boost::function< T* ( IBlock* const block, StructuredBlockStorage* const storage ) > function, + std::function< T* ( IBlock* const block, StructuredBlockStorage* const storage ) > function, const std::string& identifier, const Set<SUID>& requiredSelectors, const Set<SUID>& incompatibleSelectors ) { internal::SelectableBlockDataHandlingWrapper dataHandling( diff --git a/src/fft/Fft.cpp b/src/fft/Fft.cpp index f54423ee7044b8f6b668c31bee2e7816646719fd..bbae269ea245a124fe5ca0b8208d5bd408db6bb4 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, - boost::function<real_t(uint_t,uint_t,uint_t)> greens ) + 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 0f4c29f469d95e6a464af99b9925caa0194bb861..481c96bb86843ef632034bd4e301dfb6596a9d92 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, - boost::function<real_t(uint_t,uint_t,uint_t)> greens = boost::function<real_t(uint_t,uint_t,uint_t)>() ); + 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/field/AccuracyEvaluation.h b/src/field/AccuracyEvaluation.h index a043dc0958f1664ff4cc35bab891152107dadd7f..4f6e40176bd85bf9db91aba8318ac6311f37bdf7 100644 --- a/src/field/AccuracyEvaluation.h +++ b/src/field/AccuracyEvaluation.h @@ -133,7 +133,7 @@ inline real_t accuracyEvaluationAbsError( const Vector3<real_t> & error ) { retu //********************************************************************************************************************** template< typename Field_T, - typename SolutionFunction_T = boost::function< typename Field_T::value_type ( const Vector3< real_t > & ) >, + typename SolutionFunction_T = std::function< typename Field_T::value_type ( const Vector3< real_t > & ) >, typename Filter_T = DefaultEvaluationFilter > class AccuracyEvaluation { diff --git a/src/field/AccuracyEvaluationLinePlot.h b/src/field/AccuracyEvaluationLinePlot.h index 217a2c55a4e77044913ba85b2889d97593fb4f32..d2c1fcbe66019004261c61fa9d9ffc06d33376ea 100644 --- a/src/field/AccuracyEvaluationLinePlot.h +++ b/src/field/AccuracyEvaluationLinePlot.h @@ -191,7 +191,7 @@ inline void accuracyEvaluationLinePlotIO( std::ofstream & file, const std::vecto //********************************************************************************************************************** template< typename Field_T, - typename SolutionFunction_T = boost::function< typename Field_T::value_type ( const Vector3< real_t > & ) >, + typename SolutionFunction_T = std::function< typename Field_T::value_type ( const Vector3< real_t > & ) >, typename Filter_T = DefaultEvaluationFilter > class AccuracyEvaluationLinePlot { diff --git a/src/field/AddToStorage.h b/src/field/AddToStorage.h index 5136dab5ab7a4261ff381ad2eb660f77fd91f0c8..7895d3b555663386540c135f755af734eca76435 100644 --- a/src/field/AddToStorage.h +++ b/src/field/AddToStorage.h @@ -64,8 +64,8 @@ BlockDataID addFlagFieldToStorage( const shared_ptr< BlockStorage_T > & blocks, const std::string & identifier, const uint_t nrOfGhostLayers = uint_t(1), const bool alwaysInitialize = false, - const boost::function< void ( FlagField_T * field, IBlock * const block ) > & initFunction = - boost::function< void ( FlagField_T * field, IBlock * const block ) >(), + const std::function< void ( FlagField_T * field, IBlock * const block ) > & initFunction = + std::function< void ( FlagField_T * field, IBlock * const block ) >(), const Set<SUID> & requiredSelectors = Set<SUID>::emptySet(), const Set<SUID> & incompatibleSelectors = Set<SUID>::emptySet() ) { @@ -91,7 +91,7 @@ BlockDataID addFlagFieldToStorage( const shared_ptr< BlockStorage_T > & blocks, const Set<SUID> & requiredSelectors, const Set<SUID> & incompatibleSelectors = Set<SUID>::emptySet() ) { return addFlagFieldToStorage< FlagField_T >( blocks, identifier, nrOfGhostLayers, alwaysInitialize, - boost::function< void ( FlagField_T * field, IBlock * const block ) >(), + std::function< void ( FlagField_T * field, IBlock * const block ) >(), requiredSelectors, incompatibleSelectors ); } @@ -108,9 +108,9 @@ struct AddToStorage { static BlockDataID add( const shared_ptr< BlockStorage_T > & blocks, const std::string & identifier, const typename GhostLayerField_T::value_type & initValue, const Layout layout, const uint_t nrOfGhostLayers, - const bool /*alwaysInitialize*/, const boost::function< void ( GhostLayerField_T * field, IBlock * const block ) > & initFunction, + const bool /*alwaysInitialize*/, const std::function< void ( GhostLayerField_T * field, IBlock * const block ) > & initFunction, const Set<SUID> & requiredSelectors, const Set<SUID> & incompatibleSelectors, - const boost::function< Vector3< uint_t > ( const shared_ptr< StructuredBlockStorage > &, IBlock * const ) > calculateSize = defaultSize ) + const std::function< Vector3< uint_t > ( const shared_ptr< StructuredBlockStorage > &, IBlock * const ) > calculateSize = defaultSize ) { auto dataHandling = walberla::make_shared< field::AlwaysInitializeBlockDataHandling< GhostLayerField_T > >( blocks, nrOfGhostLayers, initValue, layout, calculateSize ); dataHandling->addInitializationFunction( initFunction ); @@ -125,9 +125,9 @@ struct AddToStorage< GhostLayerField_T, BlockStorage_T, { static BlockDataID add( const shared_ptr< BlockStorage_T > & blocks, const std::string & identifier, const typename GhostLayerField_T::value_type & initValue, const Layout layout, const uint_t nrOfGhostLayers, - const bool alwaysInitialize, const boost::function< void ( GhostLayerField_T * field, IBlock * const block ) > & initFunction, + const bool alwaysInitialize, const std::function< void ( GhostLayerField_T * field, IBlock * const block ) > & initFunction, const Set<SUID> & requiredSelectors, const Set<SUID> & incompatibleSelectors, - const boost::function< Vector3< uint_t > ( const shared_ptr< StructuredBlockStorage > &, IBlock * const ) > calculateSize = defaultSize ) + const std::function< Vector3< uint_t > ( const shared_ptr< StructuredBlockStorage > &, IBlock * const ) > calculateSize = defaultSize ) { if( alwaysInitialize ) { @@ -153,8 +153,8 @@ BlockDataID addToStorage( const shared_ptr< BlockStorage_T > & blocks, const Layout layout = zyxf, const uint_t nrOfGhostLayers = uint_t(1), const bool alwaysInitialize = false, - const boost::function< void ( GhostLayerField_T * field, IBlock * const block ) > & initFunction = - boost::function< void ( GhostLayerField_T * field, IBlock * const block ) >(), + const std::function< void ( GhostLayerField_T * field, IBlock * const block ) > & initFunction = + std::function< void ( GhostLayerField_T * field, IBlock * const block ) >(), const Set<SUID> & requiredSelectors = Set<SUID>::emptySet(), const Set<SUID> & incompatibleSelectors = Set<SUID>::emptySet() ) { @@ -174,7 +174,7 @@ BlockDataID addToStorage( const shared_ptr< BlockStorage_T > & blocks, const Set<SUID> & requiredSelectors, const Set<SUID> & incompatibleSelectors = Set<SUID>::emptySet() ) { return addToStorage< GhostLayerField_T >( blocks, identifier, initValue, layout, nrOfGhostLayers, alwaysInitialize, - boost::function< void ( GhostLayerField_T * field, IBlock * const block ) >(), + std::function< void ( GhostLayerField_T * field, IBlock * const block ) >(), requiredSelectors, incompatibleSelectors ); } @@ -183,13 +183,13 @@ BlockDataID addToStorage( const shared_ptr< BlockStorage_T > & blocks, template< typename GhostLayerField_T, typename BlockStorage_T > BlockDataID addToStorage( const shared_ptr< BlockStorage_T > & blocks, const std::string & identifier, - const boost::function< Vector3< uint_t > ( const shared_ptr< StructuredBlockStorage > &, IBlock * const ) > calculateSize, + const std::function< Vector3< uint_t > ( const shared_ptr< StructuredBlockStorage > &, IBlock * const ) > calculateSize, const typename GhostLayerField_T::value_type & initValue = typename GhostLayerField_T::value_type(), const Layout layout = zyxf, const uint_t nrOfGhostLayers = uint_t(1), const bool alwaysInitialize = false, - const boost::function< void ( GhostLayerField_T * field, IBlock * const block ) > & initFunction = - boost::function< void ( GhostLayerField_T * field, IBlock * const block ) >(), + const std::function< void ( GhostLayerField_T * field, IBlock * const block ) > & initFunction = + std::function< void ( GhostLayerField_T * field, IBlock * const block ) >(), const Set<SUID> & requiredSelectors = Set<SUID>::emptySet(), const Set<SUID> & incompatibleSelectors = Set<SUID>::emptySet() ) { @@ -203,7 +203,7 @@ BlockDataID addToStorage( const shared_ptr< BlockStorage_T > & blocks, template< typename GhostLayerField_T, typename BlockStorage_T > BlockDataID addToStorage( const shared_ptr< BlockStorage_T > & blocks, const std::string & identifier, - const boost::function< Vector3< uint_t > ( const shared_ptr< StructuredBlockStorage > &, IBlock * const ) > calculateSize, + const std::function< Vector3< uint_t > ( const shared_ptr< StructuredBlockStorage > &, IBlock * const ) > calculateSize, const typename GhostLayerField_T::value_type & initValue, const Layout layout, const uint_t nrOfGhostLayers, @@ -211,7 +211,7 @@ BlockDataID addToStorage( const shared_ptr< BlockStorage_T > & blocks, const Set<SUID> & requiredSelectors, const Set<SUID> & incompatibleSelectors = Set<SUID>::emptySet() ) { return addToStorage< GhostLayerField_T >( blocks, identifier, initValue, layout, nrOfGhostLayers, alwaysInitialize, - boost::function< void ( GhostLayerField_T * field, IBlock * const block ) >(), + std::function< void ( GhostLayerField_T * field, IBlock * const block ) >(), requiredSelectors, incompatibleSelectors, calculateSize ); } @@ -274,8 +274,8 @@ struct Creator : public domain_decomposition::BlockDataCreator< GhostLayerField_ const Layout layout = zyxf, const uint_t nrOfGhostLayers = uint_t(1), const bool /*alwaysInitialize*/ = false, - const boost::function< void ( GhostLayerField_T * field, IBlock * const block ) > & initFunction = - boost::function< void ( GhostLayerField_T * field, IBlock * const block ) >() ) : + const std::function< void ( GhostLayerField_T * field, IBlock * const block ) > & initFunction = + std::function< void ( GhostLayerField_T * field, IBlock * const block ) >() ) : domain_decomposition::BlockDataCreator< GhostLayerField_T >( shared_ptr< field::DefaultBlockDataHandling< GhostLayerField_T > >(), identifier, requiredSelectors, incompatibleSelectors ) { @@ -313,8 +313,8 @@ struct Creator< GhostLayerField_T, const Layout layout = zyxf, const uint_t nrOfGhostLayers = uint_t(1), const bool alwaysInitialize = false, - const boost::function< void ( GhostLayerField_T * field, IBlock * const block ) > & initFunction = - boost::function< void ( GhostLayerField_T * field, IBlock * const block ) >() ) : + const std::function< void ( GhostLayerField_T * field, IBlock * const block ) > & initFunction = + std::function< void ( GhostLayerField_T * field, IBlock * const block ) >() ) : domain_decomposition::BlockDataCreator< GhostLayerField_T >( shared_ptr< field::DefaultBlockDataHandling< GhostLayerField_T > >(), identifier, requiredSelectors, incompatibleSelectors ) { @@ -358,8 +358,8 @@ struct Creator< FlagField<T> > : public domain_decomposition::BlockDataCreator< const Set<SUID> & incompatibleSelectors, const uint_t nrOfGhostLayers = uint_t(1), const bool alwaysInitialize = false, - const boost::function< void ( FlagField<T> * field, IBlock * const block ) > & initFunction = - boost::function< void ( FlagField<T> * field, IBlock * const block ) >() ) : + const std::function< void ( FlagField<T> * field, IBlock * const block ) > & initFunction = + std::function< void ( FlagField<T> * field, IBlock * const block ) >() ) : domain_decomposition::BlockDataCreator< FlagField<T> >( shared_ptr< field::DefaultBlockDataHandling< FlagField<T> > >(), identifier, requiredSelectors, incompatibleSelectors ) { diff --git a/src/field/Field.h b/src/field/Field.h index 079e8d7fe18408ce2f19e4ea7ac3d0cfd2f9914f..913655771e2eec0c8937b3e96ce3511093ec3f34 100644 --- a/src/field/Field.h +++ b/src/field/Field.h @@ -36,7 +36,7 @@ #include "iterators/FieldIterator.h" #include "iterators/FieldPointer.h" -#include <boost/function.hpp> +#include <functional> #include <memory> #include <vector> @@ -277,7 +277,7 @@ namespace field { //** Monitoring ************************************************************************************************* /*! \name Monitoring */ //@{ - typedef boost::function< void ( cell_idx_t x, cell_idx_t y, + typedef std::function< void ( cell_idx_t x, cell_idx_t y, cell_idx_t z, cell_idx_t f, const T & value) > MonitorFunction; void addMonitoringFunction( const MonitorFunction & func ); diff --git a/src/field/VolumetricFlowRateEvaluation.h b/src/field/VolumetricFlowRateEvaluation.h index 26bf6ec8134993a24d14ef16a97b0af2b603c9f3..1763ea0eb78585bb8588cb581869d027488f5680 100644 --- a/src/field/VolumetricFlowRateEvaluation.h +++ b/src/field/VolumetricFlowRateEvaluation.h @@ -47,8 +47,8 @@ namespace field { namespace internal { -typedef boost::function< real_t () > FlowRateSolution_T; -typedef boost::function< Vector3< real_t > ( const Vector3< real_t > & ) > FlowRateVelocitySolution_T; +typedef std::function< real_t () > FlowRateSolution_T; +typedef std::function< Vector3< real_t > ( const Vector3< real_t > & ) > FlowRateVelocitySolution_T; const std::string volumetricFlowRateEvaluationFilename("flowrate.dat"); const real_t volumetricFlowRateEvaluationNormalization( real_t(1) ); @@ -205,7 +205,7 @@ public: real_t solution() const { - if( solution_.empty() ) + if( !solution_ ) return real_t(0); auto blocks = blocks_.lock(); @@ -305,7 +305,7 @@ void VolumetricFlowRateEvaluation< VelocityField_T, Filter_T >::operator()() if( axis_[0] ) { const auto factor = normalizationFactor_ * normalizedDy * normalizedDz; - if( velocitySolution_.empty() ) + if( !velocitySolution_ ) { WALBERLA_FOR_ALL_CELLS_XYZ_OMP( field, omp parallel for schedule(static) reduction(+:_flowRate), @@ -338,7 +338,7 @@ void VolumetricFlowRateEvaluation< VelocityField_T, Filter_T >::operator()() else if( axis_[1] ) { const auto factor = normalizationFactor_ * normalizedDx * normalizedDz; - if( velocitySolution_.empty() ) + if( !velocitySolution_ ) { WALBERLA_FOR_ALL_CELLS_XYZ_OMP( field, omp parallel for schedule(static) reduction(+:_flowRate), @@ -371,7 +371,7 @@ void VolumetricFlowRateEvaluation< VelocityField_T, Filter_T >::operator()() else { const auto factor = normalizationFactor_ * normalizedDx * normalizedDy; - if( velocitySolution_.empty() ) + if( !velocitySolution_ ) { WALBERLA_FOR_ALL_CELLS_XYZ_OMP( field, omp parallel for schedule(static) reduction(+:_flowRate), @@ -420,16 +420,16 @@ void VolumetricFlowRateEvaluation< VelocityField_T, Filter_T >::operator()() file << "# volumetric flow rate evaluation of data '" << id << "'\n" << "# step [1], flow rate (simulation) [2], flow rate (\"discrete\" solution) [3], flow rate (exact solution) [4]" ", rel. error (base = \"discrete\" solution) [5], rel. error (base = exact solution) [6]" << std::endl; - if( velocitySolution_.empty() ) + if( !velocitySolution_ ) file << "ATTENTION: \"discrete\" solution values not available and thus not valid!" << std::endl; - if( solution_.empty() ) + if( !solution_ ) file << "ATTENTION: exact solution values not available and thus not valid!" << std::endl; file.close(); } if( log ) { - if( !velocitySolution_.empty() && !solution_.empty() ) + if( velocitySolution_ && solution_ ) { WALBERLA_LOG_INFO( "Evaluation of the volumetric flow rate [data = '" << id << "']:" << "\n- exact solution: " << _solution << @@ -439,18 +439,18 @@ void VolumetricFlowRateEvaluation< VelocityField_T, Filter_T >::operator()() "\n + " << ( std::abs( ( flowRate_ - velocitySolutionFlowRate_ ) / velocitySolutionFlowRate_ ) ) << " (base = \"discrete\" solution)" << "\n + " << ( std::abs( ( flowRate_ - _solution ) / _solution ) ) << " (base = exact solution)" ); } - else if( !velocitySolution_.empty() ) + else if( velocitySolution_ ) { - WALBERLA_ASSERT( solution_.empty() ); + WALBERLA_ASSERT( !solution_ ); WALBERLA_LOG_INFO( "Evaluation of the volumetric flow rate [data = '" << id << "']:" << "\n- \"discrete\" solution: " << velocitySolutionFlowRate_ << " (using reference velocities evaluated at cell centers)" << "\n- simulation: " << flowRate_ << " (using computed velocities evaluated at cell centers)" << "\n- rel. error (of the simulation): " << ( std::abs( flowRate_ - velocitySolutionFlowRate_ ) / velocitySolutionFlowRate_ ) ); } - else if( !solution_.empty() ) + else if( solution_ ) { - WALBERLA_ASSERT( velocitySolution_.empty() ); + WALBERLA_ASSERT( !velocitySolution_ ); WALBERLA_LOG_INFO( "Evaluation of the volumetric flow rate [data = '" << id << "']:" << "\n- exact solution: " << _solution << "\n- simulation: " << flowRate_ << @@ -459,7 +459,7 @@ void VolumetricFlowRateEvaluation< VelocityField_T, Filter_T >::operator()() } else { - WALBERLA_ASSERT( solution_.empty() && velocitySolution_.empty() ); + WALBERLA_ASSERT( !solution_ && !velocitySolution_ ); WALBERLA_LOG_INFO( "Evaluation of the volumetric flow rate [data = '" << id << "']: " << flowRate_ ); } } @@ -467,7 +467,7 @@ void VolumetricFlowRateEvaluation< VelocityField_T, Filter_T >::operator()() if( plot ) { std::ofstream file( filename_.c_str(), std::ofstream::out | std::ofstream::app ); - file << ( executionCounter_ - uint_t(1) ) << " " << flowRate_ << " " << velocitySolutionFlowRate_ << " " << solution_ << " " + file << ( executionCounter_ - uint_t(1) ) << " " << flowRate_ << " " << velocitySolutionFlowRate_ << " " << _solution << " " << ( isIdentical( velocitySolutionFlowRate_, real_t(0) ) ? real_t(0) : std::abs( ( flowRate_ - velocitySolutionFlowRate_ ) / velocitySolutionFlowRate_ ) ) << " " << ( isIdentical( _solution, real_t(0) ) ? real_t(0) : std::abs( ( flowRate_ - _solution ) / _solution ) ) << std::endl; file.close(); diff --git a/src/field/blockforest/BlockDataHandling.h b/src/field/blockforest/BlockDataHandling.h index 3e73314c69633274a2647fecb2f5a848bfffa638..3d6d92a622287bd11d341e14d1e62a707aec464f 100644 --- a/src/field/blockforest/BlockDataHandling.h +++ b/src/field/blockforest/BlockDataHandling.h @@ -40,7 +40,7 @@ class BlockDataHandling : public blockforest::BlockDataHandling< Field_T > public: typedef typename Field_T::value_type Value_T; - typedef boost::function< void ( Field_T * field, IBlock * const block ) > InitializationFunction_T; + typedef std::function< void ( Field_T * field, IBlock * const block ) > InitializationFunction_T; virtual ~BlockDataHandling() {} @@ -395,18 +395,18 @@ public: typedef typename GhostLayerField_T::value_type Value_T; DefaultBlockDataHandling( const weak_ptr< StructuredBlockStorage > & blocks, - const boost::function< Vector3< uint_t > ( const shared_ptr< StructuredBlockStorage > &, IBlock * const ) > calculateSize = internal::defaultSize ) : + const std::function< Vector3< uint_t > ( const shared_ptr< StructuredBlockStorage > &, IBlock * const ) > calculateSize = internal::defaultSize ) : blocks_( blocks ), nrOfGhostLayers_( uint_t(1) ), initValue_(), layout_( zyxf ), calculateSize_( calculateSize ) {} DefaultBlockDataHandling( const weak_ptr< StructuredBlockStorage > & blocks, const uint_t nrOfGhostLayers, - const boost::function< Vector3< uint_t > ( const shared_ptr< StructuredBlockStorage > &, IBlock * const ) > calculateSize = internal::defaultSize ) : + const std::function< Vector3< uint_t > ( const shared_ptr< StructuredBlockStorage > &, IBlock * const ) > calculateSize = internal::defaultSize ) : blocks_( blocks ), nrOfGhostLayers_( nrOfGhostLayers ), initValue_(), layout_( zyxf ), calculateSize_( calculateSize ) {} DefaultBlockDataHandling( const weak_ptr< StructuredBlockStorage > & blocks, const uint_t nrOfGhostLayers, const Value_T & initValue, const Layout layout = zyxf, - const boost::function< Vector3< uint_t > ( const shared_ptr< StructuredBlockStorage > &, IBlock * const ) > calculateSize = internal::defaultSize ) : + const std::function< Vector3< uint_t > ( const shared_ptr< StructuredBlockStorage > &, IBlock * const ) > calculateSize = internal::defaultSize ) : blocks_( blocks ), nrOfGhostLayers_( nrOfGhostLayers ), initValue_( initValue ), layout_( layout ), calculateSize_( calculateSize ) { static_assert( !boost::is_same< GhostLayerField_T, FlagField< Value_T > >::value, @@ -440,7 +440,7 @@ private: uint_t nrOfGhostLayers_; Value_T initValue_; Layout layout_; - const boost::function< Vector3< uint_t > ( const shared_ptr< StructuredBlockStorage > &, IBlock * const ) > calculateSize_; + const std::function< Vector3< uint_t > ( const shared_ptr< StructuredBlockStorage > &, IBlock * const ) > calculateSize_; }; // class DefaultBlockDataHandling @@ -455,21 +455,21 @@ class AlwaysInitializeBlockDataHandling : public blockforest::AlwaysInitializeBl public: typedef typename GhostLayerField_T::value_type Value_T; - typedef boost::function< void ( GhostLayerField_T * field, IBlock * const block ) > InitializationFunction_T; + typedef std::function< void ( GhostLayerField_T * field, IBlock * const block ) > InitializationFunction_T; AlwaysInitializeBlockDataHandling( const weak_ptr< StructuredBlockStorage > & blocks, - const boost::function< Vector3< uint_t > ( const shared_ptr< StructuredBlockStorage > &, IBlock * const ) > calculateSize = internal::defaultSize ) : + const std::function< Vector3< uint_t > ( const shared_ptr< StructuredBlockStorage > &, IBlock * const ) > calculateSize = internal::defaultSize ) : blocks_( blocks ), nrOfGhostLayers_( uint_t(1) ), initValue_(), layout_( zyxf ), calculateSize_( calculateSize ) {} AlwaysInitializeBlockDataHandling( const weak_ptr< StructuredBlockStorage > & blocks, const uint_t nrOfGhostLayers, - const boost::function< Vector3< uint_t > ( const shared_ptr< StructuredBlockStorage > &, IBlock * const ) > calculateSize = internal::defaultSize ) : + const std::function< Vector3< uint_t > ( const shared_ptr< StructuredBlockStorage > &, IBlock * const ) > calculateSize = internal::defaultSize ) : blocks_( blocks ), nrOfGhostLayers_( nrOfGhostLayers ), initValue_(), layout_( zyxf ), calculateSize_( calculateSize ) {} AlwaysInitializeBlockDataHandling( const weak_ptr< StructuredBlockStorage > & blocks, const uint_t nrOfGhostLayers, const Value_T & initValue, const Layout layout, - const boost::function< Vector3< uint_t > ( const shared_ptr< StructuredBlockStorage > &, IBlock * const ) > calculateSize = internal::defaultSize ) : + const std::function< Vector3< uint_t > ( const shared_ptr< StructuredBlockStorage > &, IBlock * const ) > calculateSize = internal::defaultSize ) : blocks_( blocks ), nrOfGhostLayers_( nrOfGhostLayers ), initValue_( initValue ), layout_( layout ), calculateSize_( calculateSize ) { static_assert( !boost::is_same< GhostLayerField_T, FlagField< Value_T > >::value, @@ -498,7 +498,7 @@ private: uint_t nrOfGhostLayers_; Value_T initValue_; Layout layout_; - const boost::function< Vector3< uint_t > ( const shared_ptr< StructuredBlockStorage > &, IBlock * const ) > calculateSize_; + const std::function< Vector3< uint_t > ( const shared_ptr< StructuredBlockStorage > &, IBlock * const ) > calculateSize_; InitializationFunction_T initFunction_; diff --git a/src/field/python/GatherExport.impl.h b/src/field/python/GatherExport.impl.h index d297d8a63c2e8d84f1a2aa6dbce933b6d4d92c17..42f66565c21de0d708f2f00f3f916cf770e84ce1 100644 --- a/src/field/python/GatherExport.impl.h +++ b/src/field/python/GatherExport.impl.h @@ -76,7 +76,7 @@ namespace internal { IBlock * firstBlock = & ( * blocks->begin() ); python_coupling::Dispatcher<FieldTypes, Exporter_gatherToObject > dispatcher( firstBlock ); auto func = dispatcher( fieldID ); - if ( func.empty() ) + if ( !func ) { PyErr_SetString( PyExc_RuntimeError, "This function cannot handle this type of block data."); throw error_already_set(); diff --git a/src/gather/CurveGatherPackInfo.h b/src/gather/CurveGatherPackInfo.h index ff545e15f54e24101f61401a230f66c4a83342a3..f23b18ae6abc04845bedef1fb39e748250fd5243 100644 --- a/src/gather/CurveGatherPackInfo.h +++ b/src/gather/CurveGatherPackInfo.h @@ -28,7 +28,7 @@ #include "domain_decomposition/StructuredBlockStorage.h" #include "field/interpolators/TrilinearInterpolatorFwd.h" -#include <boost/function.hpp> +#include <functional> #include <functional> #include <map> #include <vector> @@ -52,7 +52,7 @@ class CurveGatherPackInfo : public GatherPackInfo { public: typedef Vector3<real_t> RealVec3; - typedef boost::function<RealVec3 (real_t t) > CurveCallback; + typedef std::function<RealVec3 (real_t t) > CurveCallback; //**Construction & Destruction************************************************************************* diff --git a/src/gui/Gui.h b/src/gui/Gui.h index f2b520d76ca34410c8de3ea9ace617fa1680b18f..b66ddc3be5b4c722b3f5455f717e46955c5655b2 100644 --- a/src/gui/Gui.h +++ b/src/gui/Gui.h @@ -25,7 +25,7 @@ #include "blockforest/StructuredBlockForest.h" #include "timeloop/ITimeloop.h" -#include <boost/function.hpp> +#include <functional> #include <vector> @@ -52,7 +52,7 @@ namespace gui { void registerPropertyTree( const shared_ptr<PropertyTree> propertyTree ); - typedef boost::function< DisplayAdaptor * ( const IBlock &, ConstBlockDataID ) > DisplayAdaptorCreatorFunc; + typedef std::function< DisplayAdaptor * ( const IBlock &, ConstBlockDataID ) > DisplayAdaptorCreatorFunc; void registerDisplayAdaptorCreator( const DisplayAdaptorCreatorFunc & creatorFunc ); static void breakpoint( const std::string & comment, const std::string & file, int line ); diff --git a/src/lbm/python/ExportBasic.impl.h b/src/lbm/python/ExportBasic.impl.h index 4727cb5f38cd106b094c849c7c384e7c82164f01..afae7a5a105fc0e4067d694eaa74e19b5817bb51 100644 --- a/src/lbm/python/ExportBasic.impl.h +++ b/src/lbm/python/ExportBasic.impl.h @@ -388,7 +388,7 @@ namespace internal SweepWrapper() {} - SweepWrapper( const boost::function<void(IBlock*) > & sweepToWrap ) + SweepWrapper( const std::function<void(IBlock*) > & sweepToWrap ) : sweepToWrap_( sweepToWrap ) {} void operator() ( IBlock * block ) @@ -397,7 +397,7 @@ namespace internal sweepToWrap_( block ); } protected: - boost::function<void(IBlock*) > sweepToWrap_; + std::function<void(IBlock*) > sweepToWrap_; }; diff --git a/src/lbm/refinement/BoundarySetup.h b/src/lbm/refinement/BoundarySetup.h index 07b963f0da2fcb36d12bf619924f85747bfd72fa..4271b9984e3e74476bae1e4b7ab0f20af61dcc24 100644 --- a/src/lbm/refinement/BoundarySetup.h +++ b/src/lbm/refinement/BoundarySetup.h @@ -74,16 +74,16 @@ inline shared_ptr< BoundaryConfiguration > defaultBoundaryConfiguration( const C //********************************************************************************************************************** template< typename BoundaryHandling_T, bool ForceBoundary > void consistentlySetBoundary( StructuredBlockStorage & blocks, Block & block, const BlockDataID & boundaryHandlingId, const FlagUID & flag, - const boost::function< bool ( const Vector3< real_t > & ) > & isBoundary, - const boost::function< shared_ptr< BoundaryConfiguration > ( const Cell &, const Vector3< real_t > & ) > & parameter = internal::defaultBoundaryConfiguration ); + const std::function< bool ( const Vector3< real_t > & ) > & isBoundary, + const std::function< shared_ptr< BoundaryConfiguration > ( const Cell &, const Vector3< real_t > & ) > & parameter = internal::defaultBoundaryConfiguration ); /// For documentation see function "template< typename BoundaryHandling_T, bool ForceBoundary > void consistentlySetBoundary(...)" template< typename BoundaryHandling_T > void consistentlySetBoundary( StructuredBlockStorage & blocks, Block & block, const BlockDataID & boundaryHandlingId, const FlagUID & flag, - const boost::function< bool ( const Vector3< real_t > & ) > & isBoundary, - const boost::function< shared_ptr< BoundaryConfiguration > ( const Cell &, const Vector3< real_t > & ) > & parameter = internal::defaultBoundaryConfiguration ) + const std::function< bool ( const Vector3< real_t > & ) > & isBoundary, + const std::function< shared_ptr< BoundaryConfiguration > ( const Cell &, const Vector3< real_t > & ) > & parameter = internal::defaultBoundaryConfiguration ) { consistentlySetBoundary< BoundaryHandling_T, false >( blocks, block, boundaryHandlingId, flag, isBoundary, parameter ); } @@ -93,8 +93,8 @@ void consistentlySetBoundary( StructuredBlockStorage & blocks, Block & block, co /// For documentation see function "template< typename BoundaryHandling_T, bool ForceBoundary > void consistentlySetBoundary(...)" template< typename BoundaryHandling_T > void consistentlyForceBoundary( StructuredBlockStorage & blocks, Block & block, const BlockDataID & boundaryHandlingId, const FlagUID & flag, - const boost::function< bool ( const Vector3< real_t > & ) > & isBoundary, - const boost::function< shared_ptr< BoundaryConfiguration > ( const Cell &, const Vector3< real_t > & ) > & parameter = internal::defaultBoundaryConfiguration ) + const std::function< bool ( const Vector3< real_t > & ) > & isBoundary, + const std::function< shared_ptr< BoundaryConfiguration > ( const Cell &, const Vector3< real_t > & ) > & parameter = internal::defaultBoundaryConfiguration ) { consistentlySetBoundary< BoundaryHandling_T, true >( blocks, block, boundaryHandlingId, flag, isBoundary, parameter ); } @@ -103,8 +103,8 @@ void consistentlyForceBoundary( StructuredBlockStorage & blocks, Block & block, template< typename BoundaryHandling_T, bool ForceBoundary > void consistentlySetBoundary( StructuredBlockStorage & blocks, Block & block, const BlockDataID & boundaryHandlingId, const FlagUID & flag, - const boost::function< bool ( const Vector3< real_t > & ) > & isBoundary, - const boost::function< shared_ptr< BoundaryConfiguration > ( const Cell &, const Vector3< real_t > & ) > & parameter ) + const std::function< bool ( const Vector3< real_t > & ) > & isBoundary, + const std::function< shared_ptr< BoundaryConfiguration > ( const Cell &, const Vector3< real_t > & ) > & parameter ) { const uint_t level = blocks.getLevel(block); diff --git a/src/lbm/refinement/RefinementFunctorWrapper.h b/src/lbm/refinement/RefinementFunctorWrapper.h index 92261857469ffe0297b4f9462daf978fe792cae9..9ea0b99e15baa1ebdd6653256cbaf6e6dfd3b87e 100644 --- a/src/lbm/refinement/RefinementFunctorWrapper.h +++ b/src/lbm/refinement/RefinementFunctorWrapper.h @@ -23,7 +23,7 @@ #include "domain_decomposition/BlockStorage.h" -#include <boost/function.hpp> +#include <functional> namespace walberla { namespace lbm { @@ -31,7 +31,7 @@ namespace refinement { class FunctorWrapper { public: - FunctorWrapper( const boost::function<void()> & fct) + FunctorWrapper( const std::function<void()> & fct) : fct_(fct) { } @@ -40,12 +40,12 @@ public: } private: - boost::function<void(void)> fct_; + std::function<void(void)> fct_; }; class SweepAsFunctorWrapper { public: - SweepAsFunctorWrapper( const boost::function<void(IBlock * )> & fct, + SweepAsFunctorWrapper( const std::function<void(IBlock * )> & fct, const shared_ptr <StructuredBlockStorage> & blockStorage ) : fct_(fct), blockStorage_(blockStorage) { } @@ -58,7 +58,7 @@ public: } private: - boost::function<void(IBlock * )> fct_; + std::function<void(IBlock * )> fct_; shared_ptr <StructuredBlockStorage> blockStorage_; }; diff --git a/src/lbm/refinement/TimeStep.h b/src/lbm/refinement/TimeStep.h index f006d0494aa0af888821c671c6491aa86cff49dc..1be6a470d5402e21600831870524e80c563f6716 100644 --- a/src/lbm/refinement/TimeStep.h +++ b/src/lbm/refinement/TimeStep.h @@ -55,8 +55,8 @@ public: typedef typename NeighborsStencil<LatticeModel_T>::type CommunicationStencil_T; - typedef boost::function< void ( const uint_t, const uint_t ) > VoidFunction; // parameters: level, execution count - typedef boost::function< void ( IBlock *, const uint_t, const uint_t ) > BlockFunction; // parameters: block, level, execution count + typedef std::function< void ( const uint_t, const uint_t ) > VoidFunction; // parameters: level, execution count + typedef std::function< void ( IBlock *, const uint_t, const uint_t ) > BlockFunction; // parameters: block, level, execution count private: diff --git a/src/mesh/boundary/BoundarySetup.h b/src/mesh/boundary/BoundarySetup.h index 26254df4ec3cfeaa65a7f9c1937f777854960f98..08840ed0ae24502e7248d9831351b955d15f0d30 100644 --- a/src/mesh/boundary/BoundarySetup.h +++ b/src/mesh/boundary/BoundarySetup.h @@ -34,7 +34,7 @@ #include "stencil/D3Q27.h" -#include <boost/function.hpp> +#include <functional> #include <queue> @@ -46,7 +46,7 @@ class BoundarySetup public: typedef field::GhostLayerField< uint8_t, uint_t(1) > VoxelizationField; - typedef boost::function< real_t ( const Vector3< real_t > &) > DistanceFunction; + typedef std::function< real_t ( const Vector3< real_t > &) > DistanceFunction; enum Location { INSIDE, OUTSIDE }; diff --git a/src/mesh/vtk/VTKMeshWriter.h b/src/mesh/vtk/VTKMeshWriter.h index f01a65bebfe5bf0fa30df0e15ae1a4fc788aa243..025779e4f785fed80866a5f72bde633d3d9c3c1a 100644 --- a/src/mesh/vtk/VTKMeshWriter.h +++ b/src/mesh/vtk/VTKMeshWriter.h @@ -42,7 +42,7 @@ namespace mesh { template< typename MeshType > class VTKMeshWriter { public: - typedef boost::function<bool ( const MeshType &, const typename MeshType::FaceHandle & )> FaceFilterFunction; + typedef std::function<bool ( const MeshType &, const typename MeshType::FaceHandle & )> FaceFilterFunction; typedef std::vector< typename MeshType::FaceHandle > Faces; typedef std::vector< typename MeshType::VertexHandle > Vertices; @@ -98,7 +98,7 @@ public: inline void setFaceFilter ( const FaceFilterFunction & f ) { faceFilter_ = f; } inline void clearFaceFilter() { faceFilter_ = FaceFilterFunction(); } - inline bool isFaceFilterSet() const { return !faceFilter_.empty(); } + inline bool isFaceFilterSet() const { return static_cast<bool>(faceFilter_); } void incrementTimeStep() { ++timestep_; } bool isWriteScheduled() const { return timestep_ % writeFrequency_ == 0; } diff --git a/src/pde/iterations/CGFixedStencilIteration.h b/src/pde/iterations/CGFixedStencilIteration.h index b7c5ac85fbfa17ec775841822f5d8fcf14fc7531..145fa37c80515a9745265d9b12a652abbf733d19 100644 --- a/src/pde/iterations/CGFixedStencilIteration.h +++ b/src/pde/iterations/CGFixedStencilIteration.h @@ -31,7 +31,7 @@ #include "field/GhostLayerField.h" #include "field/iterators/IteratorMacros.h" -#include <boost/function.hpp> +#include <functional> @@ -50,7 +50,7 @@ public: CGFixedStencilIteration( BlockStorage & blocks, const BlockDataID & uId, const BlockDataID & rId, const BlockDataID & dId, const BlockDataID & zId, const BlockDataID & fId, const std::vector< real_t > & weights, - const uint_t iterations, const boost::function< void () > & synchronizeD, + const uint_t iterations, const std::function< void () > & synchronizeD, const real_t residualNormThreshold = real_t(0), const Set<SUID> & requiredSelectors = Set<SUID>::emptySet(), const Set<SUID> & incompatibleSelectors = Set<SUID>::emptySet() ); @@ -88,7 +88,7 @@ protected: uint_t iterations_; real_t residualNormThreshold_; - boost::function< void () > synchronizeD_; + std::function< void () > synchronizeD_; Set<SUID> requiredSelectors_; Set<SUID> incompatibleSelectors_; @@ -100,7 +100,7 @@ template< typename Stencil_T > CGFixedStencilIteration< Stencil_T >::CGFixedStencilIteration( BlockStorage & blocks, const BlockDataID & uId, const BlockDataID & rId, const BlockDataID & dId, const BlockDataID & zId, const BlockDataID & fId, const std::vector< real_t > & weights, - const uint_t iterations, const boost::function< void () > & synchronizeD, + const uint_t iterations, const std::function< void () > & synchronizeD, const real_t residualNormThreshold, const Set<SUID> & requiredSelectors, const Set<SUID> & incompatibleSelectors ) : blocks_( blocks ), uId_( uId ), rId_( rId ), dId_( dId ), zId_( zId ), fId_( fId ), diff --git a/src/pde/iterations/CGIteration.h b/src/pde/iterations/CGIteration.h index 2a0afaf23bb81526e8f4468fa3a7bbc6c015a387..d3339759bb7b2998a22eb6e281704ef583a98715 100644 --- a/src/pde/iterations/CGIteration.h +++ b/src/pde/iterations/CGIteration.h @@ -31,7 +31,7 @@ #include "field/GhostLayerField.h" #include "field/iterators/IteratorMacros.h" -#include <boost/function.hpp> +#include <functional> @@ -51,7 +51,7 @@ public: CGIteration( BlockStorage & blocks, const BlockDataID & uId, const BlockDataID & rId, const BlockDataID & dId, const BlockDataID & zId, const BlockDataID & fId, const BlockDataID & stencilId, - const uint_t iterations, const boost::function< void () > & synchronizeD, + const uint_t iterations, const std::function< void () > & synchronizeD, const real_t residualNormThreshold = real_t(0), const Set<SUID> & requiredSelectors = Set<SUID>::emptySet(), const Set<SUID> & incompatibleSelectors = Set<SUID>::emptySet() ); @@ -88,7 +88,7 @@ protected: uint_t iterations_; real_t residualNormThreshold_; - boost::function< void () > synchronizeD_; + std::function< void () > synchronizeD_; Set<SUID> requiredSelectors_; Set<SUID> incompatibleSelectors_; @@ -100,7 +100,7 @@ template< typename Stencil_T > CGIteration< Stencil_T >::CGIteration( BlockStorage & blocks, const BlockDataID & uId, const BlockDataID & rId, const BlockDataID & dId, const BlockDataID & zId, const BlockDataID & fId, const BlockDataID & stencilId, - const uint_t iterations, const boost::function< void () > & synchronizeD, + const uint_t iterations, const std::function< void () > & synchronizeD, const real_t residualNormThreshold, const Set<SUID> & requiredSelectors, const Set<SUID> & incompatibleSelectors ) : blocks_( blocks ), uId_( uId ), rId_( rId ), dId_( dId ), zId_( zId ), fId_( fId ), stencilId_( stencilId ), diff --git a/src/pde/iterations/JacobiIteration.cpp b/src/pde/iterations/JacobiIteration.cpp index f3044457e4c1672a3263c349db2de980b4c1a553..f088ebe3110c14891d7e6620e62319e117ebdf1d 100644 --- a/src/pde/iterations/JacobiIteration.cpp +++ b/src/pde/iterations/JacobiIteration.cpp @@ -37,7 +37,7 @@ void JacobiIteration::operator()() uint_t i( uint_t(0) ); while( i < iterations_ ) { - if( !boundary_.empty() ) + if( boundary_ ) boundary_(); communication_(); @@ -48,7 +48,7 @@ void JacobiIteration::operator()() { if( (i % residualCheckFrequency_) == uint_t(0) ) { - if( !boundary_.empty() ) + if( boundary_ ) boundary_(); const real_t residualNorm = residualNorm_(); WALBERLA_CHECK( math::finite(residualNorm), "Non-finite residual norm detected during the Jacobi iteration, " diff --git a/src/pde/iterations/JacobiIteration.h b/src/pde/iterations/JacobiIteration.h index 3f30bcd85b21039576eefa1e3660744b13de4845..3002e7ff33c13c7dfcd5da50238828809e74c45c 100644 --- a/src/pde/iterations/JacobiIteration.h +++ b/src/pde/iterations/JacobiIteration.h @@ -25,7 +25,7 @@ #include "core/uid/SUID.h" #include "domain_decomposition/BlockStorage.h" -#include <boost/function.hpp> +#include <functional> @@ -39,9 +39,9 @@ class JacobiIteration public: JacobiIteration( BlockStorage & blocks, const uint_t iterations, - const boost::function< void () > & communication, - const boost::function< void ( IBlock * ) > & jacobi, - const boost::function< real_t () > & residualNorm, + const std::function< void () > & communication, + const std::function< void ( IBlock * ) > & jacobi, + const std::function< real_t () > & residualNorm, const real_t residualNormThreshold = real_t(0), const uint_t residualCheckFrequency = uint_t(1), const Set<SUID> & requiredSelectors = Set<SUID>::emptySet(), const Set<SUID> & incompatibleSelectors = Set<SUID>::emptySet() ) : @@ -51,7 +51,7 @@ public: requiredSelectors_( requiredSelectors ), incompatibleSelectors_( incompatibleSelectors ) {} - void addBoundaryHandling( const boost::function< void () > & boundary ) { boundary_ = boundary; } + void addBoundaryHandling( const std::function< void () > & boundary ) { boundary_ = boundary; } void operator()(); @@ -63,10 +63,10 @@ protected: real_t residualNormThreshold_; uint_t residualCheckFrequency_; - boost::function< void () > boundary_; - boost::function< void () > communication_; - boost::function< void ( IBlock * ) > jacobi_; - boost::function< real_t () > residualNorm_; + std::function< void () > boundary_; + std::function< void () > communication_; + std::function< void ( IBlock * ) > jacobi_; + std::function< real_t () > residualNorm_; Set<SUID> requiredSelectors_; Set<SUID> incompatibleSelectors_; diff --git a/src/pde/iterations/RBGSIteration.cpp b/src/pde/iterations/RBGSIteration.cpp index 7994b633128a3eeec52ceea4abc12870db0f66bc..18c503db781cf4e73f21731c558dc052796c72ee 100644 --- a/src/pde/iterations/RBGSIteration.cpp +++ b/src/pde/iterations/RBGSIteration.cpp @@ -40,14 +40,14 @@ void RBGSIteration::operator()() uint_t i( uint_t(0) ); while( i < iterations_ ) { - if( !boundary_.empty() ) + if( boundary_ ) boundary_(); communication_(); for( auto block = blocks_.begin( requiredSelectors_, incompatibleSelectors_ ); block != blocks_.end(); ++block ) redUpdate_( block.get() ); - if( !boundary_.empty() ) + if( boundary_ ) boundary_(); communication_(); @@ -58,7 +58,7 @@ void RBGSIteration::operator()() { if( (i % residualCheckFrequency_) == uint_t(0) ) { - if( !boundary_.empty() ) + if( boundary_ ) boundary_(); const real_t residualNorm = residualNorm_(); WALBERLA_CHECK( math::finite(residualNorm), "Non-finite residual norm detected during the red-black Gauss-Seidel iteration, " diff --git a/src/pde/iterations/RBGSIteration.h b/src/pde/iterations/RBGSIteration.h index aaae718913b99ca1006d37b1ac0f224e5b7dcaac..9f4ee04e7e9f3aa7f4584263e6d6603716d14b32 100644 --- a/src/pde/iterations/RBGSIteration.h +++ b/src/pde/iterations/RBGSIteration.h @@ -25,7 +25,7 @@ #include "core/uid/SUID.h" #include "domain_decomposition/BlockStorage.h" -#include <boost/function.hpp> +#include <functional> @@ -39,10 +39,10 @@ class RBGSIteration public: RBGSIteration( BlockStorage & blocks, const uint_t iterations, - const boost::function< void () > & communication, - const boost::function< void ( IBlock * ) > & redUpdate, - const boost::function< void ( IBlock * ) > & blackUpdate, - const boost::function< real_t () > & residualNorm, + const std::function< void () > & communication, + const std::function< void ( IBlock * ) > & redUpdate, + const std::function< void ( IBlock * ) > & blackUpdate, + const std::function< real_t () > & residualNorm, const real_t residualNormThreshold = real_t(0), const uint_t residualCheckFrequency = uint_t(1), const Set<SUID> & requiredSelectors = Set<SUID>::emptySet(), const Set<SUID> & incompatibleSelectors = Set<SUID>::emptySet() ) : @@ -53,7 +53,7 @@ public: requiredSelectors_( requiredSelectors ), incompatibleSelectors_( incompatibleSelectors ) {} - void addBoundaryHandling( const boost::function< void () > & boundary ) { boundary_ = boundary; } + void addBoundaryHandling( const std::function< void () > & boundary ) { boundary_ = boundary; } void operator()(); @@ -71,11 +71,11 @@ protected: uint_t iterationsPerformed_; bool thresholdReached_; - boost::function< void () > boundary_; - boost::function< void () > communication_; - boost::function< void ( IBlock * ) > redUpdate_; - boost::function< void ( IBlock * ) > blackUpdate_; - boost::function< real_t () > residualNorm_; + std::function< void () > boundary_; + std::function< void () > communication_; + std::function< void ( IBlock * ) > redUpdate_; + std::function< void ( IBlock * ) > blackUpdate_; + std::function< real_t () > residualNorm_; Set<SUID> requiredSelectors_; Set<SUID> incompatibleSelectors_; diff --git a/src/pde/iterations/VCycles.h b/src/pde/iterations/VCycles.h index 161af67115994d5a5ea20275198e04de7e97491c..eca2b908fc5420cb24b1889e0bba71c2c2cbe86d 100644 --- a/src/pde/iterations/VCycles.h +++ b/src/pde/iterations/VCycles.h @@ -33,7 +33,7 @@ #include "pde/sweeps/RBGSFixedStencil.h" #include "pde/sweeps/RBGS.h" -#include <boost/function.hpp> +#include <functional> #include <vector> @@ -54,7 +54,7 @@ public: const Weight_T weights, const uint_t iterations, const uint_t numLvl, const uint_t preSmoothingIters, const uint_t postSmoothingIters, - const uint_t coarseIters, const boost::function< real_t () > & residualNorm, + const uint_t coarseIters, const std::function< real_t () > & residualNorm, const real_t residualNormThreshold = real_t(0), const uint_t residualCheckFrequency = uint_t(1), const Set<SUID> & requiredSelectors = Set<SUID>::emptySet(), const Set<SUID> & incompatibleSelectors = Set<SUID>::emptySet() ); @@ -63,7 +63,7 @@ public: const BlockDataID & stencilFieldId, const uint_t iterations, const uint_t numLvl, const uint_t preSmoothingIters, const uint_t postSmoothingIters, - const uint_t coarseIters, const boost::function< real_t () > & residualNorm, + const uint_t coarseIters, const std::function< real_t () > & residualNorm, const real_t residualNormThreshold = real_t(0), const uint_t residualCheckFrequency = uint_t(1), const Set<SUID> & requiredSelectors = Set<SUID>::emptySet(), const Set<SUID> & incompatibleSelectors = Set<SUID>::emptySet() ); @@ -94,7 +94,7 @@ protected: uint_t iterationsPerformed_; bool thresholdReached_; - boost::function< real_t() > residualNorm_; + std::function< real_t() > residualNorm_; std::vector<real_t> convergenceRate_; std::vector<BlockDataID> uId_; @@ -105,9 +105,9 @@ protected: std::vector< shared_ptr<pde::RBGSFixedStencil< Stencil_T > > > RBGSFixedSweeps_; std::vector< shared_ptr<pde::RBGS< Stencil_T > > > RBGSSweeps_; - std::vector< boost::function< void() > > RBGSIteration_; - boost::function< void() > CGIteration_; - std::vector<boost::function< void(IBlock *) > > computeResidual_, restrict_, zeroize_, prolongateAndCorrect_; + std::vector< std::function< void() > > RBGSIteration_; + std::function< void() > CGIteration_; + std::vector<std::function< void(IBlock *) > > computeResidual_, restrict_, zeroize_, prolongateAndCorrect_; std::vector< blockforest::communication::UniformBufferedScheme< Stencil_T > > communication_; diff --git a/src/pde/iterations/VCycles.impl.h b/src/pde/iterations/VCycles.impl.h index 8ad0833d4f9c4f1173f32a9dd4a2d011b6c8fa07..a35cf35779f8dd3396a6792a4fedeaad7e7957e3 100644 --- a/src/pde/iterations/VCycles.impl.h +++ b/src/pde/iterations/VCycles.impl.h @@ -44,7 +44,7 @@ VCycles< Stencil_T >::VCycles( shared_ptr< StructuredBlockForest > blocks, const const Weight_T weights, const uint_t iterations, const uint_t numLvl, const uint_t preSmoothingIters, const uint_t postSmoothingIters, - const uint_t coarseIters, const boost::function< real_t () > & residualNorm, + const uint_t coarseIters, const std::function< real_t () > & residualNorm, const real_t residualNormThreshold, const uint_t residualCheckFrequency, const Set<SUID> & requiredSelectors, const Set<SUID> & incompatibleSelectors ) : @@ -150,7 +150,7 @@ VCycles< Stencil_T >::VCycles( shared_ptr< StructuredBlockForest > blocks, const const BlockDataID & stencilFieldId, const uint_t iterations, const uint_t numLvl, const uint_t preSmoothingIters, const uint_t postSmoothingIters, - const uint_t coarseIters, const boost::function< real_t () > & residualNorm, + const uint_t coarseIters, const std::function< real_t () > & residualNorm, const real_t residualNormThreshold, const uint_t residualCheckFrequency, const Set<SUID> & requiredSelectors, const Set<SUID> & incompatibleSelectors ) : diff --git a/src/pde/sweeps/RBGS.h b/src/pde/sweeps/RBGS.h index 98f9849190bb1f88d6fab4eb2e912c8be2cc2389..1f3404341379aea84ab26e4d514a8a5f9cc9ff58 100644 --- a/src/pde/sweeps/RBGS.h +++ b/src/pde/sweeps/RBGS.h @@ -51,12 +51,12 @@ public: void update( IBlock * const block, const bool rb ); - boost::function< void ( IBlock * const ) > getRedSweep() + std::function< void ( IBlock * const ) > getRedSweep() { return boost::bind( &RBGS::update, this, _1, true ); } - boost::function< void ( IBlock * const ) > getBlackSweep() + std::function< void ( IBlock * const ) > getBlackSweep() { return boost::bind( &RBGS::update, this, _1, false ); } diff --git a/src/pde/sweeps/RBGSFixedStencil.h b/src/pde/sweeps/RBGSFixedStencil.h index cd4715fda9efc16bffe66e9cd97b2b3c39840594..76df0005548e9df4126d30e017ce10bb1d75f750 100644 --- a/src/pde/sweeps/RBGSFixedStencil.h +++ b/src/pde/sweeps/RBGSFixedStencil.h @@ -50,12 +50,12 @@ public: void update( IBlock * const block, const bool rb ); - boost::function< void ( IBlock * const ) > getRedSweep() + std::function< void ( IBlock * const ) > getRedSweep() { return boost::bind( &RBGSFixedStencil::update, this, _1, true ); } - boost::function< void ( IBlock * const ) > getBlackSweep() + std::function< void ( IBlock * const ) > getBlackSweep() { return boost::bind( &RBGSFixedStencil::update, this, _1, false ); } diff --git a/src/pde/sweeps/SOR.h b/src/pde/sweeps/SOR.h index 9ce89069cef49c9ea003513a6cd311d0242dff18..90be98268340223cd6e22d750c7db6bee9d5105b 100644 --- a/src/pde/sweeps/SOR.h +++ b/src/pde/sweeps/SOR.h @@ -51,12 +51,12 @@ public: void update( IBlock * const block, const bool rb ); - boost::function< void ( IBlock * const ) > getRedSweep() + std::function< void ( IBlock * const ) > getRedSweep() { return boost::bind( &SOR::update, this, _1, true ); } - boost::function< void ( IBlock * const ) > getBlackSweep() + std::function< void ( IBlock * const ) > getBlackSweep() { return boost::bind( &SOR::update, this, _1, false ); } diff --git a/src/pde/sweeps/SORFixedStencil.h b/src/pde/sweeps/SORFixedStencil.h index 2e9a54a9128f7316a5ca228637a7ce4c399c7bf8..51535e0378b9ccaa5bcf1181442ed5ff7bdba5ec 100644 --- a/src/pde/sweeps/SORFixedStencil.h +++ b/src/pde/sweeps/SORFixedStencil.h @@ -50,12 +50,12 @@ public: void update( IBlock * const block, const bool rb ); - boost::function< void ( IBlock * const ) > getRedSweep() + std::function< void ( IBlock * const ) > getRedSweep() { return boost::bind( &SORFixedStencil::update, this, _1, true ); } - boost::function< void ( IBlock * const ) > getBlackSweep() + std::function< void ( IBlock * const ) > getBlackSweep() { return boost::bind( &SORFixedStencil::update, this, _1, false ); } diff --git a/src/pe/rigidbody/BodyStorage.h b/src/pe/rigidbody/BodyStorage.h index fb34a55908f6a721914f9fcde6fb8e4953f73589..6761fea4e1ed826cf5825b5c2ceb2e7d1bd21f5e 100644 --- a/src/pe/rigidbody/BodyStorage.h +++ b/src/pe/rigidbody/BodyStorage.h @@ -37,7 +37,7 @@ #include <pe/rigidbody/RigidBody.h> #include <pe/Types.h> -#include <boost/function.hpp> +#include <functional> namespace walberla { namespace pe { @@ -133,11 +133,11 @@ public: //**Callbacks************************************************************************ /*!\name Callbacks */ //@{ - inline void registerAddCallback ( const std::string name, const boost::function<void (BodyID)>& func ); + inline void registerAddCallback ( const std::string name, const std::function<void (BodyID)>& func ); inline void deregisterAddCallback ( const std::string name ); inline void clearAddCallbacks ( ); - inline void registerRemoveCallback ( const std::string name, const boost::function<void (BodyID)>& func ); + inline void registerRemoveCallback ( const std::string name, const std::function<void (BodyID)>& func ); inline void deregisterRemoveCallback ( const std::string name ); inline void clearRemoveCallbacks ( ); //@} @@ -150,8 +150,8 @@ private: Bodies bodies_; //!< The rigid bodies contained in the simulation world. std::map<id_t, SizeType> bodyIDs_; //!< The association of system IDs to rigid bodies. - std::map< std::string, boost::function<void (BodyID)> > addCallbacks_; - std::map< std::string, boost::function<void (BodyID)> > removeCallbacks_; + std::map< std::string, std::function<void (BodyID)> > addCallbacks_; + std::map< std::string, std::function<void (BodyID)> > removeCallbacks_; //@} //********************************************************************************************** }; @@ -713,7 +713,7 @@ inline void BodyStorage::clear() } //************************************************************************************************* -inline void BodyStorage::registerAddCallback ( const std::string name, const boost::function<void (BodyID)>& func ) +inline void BodyStorage::registerAddCallback ( const std::string name, const std::function<void (BodyID)>& func ) { WALBERLA_ASSERT_EQUAL(addCallbacks_.find(name), addCallbacks_.end(), "Callback '" << name << "' already exists!"); addCallbacks_.insert( std::make_pair(name, func) ); @@ -733,7 +733,7 @@ inline void BodyStorage::clearAddCallbacks ( ) addCallbacks_.clear(); } -inline void BodyStorage::registerRemoveCallback ( const std::string name, const boost::function<void (BodyID)>& func ) +inline void BodyStorage::registerRemoveCallback ( const std::string name, const std::function<void (BodyID)>& func ) { WALBERLA_ASSERT_EQUAL(removeCallbacks_.find(name), removeCallbacks_.end(), "Callback '" << name << "' already exists!"); removeCallbacks_.insert( std::make_pair(name, func) ); diff --git a/src/pe_coupling/discrete_particle_methods/evaluators/AddedMassForceEvaluator.h b/src/pe_coupling/discrete_particle_methods/evaluators/AddedMassForceEvaluator.h index 5950cfc3fc1f8dc59119ad24072f8609f218d762..a318686d8865509b3597d3361852c51c42c1ffcc 100644 --- a/src/pe_coupling/discrete_particle_methods/evaluators/AddedMassForceEvaluator.h +++ b/src/pe_coupling/discrete_particle_methods/evaluators/AddedMassForceEvaluator.h @@ -45,7 +45,7 @@ #include "stencil/Directions.h" -#include <boost/function.hpp> +#include <functional> namespace walberla { namespace pe_coupling { @@ -78,9 +78,9 @@ public: const BlockDataID & forceFieldID, const BlockDataID & bodyStorageID, const BlockDataID & flagFieldID, const Set< FlagUID > & domainFlags, const BlockDataID & velocityTimeDerivativeFieldID, - const boost::function<Vector3<real_t> ( const Vector3<real_t> &, const Vector3<real_t> &, real_t, real_t )> & addedMassForceCorrelationFunction, + const std::function<Vector3<real_t> ( const Vector3<real_t> &, const Vector3<real_t> &, real_t, real_t )> & addedMassForceCorrelationFunction, const shared_ptr< BodyVelocityTimeDerivativeEvaluator > & bodyVelocityTimeDerivativeEvaluator, - const boost::function<bool(pe::BodyID)> & dpmBodySelectorFct = selectRegularBodies ) + const std::function<bool(pe::BodyID)> & dpmBodySelectorFct = selectRegularBodies ) : blockStorage_( blockStorage ), bodyStorageID_( bodyStorageID ), addedMassForceCorrelationFunction_( addedMassForceCorrelationFunction ), bodyVelocityTimeDerivativeEvaluator_( bodyVelocityTimeDerivativeEvaluator ), @@ -97,11 +97,11 @@ private: shared_ptr<StructuredBlockStorage> blockStorage_; const BlockDataID bodyStorageID_; - boost::function<Vector3<real_t> ( const Vector3<real_t> &, const Vector3<real_t> &, real_t, real_t )> addedMassForceCorrelationFunction_; + std::function<Vector3<real_t> ( const Vector3<real_t> &, const Vector3<real_t> &, real_t, real_t )> addedMassForceCorrelationFunction_; shared_ptr< BodyVelocityTimeDerivativeEvaluator > bodyVelocityTimeDerivativeEvaluator_; - boost::function<bool(pe::BodyID)> dpmBodySelectorFct_; + std::function<bool(pe::BodyID)> dpmBodySelectorFct_; BlockDataID velocityTimeDerivativeFieldInterpolatorID_; BlockDataID forceDistributorID_; diff --git a/src/pe_coupling/discrete_particle_methods/evaluators/BodyVelocityTimeDerivativeEvaluator.h b/src/pe_coupling/discrete_particle_methods/evaluators/BodyVelocityTimeDerivativeEvaluator.h index 95d64064089c8a89081774b59a7f0f90b3856ecc..229be174ef1951b0e2601a65717457683c8d1467 100644 --- a/src/pe_coupling/discrete_particle_methods/evaluators/BodyVelocityTimeDerivativeEvaluator.h +++ b/src/pe_coupling/discrete_particle_methods/evaluators/BodyVelocityTimeDerivativeEvaluator.h @@ -27,7 +27,7 @@ #include "pe_coupling/utility/BodySelectorFunctions.h" -#include <boost/function.hpp> +#include <functional> #include <map> namespace walberla { @@ -50,7 +50,7 @@ public: BodyVelocityTimeDerivativeEvaluator( const shared_ptr<StructuredBlockStorage> & blockStorage, const BlockDataID & bodyStorageID, const real_t & deltaT = real_t(1), - const boost::function<bool(pe::BodyID)> & dpmBodySelectorFct = selectRegularBodies ) + const std::function<bool(pe::BodyID)> & dpmBodySelectorFct = selectRegularBodies ) : blockStorage_( blockStorage ), bodyStorageID_( bodyStorageID ), deltaTinv_( real_t(1) / deltaT ), dpmBodySelectorFct_( dpmBodySelectorFct) { } @@ -88,7 +88,7 @@ private: const BlockDataID bodyStorageID_; std::map< walberla::id_t, Vector3< real_t > > bodyVelocityMap_; real_t deltaTinv_; - boost::function<bool(pe::BodyID)> dpmBodySelectorFct_; + std::function<bool(pe::BodyID)> dpmBodySelectorFct_; }; diff --git a/src/pe_coupling/discrete_particle_methods/evaluators/EffectiveViscosityFieldEvaluator.h b/src/pe_coupling/discrete_particle_methods/evaluators/EffectiveViscosityFieldEvaluator.h index c052b6059bad2ac9a54ce5bee15a8f8ae6c10033..fc10c9b975cf8e5845432f62d439b354fefb6f3f 100644 --- a/src/pe_coupling/discrete_particle_methods/evaluators/EffectiveViscosityFieldEvaluator.h +++ b/src/pe_coupling/discrete_particle_methods/evaluators/EffectiveViscosityFieldEvaluator.h @@ -66,7 +66,7 @@ public: EffectiveViscosityFieldEvaluator( const BlockDataID & omegaFieldID, const ConstBlockDataID & solidVolumeFractionFieldID, const real_t & fluidViscosity, - const boost::function<real_t (real_t, real_t)> & effectiveViscosityFunc ) + const std::function<real_t (real_t, real_t)> & effectiveViscosityFunc ) : omegaFieldID_( omegaFieldID ), solidVolumeFractionFieldID_( solidVolumeFractionFieldID ), fluidViscosity_( fluidViscosity ), effectiveViscosityFunc_( effectiveViscosityFunc ) { @@ -97,7 +97,7 @@ private: const BlockDataID omegaFieldID_; const ConstBlockDataID solidVolumeFractionFieldID_; real_t fluidViscosity_; - boost::function<real_t (real_t, real_t)> effectiveViscosityFunc_; + std::function<real_t (real_t, real_t)> effectiveViscosityFunc_; }; diff --git a/src/pe_coupling/discrete_particle_methods/evaluators/InteractionForceEvaluator.h b/src/pe_coupling/discrete_particle_methods/evaluators/InteractionForceEvaluator.h index d3a6dc098cb536ba85794543c69086095b074566..33a2e7d76fa567bd754214a4ccba52280c31299e 100644 --- a/src/pe_coupling/discrete_particle_methods/evaluators/InteractionForceEvaluator.h +++ b/src/pe_coupling/discrete_particle_methods/evaluators/InteractionForceEvaluator.h @@ -45,7 +45,7 @@ #include "stencil/Directions.h" -#include <boost/function.hpp> +#include <functional> #include <vector> @@ -88,9 +88,9 @@ public: const BlockDataID & forceFieldID, const BlockDataID & bodyStorageID, const BlockDataID & flagFieldID, const Set< FlagUID > & domainFlags, const BlockDataID & velocityFieldID, const BlockDataID & solidVolumeFractionFieldID, const BlockDataID & pressureGradientFieldID, - const boost::function<Vector3<real_t> ( const Vector3<real_t> &, const Vector3<real_t> &, real_t, real_t, real_t, real_t )> & dragForceCorrelationFunction, + const std::function<Vector3<real_t> ( const Vector3<real_t> &, const Vector3<real_t> &, real_t, real_t, real_t, real_t )> & dragForceCorrelationFunction, real_t fluidDynamicViscosity, - const boost::function<bool(pe::BodyID)> & dpmBodySelectorFct = selectRegularBodies ) + const std::function<bool(pe::BodyID)> & dpmBodySelectorFct = selectRegularBodies ) : blockStorage_( blockStorage ), bodyStorageID_( bodyStorageID ), dragForceCorrelationFunction_( dragForceCorrelationFunction ), fluidDynamicViscosity_( fluidDynamicViscosity ), dpmBodySelectorFct_( dpmBodySelectorFct) @@ -109,11 +109,11 @@ private: const BlockDataID bodyStorageID_; const BlockDataID pdfFieldID_; - boost::function<Vector3<real_t> ( const Vector3<real_t> &, const Vector3<real_t> &, real_t, real_t, real_t, real_t )> dragForceCorrelationFunction_; + std::function<Vector3<real_t> ( const Vector3<real_t> &, const Vector3<real_t> &, real_t, real_t, real_t, real_t )> dragForceCorrelationFunction_; real_t fluidDynamicViscosity_; - boost::function<bool(pe::BodyID)> dpmBodySelectorFct_; + std::function<bool(pe::BodyID)> dpmBodySelectorFct_; BlockDataID velocityFieldInterpolatorID_; BlockDataID solidVolumeFractionFieldInterpolatorID_; diff --git a/src/pe_coupling/discrete_particle_methods/evaluators/LiftForceEvaluator.h b/src/pe_coupling/discrete_particle_methods/evaluators/LiftForceEvaluator.h index 97dee854dc7d68d66e165dd5849de0a8b04af2cd..d04ca701ca8788abc87b424b4b9b3a3328109819 100644 --- a/src/pe_coupling/discrete_particle_methods/evaluators/LiftForceEvaluator.h +++ b/src/pe_coupling/discrete_particle_methods/evaluators/LiftForceEvaluator.h @@ -38,7 +38,7 @@ #include "pe_coupling/geometry/SphereEquivalentDiameter.h" #include "pe_coupling/utility/BodySelectorFunctions.h" -#include <boost/function.hpp> +#include <functional> #include <cmath> @@ -72,9 +72,9 @@ public: LiftForceEvaluator( const shared_ptr<StructuredBlockStorage> & blockStorage, const BlockDataID & forceFieldID, const BlockDataID & bodyStorageID, const BlockDataID & flagFieldID, const Set< FlagUID > & domainFlags, const BlockDataID & velocityFieldID, const BlockDataID & velocityCurlFieldID, - const boost::function<Vector3<real_t> ( const Vector3<real_t> &, const Vector3<real_t> &, const Vector3<real_t> &, real_t, real_t, real_t )> & liftForceCorrelationFunction, + const std::function<Vector3<real_t> ( const Vector3<real_t> &, const Vector3<real_t> &, const Vector3<real_t> &, real_t, real_t, real_t )> & liftForceCorrelationFunction, real_t fluidDynamicViscosity, - const boost::function<bool(pe::BodyID)> & dpmBodySelectorFct = selectRegularBodies ) + const std::function<bool(pe::BodyID)> & dpmBodySelectorFct = selectRegularBodies ) : blockStorage_( blockStorage ), bodyStorageID_( bodyStorageID ), liftForceCorrelationFunction_( liftForceCorrelationFunction ), fluidDynamicViscosity_( fluidDynamicViscosity ), dpmBodySelectorFct_( dpmBodySelectorFct) { @@ -90,11 +90,11 @@ private: shared_ptr<StructuredBlockStorage> blockStorage_; BlockDataID bodyStorageID_; - boost::function<Vector3<real_t> ( const Vector3<real_t> &, const Vector3<real_t> &, const Vector3<real_t> &, real_t, real_t, real_t )> liftForceCorrelationFunction_; + std::function<Vector3<real_t> ( const Vector3<real_t> &, const Vector3<real_t> &, const Vector3<real_t> &, real_t, real_t, real_t )> liftForceCorrelationFunction_; real_t fluidDynamicViscosity_; - boost::function<bool(pe::BodyID)> dpmBodySelectorFct_; + std::function<bool(pe::BodyID)> dpmBodySelectorFct_; BlockDataID velocityFieldInterpolatorID_; BlockDataID velocityCurlFieldInterpolatorID_; diff --git a/src/pe_coupling/discrete_particle_methods/evaluators/SolidVolumeFractionFieldEvaluator.h b/src/pe_coupling/discrete_particle_methods/evaluators/SolidVolumeFractionFieldEvaluator.h index eb0bbafb4b3b8ff7d74da6ea51661698a92a821d..1c83df74afc0eba7d192454f350932307f27bef4 100644 --- a/src/pe_coupling/discrete_particle_methods/evaluators/SolidVolumeFractionFieldEvaluator.h +++ b/src/pe_coupling/discrete_particle_methods/evaluators/SolidVolumeFractionFieldEvaluator.h @@ -32,7 +32,7 @@ #include "pe_coupling/utility/BodySelectorFunctions.h" -#include <boost/function.hpp> +#include <functional> namespace walberla { namespace pe_coupling { @@ -68,7 +68,7 @@ public: SolidVolumeFractionFieldEvaluator( const shared_ptr<StructuredBlockStorage> & blockStorage, const BlockDataID & solidVolumeFractionFieldID, const BlockDataID & bodyStorageID, const BlockDataID & flagFieldID, const Set< FlagUID > & domainFlags, - const boost::function<bool(pe::BodyID)> & dpmBodySelectorFct = selectRegularBodies ) + const std::function<bool(pe::BodyID)> & dpmBodySelectorFct = selectRegularBodies ) : blockStorage_( blockStorage ), solidVolumeFractionFieldID_( solidVolumeFractionFieldID ), bodyStorageID_( bodyStorageID ), dpmBodySelectorFct_( dpmBodySelectorFct) { @@ -104,7 +104,7 @@ private: BlockDataID solidVolumeFractionFieldID_; BlockDataID bodyStorageID_; - boost::function<bool(pe::BodyID)> dpmBodySelectorFct_; + std::function<bool(pe::BodyID)> dpmBodySelectorFct_; BlockDataID scalarDistributorID_; }; diff --git a/src/pe_coupling/discrete_particle_methods/utility/BodyVelocityInitializer.h b/src/pe_coupling/discrete_particle_methods/utility/BodyVelocityInitializer.h index 3ad78d1ad3f1929342c05c101b516dbe1a00b403..75ebeef5b370820e5f306b06c0f954c45b7dd16e 100644 --- a/src/pe_coupling/discrete_particle_methods/utility/BodyVelocityInitializer.h +++ b/src/pe_coupling/discrete_particle_methods/utility/BodyVelocityInitializer.h @@ -36,7 +36,7 @@ #include "pe_coupling/utility/BodySelectorFunctions.h" -#include <boost/function.hpp> +#include <functional> #include <cmath> @@ -66,7 +66,7 @@ public: BodyVelocityInitializer( const shared_ptr<StructuredBlockStorage> & blockStorage, const BlockDataID & bodyStorageID, const BlockDataID & flagFieldID, const Set< FlagUID > & domainFlags, const BlockDataID & velocityFieldID, - const boost::function<bool(pe::BodyID)> & dpmBodySelectorFct = selectRegularBodies ) + const std::function<bool(pe::BodyID)> & dpmBodySelectorFct = selectRegularBodies ) : blockStorage_( blockStorage ), bodyStorageID_( bodyStorageID ), dpmBodySelectorFct_( dpmBodySelectorFct) { @@ -105,7 +105,7 @@ private: shared_ptr<StructuredBlockStorage> blockStorage_; BlockDataID bodyStorageID_; BlockDataID velocityFieldInterpolatorID_; - boost::function<bool(pe::BodyID)> dpmBodySelectorFct_; + std::function<bool(pe::BodyID)> dpmBodySelectorFct_; }; diff --git a/src/pe_coupling/discrete_particle_methods/utility/SubgridTimeStep.h b/src/pe_coupling/discrete_particle_methods/utility/SubgridTimeStep.h index 130a4829fa5a6bd87960c937f7fa12621cddc525..b337175e03fca3e4cd63158a5c24c31d7e4b28e0 100644 --- a/src/pe_coupling/discrete_particle_methods/utility/SubgridTimeStep.h +++ b/src/pe_coupling/discrete_particle_methods/utility/SubgridTimeStep.h @@ -32,7 +32,7 @@ #include "pe/rigidbody/BodyIterators.h" #include "pe/synchronization/SyncForces.h" -#include <boost/function.hpp> +#include <functional> #include <map> @@ -63,8 +63,8 @@ public: explicit SubgridTimeStep( const shared_ptr<StructuredBlockStorage> & blockStorage, const BlockDataID & bodyStorageID, pe::cr::ICR & collisionResponse, - const boost::function<void (void)> & synchronizeFunc, - const boost::function<void ()> & forceEvaluationFunc, + const std::function<void (void)> & synchronizeFunc, + const std::function<void ()> & forceEvaluationFunc, const real_t timeStepSize = real_t(1), const uint_t intermediateSteps = uint_t(1) ) : timeStepSize_( timeStepSize ) , intermediateSteps_( ( intermediateSteps == 0 ) ? uint_t(1) : intermediateSteps ) @@ -153,8 +153,8 @@ protected: const BlockDataID & bodyStorageID_; pe::cr::ICR & collisionResponse_; - boost::function<void (void)> synchronizeFunc_; - boost::function<void ()> forceEvaluationFunc_; + std::function<void (void)> synchronizeFunc_; + std::function<void ()> forceEvaluationFunc_; }; diff --git a/src/pe_coupling/mapping/BodyMapping.h b/src/pe_coupling/mapping/BodyMapping.h index 042c8dd23acc30d445dbba791fc68d86a5970d05..4af2e9d3195ebaddc0ce3a6a08108c2c4d28d10d 100644 --- a/src/pe_coupling/mapping/BodyMapping.h +++ b/src/pe_coupling/mapping/BodyMapping.h @@ -35,7 +35,7 @@ #include "pe_coupling/utility/BodySelectorFunctions.h" -#include <boost/function.hpp> +#include <functional> namespace walberla { namespace pe_coupling { @@ -99,7 +99,7 @@ template< typename BoundaryHandling_T > void mapBodies( StructuredBlockStorage & blockStorage, const BlockDataID & boundaryHandlingID, const BlockDataID & bodyStorageID, pe::BodyStorage & globalBodyStorage, const FlagUID & obstacle, - const boost::function<bool(pe::BodyID)> & mappingBodySelectorFct = selectAllBodies ) + const std::function<bool(pe::BodyID)> & mappingBodySelectorFct = selectAllBodies ) { for( auto blockIt = blockStorage.begin(); blockIt != blockStorage.end(); ++blockIt ) { diff --git a/src/pe_coupling/momentum_exchange_method/BodyMapping.h b/src/pe_coupling/momentum_exchange_method/BodyMapping.h index 3b4b7ff57736c629eaaa377086162d88a7e47f21..7651386b613b476a00d5070c1550884930a003f9 100644 --- a/src/pe_coupling/momentum_exchange_method/BodyMapping.h +++ b/src/pe_coupling/momentum_exchange_method/BodyMapping.h @@ -35,7 +35,7 @@ #include "pe_coupling/mapping/BodyBBMapping.h" #include "pe_coupling/utility/BodySelectorFunctions.h" -#include <boost/function.hpp> +#include <functional> namespace walberla { namespace pe_coupling { @@ -70,7 +70,7 @@ public: const shared_ptr<pe::BodyStorage> & globalBodyStorage, const BlockDataID & bodyFieldID, const FlagUID & obstacle, const FlagUID & formerObstacle, - const boost::function<bool(pe::BodyID)> & mappingBodySelectorFct = selectRegularBodies ) + const std::function<bool(pe::BodyID)> & mappingBodySelectorFct = selectRegularBodies ) : blockStorage_( blockStorage ), boundaryHandlingID_( boundaryHandlingID ), bodyStorageID_(bodyStorageID), globalBodyStorage_( globalBodyStorage ), bodyFieldID_( bodyFieldID ), obstacle_( obstacle ), formerObstacle_( formerObstacle ), mappingBodySelectorFct_( mappingBodySelectorFct ) @@ -192,7 +192,7 @@ private: const FlagUID obstacle_; const FlagUID formerObstacle_; - boost::function<bool(pe::BodyID)> mappingBodySelectorFct_; + std::function<bool(pe::BodyID)> mappingBodySelectorFct_; }; // class BodyMapping @@ -267,7 +267,7 @@ template< typename BoundaryHandling_T > void mapMovingBodies( StructuredBlockStorage & blockStorage, const BlockDataID & boundaryHandlingID, const BlockDataID & bodyStorageID, pe::BodyStorage & globalBodyStorage, const BlockDataID & bodyFieldID, const FlagUID & obstacle, - const boost::function<bool(pe::BodyID)> & mappingBodySelectorFct = selectAllBodies ) + const std::function<bool(pe::BodyID)> & mappingBodySelectorFct = selectAllBodies ) { for( auto blockIt = blockStorage.begin(); blockIt != blockStorage.end(); ++blockIt ) { diff --git a/src/pe_coupling/momentum_exchange_method/restoration/PDFReconstruction.h b/src/pe_coupling/momentum_exchange_method/restoration/PDFReconstruction.h index ef8289da08ffc29712a8cb4ec7cfcfc559605a5c..d21808bb3cc8bae4084ea24bff84b6051dd30253 100644 --- a/src/pe_coupling/momentum_exchange_method/restoration/PDFReconstruction.h +++ b/src/pe_coupling/momentum_exchange_method/restoration/PDFReconstruction.h @@ -33,7 +33,7 @@ #include "field/iterators/IteratorMacros.h" #include "Reconstructor.h" -#include <boost/function.hpp> +#include <functional> namespace walberla { namespace pe_coupling { @@ -71,7 +71,7 @@ public: const BlockDataID & bodyFieldID, const Reconstructer_T & reconstructor, const FlagUID & formerObstacle, const FlagUID & fluid, - const boost::function<bool(pe::BodyID)> & movingBodySelectorFct = selectRegularBodies, + const std::function<bool(pe::BodyID)> & movingBodySelectorFct = selectRegularBodies, const bool optimizeForSmallObstacleFraction = false ) : blockStorage_( blockStorage ), boundaryHandlingID_( boundaryHandlingID ), bodyStorageID_(bodyStorageID), globalBodyStorage_( globalBodyStorage ), bodyFieldID_( bodyFieldID ), @@ -127,7 +127,7 @@ private: const FlagUID formerObstacle_; const FlagUID fluid_; - boost::function<bool(pe::BodyID)> movingBodySelectorFct_; + std::function<bool(pe::BodyID)> movingBodySelectorFct_; const bool optimizeForSmallObstacleFraction_; diff --git a/src/pe_coupling/partially_saturated_cells_method/BodyAndVolumeFractionMapping.h b/src/pe_coupling/partially_saturated_cells_method/BodyAndVolumeFractionMapping.h index 3a6ef85a07db100e4f487548c518a0f0d02d63d9..9f28d42e6bd41f2226766c3e6b88bb8ad0b350ec 100644 --- a/src/pe_coupling/partially_saturated_cells_method/BodyAndVolumeFractionMapping.h +++ b/src/pe_coupling/partially_saturated_cells_method/BodyAndVolumeFractionMapping.h @@ -34,7 +34,7 @@ #include "pe_coupling/mapping/BodyBBMapping.h" #include "pe_coupling/utility/BodySelectorFunctions.h" -#include <boost/function.hpp> +#include <functional> namespace walberla { namespace pe_coupling { @@ -108,7 +108,7 @@ public: const shared_ptr<pe::BodyStorage> & globalBodyStorage, const BlockDataID & bodyStorageID, const BlockDataID & bodyAndVolumeFractionFieldID, - const boost::function<bool(pe::BodyID)> & mappingBodySelectorFct = selectRegularBodies, + const std::function<bool(pe::BodyID)> & mappingBodySelectorFct = selectRegularBodies, const real_t velocityUpdatingEpsilon = real_t(0), const real_t positionUpdatingEpsilon = real_t(0), const uint_t superSamplingDepth = uint_t(4) ) @@ -141,7 +141,7 @@ private: const BlockDataID bodyStorageID_; const BlockDataID bodyAndVolumeFractionFieldID_; - boost::function<bool(pe::BodyID)> mappingBodySelectorFct_; + std::function<bool(pe::BodyID)> mappingBodySelectorFct_; shared_ptr<BodyAndVolumeFractionField_T> updatedBodyAndVolumeFractionField_; std::map< walberla::id_t, Vector3< real_t > > lastUpdatedPositionMap_; diff --git a/src/pe_coupling/utility/TimeStep.h b/src/pe_coupling/utility/TimeStep.h index 6faf07fa6620ca33fbec4d7e8073bf33effa7ad1..684fb6bf60a01d9869f3b9f8adc12723b155e7af 100644 --- a/src/pe_coupling/utility/TimeStep.h +++ b/src/pe_coupling/utility/TimeStep.h @@ -32,7 +32,7 @@ #include "pe/rigidbody/BodyIterators.h" #include "pe/synchronization/SyncForces.h" -#include <boost/function.hpp> +#include <functional> #include <map> @@ -47,7 +47,7 @@ public: explicit TimeStep( const shared_ptr<StructuredBlockStorage> & blockStorage, const BlockDataID & bodyStorageID, pe::cr::ICR & collisionResponse, - const boost::function<void (void)> & synchronizeFunc, + const std::function<void (void)> & synchronizeFunc, const real_t timeStep = real_t(1), const uint_t intermediateSteps = uint_c(1) ) : timeStep_( timeStep ) , intermediateSteps_( ( intermediateSteps == 0 ) ? uint_c(1) : intermediateSteps ) @@ -147,7 +147,7 @@ protected: const BlockDataID & bodyStorageID_; pe::cr::ICR & collisionResponse_; - boost::function<void (void)> synchronizeFunc_; + std::function<void (void)> synchronizeFunc_; }; // class TimeStep diff --git a/src/python_coupling/DictWrapper.impl.h b/src/python_coupling/DictWrapper.impl.h index 57e7f55348865367bb0ae12a550a76e8d1cbf0d2..400eb2e7f09e4855cd2d1ffdb630b2dfb6ac6448 100644 --- a/src/python_coupling/DictWrapper.impl.h +++ b/src/python_coupling/DictWrapper.impl.h @@ -102,7 +102,7 @@ inline bool DictWrapper::has<DictWrapper >( const std::string & name ) //=================================================================================================================== // -// Getting boost::functions +// Getting std::functions // //=================================================================================================================== @@ -111,13 +111,13 @@ inline void runPythonObject( boost::python::object obj ) { obj(); } template<> -inline boost::function<void()> DictWrapper::get( const std::string & name ) { +inline std::function<void()> DictWrapper::get( const std::string & name ) { boost::python::object obj ( d_[name] ); return boost::bind( &runPythonObject, obj ); } template<> -inline bool DictWrapper::has<boost::function<void()> >( const std::string & name ) +inline bool DictWrapper::has<std::function<void()> >( const std::string & name ) { if(! d_.has_key(name) ) return false; diff --git a/src/python_coupling/Manager.h b/src/python_coupling/Manager.h index 5acfb0daadcd7d5444cdf757bb62bc8cb6e94236..b6294b6fb0a6f218585b1e75bcc9d1bf5ba262ed 100644 --- a/src/python_coupling/Manager.h +++ b/src/python_coupling/Manager.h @@ -71,8 +71,8 @@ namespace python_coupling { public: WALBERLA_BEFRIEND_SINGLETON; - typedef boost::function<void()> ExporterFunction; - typedef boost::function< boost::python::object ( IBlock&, BlockDataID ) > BlockDataToObjectFunction; + typedef std::function<void()> ExporterFunction; + typedef std::function< boost::python::object ( IBlock&, BlockDataID ) > BlockDataToObjectFunction; ~Manager(); diff --git a/src/python_coupling/helper/MplHelpers.h b/src/python_coupling/helper/MplHelpers.h index ff5969f75dbc2ab7a7778749fed990be7f85432c..640f45637b09d10dc54904250749830dea43fbc8 100644 --- a/src/python_coupling/helper/MplHelpers.h +++ b/src/python_coupling/helper/MplHelpers.h @@ -61,7 +61,7 @@ struct NonCopyableWrap {}; #define FunctionExporterClass( functionName, functionSignature ) \ struct Exporter_##functionName \ { \ - typedef boost::function< functionSignature > FunctionType;\ + typedef std::function< functionSignature > FunctionType;\ Exporter_##functionName( const IBlock * block, ConstBlockDataID id )\ : block_( block ), blockDataID_( id )\ {}\ diff --git a/src/timeloop/PerformanceMeter.cpp b/src/timeloop/PerformanceMeter.cpp index 1f4f5c13dce935e034d3e34f69fc1d58b4cd489c..7af5f847d18ba2ae2bc51049fbe8706a3d30a0a7 100644 --- a/src/timeloop/PerformanceMeter.cpp +++ b/src/timeloop/PerformanceMeter.cpp @@ -51,7 +51,7 @@ namespace timeloop { timeloop.addFuncBeforeTimeStep( perfMeter.getBeforeFunction() ); \endcode *******************************************************************************************************************/ - boost::function<void () > PerformanceMeter::getBeforeFunction() + std::function<void () > PerformanceMeter::getBeforeFunction() { return boost::bind ( &PerformanceMeter::timingStart, this ); } @@ -64,7 +64,7 @@ namespace timeloop { timeloop.addFuncAfterTimeStep ( perfMeter.getAfterFunction() ); \endcode *******************************************************************************************************************/ - boost::function<void () > PerformanceMeter::getAfterFunction() + std::function<void () > PerformanceMeter::getAfterFunction() { return boost::bind ( &PerformanceMeter::timingEnd, this ); } diff --git a/src/timeloop/PerformanceMeter.h b/src/timeloop/PerformanceMeter.h index d08a3fb1b79fd79f5ade7ce5d78b489fa89db84d..732121789149a1553e927fe2eb5d24e8ffa07846 100644 --- a/src/timeloop/PerformanceMeter.h +++ b/src/timeloop/PerformanceMeter.h @@ -24,7 +24,7 @@ #include "domain_decomposition/StructuredBlockStorage.h" #include <boost/bind.hpp> -#include <boost/function.hpp> +#include <functional> #include <iostream> #include <map> @@ -72,7 +72,7 @@ namespace timeloop { class PerformanceMeter { public: - typedef boost::function< uint_t(const IBlock &) > CountFunction; + typedef std::function< uint_t(const IBlock &) > CountFunction; PerformanceMeter( StructuredBlockStorage & blockStorage ); @@ -86,8 +86,8 @@ namespace timeloop { void timingStart(); void timingEnd(); - boost::function<void () > getBeforeFunction(); - boost::function<void () > getAfterFunction(); + std::function<void () > getBeforeFunction(); + std::function<void () > getAfterFunction(); void clear(); //@} diff --git a/src/timeloop/SelectableFunctionCreators.h b/src/timeloop/SelectableFunctionCreators.h index f00d5a3a0f298c901665b05115335d0c5c562e26..b6762e469e37afc1f3c093c76af35c822731ec82 100644 --- a/src/timeloop/SelectableFunctionCreators.h +++ b/src/timeloop/SelectableFunctionCreators.h @@ -26,7 +26,7 @@ #include "domain_decomposition/BlockStorage.h" #include <boost/bind.hpp> -#include <boost/function.hpp> +#include <functional> #include <string> @@ -38,7 +38,7 @@ namespace timeloop { template < typename FuncType > struct FuncCreator { - FuncCreator( boost::function< FuncType > fct, + FuncCreator( std::function< FuncType > fct, const std::string& identifier = std::string(), const Set<SUID>& requiredSelectors = Set<SUID>::emptySet(), const Set<SUID>& incompatibleSelectors = Set<SUID>::emptySet() ) @@ -46,7 +46,7 @@ namespace timeloop { requiredSelectors_( requiredSelectors ), incompatibleSelectors_( incompatibleSelectors ) {} - boost::function< FuncType > function_; + std::function< FuncType > function_; std::string identifier_; Set<SUID> requiredSelectors_; Set<SUID> incompatibleSelectors_; @@ -58,7 +58,7 @@ namespace timeloop { { SelectableFunction() {} - SelectableFunction ( boost::function< FuncType > fct, + SelectableFunction ( std::function< FuncType > fct, const std::string& identifier = std::string(), const Set<SUID>& requiredSelectors = Set<SUID>::emptySet(), const Set<SUID>& incompatibleSelectors = Set<SUID>::emptySet() ) @@ -72,14 +72,14 @@ namespace timeloop { return *this; } - selectable::SetSelectableObject< boost::function<FuncType>, SUID > selectableFunc_; + selectable::SetSelectableObject< std::function<FuncType>, SUID > selectableFunc_; }; struct BeforeFunction : public SelectableFunction< void () > { BeforeFunction() {} - BeforeFunction(boost::function< void () > fct, + BeforeFunction(std::function< void () > fct, const std::string& id = std::string(), const Set<SUID>& req = Set<SUID>::emptySet(), const Set<SUID>& incomp = Set<SUID>::emptySet()) @@ -97,7 +97,7 @@ namespace timeloop { struct AfterFunction : public SelectableFunction< void () > { AfterFunction() {} - AfterFunction(boost::function< void () > fct, + AfterFunction(std::function< void () > fct, const std::string& id = std::string(), const Set<SUID>& req = Set<SUID>::emptySet(), const Set<SUID>& incomp = Set<SUID>::emptySet()) @@ -115,14 +115,14 @@ namespace timeloop { template< typename T > struct SweepOnBlock { - SweepOnBlock( boost::function< T* ( IBlock* const block ) > function, + SweepOnBlock( std::function< T* ( IBlock* const block ) > function, const std::string& identifier = std::string(), const Set<SUID>& required = Set<SUID>::emptySet(), const Set<SUID>& incompatible = Set<SUID>::emptySet() ) : function_( function ), identifier_( identifier ), requiredSelectors_( required ), incompatibleSelectors_( incompatible ) {} - boost::function< T* ( IBlock* const block ) > function_; + std::function< T* ( IBlock* const block ) > function_; std::string identifier_; Set<SUID> requiredSelectors_; diff --git a/src/timeloop/SweepTimeloop.h b/src/timeloop/SweepTimeloop.h index 33daeb7b52df4b542ebb4488d89ea42dc01bc96f..a9b4d6d2ad88692a1c86e674e82a1c2f80cd897d 100644 --- a/src/timeloop/SweepTimeloop.h +++ b/src/timeloop/SweepTimeloop.h @@ -26,7 +26,7 @@ #include "Timeloop.h" #include "domain_decomposition/StructuredBlockStorage.h" -#include <boost/function.hpp> +#include <functional> #include <map> diff --git a/src/timeloop/Timeloop.h b/src/timeloop/Timeloop.h index b576f79a36d271ff3993439569a3cf443e4af505..e2cc5500191eab290607be954d4cc6306ae84560 100644 --- a/src/timeloop/Timeloop.h +++ b/src/timeloop/Timeloop.h @@ -30,13 +30,13 @@ #include "core/timing/TimingPool.h" #include "core/uid/SUID.h" -#include <boost/function.hpp> +#include <functional> namespace walberla { namespace timeloop { -typedef boost::function<void ()> VoidFctNoArguments; +typedef std::function<void ()> VoidFctNoArguments; //******************************************************************************************************************* diff --git a/src/vtk/ChainedFilter.h b/src/vtk/ChainedFilter.h index 43411c80d7779832cda4389369f7ba916939ec7d..573fff5c160854ac95cc72880f3b2c192c8e82c6 100644 --- a/src/vtk/ChainedFilter.h +++ b/src/vtk/ChainedFilter.h @@ -25,7 +25,7 @@ #include "core/cell/CellSet.h" #include "domain_decomposition/StructuredBlockStorage.h" -#include <boost/function.hpp> +#include <functional> namespace walberla { @@ -37,7 +37,7 @@ class ChainedFilter { public: - typedef boost::function< void ( CellSet& filteredCells, const IBlock& block, const StructuredBlockStorage& storage, const uint_t ghostLayers ) > CellFilter; + typedef std::function< void ( CellSet& filteredCells, const IBlock& block, const StructuredBlockStorage& storage, const uint_t ghostLayers ) > CellFilter; void addFilter( const CellFilter& filter ) { filters_.push_back( filter ); } diff --git a/src/vtk/Initialization.h b/src/vtk/Initialization.h index 6970130315c2f96d7c7c26e025667e00f20e6937..b08caac6a49eb3f7a0e2f024a32cc6f62d1b2505 100644 --- a/src/vtk/Initialization.h +++ b/src/vtk/Initialization.h @@ -26,7 +26,7 @@ #include "core/config/Config.h" #include "domain_decomposition/StructuredBlockStorage.h" -#include <boost/function.hpp> +#include <functional> #include <string> @@ -37,7 +37,7 @@ namespace vtk { // For documentation see the documentation of function "initializeVTKOutput" in Initialization.cpp -typedef boost::function< void () > OutputFunction; +typedef std::function< void () > OutputFunction; struct SelectableOutputFunction { @@ -76,7 +76,7 @@ void initializeVTKOutput( std::map< std::string, SelectableOutputFunction > & ou const std::map< std::string, VTKOutput::CellFilter > & filters, const std::map< std::string, VTKOutput::BeforeFunction > & beforeFunctions ); -typedef boost::function< void ( std::vector< shared_ptr< BlockCellDataWriterInterface > > & writers, +typedef std::function< void ( std::vector< shared_ptr< BlockCellDataWriterInterface > > & writers, std::map< std::string, VTKOutput::CellFilter > & filters, std::map< std::string, VTKOutput::BeforeFunction > & beforeFunctions ) > RegisterVTKOutputFunction; diff --git a/src/vtk/VTKOutput.h b/src/vtk/VTKOutput.h index 71cec90a9f124875c962ee19cc135851ea1f773e..2f51b9b21f7ad5f8d8232b5f4c119601ed8a4c3b 100644 --- a/src/vtk/VTKOutput.h +++ b/src/vtk/VTKOutput.h @@ -35,7 +35,7 @@ #include <boost/filesystem/operations.hpp> #include <boost/filesystem/path.hpp> -#include <boost/function.hpp> +#include <functional> #include <boost/tuple/tuple.hpp> #include <fstream> @@ -144,8 +144,8 @@ public: const bool continuousNumbering, const bool binary, const bool littleEndian, const bool useMPIIO, const uint_t initialExecutionCount ); - typedef boost::function< void () > BeforeFunction; - typedef boost::function< void ( CellSet& filteredCells, const IBlock& block, + typedef std::function< void () > BeforeFunction; + typedef std::function< void ( CellSet& filteredCells, const IBlock& block, const StructuredBlockStorage& storage, const uint_t ghostLayers ) > CellFilter; ~VTKOutput(); diff --git a/tests/field/FieldTiming.cpp b/tests/field/FieldTiming.cpp index 86fdb06f5e664abb5f4789c638639ccdd985bf4e..5e8fd340756e899de7c9c0c6ca2e725682c60bb8 100644 --- a/tests/field/FieldTiming.cpp +++ b/tests/field/FieldTiming.cpp @@ -196,7 +196,7 @@ double initFieldRandom(DoubleField & field) return sum; } -typedef boost::function<double (const DoubleField & field)> Func; +typedef std::function<double (const DoubleField & field)> Func; void timeFunction( WcTimer & timer, Func f, const DoubleField & field, double sum, double epsilon, int nrExecutions=30 ) { for(int i=0 ; i < nrExecutions; ++i) diff --git a/tests/lbm/boundary/SimpleDiffusionDirichlet.cpp b/tests/lbm/boundary/SimpleDiffusionDirichlet.cpp index 4515cc13c0dec9b3147fff7d60cfa1629bb76dc6..d28603a3feb1553d8d321d7b2ab216bc3ef14960 100644 --- a/tests/lbm/boundary/SimpleDiffusionDirichlet.cpp +++ b/tests/lbm/boundary/SimpleDiffusionDirichlet.cpp @@ -75,6 +75,7 @@ #include <boost/lexical_cast.hpp> #include <stdexcept> +#include <array> #include "gather/GnuPlotGraphWriter.h" #include "field/vtk/FlagFieldCellFilter.h" @@ -240,6 +241,7 @@ public: piInv_(real_t(1)/math::PI), valid_(uint_c(std::ceil(omega*omega*omega*real_t(10)))), time_( time ), + expArray(), timestep_( uint_t(0u) ), E_max_(maxValue-minValue), E_mean_(maxValue-minValue) @@ -265,7 +267,7 @@ private: const uint_t valid_; const uint_t time_; - real_t expArray[1000]; + std::array<real_t,1000> expArray; uint_t timestep_; real_t E_max_; diff --git a/tests/mesh/PeVTKMeshWriterTest.cpp b/tests/mesh/PeVTKMeshWriterTest.cpp index 4c0f683dc4aded284648b6f1a13ae00be345434f..0737b841f6fe56e3109bf887cf049328d2beabe5 100644 --- a/tests/mesh/PeVTKMeshWriterTest.cpp +++ b/tests/mesh/PeVTKMeshWriterTest.cpp @@ -140,7 +140,7 @@ int main( int argc, char ** argv ) cr.setRelaxationParameter( real_t(0.7) ); cr.setGlobalLinearAcceleration( Vec3(0,0,5) ); - boost::function<void(void)> syncCall = boost::bind( pe::syncNextNeighbors<BodyTuple>, boost::ref(*forest), storageID, static_cast<WcTimingTree*>(NULL), real_c(0.0), false ); + std::function<void(void)> syncCall = boost::bind( pe::syncNextNeighbors<BodyTuple>, boost::ref(*forest), storageID, static_cast<WcTimingTree*>(NULL), real_c(0.0), false ); typedef mesh::FloatPolyMesh OutputMeshType; typedef mesh::pe::DefaultTesselation<OutputMeshType> TesselationType; diff --git a/tests/pe/DeleteBody.cpp b/tests/pe/DeleteBody.cpp index 9b0d149bc327ed2bdfc6c9f79e6eeacfb5c8a0ba..64f03d42a807a89b5cce96903acf13ee7fe5220d 100644 --- a/tests/pe/DeleteBody.cpp +++ b/tests/pe/DeleteBody.cpp @@ -80,7 +80,7 @@ int main( int argc, char** argv ) } WALBERLA_CHECK_UNEQUAL(firstStorage, secondStorage); - boost::function<void(void)> syncCall; + std::function<void(void)> syncCall; if (!syncShadowOwners) { syncCall = boost::bind( pe::syncNextNeighbors<BodyTuple>, boost::ref(forest->getBlockForest()), storageID, static_cast<WcTimingTree*>(NULL), real_c(0.0), false ); diff --git a/tests/pe/ShadowCopy.cpp b/tests/pe/ShadowCopy.cpp index d0d3c119fd47b8c7f3a2ccef15a08f86ab935870..cbd4958e34ede91c698393f37f42633925f15abc 100644 --- a/tests/pe/ShadowCopy.cpp +++ b/tests/pe/ShadowCopy.cpp @@ -62,7 +62,7 @@ int main( int argc, char** argv ) // logging::Logging::instance()->includeLoggingToFile("ShadowCopy"); bool syncShadowOwners = false; - boost::function<void(void)> syncCall; + std::function<void(void)> syncCall; if (!syncShadowOwners) { syncCall = boost::bind( pe::syncNextNeighbors<BodyTuple>, boost::ref(forest->getBlockForest()), storageID, static_cast<WcTimingTree*>(NULL), real_c(0.0), false ); diff --git a/tests/pe_coupling/discrete_particle_methods/HinderedSettlingDynamicsDPM.cpp b/tests/pe_coupling/discrete_particle_methods/HinderedSettlingDynamicsDPM.cpp index 8786074ddbe78cea3ca1a560f4f6b8ff2d03fda6..cc700fde4efd3e4836ff398026a69e491b2fbbcb 100644 --- a/tests/pe_coupling/discrete_particle_methods/HinderedSettlingDynamicsDPM.cpp +++ b/tests/pe_coupling/discrete_particle_methods/HinderedSettlingDynamicsDPM.cpp @@ -337,7 +337,7 @@ public: QuantityEvaluator( SweepTimeloop* timeloop, StructuredBlockStorage & blocks, const BlockDataID & bodyStorageID, const BlockDataID & forceFieldID, const BlockDataID & pdfFieldID, const std::string & fileName, bool fileIO, const uint_t & numSpheres, const real_t & velExpected, - const boost::function<Vector3<real_t> ()> & evaluateMeanFluidVelocity ) : + const std::function<Vector3<real_t> ()> & evaluateMeanFluidVelocity ) : timeloop_( timeloop ), blocks_( blocks ), bodyStorageID_( bodyStorageID ), forceFieldID_( forceFieldID ), pdfFieldID_( pdfFieldID ), fileName_( fileName ), fileIO_( fileIO ), numSpheres_( numSpheres ), velExpected_( velExpected ), evaluateMeanFluidVelocity_( evaluateMeanFluidVelocity ) @@ -484,7 +484,7 @@ private: const uint_t numSpheres_; const real_t velExpected_; - boost::function<Vector3<real_t> ()> evaluateMeanFluidVelocity_; + std::function<Vector3<real_t> ()> evaluateMeanFluidVelocity_; }; @@ -1044,7 +1044,7 @@ int main( int argc, char **argv ) ///////////////////////////////// // drag correlation function - boost::function<Vector3<real_t> ( const Vector3<real_t>&, const Vector3<real_t> &, real_t, real_t, real_t, real_t)> dragCorrelationFunction; + std::function<Vector3<real_t> ( const Vector3<real_t>&, const Vector3<real_t> &, real_t, real_t, real_t, real_t)> dragCorrelationFunction; if( dragCorr == DragCorrelation::ErgunWenYu ) { dragCorrelationFunction = pe_coupling::discrete_particle_methods::dragForceErgunWenYu; @@ -1075,7 +1075,7 @@ int main( int argc, char **argv ) } // lift correlation function - boost::function<Vector3<real_t> ( const Vector3<real_t> &, const Vector3<real_t> &, const Vector3<real_t> &, real_t, real_t, real_t )> liftCorrelationFunction; + std::function<Vector3<real_t> ( const Vector3<real_t> &, const Vector3<real_t> &, const Vector3<real_t> &, real_t, real_t, real_t )> liftCorrelationFunction; if( liftCorr == LiftCorrelation::NoLift ) { liftCorrelationFunction = pe_coupling::discrete_particle_methods::noLiftForce; @@ -1090,7 +1090,7 @@ int main( int argc, char **argv ) } // added mass correlation function - boost::function<Vector3<real_t> ( const Vector3<real_t> &, const Vector3<real_t> &, real_t, real_t )> addedMassCorrelationFunction; + std::function<Vector3<real_t> ( const Vector3<real_t> &, const Vector3<real_t> &, real_t, real_t )> addedMassCorrelationFunction; if( addedMassCorr == AddedMassCorrelation::NoAM ) { addedMassCorrelationFunction = pe_coupling::discrete_particle_methods::noAddedMassForce; @@ -1105,7 +1105,7 @@ int main( int argc, char **argv ) } // set up effective viscosity calculation - boost::function<real_t ( real_t, real_t)> effectiveViscosityFunction; + std::function<real_t ( real_t, real_t)> effectiveViscosityFunction; if( effVisc == EffectiveViscosity::None ) { effectiveViscosityFunction = pe_coupling::discrete_particle_methods::calculateUnchangedEffectiveViscosity; @@ -1137,7 +1137,7 @@ int main( int argc, char **argv ) (*bodyVelocityTimeDerivativeEvaluator)(); // function used to evaluate the interaction force between fluid and particles - boost::function<void(void)> dragAndPressureForceEvaluationFunction; + std::function<void(void)> dragAndPressureForceEvaluationFunction; if( dpm == DPMethod::GNS ) { if (interpol == Interpolation::INearestNeighbor) { if (dist == Distribution::DNearestNeighbor) { @@ -1202,7 +1202,7 @@ int main( int argc, char **argv ) // function to evaluate the lift force contribution - boost::function<void(void)> liftForceEvaluationFunction; + std::function<void(void)> liftForceEvaluationFunction; if( interpol == Interpolation::INearestNeighbor ) { if( dist == Distribution::DNearestNeighbor ) @@ -1262,7 +1262,7 @@ int main( int argc, char **argv ) } // function to evaluate the added mass contribution - boost::function<void(void)> addedMassEvaluationFunction; + std::function<void(void)> addedMassEvaluationFunction; if( interpol == Interpolation::INearestNeighbor ) { if( dist == Distribution::DNearestNeighbor ) @@ -1322,7 +1322,7 @@ int main( int argc, char **argv ) } // function to evaluate lubrication forces - boost::function<void(void)> lubricationEvaluationFunction; + std::function<void(void)> lubricationEvaluationFunction; if( lubricationCutOffDistance > real_t(0) ) { if( useLubricationCorrection ) @@ -1343,7 +1343,7 @@ int main( int argc, char **argv ) // function to evaluate the mean fluid velocity - boost::function<Vector3<real_t> ()> evaluateMeanFluidVelocity = boost::bind(getGNSMeanFluidVelocity, blocks, pdfFieldID, svfFieldID, domainVolume); + std::function<Vector3<real_t> ()> evaluateMeanFluidVelocity = boost::bind(getGNSMeanFluidVelocity, blocks, pdfFieldID, svfFieldID, domainVolume); ////////////////////////////// diff --git a/tests/pe_coupling/discrete_particle_methods/SphereWallCollisionBehaviorDPM.cpp b/tests/pe_coupling/discrete_particle_methods/SphereWallCollisionBehaviorDPM.cpp index 8b4616f72d3d8b3cebae47ebd4894ee6ab26dc08..3ac3679f58cc454677672cd5a923d61404d6af52 100644 --- a/tests/pe_coupling/discrete_particle_methods/SphereWallCollisionBehaviorDPM.cpp +++ b/tests/pe_coupling/discrete_particle_methods/SphereWallCollisionBehaviorDPM.cpp @@ -840,7 +840,7 @@ int main( int argc, char **argv ) ///////////////////////////////// // drag correlation function - boost::function<Vector3<real_t> ( const Vector3<real_t>&, const Vector3<real_t> &, real_t, real_t, real_t, real_t)> dragCorrelationFunction; + std::function<Vector3<real_t> ( const Vector3<real_t>&, const Vector3<real_t> &, real_t, real_t, real_t, real_t)> dragCorrelationFunction; if( dragCorr == DragCorrelation::ErgunWenYu ) { dragCorrelationFunction = pe_coupling::discrete_particle_methods::dragForceErgunWenYu; @@ -871,7 +871,7 @@ int main( int argc, char **argv ) } // lift correlation function - boost::function<Vector3<real_t> ( const Vector3<real_t> &, const Vector3<real_t> &, const Vector3<real_t> &, real_t, real_t, real_t )> liftCorrelationFunction; + std::function<Vector3<real_t> ( const Vector3<real_t> &, const Vector3<real_t> &, const Vector3<real_t> &, real_t, real_t, real_t )> liftCorrelationFunction; if( liftCorr == LiftCorrelation::NoLift ) { liftCorrelationFunction = pe_coupling::discrete_particle_methods::noLiftForce; @@ -886,7 +886,7 @@ int main( int argc, char **argv ) } // added mass correlation function - boost::function<Vector3<real_t> ( const Vector3<real_t> &, const Vector3<real_t> &, real_t, real_t )> addedMassCorrelationFunction; + std::function<Vector3<real_t> ( const Vector3<real_t> &, const Vector3<real_t> &, real_t, real_t )> addedMassCorrelationFunction; if( addedMassCorr == AddedMassCorrelation::NoAM ) { addedMassCorrelationFunction = pe_coupling::discrete_particle_methods::noAddedMassForce; @@ -901,7 +901,7 @@ int main( int argc, char **argv ) } // set up effective viscosity calculation - boost::function<real_t ( real_t, real_t)> effectiveViscosityFunction; + std::function<real_t ( real_t, real_t)> effectiveViscosityFunction; if( effVisc == EffectiveViscosity::None ) { effectiveViscosityFunction = pe_coupling::discrete_particle_methods::calculateUnchangedEffectiveViscosity; @@ -933,7 +933,7 @@ int main( int argc, char **argv ) (*bodyVelocityTimeDerivativeEvaluator)(); // function used to evaluate the interaction force between fluid and particles - boost::function<void(void)> dragAndPressureForceEvaluationFunction; + std::function<void(void)> dragAndPressureForceEvaluationFunction; if( dpm == DPMethod::GNS ) { if (interpol == Interpolation::INearestNeighbor) { if (dist == Distribution::DNearestNeighbor) { @@ -998,7 +998,7 @@ int main( int argc, char **argv ) // function to evaluate the lift force contribution - boost::function<void(void)> liftForceEvaluationFunction; + std::function<void(void)> liftForceEvaluationFunction; if( interpol == Interpolation::INearestNeighbor ) { if( dist == Distribution::DNearestNeighbor ) @@ -1059,7 +1059,7 @@ int main( int argc, char **argv ) // function to evaluate the added mass contribution - boost::function<void(void)> addedMassEvaluationFunction; + std::function<void(void)> addedMassEvaluationFunction; if( interpol == Interpolation::INearestNeighbor ) { if( dist == Distribution::DNearestNeighbor ) @@ -1119,7 +1119,7 @@ int main( int argc, char **argv ) } // function to evaluate lubrication forces - boost::function<void(void)> lubricationEvaluationFunction; + std::function<void(void)> lubricationEvaluationFunction; if( lubricationCutOffDistance > real_t(0) ) { if( useLubricationCorrection ) diff --git a/tests/pe_coupling/momentum_exchange_method/BodyAtBlockBoarderCheck.cpp b/tests/pe_coupling/momentum_exchange_method/BodyAtBlockBoarderCheck.cpp index e47a1d4cbe0d44769c633b29bb900a9f2d0a4c6c..4133741c77ebb5f7bf427b77ad096f0ab0c2ea33 100644 --- a/tests/pe_coupling/momentum_exchange_method/BodyAtBlockBoarderCheck.cpp +++ b/tests/pe_coupling/momentum_exchange_method/BodyAtBlockBoarderCheck.cpp @@ -281,7 +281,7 @@ int main( int argc, char **argv ) // connect to pe const real_t overlap = real_c( 1.5 ) * dx; - boost::function<void(void)> syncCall = boost::bind( pe::syncShadowOwners<BodyTypeTuple>, boost::ref(blocks->getBlockForest()), bodyStorageID, static_cast<WcTimingTree*>(NULL), overlap, false ); + std::function<void(void)> syncCall = boost::bind( pe::syncShadowOwners<BodyTypeTuple>, boost::ref(blocks->getBlockForest()), bodyStorageID, static_cast<WcTimingTree*>(NULL), overlap, false ); auto sphereMaterialID = pe::createMaterial( "sphereMat", real_c(1) , real_c(0.3), real_c(0.2), real_c(0.2), real_c(0.24), real_c(200), real_c(200), real_c(0), real_c(0) ); // create two spheres: one which overlaps with a block boundary and one inside the block diff --git a/tests/pe_coupling/momentum_exchange_method/DragForceSphereMEM.cpp b/tests/pe_coupling/momentum_exchange_method/DragForceSphereMEM.cpp index 1e4bf71b5d9d87f25d6822e22372d4c690285918..c1d3d69a0964a5d187d79d9304497c00d4bf4ce6 100644 --- a/tests/pe_coupling/momentum_exchange_method/DragForceSphereMEM.cpp +++ b/tests/pe_coupling/momentum_exchange_method/DragForceSphereMEM.cpp @@ -516,7 +516,7 @@ int main( int argc, char **argv ) SweepTimeloop timeloop( blocks->getBlockStorage(), timesteps ); // setup of the LBM communication for synchronizing the pdf field between neighboring blocks - boost::function< void () > commFunction; + std::function< void () > commFunction; blockforest::communication::UniformBufferedScheme< stencil::D3Q27 > scheme( blocks ); scheme.addPackInfo( make_shared< field::communication::PackInfo< PdfField_T > >( pdfFieldID ) ); diff --git a/tests/pe_coupling/momentum_exchange_method/GlobalBodyAsBoundaryMEMStaticRefinement.cpp b/tests/pe_coupling/momentum_exchange_method/GlobalBodyAsBoundaryMEMStaticRefinement.cpp index e833f9a7134c8d7cdcaee07ac7711f928b4bc502..27626a2e5d93b95e14850edf93265aebfd06bca5 100644 --- a/tests/pe_coupling/momentum_exchange_method/GlobalBodyAsBoundaryMEMStaticRefinement.cpp +++ b/tests/pe_coupling/momentum_exchange_method/GlobalBodyAsBoundaryMEMStaticRefinement.cpp @@ -391,7 +391,7 @@ int main( int argc, char **argv ) /////////////// // setup of the LBM communication for synchronizing the pdf field between neighboring blocks - boost::function< void () > commFunction; + std::function< void () > commFunction; blockforest::communication::UniformBufferedScheme< Stencil_T > scheme( blocks ); scheme.addPackInfo( make_shared< lbm::PdfFieldPackInfo< LatticeModel_T > >( pdfFieldID ) ); commFunction = scheme; diff --git a/tests/pe_coupling/momentum_exchange_method/LubricationCorrectionMEM.cpp b/tests/pe_coupling/momentum_exchange_method/LubricationCorrectionMEM.cpp index 2569114b661f0143c030adc415601dbb42638450..d0d021395ac9fdebda1baca45cb0bc78b13449ae 100644 --- a/tests/pe_coupling/momentum_exchange_method/LubricationCorrectionMEM.cpp +++ b/tests/pe_coupling/momentum_exchange_method/LubricationCorrectionMEM.cpp @@ -789,7 +789,7 @@ int main( int argc, char **argv ) // set up synchronization procedure const real_t overlap = real_c( 1.5 ) * dx; - boost::function<void(void)> syncCall = boost::bind( pe::syncShadowOwners<BodyTypeTuple>, boost::ref(blocks->getBlockForest()), bodyStorageID, static_cast<WcTimingTree*>(NULL), overlap, false ); + std::function<void(void)> syncCall = boost::bind( pe::syncShadowOwners<BodyTypeTuple>, boost::ref(blocks->getBlockForest()), bodyStorageID, static_cast<WcTimingTree*>(NULL), overlap, false ); // create the material const auto myMat = pe::createMaterial( "myMat", real_c(1.4), real_t(0), real_t(1), real_t(1), real_t(0), real_t(1), real_t(1), real_t(0), real_t(0) ); @@ -940,7 +940,7 @@ int main( int argc, char **argv ) << Sweep( pe_coupling::PDFReconstruction< LatticeModel_T, BoundaryHandling_T, Reconstructor_T >( blocks, boundaryHandlingID, bodyStorageID, globalBodyStorage, bodyFieldID, reconstructor, FormerMO_Flag, Fluid_Flag ), "PDF Restore" ); // setup of the LBM communication for synchronizing the pdf field between neighboring blocks - boost::function< void () > commFunction; + std::function< void () > commFunction; if( fullPDFSync ) { blockforest::communication::UniformBufferedScheme< stencil::D3Q27 > scheme( blocks ); diff --git a/tests/pe_coupling/momentum_exchange_method/PeriodicParticleChannelMEM.cpp b/tests/pe_coupling/momentum_exchange_method/PeriodicParticleChannelMEM.cpp index 15d44380b97143cfaeb25476b5b4a9652578daa3..ef64aa7a87b345e84e5bd1390f18b008667064a7 100644 --- a/tests/pe_coupling/momentum_exchange_method/PeriodicParticleChannelMEM.cpp +++ b/tests/pe_coupling/momentum_exchange_method/PeriodicParticleChannelMEM.cpp @@ -413,7 +413,7 @@ int main( int argc, char **argv ) // set up synchronization procedure const real_t overlap = real_c( 1.5 ) * dx; - boost::function<void(void)> syncCall = boost::bind( pe::syncShadowOwners<BodyTypeTuple>, boost::ref(blocks->getBlockForest()), bodyStorageID, static_cast<WcTimingTree*>(NULL), overlap, false ); + std::function<void(void)> syncCall = boost::bind( pe::syncShadowOwners<BodyTypeTuple>, boost::ref(blocks->getBlockForest()), bodyStorageID, static_cast<WcTimingTree*>(NULL), overlap, false ); // create pe bodies const auto material = pe::createMaterial( "granular", real_c(1.2), real_c(0.25), real_c(0.4), real_c(0.4), real_c(0.35), real_c(1.39e11), real_c(5.18e7), real_c(1.07e2), real_c(1.07e2) ); @@ -524,7 +524,7 @@ int main( int argc, char **argv ) reconstructor, FormerMO_Flag, Fluid_Flag ), "PDF Restore" ); // setup of the LBM communication for synchronizing the pdf field between neighboring blocks - boost::function< void () > commFunction; + std::function< void () > commFunction; if( fullPDFSync ) { blockforest::communication::UniformBufferedScheme< stencil::D3Q27 > scheme( blocks ); diff --git a/tests/pe_coupling/momentum_exchange_method/SegreSilberbergMEM.cpp b/tests/pe_coupling/momentum_exchange_method/SegreSilberbergMEM.cpp index 6cfeb3dea5941f075fd70d3305529ebb096e0956..6ccc9f5c7d5156ba058991860ccb271ecbcbfe91 100644 --- a/tests/pe_coupling/momentum_exchange_method/SegreSilberbergMEM.cpp +++ b/tests/pe_coupling/momentum_exchange_method/SegreSilberbergMEM.cpp @@ -546,7 +546,7 @@ int main( int argc, char **argv ) // set up synchronization procedure const real_t overlap = real_t( 1.5 ) * dx; - boost::function<void(void)> syncCall; + std::function<void(void)> syncCall; if (!syncShadowOwners) { syncCall = boost::bind( pe::syncNextNeighbors<BodyTypeTuple>, boost::ref(blocks->getBlockForest()), bodyStorageID, static_cast<WcTimingTree*>(NULL), overlap, false ); @@ -623,7 +623,7 @@ int main( int argc, char **argv ) /////////////// // setup of the LBM communication for synchronizing the pdf field between neighboring blocks - boost::function< void () > commFunction; + std::function< void () > commFunction; blockforest::communication::UniformBufferedScheme< Stencil_T > scheme( blocks ); scheme.addPackInfo( make_shared< lbm::PdfFieldPackInfo< LatticeModel_T > >( pdfFieldID ) ); commFunction = scheme; @@ -670,9 +670,9 @@ int main( int argc, char **argv ) } shared_ptr<pe_coupling::BodiesForceTorqueContainer> bodiesFTContainer1 = make_shared<pe_coupling::BodiesForceTorqueContainer>(blocks, bodyStorageID); - boost::function<void(void)> storeForceTorqueInCont1 = boost::bind(&pe_coupling::BodiesForceTorqueContainer::store, bodiesFTContainer1); + std::function<void(void)> storeForceTorqueInCont1 = boost::bind(&pe_coupling::BodiesForceTorqueContainer::store, bodiesFTContainer1); shared_ptr<pe_coupling::BodiesForceTorqueContainer> bodiesFTContainer2 = make_shared<pe_coupling::BodiesForceTorqueContainer>(blocks, bodyStorageID); - boost::function<void(void)> setForceTorqueOnBodiesFromCont2 = boost::bind(&pe_coupling::BodiesForceTorqueContainer::setOnBodies, bodiesFTContainer2); + std::function<void(void)> setForceTorqueOnBodiesFromCont2 = boost::bind(&pe_coupling::BodiesForceTorqueContainer::setOnBodies, bodiesFTContainer2); bodiesFTContainer2->store(); diff --git a/tests/pe_coupling/momentum_exchange_method/SettlingSphereMEM.cpp b/tests/pe_coupling/momentum_exchange_method/SettlingSphereMEM.cpp index 0dfd102a5a61d08575b626f706b98f08b1451396..1b0d57f8e085afef600e8b85d0b9d2bfef6b0ba4 100644 --- a/tests/pe_coupling/momentum_exchange_method/SettlingSphereMEM.cpp +++ b/tests/pe_coupling/momentum_exchange_method/SettlingSphereMEM.cpp @@ -457,7 +457,7 @@ int main( int argc, char **argv ) // set up synchronization procedure const real_t overlap = real_t( 1.5 ) * dx; - boost::function<void(void)> syncCall = boost::bind( pe::syncShadowOwners<BodyTypeTuple>, boost::ref(blocks->getBlockForest()), bodyStorageID, static_cast<WcTimingTree*>(NULL), overlap, false ); + std::function<void(void)> syncCall = boost::bind( pe::syncShadowOwners<BodyTypeTuple>, boost::ref(blocks->getBlockForest()), bodyStorageID, static_cast<WcTimingTree*>(NULL), overlap, false ); // create pe bodies @@ -509,7 +509,7 @@ int main( int argc, char **argv ) /////////////// // setup of the LBM communication for synchronizing the pdf field between neighboring blocks - boost::function< void () > commFunction; + std::function< void () > commFunction; blockforest::communication::UniformBufferedScheme< Stencil_T > scheme( blocks ); scheme.addPackInfo( make_shared< lbm::PdfFieldPackInfo< LatticeModel_T > >( pdfFieldID ) ); commFunction = scheme; @@ -530,11 +530,11 @@ int main( int argc, char **argv ) ( blocks, boundaryHandlingID, bodyStorageID, globalBodyStorage, bodyFieldID, reconstructor, FormerMO_Flag, Fluid_Flag ), "PDF Restore" ); shared_ptr<pe_coupling::BodiesForceTorqueContainer> bodiesFTContainer1 = make_shared<pe_coupling::BodiesForceTorqueContainer>(blocks, bodyStorageID); - boost::function<void(void)> storeForceTorqueInCont1 = boost::bind(&pe_coupling::BodiesForceTorqueContainer::store, bodiesFTContainer1); + std::function<void(void)> storeForceTorqueInCont1 = boost::bind(&pe_coupling::BodiesForceTorqueContainer::store, bodiesFTContainer1); shared_ptr<pe_coupling::BodiesForceTorqueContainer> bodiesFTContainer2 = make_shared<pe_coupling::BodiesForceTorqueContainer>(blocks, bodyStorageID); - boost::function<void(void)> setForceTorqueOnBodiesFromCont2 = boost::bind(&pe_coupling::BodiesForceTorqueContainer::setOnBodies, bodiesFTContainer2); + std::function<void(void)> setForceTorqueOnBodiesFromCont2 = boost::bind(&pe_coupling::BodiesForceTorqueContainer::setOnBodies, bodiesFTContainer2); shared_ptr<pe_coupling::ForceTorqueOnBodiesScaler> forceScaler = make_shared<pe_coupling::ForceTorqueOnBodiesScaler>(blocks, bodyStorageID, real_t(1)); - boost::function<void(void)> setForceScalingFactorToHalf = boost::bind(&pe_coupling::ForceTorqueOnBodiesScaler::resetScalingFactor,forceScaler,real_t(0.5)); + std::function<void(void)> setForceScalingFactorToHalf = boost::bind(&pe_coupling::ForceTorqueOnBodiesScaler::resetScalingFactor,forceScaler,real_t(0.5)); if( averageForceTorqueOverTwoTimSteps ) { bodiesFTContainer2->store(); diff --git a/tests/pe_coupling/momentum_exchange_method/SettlingSphereMEMDynamicRefinement.cpp b/tests/pe_coupling/momentum_exchange_method/SettlingSphereMEMDynamicRefinement.cpp index 75b9ff72e24c4792a8bce5a4bbf3128d564b908d..469892c98be27ce0920bcf5c52e4c609f838e9f5 100644 --- a/tests/pe_coupling/momentum_exchange_method/SettlingSphereMEMDynamicRefinement.cpp +++ b/tests/pe_coupling/momentum_exchange_method/SettlingSphereMEMDynamicRefinement.cpp @@ -677,7 +677,7 @@ int main( int argc, char **argv ) // set up synchronization procedure const real_t overlap = real_t( 1.5 ) * dx; - boost::function<void(void)> syncCall = boost::bind( pe::syncShadowOwners<BodyTypeTuple>, boost::ref(blocks->getBlockForest()), bodyStorageID, static_cast<WcTimingTree*>(NULL), overlap, false ); + std::function<void(void)> syncCall = boost::bind( pe::syncShadowOwners<BodyTypeTuple>, boost::ref(blocks->getBlockForest()), bodyStorageID, static_cast<WcTimingTree*>(NULL), overlap, false ); // create pe bodies @@ -728,12 +728,12 @@ int main( int argc, char **argv ) // force averaging functionality shared_ptr<pe_coupling::BodiesForceTorqueContainer> bodiesFTContainer1 = make_shared<pe_coupling::BodiesForceTorqueContainer>(blocks, bodyStorageID); - boost::function<void(void)> storeForceTorqueInCont1 = boost::bind(&pe_coupling::BodiesForceTorqueContainer::store, bodiesFTContainer1); + std::function<void(void)> storeForceTorqueInCont1 = boost::bind(&pe_coupling::BodiesForceTorqueContainer::store, bodiesFTContainer1); shared_ptr<pe_coupling::BodiesForceTorqueContainer> bodiesFTContainer2 = make_shared<pe_coupling::BodiesForceTorqueContainer>(blocks, bodyStorageID); - boost::function<void(void)> setForceTorqueOnBodiesFromCont2 = boost::bind(&pe_coupling::BodiesForceTorqueContainer::setOnBodies, bodiesFTContainer2); + std::function<void(void)> setForceTorqueOnBodiesFromCont2 = boost::bind(&pe_coupling::BodiesForceTorqueContainer::setOnBodies, bodiesFTContainer2); shared_ptr<pe_coupling::ForceTorqueOnBodiesScaler> forceScaler = make_shared<pe_coupling::ForceTorqueOnBodiesScaler>(blocks, bodyStorageID, real_t(0.5)); - boost::function<void(void)> setForceScalingFactorToOne = boost::bind(&pe_coupling::ForceTorqueOnBodiesScaler::resetScalingFactor,forceScaler,real_t(1)); - boost::function<void(void)> setForceScalingFactorToHalf = boost::bind(&pe_coupling::ForceTorqueOnBodiesScaler::resetScalingFactor,forceScaler,real_t(0.5)); + std::function<void(void)> setForceScalingFactorToOne = boost::bind(&pe_coupling::ForceTorqueOnBodiesScaler::resetScalingFactor,forceScaler,real_t(1)); + std::function<void(void)> setForceScalingFactorToHalf = boost::bind(&pe_coupling::ForceTorqueOnBodiesScaler::resetScalingFactor,forceScaler,real_t(0.5)); if( averageForceTorqueOverTwoTimSteps ) { bodiesFTContainer2->store(); @@ -746,7 +746,7 @@ int main( int argc, char **argv ) /////////////// // setup of the LBM communication for synchronizing the pdf field between neighboring blocks - boost::function< void () > commFunction; + std::function< void () > commFunction; blockforest::communication::UniformBufferedScheme< Stencil_T > scheme( blocks ); scheme.addPackInfo( make_shared< lbm::PdfFieldPackInfo< LatticeModel_T > >( pdfFieldID ) ); commFunction = scheme; diff --git a/tests/pe_coupling/momentum_exchange_method/SettlingSphereMEMStaticRefinement.cpp b/tests/pe_coupling/momentum_exchange_method/SettlingSphereMEMStaticRefinement.cpp index d93c8731e1272efdb81d71f6509a9de44121080a..7a0734d33b7845eb778b275d79e6b0b043202fcd 100644 --- a/tests/pe_coupling/momentum_exchange_method/SettlingSphereMEMStaticRefinement.cpp +++ b/tests/pe_coupling/momentum_exchange_method/SettlingSphereMEMStaticRefinement.cpp @@ -544,7 +544,7 @@ int main( int argc, char **argv ) // set up synchronization procedure const real_t overlap = real_t( 1.5 ) * dx; - boost::function<void(void)> syncCall = boost::bind( pe::syncShadowOwners<BodyTypeTuple>, boost::ref(blocks->getBlockForest()), bodyStorageID, static_cast<WcTimingTree*>(NULL), overlap, false ); + std::function<void(void)> syncCall = boost::bind( pe::syncShadowOwners<BodyTypeTuple>, boost::ref(blocks->getBlockForest()), bodyStorageID, static_cast<WcTimingTree*>(NULL), overlap, false ); // create pe bodies @@ -595,11 +595,11 @@ int main( int argc, char **argv ) // force averaging functionality shared_ptr<pe_coupling::BodiesForceTorqueContainer> bodiesFTContainer1 = make_shared<pe_coupling::BodiesForceTorqueContainer>(blocks, bodyStorageID); - boost::function<void(void)> storeForceTorqueInCont1 = boost::bind(&pe_coupling::BodiesForceTorqueContainer::store, bodiesFTContainer1); + std::function<void(void)> storeForceTorqueInCont1 = boost::bind(&pe_coupling::BodiesForceTorqueContainer::store, bodiesFTContainer1); shared_ptr<pe_coupling::BodiesForceTorqueContainer> bodiesFTContainer2 = make_shared<pe_coupling::BodiesForceTorqueContainer>(blocks, bodyStorageID); - boost::function<void(void)> setForceTorqueOnBodiesFromCont2 = boost::bind(&pe_coupling::BodiesForceTorqueContainer::setOnBodies, bodiesFTContainer2); + std::function<void(void)> setForceTorqueOnBodiesFromCont2 = boost::bind(&pe_coupling::BodiesForceTorqueContainer::setOnBodies, bodiesFTContainer2); shared_ptr<pe_coupling::ForceTorqueOnBodiesScaler> forceScaler = make_shared<pe_coupling::ForceTorqueOnBodiesScaler>(blocks, bodyStorageID, real_t(1)); - boost::function<void(void)> setForceScalingFactorToHalf = boost::bind(&pe_coupling::ForceTorqueOnBodiesScaler::resetScalingFactor,forceScaler,real_t(0.5)); + std::function<void(void)> setForceScalingFactorToHalf = boost::bind(&pe_coupling::ForceTorqueOnBodiesScaler::resetScalingFactor,forceScaler,real_t(0.5)); if( averageForceTorqueOverTwoTimSteps ) { bodiesFTContainer2->store(); @@ -610,7 +610,7 @@ int main( int argc, char **argv ) /////////////// // setup of the LBM communication for synchronizing the pdf field between neighboring blocks - boost::function< void () > commFunction; + std::function< void () > commFunction; blockforest::communication::UniformBufferedScheme< Stencil_T > scheme( blocks ); scheme.addPackInfo( make_shared< lbm::PdfFieldPackInfo< LatticeModel_T > >( pdfFieldID ) ); commFunction = scheme; diff --git a/tests/pe_coupling/momentum_exchange_method/SquirmerTest.cpp b/tests/pe_coupling/momentum_exchange_method/SquirmerTest.cpp index 00ce16ed011c41a33eb4a42b8b8a2cb706dc94a7..82fd1093713a0421ace63341e6a65225b41f2534 100644 --- a/tests/pe_coupling/momentum_exchange_method/SquirmerTest.cpp +++ b/tests/pe_coupling/momentum_exchange_method/SquirmerTest.cpp @@ -289,7 +289,7 @@ int main(int argc, char **argv) { return EXIT_FAILURE; } - boost::function<void(void)> syncCall = boost::bind(pe::syncShadowOwners<BodyTypeTuple>, + std::function<void(void)> syncCall = boost::bind(pe::syncShadowOwners<BodyTypeTuple>, boost::ref(blocks->getBlockForest()), bodyStorageID, static_cast<WcTimingTree *>(NULL), overlap, false); @@ -358,7 +358,7 @@ int main(int argc, char **argv) { "PDF Restore"); // setup of the LBM communication for synchronizing the pdf field between neighboring blocks - boost::function<void()> commFunction; + std::function<void()> commFunction; blockforest::communication::UniformBufferedScheme<stencil::D3Q27> scheme(blocks); scheme.addPackInfo(make_shared<field::communication::PackInfo<PdfField_T> >(pdfFieldID)); diff --git a/tests/pe_coupling/momentum_exchange_method/TaylorCouetteFlowMEM.cpp b/tests/pe_coupling/momentum_exchange_method/TaylorCouetteFlowMEM.cpp index 1b8d4677ec81ff4777f62a811fe0a2ee44a13c20..e6d43a5d0039a43d1aee67b9723f95d971e0b4de 100644 --- a/tests/pe_coupling/momentum_exchange_method/TaylorCouetteFlowMEM.cpp +++ b/tests/pe_coupling/momentum_exchange_method/TaylorCouetteFlowMEM.cpp @@ -303,7 +303,7 @@ int main( int argc, char **argv ) // set up synchronization procedure const real_t overlap = real_t( 1.5 ) * dx; - boost::function<void(void)> syncCall = boost::bind( pe::syncShadowOwners<BodyTypeTuple>, boost::ref(blocks->getBlockForest()), bodyStorageID, static_cast<WcTimingTree*>(NULL), overlap, false ); + std::function<void(void)> syncCall = boost::bind( pe::syncShadowOwners<BodyTypeTuple>, boost::ref(blocks->getBlockForest()), bodyStorageID, static_cast<WcTimingTree*>(NULL), overlap, false ); // create pe bodies const auto material = pe::createMaterial( "granular", real_t(1.2), real_t(0.25), real_t(0.4), real_t(0.4), real_t(0.35), real_t(1.39e11), real_t(5.18e7), real_t(1.07e2), real_t(1.07e2) ); @@ -348,7 +348,7 @@ int main( int argc, char **argv ) SweepTimeloop timeloop( blocks->getBlockStorage(), timesteps ); // setup of the LBM communication for synchronizing the pdf field between neighboring blocks - boost::function< void () > commFunction; + std::function< void () > commFunction; blockforest::communication::UniformBufferedScheme< Stencil_T > scheme( blocks ); scheme.addPackInfo( make_shared< lbm::PdfFieldPackInfo< LatticeModel_T > >( pdfFieldID ) ); commFunction = scheme; diff --git a/tests/pe_coupling/momentum_exchange_method/TorqueSphereMEM.cpp b/tests/pe_coupling/momentum_exchange_method/TorqueSphereMEM.cpp index 85cc5083ed638f8dd62b4802507f7333c8d56dbc..2ff3f3c98e779a184d5c5e51e1407df41814814f 100644 --- a/tests/pe_coupling/momentum_exchange_method/TorqueSphereMEM.cpp +++ b/tests/pe_coupling/momentum_exchange_method/TorqueSphereMEM.cpp @@ -466,7 +466,7 @@ int main( int argc, char **argv ) SweepTimeloop timeloop( blocks->getBlockStorage(), timesteps ); // setup of the LBM communication for synchronizing the pdf field between neighboring blocks - boost::function< void () > commFunction; + std::function< void () > commFunction; blockforest::communication::UniformBufferedScheme< stencil::D3Q27 > scheme( blocks ); scheme.addPackInfo( make_shared< field::communication::PackInfo< PdfField_T > >( pdfFieldID ) ); diff --git a/tests/pe_coupling/partially_saturated_cells_method/DragForceSpherePSM.cpp b/tests/pe_coupling/partially_saturated_cells_method/DragForceSpherePSM.cpp index 79e3c2f4901866bc7a1dd3e9304fc0629981da8a..1547b5baa773303c0002aa8779127d5cecc4e711 100644 --- a/tests/pe_coupling/partially_saturated_cells_method/DragForceSpherePSM.cpp +++ b/tests/pe_coupling/partially_saturated_cells_method/DragForceSpherePSM.cpp @@ -455,7 +455,7 @@ int main( int argc, char **argv ) SweepTimeloop timeloop( blocks->getBlockStorage(), timesteps ); // setup of the LBM communication for synchronizing the pdf field between neighboring blocks - boost::function< void () > commFunction; + std::function< void () > commFunction; blockforest::communication::UniformBufferedScheme< Stencil_T > scheme( blocks ); scheme.addPackInfo( make_shared< field::communication::PackInfo< PdfField_T > >( pdfFieldID ) ); diff --git a/tests/pe_coupling/partially_saturated_cells_method/SegreSilberbergPSM.cpp b/tests/pe_coupling/partially_saturated_cells_method/SegreSilberbergPSM.cpp index 563828ee360da2151c6e5ee36e27d30e9b337a56..7e0ad3250d28b0cb1f219bbae034dfdc77e817e2 100644 --- a/tests/pe_coupling/partially_saturated_cells_method/SegreSilberbergPSM.cpp +++ b/tests/pe_coupling/partially_saturated_cells_method/SegreSilberbergPSM.cpp @@ -502,7 +502,7 @@ int main( int argc, char **argv ) // set up synchronization procedure const real_t overlap = real_c( 1.5 ) * dx; - boost::function<void(void)> syncCall = boost::bind( pe::syncShadowOwners<BodyTypeTuple>, boost::ref(blocks->getBlockForest()), bodyStorageID, static_cast<WcTimingTree*>(NULL), overlap, false ); + std::function<void(void)> syncCall = boost::bind( pe::syncShadowOwners<BodyTypeTuple>, boost::ref(blocks->getBlockForest()), bodyStorageID, static_cast<WcTimingTree*>(NULL), overlap, false ); // create pe bodies @@ -568,7 +568,7 @@ int main( int argc, char **argv ) /////////////// // setup of the LBM communication for synchronizing the pdf field between neighboring blocks - boost::function< void () > commFunction; + std::function< void () > commFunction; blockforest::communication::UniformBufferedScheme< Stencil_T > scheme( blocks ); scheme.addPackInfo( make_shared< lbm::PdfFieldPackInfo< LatticeModel_T > >( pdfFieldID ) ); commFunction = scheme; diff --git a/tests/pe_coupling/partially_saturated_cells_method/TorqueSpherePSM.cpp b/tests/pe_coupling/partially_saturated_cells_method/TorqueSpherePSM.cpp index 31921f2f02306b36cd19480d3b3d043504072583..f91b5566e82396466744845bae224e5028e769a6 100644 --- a/tests/pe_coupling/partially_saturated_cells_method/TorqueSpherePSM.cpp +++ b/tests/pe_coupling/partially_saturated_cells_method/TorqueSpherePSM.cpp @@ -402,7 +402,7 @@ int main( int argc, char **argv ) SweepTimeloop timeloop( blocks->getBlockStorage(), timesteps ); // setup of the LBM communication for synchronizing the pdf field between neighboring blocks - boost::function< void () > commFunction; + std::function< void () > commFunction; blockforest::communication::UniformBufferedScheme< stencil::D3Q27 > scheme( blocks ); scheme.addPackInfo( make_shared< field::communication::PackInfo< PdfField_T > >( pdfFieldID ) );