Commit 68be89d6 authored by Michael Kuron's avatar Michael Kuron
Browse files

Make BoundaryHandling variadic

parent 16fc13db
......@@ -106,8 +106,7 @@ typedef lbm::NoSlip< LatticeModel_T, flag_t > NoSlip_T;
typedef pe_coupling::CurvedLinear< LatticeModel_T, FlagField_T > MO_T;
typedef boost::tuples::tuple< NoSlip_T, MO_T > BoundaryConditions_T;
typedef BoundaryHandling< FlagField_T, Stencil_T, BoundaryConditions_T > BoundaryHandling_T;
typedef BoundaryHandling< FlagField_T, Stencil_T, NoSlip_T, MO_T > BoundaryHandling_T;
typedef std::tuple<pe::Sphere, pe::Ellipsoid, pe::Plane> BodyTypeTuple;
......@@ -590,8 +589,8 @@ BoundaryHandling_T * MyBoundaryHandling::initialize( IBlock * const block )
WALBERLA_CHECK_NOT_NULLPTR( blocksPtr );
BoundaryHandling_T * handling = new BoundaryHandling_T( "moving obstacle boundary handling", flagField, fluid,
boost::tuples::make_tuple( NoSlip_T( "NoSlip", NoSlip_Flag, pdfField ),
MO_T( "MO", MO_Flag, pdfField, flagField, bodyField, fluid, *blocksPtr, *block ) ),
NoSlip_T( "NoSlip", NoSlip_Flag, pdfField ),
MO_T( "MO", MO_Flag, pdfField, flagField, bodyField, fluid, *blocksPtr, *block ),
BoundaryHandling_T::Mode::ENTIRE_FIELD_TRAVERSAL);
handling->fillWithDomain( FieldGhostLayers );
......
......@@ -71,8 +71,6 @@
#include "field/vtk/all.h"
#include "lbm/vtk/all.h"
#include <boost/tuple/tuple.hpp>
#include <vector>
#include <iomanip>
#include <iostream>
......@@ -102,8 +100,7 @@ const uint_t FieldGhostLayers = 1;
// boundary handling
typedef pe_coupling::CurvedLinear< LatticeModel_T, FlagField_T > MO_CLI_T;
typedef boost::tuples::tuple<MO_CLI_T > BoundaryConditions_T;
typedef BoundaryHandling< FlagField_T, Stencil_T, BoundaryConditions_T > BoundaryHandling_T;
typedef BoundaryHandling< FlagField_T, Stencil_T, MO_CLI_T > BoundaryHandling_T;
typedef std::tuple<pe::Sphere, pe::Ellipsoid, pe::Plane> BodyTypeTuple;
......@@ -152,7 +149,7 @@ BoundaryHandling_T * MyBoundaryHandling::operator()( IBlock * const block, const
BoundaryHandling_T::Mode mode = (useEntireFieldTraversal_) ? BoundaryHandling_T::Mode::ENTIRE_FIELD_TRAVERSAL : BoundaryHandling_T::Mode::OPTIMIZED_SPARSE_TRAVERSAL ;
BoundaryHandling_T * handling = new BoundaryHandling_T( "fixed obstacle boundary handling", flagField, fluid,
boost::tuples::make_tuple( MO_CLI_T ( "MO_CLI", MO_CLI_Flag, pdfField, flagField, bodyField, fluid, *storage, *block ) ),
MO_CLI_T ( "MO_CLI", MO_CLI_Flag, pdfField, flagField, bodyField, fluid, *storage, *block ),
mode);
// boundaries are set by mapping the planes into the domain
......
......@@ -373,9 +373,7 @@ public:
typedef lbm::NoSlip< LatticeModel_T, flag_t > NoSlip_T;
typedef lbm::SimpleUBB< LatticeModel_T, flag_t > UBB_T;
typedef boost::tuples::tuple< NoSlip_T, UBB_T > BoundaryConditions_T;
typedef BoundaryHandling< FlagField_T, typename Types<LatticeModel_T>::Stencil_T, BoundaryConditions_T > BoundaryHandling_T;
typedef BoundaryHandling< FlagField_T, typename Types<LatticeModel_T>::Stencil_T, NoSlip_T, UBB_T > BoundaryHandling_T;
......@@ -405,8 +403,8 @@ MyBoundaryHandling<LatticeModel_T>::operator()( IBlock * const block ) const
const flag_t fluid = flagField->registerFlag( Fluid_Flag );
return new BoundaryHandling_T( "boundary handling", flagField, fluid,
boost::tuples::make_tuple( NoSlip_T( "no slip", NoSlip_Flag, pdfField ),
UBB_T( "velocity bounce back", UBB_Flag, pdfField, topVelocity_, real_t(0), real_t(0) ) ) );
NoSlip_T( "no slip", NoSlip_Flag, pdfField ),
UBB_T( "velocity bounce back", UBB_Flag, pdfField, topVelocity_, real_t(0), real_t(0) ) );
}
......
......@@ -95,8 +95,7 @@ const uint_t FieldGhostLayers = 4;
typedef pe_coupling::SimpleBB< LatticeModel_T, FlagField_T > MO_SBB_T;
typedef pe_coupling::CurvedLinear< LatticeModel_T, FlagField_T > MO_CLI_T;
typedef boost::tuples::tuple< MO_SBB_T, MO_CLI_T > BoundaryConditions_T;
typedef BoundaryHandling< FlagField_T, Stencil_T, BoundaryConditions_T > BoundaryHandling_T;
typedef BoundaryHandling< FlagField_T, Stencil_T, MO_SBB_T, MO_CLI_T > BoundaryHandling_T;
typedef std::tuple< pe::Sphere, pe::Plane > BodyTypeTuple;
......@@ -238,8 +237,8 @@ BoundaryHandling_T * MyBoundaryHandling::operator()( IBlock * const block, const
const auto fluid = flagField->flagExists( Fluid_Flag ) ? flagField->getFlag( Fluid_Flag ) : flagField->registerFlag( Fluid_Flag );
BoundaryHandling_T * handling = new BoundaryHandling_T( "moving obstacle boundary handling", flagField, fluid,
boost::tuples::make_tuple( MO_SBB_T( "MO_SBB", MO_SBB_Flag, pdfField, flagField, bodyField, fluid, *storage, *block ),
MO_CLI_T( "MO_CLI", MO_CLI_Flag, pdfField, flagField, bodyField, fluid, *storage, *block ) ) );
MO_SBB_T( "MO_SBB", MO_SBB_Flag, pdfField, flagField, bodyField, fluid, *storage, *block ),
MO_CLI_T( "MO_CLI", MO_CLI_Flag, pdfField, flagField, bodyField, fluid, *storage, *block ) );
// boundary conditions are set by mapping the (moving) planes into the domain
......
......@@ -98,8 +98,7 @@ typedef pe_coupling::SimpleBB< LatticeModel_T, FlagField_T > MEM_BB_T;
typedef pe_coupling::CurvedLinear< LatticeModel_T, FlagField_T > MEM_CLI_T;
typedef pe_coupling::CurvedQuadratic< LatticeModel_T, FlagField_T > MEM_MR_T;
typedef boost::tuples::tuple< UBB_T, Outlet_T, MEM_BB_T, MEM_CLI_T, MEM_MR_T > BoundaryConditions_T;
typedef BoundaryHandling< FlagField_T, Stencil_T, BoundaryConditions_T > BoundaryHandling_T;
typedef BoundaryHandling< FlagField_T, Stencil_T, UBB_T, Outlet_T, MEM_BB_T, MEM_CLI_T, MEM_MR_T > BoundaryHandling_T;
using BodyTypeTuple = std::tuple<pe::Sphere>;
......@@ -199,11 +198,11 @@ BoundaryHandling_T * MyBoundaryHandling::operator()( IBlock * const block, const
const auto fluid = flagField->flagExists( Fluid_Flag ) ? flagField->getFlag( Fluid_Flag ) : flagField->registerFlag( Fluid_Flag );
BoundaryHandling_T * handling = new BoundaryHandling_T( "moving obstacle boundary handling", flagField, fluid,
boost::tuples::make_tuple( UBB_T( "UBB", UBB_Flag, pdfField, velocity_),
UBB_T( "UBB", UBB_Flag, pdfField, velocity_),
Outlet_T( "Outlet", Outlet_Flag, pdfField, real_t(1) ),
MEM_BB_T ( "MEM_BB", MEM_BB_Flag, pdfField, flagField, bodyField, fluid, *storage, *block ),
MEM_CLI_T( "MEM_CLI", MEM_CLI_Flag, pdfField, flagField, bodyField, fluid, *storage, *block ),
MEM_MR_T ( "MEM_MR", MEM_MR_Flag, pdfField, flagField, bodyField, fluid, *storage, *block, pdfFieldPreCol ) ) );
MEM_MR_T ( "MEM_MR", MEM_MR_Flag, pdfField, flagField, bodyField, fluid, *storage, *block, pdfFieldPreCol ) );
const auto ubb = flagField->getFlag( UBB_Flag );
const auto outlet = flagField->getFlag( Outlet_Flag );
......
......@@ -434,9 +434,7 @@ struct MyBoundaryTypes
typedef lbm::NoSlip< LatticeModel_T, flag_t > NoSlip_T;
typedef lbm::SimpleUBB< LatticeModel_T, flag_t > UBB_T;
typedef boost::tuples::tuple< NoSlip_T, UBB_T > BoundaryConditions_T;
typedef BoundaryHandling< FlagField_T, typename Types<LatticeModel_T>::Stencil_T, BoundaryConditions_T > BoundaryHandling_T;
typedef BoundaryHandling< FlagField_T, typename Types<LatticeModel_T>::Stencil_T, NoSlip_T, UBB_T > BoundaryHandling_T;
};
template< typename LatticeModel_T >
......@@ -447,8 +445,6 @@ public:
using NoSlip_T = typename MyBoundaryTypes< LatticeModel_T >::NoSlip_T;
using UBB_T = typename MyBoundaryTypes< LatticeModel_T >::UBB_T;
using BoundaryConditions_T = typename MyBoundaryTypes< LatticeModel_T >::BoundaryConditions_T;
using BoundaryHandling_T = typename MyBoundaryTypes< LatticeModel_T >::BoundaryHandling_T;
......@@ -484,8 +480,8 @@ MyBoundaryHandling<LatticeModel_T>::initialize( IBlock * const block )
const auto fluid = flagField->flagExists( Fluid_Flag ) ? flagField->getFlag( Fluid_Flag ) : flagField->registerFlag( Fluid_Flag );
BoundaryHandling_T * handling = new BoundaryHandling_T( "boundary handling", flagField, fluid,
boost::tuples::make_tuple( NoSlip_T( "no slip", NoSlip_Flag, pdfField ),
UBB_T( "velocity bounce back", UBB_Flag, pdfField, velocity_, real_c(0), real_c(0) ) ) );
NoSlip_T( "no slip", NoSlip_Flag, pdfField ),
UBB_T( "velocity bounce back", UBB_Flag, pdfField, velocity_, real_c(0), real_c(0) ) );
auto forest = forest_.lock();
WALBERLA_CHECK_NOT_NULLPTR( forest );
......
......@@ -458,9 +458,7 @@ public:
typedef lbm::NoSlip< LatticeModel_T, flag_t > NoSlip_T;
typedef lbm::Curved< LatticeModel_T, FlagField_T > Curved_T;
typedef boost::tuples::tuple< NoSlip_T, Curved_T > BoundaryConditions_T;
typedef BoundaryHandling< FlagField_T, typename Types<LatticeModel_T>::Stencil_T, BoundaryConditions_T > BoundaryHandling_T;
typedef BoundaryHandling< FlagField_T, typename Types<LatticeModel_T>::Stencil_T, NoSlip_T, Curved_T > BoundaryHandling_T;
......@@ -488,8 +486,8 @@ MyBoundaryHandling<LatticeModel_T>::operator()( IBlock * const block ) const
const flag_t fluid = flagField->registerFlag( Fluid_Flag );
return new BoundaryHandling_T( "boundary handling", flagField, fluid,
boost::tuples::make_tuple( NoSlip_T( "no slip", NoSlip_Flag, pdfField ),
Curved_T( "curved", Curved_Flag, pdfField, flagField, fluid ) ) );
NoSlip_T( "no slip", NoSlip_Flag, pdfField ),
Curved_T( "curved", Curved_Flag, pdfField, flagField, fluid ) );
}
......
......@@ -784,11 +784,8 @@ struct MyBoundaryTypes
typedef lbm::Outlet< LatticeModel_T, FlagField_T, 2, 1 > Outlet21_T;
typedef lbm::Outlet< LatticeModel_T, FlagField_T, 4, 3 > Outlet43_T;
typedef lbm::SimplePressure< LatticeModel_T, flag_t > PressureOutlet_T;
typedef boost::tuples::tuple< NoSlip_T, Obstacle_T, Curved_T, DynamicUBB_T, Outlet21_T, Outlet43_T, PressureOutlet_T > BoundaryConditions_T;
typedef BoundaryHandling< FlagField_T, typename Types<LatticeModel_T>::Stencil_T, BoundaryConditions_T > BoundaryHandling_T;
typedef BoundaryHandling< FlagField_T, typename Types<LatticeModel_T>::Stencil_T, NoSlip_T, Obstacle_T, Curved_T, DynamicUBB_T, Outlet21_T, Outlet43_T, PressureOutlet_T > BoundaryHandling_T;
};
......@@ -805,8 +802,6 @@ public:
using Outlet43_T = typename MyBoundaryTypes<LatticeModel_T>::Outlet43_T;
using PressureOutlet_T = typename MyBoundaryTypes<LatticeModel_T>::PressureOutlet_T;
using BoundaryConditions_T = typename MyBoundaryTypes<LatticeModel_T>::BoundaryConditions_T;
using BoundaryHandling_T = typename MyBoundaryTypes<LatticeModel_T>::BoundaryHandling_T;
......@@ -848,13 +843,13 @@ MyBoundaryHandling<LatticeModel_T>::initialize( IBlock * const block )
SinusInflowVelocity<Is2D< LatticeModel_T >::value> velocity( setup_.inflowVelocity_L, setup_.raisingTime_L, setup_.sinPeriod_L, setup_.H );
return new BoundaryHandling_T( "boundary handling", flagField, fluid,
boost::tuples::make_tuple( NoSlip_T( "no slip", NoSlip_Flag, pdfField ),
NoSlip_T( "no slip", NoSlip_Flag, pdfField ),
Obstacle_T( "obstacle (staircase)", Obstacle_Flag, pdfField ),
Curved_T( "obstacle (curved)", Curved_Flag, pdfField, flagField, fluid ),
DynamicUBB_T( "velocity bounce back", UBB_Flag, pdfField, timeTracker_, blocks->getLevel(*block), velocity, block->getAABB() ),
Outlet21_T( "outlet (2/1)", Outlet21_Flag, pdfField, flagField, fluid ),
Outlet43_T( "outlet (4/3)", Outlet43_Flag, pdfField, flagField, fluid ),
PressureOutlet_T( "pressure outlet", PressureOutlet_Flag, pdfField, real_t(1) ) ) );
PressureOutlet_T( "pressure outlet", PressureOutlet_Flag, pdfField, real_t(1) ) );
}
......
......@@ -353,9 +353,7 @@ public:
typedef lbm::NoSlip< LatticeModel_T, flag_t > NoSlip_T;
typedef lbm::SimpleUBB< LatticeModel_T, flag_t > UBB_T;
typedef boost::tuples::tuple< NoSlip_T, UBB_T > BoundaryConditions_T;
typedef BoundaryHandling< FlagField_T, typename Types<LatticeModel_T>::Stencil_T, BoundaryConditions_T > BoundaryHandling_T;
typedef BoundaryHandling< FlagField_T, typename Types<LatticeModel_T>::Stencil_T, NoSlip_T, UBB_T > BoundaryHandling_T;
......@@ -388,8 +386,8 @@ MyBoundaryHandling<LatticeModel_T>::operator()( IBlock * const block, const Stru
const auto fluid = flagField->flagExists( Fluid_Flag ) ? flagField->getFlag( Fluid_Flag ) : flagField->registerFlag( Fluid_Flag );
BoundaryHandling_T * handling = new BoundaryHandling_T( "boundary handling", flagField, fluid,
boost::tuples::make_tuple( NoSlip_T( "no slip", NoSlip_Flag, pdfField ),
UBB_T( "velocity bounce back", UBB_Flag, pdfField, velocity_, real_c(0), real_c(0) ) ) );
NoSlip_T( "no slip", NoSlip_Flag, pdfField ),
UBB_T( "velocity bounce back", UBB_Flag, pdfField, velocity_, real_c(0), real_c(0) ) );
CellInterval domainBB = storage->getDomainCellBB();
storage->transformGlobalToBlockLocalCellInterval( domainBB, *block );
......
......@@ -98,8 +98,7 @@ typedef lbm::Outlet< LatticeModel_T, FlagField_T > Outflow_T
typedef lbm::SimplePressure< LatticeModel_T, flag_t > Outflow_T;
#endif
typedef boost::tuples::tuple< NoSlip_T, Inflow_T, Outflow_T > BoundaryConditions_T;
typedef BoundaryHandling<FlagField_T, Stencil_T, BoundaryConditions_T> BoundaryHandling_T;
typedef BoundaryHandling<FlagField_T, Stencil_T, NoSlip_T, Inflow_T, Outflow_T> BoundaryHandling_T;
typedef std::tuple<pe::Plane, pe::Sphere> BodyTypeTuple ;
......@@ -165,14 +164,14 @@ BoundaryHandling_T * MyBoundaryHandling::operator()( IBlock * const block, const
#ifdef OutletBC
BoundaryHandling_T * handling = new BoundaryHandling_T( "Boundary handling", flagField, fluid,
boost::tuples::make_tuple( NoSlip_T( "NoSlip", NoSlip_Flag, pdfField ),
NoSlip_T( "NoSlip", NoSlip_Flag, pdfField ),
Inflow_T( "Inflow", Inflow_Flag, pdfField, Vector3<real_t>(real_t(0),real_t(0),uInflow_) ),
Outflow_T( "Outflow", Outflow_Flag, pdfField, flagField, fluid ) ) );
Outflow_T( "Outflow", Outflow_Flag, pdfField, flagField, fluid ) );
#else
BoundaryHandling_T * handling = new BoundaryHandling_T( "Boundary handling", flagField, fluid,
boost::tuples::make_tuple( NoSlip_T( "NoSlip", NoSlip_Flag, pdfField ),
NoSlip_T( "NoSlip", NoSlip_Flag, pdfField ),
Inflow_T( "Inflow", Inflow_Flag, pdfField, Vector3<real_t>(real_t(0),real_t(0),uInflow_) ),
Outflow_T( "Outflow", Outflow_Flag, pdfField, real_t(1) ) ) );
Outflow_T( "Outflow", Outflow_Flag, pdfField, real_t(1) ) );
#endif
const auto noslip = flagField->getFlag( NoSlip_Flag );
......
......@@ -79,10 +79,7 @@ typedef lbm::NoSlip< LatticeModel_T, flag_t > NoSlip_T; // no slip boundary
typedef lbm::SimpleUBB< LatticeModel_T, flag_t > UBB_T; // velocity bounce back boundary condition that internally works with one ...
// ... constant velocity that must be set during the setup phase
typedef boost::tuples::tuple< NoSlip_T, UBB_T > BoundaryConditions_T; // a collection of all boundary conditions - required for
// defining the type of the boundary handling (see below)
typedef BoundaryHandling< FlagField_T, Stencil_T, BoundaryConditions_T > BoundaryHandling_T; // the boundary handling
typedef BoundaryHandling< FlagField_T, Stencil_T, NoSlip_T, UBB_T > BoundaryHandling_T; // the boundary handling, includes a collection of all boundary conditions
///////////
// FLAGS //
......@@ -139,11 +136,11 @@ BoundaryHandling_T * MyBoundaryHandling::operator()( IBlock * const block ) cons
// The fluid flag is used in order to decide whether a certain cell is part of the domain (and therefore has to be
// treated by the boundary handling if it is located next to a boundary). Also, the no slip and velocity bounce back
// boundary conditions are initialized (Please note that the order in which these boundary conditions are initialized
// must be identical to the order in 'BoundaryConditions_T'!).
// must be identical to the order of the template arguments of 'BoundaryHandling_T'!).
return new BoundaryHandling_T( "boundary handling", flagField, fluid,
boost::tuples::make_tuple( NoSlip_T( "no slip", NoSlip_Flag, pdfField ),
UBB_T( "velocity bounce back", UBB_Flag, pdfField, topVelocity_, real_c(0), real_c(0) ) ) );
NoSlip_T( "no slip", NoSlip_Flag, pdfField ),
UBB_T( "velocity bounce back", UBB_Flag, pdfField, topVelocity_, real_c(0), real_c(0) ) );
}
......@@ -420,4 +417,4 @@ int main( int argc, char ** argv )
int main( int argc, char ** argv )
{
return walberla::main(argc, argv);
}
\ No newline at end of file
}
This diff is collapsed.
This diff is collapsed.
......@@ -32,8 +32,6 @@
#include "boundary/BoundaryHandling.h"
#include "lbm/field/PdfField.h"
#include <boost/tuple/tuple.hpp>
namespace walberla {
namespace lbm {
......@@ -82,8 +80,7 @@ public:
typedef Vector3<real_t> Velocity;
typedef PdfField< LatticeModel > PdfFieldLM;
typedef boost::tuple< BcNoSlip, BcFreeSlip, BcSimpleUBB, BcSimpleUBB, BcSimplePressure, BcSimplePressure> BoundaryConditions;
typedef walberla::boundary::BoundaryHandling< FlagFieldT, Stencil, BoundaryConditions > BoundaryHandling;
typedef walberla::boundary::BoundaryHandling< FlagFieldT, Stencil, BcNoSlip, BcFreeSlip, BcSimpleUBB, BcSimpleUBB, BcSimplePressure, BcSimplePressure > BoundaryHandling;
static BlockDataID addBoundaryHandlingToStorage( const shared_ptr< StructuredBlockStorage > & bs, const std::string & identifier,
BlockDataID flagFieldID, BlockDataID pdfFieldID, const Set< FlagUID > & flagUIDSet,
......@@ -165,14 +162,12 @@ DefaultBoundaryHandlingFactory<LatticeModel, FlagFieldT>::operator()( walberla::
mask = static_cast< flag_t >( mask | flagField->getOrRegisterFlag( *flag ) );
BoundaryHandling * handling = new BoundaryHandling( "default lbm boundary handling", flagField, mask,
boost::tuples::make_tuple(
BcNoSlip ( getNoSlipBoundaryUID(), getNoSlip(), pdfField ),
BcFreeSlip ( getFreeSlipBoundaryUID(), getFreeSlip(), pdfField, flagField, mask ),
BcSimpleUBB ( getVelocity0BoundaryUID(), getVelocity0(), pdfField, velocity0_ ),
BcSimpleUBB ( getVelocity1BoundaryUID(), getVelocity1(), pdfField, velocity1_ ),
BcSimplePressure( getPressure0BoundaryUID(), getPressure0(), pdfField, pressure0_ ),
BcSimplePressure( getPressure1BoundaryUID(), getPressure1(), pdfField, pressure1_ )
)
);
return handling;
......
......@@ -40,11 +40,8 @@ private:
typedef typename DefaultBoundaryHandlingFactory < LatticeModel_T, FlagField_T >::BoundaryHandling DefaultBoundaryHandling_T;
typedef typename DefaultDiffusionBoundaryHandlingFactory< DiffusionLatticeModel_T, FlagField_T >::BoundaryHandling_T DefaultDiffusionBoundaryHandlingFactory_T;
private:
typedef boost::tuples::tuple< DefaultBoundaryHandling_T &, DefaultDiffusionBoundaryHandlingFactory_T & > BoundaryHandlings;
public:
typedef BoundaryHandlingCollection< FlagField_T, BoundaryHandlings > BoundaryHandlingCollection_T;
typedef BoundaryHandlingCollection< FlagField_T, DefaultBoundaryHandling_T &, DefaultDiffusionBoundaryHandlingFactory_T & > BoundaryHandlingCollection_T;
private:
......@@ -62,7 +59,7 @@ private:
DefaultBoundaryHandling_T & handling = * block->getData< DefaultBoundaryHandling_T >( handlingID );
DefaultDiffusionBoundaryHandlingFactory_T & diffusionHandling = * block->getData< DefaultDiffusionBoundaryHandlingFactory_T >( diffusionHandlingID );
return new BoundaryHandlingCollection_T( " Diffusion Boundary Handling Collection", flagField, BoundaryHandlings( handling, diffusionHandling ) );
return new BoundaryHandlingCollection_T( " Diffusion Boundary Handling Collection", flagField, handling, diffusionHandling );
}
public:
......
......@@ -34,8 +34,6 @@
#include "field/FlagFunctions.h"
#include <boost/tuple/tuple.hpp>
#include <functional>
......@@ -56,12 +54,9 @@ public:
typedef lbm::NoDiffusion < LatticeModel_T, flag_t > NoDiffusion_T;
typedef lbm::FreeDiffusion < LatticeModel_T, FlagField_T > FreeDiffusion_T;
private:
typedef boost::tuples::tuple< DiffusionDirichlet_T, SimpleDiffusionDirichlet_T, NoDiffusion_T, FreeDiffusion_T, SimpleDiffusionDirichlet_T, SimpleDiffusionDirichlet_T > BoundaryConditions;
public:
typedef walberla::boundary::BoundaryHandling< FlagField_T, Stencil, BoundaryConditions > BoundaryHandling_T;
typedef walberla::boundary::BoundaryHandling< FlagField_T, Stencil, BoundaryConditions > BoundaryHandling;
typedef walberla::boundary::BoundaryHandling< FlagField_T, Stencil, DiffusionDirichlet_T, SimpleDiffusionDirichlet_T, NoDiffusion_T, FreeDiffusion_T, SimpleDiffusionDirichlet_T, SimpleDiffusionDirichlet_T > BoundaryHandling_T;
typedef BoundaryHandling_T BoundaryHandling;
const static FlagUID& getDiffusionDirichletFlagUID() { static FlagUID uid( "DiffusionDirichlet" ); return uid; }
const static FlagUID& getSimpleDiffusionDirichletFlagUID() { static FlagUID uid( "SimpleDiffusionDirichlet" ); return uid; }
......@@ -106,13 +101,13 @@ private:
for( auto domainFlagUID = domainFlagUIDs.begin(); domainFlagUID != domainFlagUIDs.end(); ++domainFlagUID )
field::addMask( domainMask, flagField->getOrRegisterFlag( *domainFlagUID ) );
BoundaryHandling_T * handling = new BoundaryHandling_T( "Diffusion Boundary Handling", flagField, domainMask, boost::tuples::make_tuple(
BoundaryHandling_T * handling = new BoundaryHandling_T( "Diffusion Boundary Handling", flagField, domainMask,
DiffusionDirichlet_T ( getDiffusionDirichletBoundaryUID(), getDiffusionDirichletFlagUID(), pdfField, flagField ),
SimpleDiffusionDirichlet_T( getSimpleDiffusionDirichletBoundaryUID(), getSimpleDiffusionDirichletFlagUID(), pdfField ),
NoDiffusion_T ( getNoDiffusionBoundaryUID(), getNoDiffusionFlagUID(), pdfField ),
FreeDiffusion_T ( getFreeDiffusionBoundaryUID(), getFreeDiffusionFlagUID(), pdfField, flagField, domainMask ),
SimpleDiffusionDirichlet_T( getSimpleDiffusionDirichletBoundaryUID1(), getSimpleDiffusionDirichletFlagUID1(), pdfField ),
SimpleDiffusionDirichlet_T( getSimpleDiffusionDirichletBoundaryUID2(), getSimpleDiffusionDirichletFlagUID2(), pdfField )) );
SimpleDiffusionDirichlet_T( getSimpleDiffusionDirichletBoundaryUID2(), getSimpleDiffusionDirichletFlagUID2(), pdfField ) );
if( initFlagUIDs.size() > size_t(0u) )
{
......
......@@ -33,8 +33,6 @@
#include "boundary/BoundaryHandling.h"
#include "lbm/field/PdfField.h"
#include <boost/tuple/tuple.hpp>
namespace walberla {
namespace lbm {
......@@ -86,8 +84,7 @@ public:
typedef Outlet<LatticeModel, FlagFieldT > BcOutlet;
typedef Curved<LatticeModel, FlagFieldT > BcCurved;
typedef boost::tuple< BcNoSlip, BcFreeSlip, BcPressure, BcUBB, BcOutlet, BcCurved > BoundaryConditions;
typedef walberla::boundary::BoundaryHandling< FlagFieldT, Stencil, BoundaryConditions > BoundaryHandling;
typedef walberla::boundary::BoundaryHandling< FlagFieldT, Stencil, BcNoSlip, BcFreeSlip, BcPressure, BcUBB, BcOutlet, BcCurved > BoundaryHandling;
static BlockDataID addBoundaryHandlingToStorage( const shared_ptr< StructuredBlockStorage > & bs, const std::string & identifier,
BlockDataID flagFieldID, BlockDataID pdfFieldID, const Set< FlagUID > & flagUIDSet )
......@@ -156,14 +153,12 @@ ExtendedBoundaryHandlingFactory<LatticeModel, FlagFieldT>::operator()( IBlock *
BoundaryHandling * handling = new BoundaryHandling( "extended lbm boundary handling", flagField, mask,
boost::tuples::make_tuple(
BcNoSlip ( getNoSlipBoundaryUID(), getNoSlip(), pdfField ),
BcFreeSlip ( getFreeSlipBoundaryUID(), getFreeSlip(), pdfField, flagField, mask ),
BcPressure ( getPressureBoundaryUID(), getPressure(), pdfField ),
BcUBB ( getUBBBoundaryUID(), getUBB(), pdfField, flagField, storage->getLevel(*block), block->getAABB() ),
BcOutlet ( getOutletBoundaryUID(), getOutlet(), pdfField, flagField, mask ),
BcCurved ( getCurvedBoundaryUID(), getCurved(), pdfField, flagField, mask )
)
);
return handling;
......
......@@ -35,8 +35,6 @@
#include "stencil/D3Q27.h"
#include <boost/tuple/tuple.hpp>
namespace walberla {
......@@ -203,7 +201,7 @@ private:
// TEST BOUNDARY HANDLING //
////////////////////////////
typedef BoundaryHandling< FlagField_T, stencil::D3Q27, boost::tuples::tuple< CopyBoundary, AddBoundary > > TestBoundaryHandling;
typedef BoundaryHandling< FlagField_T, stencil::D3Q27, CopyBoundary, AddBoundary > TestBoundaryHandling;
......@@ -368,7 +366,7 @@ static int main( int argc, char **argv )
FactorField_T factorField_Ref( xSize, ySize, zSize, gl, uint_c(0) );
TestBoundaryHandling handling( "test boundary handling", &flagField_BH, numeric_cast<flag_t>( domainFlag1 | domainFlag2 ),
boost::tuples::make_tuple( CopyBoundary( copy1, copy2, &workField_BH ), AddBoundary( add, &workField_BH ) ) );
CopyBoundary( copy1, copy2, &workField_BH ), AddBoundary( add, &workField_BH ) );
// START TESTING / COMPARING
......
......@@ -85,9 +85,7 @@ public:
typedef lbm::NoSlip< LatticeModel_T, flag_t > NoSlip_T;
typedef lbm::UBB< LatticeModel_T, flag_t > UBB_T;
typedef boost::tuples::tuple< NoSlip_T, UBB_T > BoundaryConditions_T;
typedef BoundaryHandling< FlagField_T, typename LatticeModel_T::Stencil, BoundaryConditions_T > BoundaryHandling_T;
typedef BoundaryHandling< FlagField_T, typename LatticeModel_T::Stencil, NoSlip_T, UBB_T > BoundaryHandling_T;
MyBoundaryHandling( const std::string & id, const BlockDataID & flagField, const BlockDataID & pdfField, const real_t velocity ) :
id_( id ), flagField_( flagField ), pdfField_( pdfField ), velocity_( velocity ) {}
......@@ -119,8 +117,8 @@ MyBoundaryHandling<LatticeModel_T>::operator()( IBlock * const block, const Stru
const auto fluid = flagField->flagExists( Fluid_Flag ) ? flagField->getFlag( Fluid_Flag ) : flagField->registerFlag( Fluid_Flag );
BoundaryHandling_T * boundaryHandling = new BoundaryHandling_T( std::string("boundary handling ")+id_, flagField, fluid,
boost::tuples::make_tuple( NoSlip_T( "no slip", NoSlip_Flag, pdfField ),
UBB_T( "velocity bounce back", UBB_Flag, pdfField ) ) );
NoSlip_T( "no slip", NoSlip_Flag, pdfField ),
UBB_T( "velocity bounce back", UBB_Flag, pdfField ) );
// closed no slip channel, periodic in x-direction
......@@ -403,4 +401,4 @@ int main( int argc, char ** argv )
int main( int argc, char ** argv )
{
return walberla::main(argc, argv);
}
\ No newline at end of file
}
......@@ -64,8 +64,7 @@ typedef FlagField< flag_t > FlagField_T;
const uint_t FieldGhostLayers = 2;
typedef lbm::NoSlip< LatticeModel_T, flag_t> NoSlip_T;
typedef boost::tuples::tuple< NoSlip_T > BoundaryConditions_T;
typedef BoundaryHandling< FlagField_T, Stencil_T, BoundaryConditions_T> BoundaryHandling_T;
typedef BoundaryHandling< FlagField_T, Stencil_T, NoSlip_T> BoundaryHandling_T;
///////////
// FLAGS //
......@@ -105,7 +104,7 @@ BoundaryHandling_T * MyBoundaryHandling::operator()( IBlock * const block, const
const auto fluid = flagField->flagExists( Fluid_Flag ) ? flagField->getFlag( Fluid_Flag ) : flagField->registerFlag( Fluid_Flag );
BoundaryHandling_T * handling = new BoundaryHandling_T( "moving obstacle boundary handling", flagField, fluid,
boost::tuples::make_tuple( NoSlip_T( "NoSlip", NoSlip_Flag, pdfField ) ) );
NoSlip_T( "NoSlip", NoSlip_Flag, pdfField ) );
const auto noSlip = flagField->getFlag(NoSlip_Flag);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment