Commit 26ac8bb5 authored by Christian Godenschwager's avatar Christian Godenschwager
Browse files

Replace boost::bind with std::bind

Part of issue #48
parent 9e36486b
Pipeline #9456 passed with stage
in 116 minutes and 43 seconds
......@@ -91,7 +91,6 @@
#include "vtk/Initialization.h"
#include "vtk/VTKOutput.h"
#include <boost/bind.hpp>
#include <boost/mpl/or.hpp>
#include <boost/type_traits/is_same.hpp>
......@@ -99,6 +98,7 @@
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <iostream>
#include <utility>
#include <vector>
......@@ -294,7 +294,7 @@ static shared_ptr< SetupBlockForest > createSetupBlockForest( const blockforest:
( setup.zCells + uint_t(2) * FieldGhostLayers ) ) * memoryPerCell;
forest->addRefinementSelectionFunction( refinementSelectionFunctions );
forest->addWorkloadMemorySUIDAssignmentFunction( boost::bind( workloadAndMemoryAssignment, _1, memoryPerBlock ) );
forest->addWorkloadMemorySUIDAssignmentFunction( std::bind( workloadAndMemoryAssignment, std::placeholders::_1, memoryPerBlock ) );
forest->init( AABB( real_c(0), real_c(0), real_c(0), real_c( setup.xBlocks * setup.xCells ),
real_c( setup.yBlocks * setup.yCells ),
......@@ -736,11 +736,11 @@ void run( const shared_ptr< Config > & config, const LatticeModel_T & latticeMod
// evaluation
const auto exactSolutionFunction = boost::bind( exactVelocity, _1, blocks->getDomain(), setup.maxVelocity_L );
const auto exactSolutionFunction = std::bind( exactVelocity, std::placeholders::_1, blocks->getDomain(), setup.maxVelocity_L );
auto volumetricFlowRate = field::makeVolumetricFlowRateEvaluation< VelocityAdaptor_T, FlagField_T >( configBlock, blocks, velocityAdaptorId,
flagFieldId, Fluid_Flag,
boost::bind( exactFlowRate, setup.flowRate_L ),
std::bind( exactFlowRate, setup.flowRate_L ),
exactSolutionFunction );
volumetricFlowRate->setNormalizationFactor( real_t(1) / setup.maxVelocity_L );
volumetricFlowRate->setDomainNormalization( Vector3<real_t>( real_t(1) ) );
......
......@@ -62,6 +62,8 @@
#include "field/vtk/all.h"
#include "lbm/vtk/all.h"
#include <functional>
namespace forces_on_sphere_near_plane_in_shear_flow
{
......@@ -177,7 +179,7 @@ static shared_ptr< StructuredBlockForest > createBlockStructure( const AABB & do
WALBERLA_LOG_INFO_ON_ROOT(" - refinement box: " << refinementBox);
sforest.addRefinementSelectionFunction( boost::bind( refinementSelection, _1, numberOfLevels, refinementBox ) );
sforest.addRefinementSelectionFunction( std::bind( refinementSelection, std::placeholders::_1, numberOfLevels, refinementBox ) );
sforest.addWorkloadMemorySUIDAssignmentFunction( workloadAndMemoryAssignment );
sforest.init( domainAABB, numberOfCoarseBlocksPerDirection[0], numberOfCoarseBlocksPerDirection[1], numberOfCoarseBlocksPerDirection[2], true, true, false );
......@@ -576,7 +578,7 @@ int main( int argc, char **argv )
// set up synchronization procedure
const real_t overlap = real_t( 1.5 ) * dx;
std::function<void(void)> syncCall = boost::bind( pe::syncShadowOwners<BodyTypeTuple>, boost::ref(blocks->getBlockForest()), bodyStorageID, static_cast<WcTimingTree*>(NULL), overlap, false );
std::function<void(void)> syncCall = std::bind( pe::syncShadowOwners<BodyTypeTuple>, std::ref(blocks->getBlockForest()), bodyStorageID, static_cast<WcTimingTree*>(NULL), overlap, false );
// create pe bodies
......
......@@ -58,6 +58,7 @@
#include "vtk/Initialization.h"
#include "vtk/VTKOutput.h"
#include <functional>
#include <memory>
......@@ -811,9 +812,9 @@ int main( int argc, char **argv )
const real_t overlap = real_t( 1.5 ) * dx;
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 );
syncCall = std::bind( pe::syncNextNeighbors<BodyTypeTuple>, std::ref(blocks->getBlockForest()), bodyStorageID, static_cast<WcTimingTree*>(NULL), overlap, false );
else
syncCall = boost::bind( pe::syncShadowOwners<BodyTypeTuple>, boost::ref(blocks->getBlockForest()), bodyStorageID, static_cast<WcTimingTree*>(NULL), overlap, false );
syncCall = std::bind( pe::syncShadowOwners<BodyTypeTuple>, std::ref(blocks->getBlockForest()), bodyStorageID, static_cast<WcTimingTree*>(NULL), overlap, false );
real_t xParticle = real_t(0);
......
......@@ -76,6 +76,7 @@
#include "vtk/VTKOutput.h"
#include <cstdlib>
#include <functional>
#include <iostream>
......@@ -279,7 +280,7 @@ void createSetupBlockForest( blockforest::SetupBlockForest & sforest, const Conf
uint_c( 19 * sizeof(real_t) ) ) / numeric_cast< memory_t >( 1024 * 1024 );
sforest.addRefinementSelectionFunction( refinementSelection );
sforest.addWorkloadMemorySUIDAssignmentFunction( boost::bind( workloadAndMemoryAssignment, _1, memoryPerBlock ) );
sforest.addWorkloadMemorySUIDAssignmentFunction( std::bind( workloadAndMemoryAssignment, std::placeholders::_1, memoryPerBlock ) );
sforest.init( AABB( real_t(0), real_t(0), real_t(0), real_c( numberOfXBlocks * numberOfXCellsPerBlock ),
real_c( numberOfYBlocks * numberOfYCellsPerBlock ),
......
......@@ -88,12 +88,11 @@
#include "vtk/Initialization.h"
#include "vtk/VTKOutput.h"
#include <boost/bind.hpp>
#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <iostream>
#include <utility>
#include <vector>
......@@ -303,7 +302,7 @@ static shared_ptr< SetupBlockForest > createSetupBlockForest( const blockforest:
( setup.zCells + uint_t(2) * FieldGhostLayers ) ) * memoryPerCell;
forest->addRefinementSelectionFunction( refinementSelectionFunctions );
forest->addWorkloadMemorySUIDAssignmentFunction( boost::bind( workloadAndMemoryAssignment, _1, memoryPerBlock ) );
forest->addWorkloadMemorySUIDAssignmentFunction( std::bind( workloadAndMemoryAssignment, std::placeholders::_1, memoryPerBlock ) );
forest->init( AABB( real_c(0), real_c(0), real_c(0), real_c( setup.xBlocks * setup.xCells ),
real_c( setup.yBlocks * setup.yCells ),
......@@ -847,12 +846,12 @@ void run( const shared_ptr< Config > & config, const LatticeModel_T & latticeMod
// evaluation
const auto exactSolutionFunction = setup.circularProfile ? boost::bind( exactPipeVelocity, _1, blocks, setup ) :
boost::bind( exactPlatesVelocity, _1, blocks, setup );
const auto exactSolutionFunction = setup.circularProfile ? std::bind( exactPipeVelocity, std::placeholders::_1, blocks, setup ) :
std::bind( exactPlatesVelocity, std::placeholders::_1, blocks, setup );
auto volumetricFlowRate = field::makeVolumetricFlowRateEvaluation< VelocityAdaptor_T, FlagField_T >( configBlock, blocks, velocityAdaptorId,
flagFieldId, Fluid_Flag,
boost::bind( exactFlowRate, setup.flowRate_L ),
std::bind( exactFlowRate, setup.flowRate_L ),
exactSolutionFunction );
volumetricFlowRate->setNormalizationFactor( real_t(1) / setup.maxVelocity_L );
volumetricFlowRate->setDomainNormalization( Vector3<real_t>( real_t(1) ) );
......
......@@ -106,12 +106,12 @@
#include <boost/mpl/equal_to.hpp>
#include <boost/mpl/int.hpp>
#include <boost/mpl/or.hpp>
#include <boost/bind.hpp>
#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <iostream>
#include <utility>
#include <vector>
......@@ -656,7 +656,7 @@ static shared_ptr< SetupBlockForest > createSetupBlockForest( const blockforest:
( setup.xCells + uint_t(2) * FieldGhostLayers ) ) * memoryPerCell;
forest->addRefinementSelectionFunction( refinementSelectionFunctions );
forest->addWorkloadMemorySUIDAssignmentFunction( boost::bind( workloadMemoryAndSUIDAssignment, _1, memoryPerBlock, boost::cref( setup ) ) );
forest->addWorkloadMemorySUIDAssignmentFunction( std::bind( workloadMemoryAndSUIDAssignment, std::placeholders::_1, memoryPerBlock, std::cref( setup ) ) );
forest->init( AABB( real_c(0), real_c(0), real_c(0),
setup.H * ( real_c(setup.xBlocks) * real_c(setup.xCells) ) / ( real_c(setup.yzBlocks) * real_c(setup.yzCells) ), setup.H, setup.H ),
......@@ -2602,7 +2602,8 @@ void run( const shared_ptr< Config > & config, const LatticeModel_T & latticeMod
adaptiveRefinementLog = oss.str();
}
minTargetLevelDeterminationFunctions.add( boost::bind( keepInflowOutflowAtTheSameLevel, _1, _2, _3, boost::cref(setup) ) );
minTargetLevelDeterminationFunctions.add( std::bind( keepInflowOutflowAtTheSameLevel, std::placeholders::_1, std::placeholders::_2,
std::placeholders::_3, std::cref(setup) ) );
if( Is2D< LatticeModel_T >::value )
minTargetLevelDeterminationFunctions.add( pseudo2DTargetLevelCorrection );
......@@ -3171,7 +3172,7 @@ int main( int argc, char **argv )
refinementSelectionFunctions.add( cylinderRefinementSelection );
}
refinementSelectionFunctions.add( boost::bind( setInflowOutflowToSameLevel, _1, setup ) );
refinementSelectionFunctions.add( std::bind( setInflowOutflowToSameLevel, std::placeholders::_1, setup ) );
if( setup.pseudo2D )
refinementSelectionFunctions.add( Pseudo2DRefinementSelectionCorrection );
......
......@@ -889,7 +889,7 @@ int main( int argc, char **argv ) {
// connect to pe
const real_t overlap = real_t(1.5) * dx;
auto syncCall = boost::bind(pe::syncNextNeighbors<BodyTypeTuple>, boost::ref(blocks->getBlockForest()),
auto syncCall = std::bind(pe::syncNextNeighbors<BodyTypeTuple>, std::ref(blocks->getBlockForest()),
bodyStorageID, static_cast<WcTimingTree *>(NULL), overlap, false);
shared_ptr<CollisionPropertiesEvaluator> collisionPropertiesEvaluator = walberla::make_shared<CollisionPropertiesEvaluator>(*cr);
......@@ -1196,7 +1196,7 @@ int main( int argc, char **argv ) {
velocityFieldID, svfFieldID,
pressureGradientFieldID, dragCorrelationFunction,
viscosity);
dragAndPressureForceEvaluationFunction = boost::bind(&IFE_T::operator(), forceEvaluatorPtr);
dragAndPressureForceEvaluationFunction = std::bind(&IFE_T::operator(), forceEvaluatorPtr);
} else if (dist == Distribution::DKernel) {
typedef pe_coupling::discrete_particle_methods::InteractionForceEvaluator<FlagField_T, field::NearestNeighborFieldInterpolator, field::KernelDistributor> IFE_T;
shared_ptr<IFE_T> forceEvaluatorPtr = make_shared<IFE_T>(blocks, dragForceFieldID, bodyStorageID,
......@@ -1204,7 +1204,7 @@ int main( int argc, char **argv ) {
velocityFieldID, svfFieldID,
pressureGradientFieldID, dragCorrelationFunction,
viscosity);
dragAndPressureForceEvaluationFunction = boost::bind(&IFE_T::operator(), forceEvaluatorPtr);
dragAndPressureForceEvaluationFunction = std::bind(&IFE_T::operator(), forceEvaluatorPtr);
}
} else if (interpol == Interpolation::IKernel) {
if (dist == Distribution::DNearestNeighbor) {
......@@ -1214,7 +1214,7 @@ int main( int argc, char **argv ) {
velocityFieldID, svfFieldID,
pressureGradientFieldID, dragCorrelationFunction,
viscosity);
dragAndPressureForceEvaluationFunction = boost::bind(&IFE_T::operator(), forceEvaluatorPtr);
dragAndPressureForceEvaluationFunction = std::bind(&IFE_T::operator(), forceEvaluatorPtr);
} else if (dist == Distribution::DKernel) {
typedef pe_coupling::discrete_particle_methods::InteractionForceEvaluator<FlagField_T, field::KernelFieldInterpolator, field::KernelDistributor> IFE_T;
shared_ptr<IFE_T> forceEvaluatorPtr = make_shared<IFE_T>(blocks, dragForceFieldID, bodyStorageID,
......@@ -1222,7 +1222,7 @@ int main( int argc, char **argv ) {
velocityFieldID, svfFieldID,
pressureGradientFieldID, dragCorrelationFunction,
viscosity);
dragAndPressureForceEvaluationFunction = boost::bind(&IFE_T::operator(), forceEvaluatorPtr);
dragAndPressureForceEvaluationFunction = std::bind(&IFE_T::operator(), forceEvaluatorPtr);
}
} else if (interpol == Interpolation::ITrilinear) {
if (dist == Distribution::DNearestNeighbor) {
......@@ -1232,7 +1232,7 @@ int main( int argc, char **argv ) {
velocityFieldID, svfFieldID,
pressureGradientFieldID, dragCorrelationFunction,
viscosity);
dragAndPressureForceEvaluationFunction = boost::bind(&IFE_T::operator(), forceEvaluatorPtr);
dragAndPressureForceEvaluationFunction = std::bind(&IFE_T::operator(), forceEvaluatorPtr);
} else if (dist == Distribution::DKernel) {
typedef pe_coupling::discrete_particle_methods::InteractionForceEvaluator<FlagField_T, field::TrilinearFieldInterpolator, field::KernelDistributor> IFE_T;
shared_ptr<IFE_T> forceEvaluatorPtr = make_shared<IFE_T>(blocks, dragForceFieldID, bodyStorageID,
......@@ -1240,7 +1240,7 @@ int main( int argc, char **argv ) {
velocityFieldID, svfFieldID,
pressureGradientFieldID, dragCorrelationFunction,
viscosity);
dragAndPressureForceEvaluationFunction = boost::bind(&IFE_T::operator(), forceEvaluatorPtr);
dragAndPressureForceEvaluationFunction = std::bind(&IFE_T::operator(), forceEvaluatorPtr);
}
}
}
......@@ -1260,7 +1260,7 @@ int main( int argc, char **argv ) {
shared_ptr< IFE_T > forceEvaluatorPtr = make_shared< IFE_T > ( blocks, liftForceFieldID, bodyStorageID, flagFieldID, Fluid_Flag,
velocityFieldID, velocityCurlFieldID, liftCorrelationFunction,
viscosity );
liftForceEvaluationFunction = boost::bind(&IFE_T::operator(), forceEvaluatorPtr);
liftForceEvaluationFunction = std::bind(&IFE_T::operator(), forceEvaluatorPtr);
}
else if( dist == Distribution::DKernel )
{
......@@ -1268,7 +1268,7 @@ int main( int argc, char **argv ) {
shared_ptr< IFE_T > forceEvaluatorPtr = make_shared< IFE_T > ( blocks, liftForceFieldID, bodyStorageID, flagFieldID, Fluid_Flag,
velocityFieldID, velocityCurlFieldID, liftCorrelationFunction,
viscosity );
liftForceEvaluationFunction = boost::bind(&IFE_T::operator(), forceEvaluatorPtr);
liftForceEvaluationFunction = std::bind(&IFE_T::operator(), forceEvaluatorPtr);
}
}
else if( interpol == Interpolation::IKernel )
......@@ -1279,7 +1279,7 @@ int main( int argc, char **argv ) {
shared_ptr< IFE_T > forceEvaluatorPtr = make_shared< IFE_T > ( blocks, liftForceFieldID, bodyStorageID, flagFieldID, Fluid_Flag,
velocityFieldID, velocityCurlFieldID, liftCorrelationFunction,
viscosity );
liftForceEvaluationFunction = boost::bind(&IFE_T::operator(), forceEvaluatorPtr);
liftForceEvaluationFunction = std::bind(&IFE_T::operator(), forceEvaluatorPtr);
}
else if( dist == Distribution::DKernel )
{
......@@ -1287,7 +1287,7 @@ int main( int argc, char **argv ) {
shared_ptr< IFE_T > forceEvaluatorPtr = make_shared< IFE_T > ( blocks, liftForceFieldID, bodyStorageID, flagFieldID, Fluid_Flag,
velocityFieldID, velocityCurlFieldID, liftCorrelationFunction,
viscosity );
liftForceEvaluationFunction = boost::bind(&IFE_T::operator(), forceEvaluatorPtr);
liftForceEvaluationFunction = std::bind(&IFE_T::operator(), forceEvaluatorPtr);
}
}
else if( interpol == Interpolation::ITrilinear )
......@@ -1298,7 +1298,7 @@ int main( int argc, char **argv ) {
shared_ptr< IFE_T > forceEvaluatorPtr = make_shared< IFE_T > ( blocks, liftForceFieldID, bodyStorageID, flagFieldID, Fluid_Flag,
velocityFieldID, velocityCurlFieldID, liftCorrelationFunction,
viscosity );
liftForceEvaluationFunction = boost::bind(&IFE_T::operator(), forceEvaluatorPtr);
liftForceEvaluationFunction = std::bind(&IFE_T::operator(), forceEvaluatorPtr);
}
else if( dist == Distribution::DKernel )
{
......@@ -1306,7 +1306,7 @@ int main( int argc, char **argv ) {
shared_ptr< IFE_T > forceEvaluatorPtr = make_shared< IFE_T > ( blocks, liftForceFieldID, bodyStorageID, flagFieldID, Fluid_Flag,
velocityFieldID, velocityCurlFieldID, liftCorrelationFunction,
viscosity );
liftForceEvaluationFunction = boost::bind(&IFE_T::operator(), forceEvaluatorPtr);
liftForceEvaluationFunction = std::bind(&IFE_T::operator(), forceEvaluatorPtr);
}
}
......@@ -1320,7 +1320,7 @@ int main( int argc, char **argv ) {
shared_ptr< IFE_T > forceEvaluatorPtr = make_shared< IFE_T > ( blocks, amForceFieldID, bodyStorageID, flagFieldID, Fluid_Flag,
timeDerivativeVelocityFieldID, addedMassCorrelationFunction,
bodyVelocityTimeDerivativeEvaluator );
addedMassEvaluationFunction = boost::bind(&IFE_T::operator(), forceEvaluatorPtr);
addedMassEvaluationFunction = std::bind(&IFE_T::operator(), forceEvaluatorPtr);
}
else if( dist == Distribution::DKernel )
{
......@@ -1328,7 +1328,7 @@ int main( int argc, char **argv ) {
shared_ptr< IFE_T > forceEvaluatorPtr = make_shared< IFE_T > ( blocks, amForceFieldID, bodyStorageID, flagFieldID, Fluid_Flag,
timeDerivativeVelocityFieldID, addedMassCorrelationFunction,
bodyVelocityTimeDerivativeEvaluator );
addedMassEvaluationFunction = boost::bind(&IFE_T::operator(), forceEvaluatorPtr);
addedMassEvaluationFunction = std::bind(&IFE_T::operator(), forceEvaluatorPtr);
}
}
else if( interpol == Interpolation::IKernel )
......@@ -1339,7 +1339,7 @@ int main( int argc, char **argv ) {
shared_ptr< IFE_T > forceEvaluatorPtr = make_shared< IFE_T > ( blocks, amForceFieldID, bodyStorageID, flagFieldID, Fluid_Flag,
timeDerivativeVelocityFieldID, addedMassCorrelationFunction,
bodyVelocityTimeDerivativeEvaluator );
addedMassEvaluationFunction = boost::bind(&IFE_T::operator(), forceEvaluatorPtr);
addedMassEvaluationFunction = std::bind(&IFE_T::operator(), forceEvaluatorPtr);
}
else if( dist == Distribution::DKernel )
{
......@@ -1347,7 +1347,7 @@ int main( int argc, char **argv ) {
shared_ptr< IFE_T > forceEvaluatorPtr = make_shared< IFE_T > ( blocks, amForceFieldID, bodyStorageID, flagFieldID, Fluid_Flag,
timeDerivativeVelocityFieldID, addedMassCorrelationFunction,
bodyVelocityTimeDerivativeEvaluator );
addedMassEvaluationFunction = boost::bind(&IFE_T::operator(), forceEvaluatorPtr);
addedMassEvaluationFunction = std::bind(&IFE_T::operator(), forceEvaluatorPtr);
}
}
else if( interpol == Interpolation::ITrilinear )
......@@ -1358,7 +1358,7 @@ int main( int argc, char **argv ) {
shared_ptr< IFE_T > forceEvaluatorPtr = make_shared< IFE_T > ( blocks, amForceFieldID, bodyStorageID, flagFieldID, Fluid_Flag,
timeDerivativeVelocityFieldID, addedMassCorrelationFunction,
bodyVelocityTimeDerivativeEvaluator );
addedMassEvaluationFunction = boost::bind(&IFE_T::operator(), forceEvaluatorPtr);
addedMassEvaluationFunction = std::bind(&IFE_T::operator(), forceEvaluatorPtr);
}
else if( dist == Distribution::DKernel )
{
......@@ -1366,7 +1366,7 @@ int main( int argc, char **argv ) {
shared_ptr< IFE_T > forceEvaluatorPtr = make_shared< IFE_T > ( blocks, amForceFieldID, bodyStorageID, flagFieldID, Fluid_Flag,
timeDerivativeVelocityFieldID, addedMassCorrelationFunction,
bodyVelocityTimeDerivativeEvaluator );
addedMassEvaluationFunction = boost::bind(&IFE_T::operator(), forceEvaluatorPtr);
addedMassEvaluationFunction = std::bind(&IFE_T::operator(), forceEvaluatorPtr);
}
}
......@@ -1376,7 +1376,7 @@ int main( int argc, char **argv ) {
{
typedef pe_coupling::discrete_particle_methods::LubricationForceEvaluator LE_T;
shared_ptr<LE_T> lubEval = make_shared<LE_T>( blocks, globalBodyStorage, bodyStorageID, viscosity, lubricationCutOffDistance );
lubricationEvaluationFunction = boost::bind(&LE_T::operator(), lubEval);
lubricationEvaluationFunction = std::bind(&LE_T::operator(), lubEval);
}
else
{
......
......@@ -24,7 +24,7 @@
#include "gui/Gui.h"
#include "timeloop/SweepTimeloop.h"
#include <boost/bind.hpp>
#include <functional>
using namespace walberla;
......@@ -125,7 +125,7 @@ int main( int argc, char ** argv )
// registering the function sweep
auto pointerToTwoArgFunction = & simpleSweep;
auto pointerToOneArgFunction = boost::bind( pointerToTwoArgFunction, _1, fieldID );
auto pointerToOneArgFunction = std::bind( pointerToTwoArgFunction, std::placeholders::_1, fieldID );
timeloop.add() << Sweep( pointerToOneArgFunction, "BogusAlgorithm" );
// registering the class sweep
......
......@@ -32,6 +32,8 @@
#include <postprocessing/sqlite/SQLite.h>
#include <vtk/VTKOutput.h>
#include <functional>
using namespace walberla;
using namespace walberla::pe;
using namespace walberla::timing;
......@@ -150,20 +152,20 @@ int main( int argc, char ** argv )
std::function<void(void)> syncCall;
if (!syncShadowOwners)
{
syncCall = boost::bind( pe::syncNextNeighbors<BodyTuple>, boost::ref(*forest), storageID, &tt, real_c(0.0), false );
syncCall = std::bind( pe::syncNextNeighbors<BodyTuple>, std::ref(*forest), storageID, &tt, real_c(0.0), false );
} else
{
syncCall = boost::bind( pe::syncShadowOwners<BodyTuple>, boost::ref(*forest), storageID, &tt, real_c(0.0), false );
syncCall = std::bind( pe::syncShadowOwners<BodyTuple>, std::ref(*forest), storageID, &tt, real_c(0.0), false );
}
//! [Bind Sync Call]
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 );
syncCallWithoutTT = std::bind( pe::syncNextNeighbors<BodyTuple>, std::ref(*forest), storageID, static_cast<WcTimingTree*>(NULL), real_c(0.0), false );
} else
{
syncCallWithoutTT = boost::bind( pe::syncShadowOwners<BodyTuple>, boost::ref(*forest), storageID, static_cast<WcTimingTree*>(NULL), real_c(0.0), false );
syncCallWithoutTT = std::bind( pe::syncShadowOwners<BodyTuple>, std::ref(*forest), storageID, static_cast<WcTimingTree*>(NULL), real_c(0.0), false );
}
//! [Bind Sync Call]
......
......@@ -31,6 +31,8 @@
#include "stencil/D3Q19.h"
#include <functional>
namespace walberla {
namespace blockforest {
......@@ -500,7 +502,7 @@ createUniformBlockGrid( const AABB& domainAABB,
numeric_cast< memory_t >( maxBlocksPerProcess );
GlobalLoadBalancing::MetisConfiguration< SetupBlock > metisConfig( includeMetis, forceMetis,
boost::bind( cellWeightedCommunicationCost,_1,_2,
std::bind( cellWeightedCommunicationCost, std::placeholders::_1, std::placeholders::_2,
numberOfXCellsPerBlock,
numberOfYCellsPerBlock,
numberOfZCellsPerBlock ) );
......
......@@ -24,6 +24,7 @@
#include "BlockForest.h"
#include "domain_decomposition/StructuredBlockStorage.h"
#include <functional>
namespace walberla {
namespace blockforest {
......@@ -205,7 +206,7 @@ inline StructuredBlockForest::StructuredBlockForest( const shared_ptr< BlockFore
blockForest_( blockForest ) {
blockForest_->addRefreshCallbackFunctionBeforeBlockDataIsUnpacked(
BlockForest::RefreshCallbackWrappper( boost::bind( resetCellDecompositionInStorage, boost::ref(*this) ) ) );
BlockForest::RefreshCallbackWrappper( std::bind( resetCellDecompositionInStorage, std::ref(*this) ) ) );
blockCells_[0] = blockXCells;
blockCells_[1] = blockYCells;
......
......@@ -36,10 +36,9 @@
#include "core/selectable/IsSetSelected.h"
#include "core/uid/SUID.h"
#include <boost/bind.hpp>
#include <functional>
#include <map>
#include <functional>
#include <set>
#include <vector>
......@@ -110,7 +109,7 @@ public:
//@{
void startCommunication() { startCommunicateEqualLevel(); startCommunicateCoarseToFine(); startCommunicateFineToCoarse(); }
std::function<void()> getStartCommunicateFunctor() { return boost::bind( &NonUniformBufferedScheme::startCommunication, this ); }
std::function<void()> getStartCommunicateFunctor() { return std::bind( &NonUniformBufferedScheme::startCommunication, this ); }
inline void startCommunicateEqualLevel();
inline void startCommunicateCoarseToFine();
......@@ -121,7 +120,7 @@ public:
inline void startCommunicateFineToCoarse( const uint_t fineLevel );
void wait() { waitCommunicateEqualLevel(); waitCommunicateCoarseToFine(); waitCommunicateFineToCoarse(); }
std::function<void() > getWaitFunctor() { return boost::bind( &NonUniformBufferedScheme::wait, this ); }
std::function<void() > getWaitFunctor() { return std::bind( &NonUniformBufferedScheme::wait, this ); }
inline void waitCommunicateEqualLevel();
inline void waitCommunicateCoarseToFine();
......@@ -659,13 +658,13 @@ void NonUniformBufferedScheme<Stencil>::startCommunicationEqualLevel( const uint
localBuffers.push_back( buffer );
const uint_t bufferIndex = uint_c( localBuffers.size() ) - uint_t(1);
VoidFunction pack = boost::bind( &NonUniformBufferedScheme<Stencil>::localBufferPacking, this,
EQUAL_LEVEL, index, bufferIndex, boost::cref( *packInfo ), block, neighbor, *dir );
VoidFunction pack = std::bind( &NonUniformBufferedScheme<Stencil>::localBufferPacking, this,
EQUAL_LEVEL, index, bufferIndex, std::cref( *packInfo ), block, neighbor, *dir );
threadsafeLocalCommunication.push_back( pack );
VoidFunction unpack = boost::bind( &NonUniformBufferedScheme<Stencil>::localBufferUnpacking, this,
EQUAL_LEVEL, index, bufferIndex, boost::cref( *packInfo ), neighbor, block, *dir );
VoidFunction unpack = std::bind( &NonUniformBufferedScheme<Stencil>::localBufferUnpacking, this,
EQUAL_LEVEL, index, bufferIndex, std::cref( *packInfo ), neighbor, block, *dir );
if( (*packInfo)->threadsafeReceiving() )
threadsafeLocalCommunicationUnpack.push_back( unpack );
......@@ -674,7 +673,7 @@ void NonUniformBufferedScheme<Stencil>::startCommunicationEqualLevel( const uint
}
else
{
VoidFunction localCommunicationFunction = boost::bind( &blockforest::communication::NonUniformPackInfo::communicateLocalEqualLevel,
VoidFunction localCommunicationFunction = std::bind( &blockforest::communication::NonUniformPackInfo::communicateLocalEqualLevel,
*packInfo, block, neighbor, *dir );
if( (*packInfo)->threadsafeReceiving() )
threadsafeLocalCommunication.push_back( localCommunicationFunction );
......@@ -688,10 +687,10 @@ void NonUniformBufferedScheme<Stencil>::startCommunicationEqualLevel( const uint
auto nProcess = block->getNeighborProcess( neighborIdx, uint_t(0) );
if( !packInfos_.empty() )
sendFunctions[ nProcess ].push_back( boost::bind( NonUniformBufferedScheme<Stencil>::writeHeader, _1, block->getId(), receiverId, *dir ) );
sendFunctions[ nProcess ].push_back( std::bind( NonUniformBufferedScheme<Stencil>::writeHeader, std::placeholders::_1, block->getId(), receiverId, *dir ) );
for( auto packInfo = packInfos_.begin(); packInfo != packInfos_.end(); ++packInfo )
sendFunctions[ nProcess ].push_back( boost::bind( &blockforest::communication::NonUniformPackInfo::packDataEqualLevel, *packInfo, block, *dir, _1 ) );
sendFunctions[ nProcess ].push_back( std::bind( &blockforest::communication::NonUniformPackInfo::packDataEqualLevel, *packInfo, block, *dir, std::placeholders::_1 ) );
}
}
}
......@@ -700,8 +699,8 @@ void NonUniformBufferedScheme<Stencil>::startCommunicationEqualLevel( const uint
for( auto sender = sendFunctions.begin(); sender != sendFunctions.end(); ++sender )
{
bufferSystem->addSendingFunction ( int_c(sender->first), boost::bind( NonUniformBufferedScheme<Stencil>::send, _1, sender->second ) );
bufferSystem->addReceivingFunction( int_c(sender->first), boost::bind( &NonUniformBufferedScheme<Stencil>::receive, this, _1 ) );
bufferSystem->addSendingFunction ( int_c(sender->first), std::bind( NonUniformBufferedScheme<Stencil>::send, std::placeholders::_1, sender->second ) );
bufferSystem->addReceivingFunction( int_c(sender->first), std::bind( &NonUniformBufferedScheme<Stencil>::receive, this, std::placeholders::_1 ) );
}
setupBeforeNextCommunication = char(0);
......@@ -785,13 +784,13 @@ void NonUniformBufferedScheme<Stencil>::startCommunicationCoarseToFine( const ui
localBuffers.push_back( buffer );
const uint_t bufferIndex = uint_c( localBuffers.size() ) - uint_t(1);
VoidFunction pack = boost::bind( &NonUniformBufferedScheme<Stencil>::localBufferPacking, this,
COARSE_TO_FINE, index, bufferIndex, boost::cref( *packInfo ), block, neighbor, *dir );
VoidFunction pack = std::bind( &NonUniformBufferedScheme<Stencil>::localBufferPacking, this,
COARSE_TO_FINE, index, bufferIndex, std::cref( *packInfo ), block, neighbor, *dir );
threadsafeLocalCommunication.push_back( pack );
VoidFunction unpack = boost::bind( &NonUniformBufferedScheme<Stencil>::localBufferUnpacking, this,
COARSE_TO_FINE, index, bufferIndex, boost::cref( *packInfo ), neighbor, block, *dir );
VoidFunction unpack = std::bind( &NonUniformBufferedScheme<Stencil>::localBufferUnpacking, this,
COARSE_TO_FINE, index, bufferIndex, std::cref( *packInfo ), neighbor, block, *dir );
if( (*packInfo)->threadsafeReceiving() )
threadsafeLocalCommunicationUnpack.push_back( unpack );
......@@ -800,7 +799,7 @@ void NonUniformBufferedScheme<Stencil>::startCommunicationCoarseToFine( const ui
}
else
{
VoidFunction localCommunicationFunction = boost::bind( &blockforest::communication::NonUniformPackInfo::communicateLocalCoarseToFine,
VoidFunction localCommunicationFunction = std::bind( &blockforest::communication::NonUniformPackInfo::communicateLocalCoarseToFine,
*packInfo, block, neighbor, *dir );
if( (*packInfo)->threadsafeReceiving() )
threadsafeLocalCommunication.push_back( localCommunicationFunction );
......@@ -814,10 +813,10 @@ void NonUniformBufferedScheme<Stencil>::startCommunicationCoarseToFine( const ui
auto nProcess = block->getNeighborProcess( neighborIdx, n );
if( !packInfos_.empty() )
sendFunctions[ nProcess ].push_back( boost::bind( NonUniformBufferedScheme<Stencil>::writeHeader, _1, block->getId(), receiverId, *dir ) );
sendFunctions[ nProcess ].push_back( std::bind( NonUniformBufferedScheme<Stencil>::writeHeader, std::placeholders::_1, block->getId(), receiverId, *dir ) );
for( auto packInfo = packInfos_.begin(); packInfo != packInfos_.end(); ++packInfo )
sendFunctions[ nProcess ].push_back( boost::bind( &blockforest::communication::NonUniformPackInfo::packDataCoarseToFine, *packInfo, block, receiverId, *dir, _1 ) );
sendFunctions[ nProcess ].push_back( std::bind( &blockforest::communication::NonUniformPackInfo::packDataCoarseToFine, *packInfo, block, receiverId, *dir, std::placeholders::_1 ) );
}
}