diff --git a/apps/benchmarks/AdaptiveMeshRefinementFluidParticleCoupling/WorkloadEvaluation.cpp b/apps/benchmarks/AdaptiveMeshRefinementFluidParticleCoupling/WorkloadEvaluation.cpp index 45b2d82e3ddcbaed6f13c755947f8a7b5830e8d8..239c024bb39b958721d44d013ecaec6b43bfcf2f 100644 --- a/apps/benchmarks/AdaptiveMeshRefinementFluidParticleCoupling/WorkloadEvaluation.cpp +++ b/apps/benchmarks/AdaptiveMeshRefinementFluidParticleCoupling/WorkloadEvaluation.cpp @@ -71,6 +71,8 @@ #include "field/vtk/all.h" #include "lbm/vtk/all.h" +#include <boost/tuple/tuple.hpp> + #include <vector> #include <iomanip> #include <iostream> diff --git a/apps/benchmarks/CouetteFlow/CouetteFlow.cpp b/apps/benchmarks/CouetteFlow/CouetteFlow.cpp index 84ccd95cec98693e244d6f48e48abbca18932b20..05126f0202fecd9662a03202b8572fa1a526c98b 100644 --- a/apps/benchmarks/CouetteFlow/CouetteFlow.cpp +++ b/apps/benchmarks/CouetteFlow/CouetteFlow.cpp @@ -91,9 +91,6 @@ #include "vtk/Initialization.h" #include "vtk/VTKOutput.h" -#include <boost/mpl/or.hpp> -#include <boost/type_traits/is_same.hpp> - #include <algorithm> #include <cmath> #include <cstdlib> @@ -101,6 +98,7 @@ #include <functional> #include <iostream> #include <memory> +#include <type_traits> #include <utility> #include <vector> @@ -164,19 +162,19 @@ template< typename LatticeModel_T, class Enable = void > struct StencilString; template< typename LatticeModel_T > -struct StencilString< LatticeModel_T, typename boost::enable_if_c< boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q15 >::value >::type > +struct StencilString< LatticeModel_T, typename std::enable_if< std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q15 >::value >::type > { static const char * str() { return "D3Q15"; } }; template< typename LatticeModel_T > -struct StencilString< LatticeModel_T, typename boost::enable_if_c< boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value >::type > +struct StencilString< LatticeModel_T, typename std::enable_if< std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value >::type > { static const char * str() { return "D3Q19"; } }; template< typename LatticeModel_T > -struct StencilString< LatticeModel_T, typename boost::enable_if_c< boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q27 >::value >::type > +struct StencilString< LatticeModel_T, typename std::enable_if< std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q27 >::value >::type > { static const char * str() { return "D3Q27"; } }; @@ -186,21 +184,21 @@ template< typename LatticeModel_T, class Enable = void > struct CollisionModelString; template< typename LatticeModel_T > -struct CollisionModelString< LatticeModel_T, typename boost::enable_if_c< boost::is_same< typename LatticeModel_T::CollisionModel::tag, +struct CollisionModelString< LatticeModel_T, typename std::enable_if< std::is_same< typename LatticeModel_T::CollisionModel::tag, lbm::collision_model::SRT_tag >::value >::type > { static const char * str() { return "SRT"; } }; template< typename LatticeModel_T > -struct CollisionModelString< LatticeModel_T, typename boost::enable_if_c< boost::is_same< typename LatticeModel_T::CollisionModel::tag, +struct CollisionModelString< LatticeModel_T, typename std::enable_if< std::is_same< typename LatticeModel_T::CollisionModel::tag, lbm::collision_model::TRT_tag >::value >::type > { static const char * str() { return "TRT"; } }; template< typename LatticeModel_T > -struct CollisionModelString< LatticeModel_T, typename boost::enable_if_c< boost::is_same< typename LatticeModel_T::CollisionModel::tag, +struct CollisionModelString< LatticeModel_T, typename std::enable_if< std::is_same< typename LatticeModel_T::CollisionModel::tag, lbm::collision_model::MRT_tag >::value >::type > { static const char * str() { return "MRT"; } @@ -638,10 +636,10 @@ struct AddRefinementTimeStep }; template< typename LatticeModel_T > -struct AddRefinementTimeStep< LatticeModel_T, typename boost::enable_if< boost::mpl::or_< boost::is_same< typename LatticeModel_T::CollisionModel::tag, - lbm::collision_model::MRT_tag >, - boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q15 >, - boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q27 > > >::type > +struct AddRefinementTimeStep< LatticeModel_T, typename std::enable_if< std::is_same< typename LatticeModel_T::CollisionModel::tag, lbm::collision_model::MRT_tag >::value || + std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q15 >::value || + std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q27 >::value + >::type > { static void add( SweepTimeloop & timeloop, shared_ptr< blockforest::StructuredBlockForest > & blocks, const BlockDataID & pdfFieldId, const BlockDataID & flagFieldId, const BlockDataID & boundaryHandlingId, diff --git a/apps/benchmarks/NonUniformGrid/NonUniformGrid.cpp b/apps/benchmarks/NonUniformGrid/NonUniformGrid.cpp index 59797ae783ba9fe419be88a603927caef6d35246..3a50ad87572dae545de03b87c1fded47f6c0d4b6 100644 --- a/apps/benchmarks/NonUniformGrid/NonUniformGrid.cpp +++ b/apps/benchmarks/NonUniformGrid/NonUniformGrid.cpp @@ -79,6 +79,7 @@ #include <functional> #include <iostream> #include <memory> +#include <type_traits> @@ -136,7 +137,7 @@ template< typename LatticeModel_T, class Enable = void > struct StencilString; template< typename LatticeModel_T > -struct StencilString< LatticeModel_T, typename boost::enable_if_c< boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value >::type > +struct StencilString< LatticeModel_T, typename std::enable_if< std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value >::type > { static const char * str() { return "D3Q19"; } }; @@ -145,21 +146,21 @@ template< typename LatticeModel_T, class Enable = void > struct CollisionModelString; template< typename LatticeModel_T > -struct CollisionModelString< LatticeModel_T, typename boost::enable_if_c< boost::is_same< typename LatticeModel_T::CollisionModel::tag, +struct CollisionModelString< LatticeModel_T, typename std::enable_if< std::is_same< typename LatticeModel_T::CollisionModel::tag, lbm::collision_model::SRT_tag >::value >::type > { static const char * str() { return "SRT"; } }; template< typename LatticeModel_T > -struct CollisionModelString< LatticeModel_T, typename boost::enable_if_c< boost::is_same< typename LatticeModel_T::CollisionModel::tag, +struct CollisionModelString< LatticeModel_T, typename std::enable_if< std::is_same< typename LatticeModel_T::CollisionModel::tag, lbm::collision_model::TRT_tag >::value >::type > { static const char * str() { return "TRT"; } }; template< typename LatticeModel_T > -struct CollisionModelString< LatticeModel_T, typename boost::enable_if_c< boost::is_same< typename LatticeModel_T::CollisionModel::tag, +struct CollisionModelString< LatticeModel_T, typename std::enable_if< std::is_same< typename LatticeModel_T::CollisionModel::tag, lbm::collision_model::MRT_tag >::value >::type > { static const char * str() { return "MRT"; } @@ -647,7 +648,7 @@ struct AddRefinementTimeStep }; template< typename LatticeModel_T > -struct AddRefinementTimeStep< LatticeModel_T, typename boost::enable_if_c< boost::is_same< typename LatticeModel_T::CollisionModel::tag, +struct AddRefinementTimeStep< LatticeModel_T, typename std::enable_if< std::is_same< typename LatticeModel_T::CollisionModel::tag, lbm::collision_model::MRT_tag >::value >::type > { static void add( SweepTimeloop & timeloop, shared_ptr< blockforest::StructuredBlockForest > & blocks, diff --git a/apps/benchmarks/PoiseuilleChannel/PoiseuilleChannel.cpp b/apps/benchmarks/PoiseuilleChannel/PoiseuilleChannel.cpp index bd9debc51ed74524a914302789bfcb262299d790..15dbd17058095c4aba2b7e680c51ea46dc2d1d31 100644 --- a/apps/benchmarks/PoiseuilleChannel/PoiseuilleChannel.cpp +++ b/apps/benchmarks/PoiseuilleChannel/PoiseuilleChannel.cpp @@ -96,6 +96,7 @@ #include <functional> #include <iostream> #include <memory> +#include <type_traits> #include <utility> #include <vector> @@ -153,13 +154,13 @@ template< typename LatticeModel_T, class Enable = void > struct StencilString; template< typename LatticeModel_T > -struct StencilString< LatticeModel_T, typename boost::enable_if_c< boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value >::type > +struct StencilString< LatticeModel_T, typename std::enable_if< std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value >::type > { static const char * str() { return "D3Q19"; } }; template< typename LatticeModel_T > -struct StencilString< LatticeModel_T, typename boost::enable_if_c< boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q27 >::value >::type > +struct StencilString< LatticeModel_T, typename std::enable_if< std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q27 >::value >::type > { static const char * str() { return "D3Q27"; } }; @@ -169,14 +170,14 @@ template< typename LatticeModel_T, class Enable = void > struct CollisionModelString; template< typename LatticeModel_T > -struct CollisionModelString< LatticeModel_T, typename boost::enable_if_c< boost::is_same< typename LatticeModel_T::CollisionModel::tag, +struct CollisionModelString< LatticeModel_T, typename std::enable_if< std::is_same< typename LatticeModel_T::CollisionModel::tag, lbm::collision_model::SRT_tag >::value >::type > { static const char * str() { return "SRT"; } }; template< typename LatticeModel_T > -struct CollisionModelString< LatticeModel_T, typename boost::enable_if_c< boost::is_same< typename LatticeModel_T::CollisionModel::tag, +struct CollisionModelString< LatticeModel_T, typename std::enable_if< std::is_same< typename LatticeModel_T::CollisionModel::tag, lbm::collision_model::TRT_tag >::value >::type > { static const char * str() { return "TRT"; } diff --git a/apps/benchmarks/SchaeferTurek/SchaeferTurek.cpp b/apps/benchmarks/SchaeferTurek/SchaeferTurek.cpp index 42885f9587e0dce2ed2f2e27e334ac312d43da7e..46bd0c3663a74e75114bbd94635272fca517c877 100644 --- a/apps/benchmarks/SchaeferTurek/SchaeferTurek.cpp +++ b/apps/benchmarks/SchaeferTurek/SchaeferTurek.cpp @@ -105,10 +105,6 @@ #include "vtk/Initialization.h" #include "vtk/VTKOutput.h" -#include <boost/mpl/equal_to.hpp> -#include <boost/mpl/int.hpp> -#include <boost/mpl/or.hpp> - #include <algorithm> #include <cmath> #include <cstdlib> @@ -116,6 +112,7 @@ #include <functional> #include <iostream> #include <memory> +#include <type_traits> #include <utility> #include <vector> @@ -196,7 +193,7 @@ const Set<SUID> None( Set<SUID>::emptySet() ); template< typename LatticeModel_T > struct Is2D { - static const bool value = boost::mpl::equal_to< boost::mpl::int_< LatticeModel_T::Stencil::D >, boost::mpl::int_< 2 > >::value; + static const bool value = LatticeModel_T::Stencil::D == 2; }; ///////////////////// @@ -207,25 +204,25 @@ template< typename LatticeModel_T, class Enable = void > struct StencilString; template< typename LatticeModel_T > -struct StencilString< LatticeModel_T, typename boost::enable_if_c< boost::is_same< typename LatticeModel_T::Stencil, stencil::D2Q9 >::value >::type > +struct StencilString< LatticeModel_T, typename std::enable_if< std::is_same< typename LatticeModel_T::Stencil, stencil::D2Q9 >::value >::type > { static const char * str() { return "D2Q9"; } }; template< typename LatticeModel_T > -struct StencilString< LatticeModel_T, typename boost::enable_if_c< boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q15 >::value >::type > +struct StencilString< LatticeModel_T, typename std::enable_if< std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q15 >::value >::type > { static const char * str() { return "D3Q15"; } }; template< typename LatticeModel_T > -struct StencilString< LatticeModel_T, typename boost::enable_if_c< boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value >::type > +struct StencilString< LatticeModel_T, typename std::enable_if< std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value >::type > { static const char * str() { return "D3Q19"; } }; template< typename LatticeModel_T > -struct StencilString< LatticeModel_T, typename boost::enable_if_c< boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q27 >::value >::type > +struct StencilString< LatticeModel_T, typename std::enable_if< std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q27 >::value >::type > { static const char * str() { return "D3Q27"; } }; @@ -235,21 +232,21 @@ template< typename LatticeModel_T, class Enable = void > struct CollisionModelString; template< typename LatticeModel_T > -struct CollisionModelString< LatticeModel_T, typename boost::enable_if_c< boost::is_same< typename LatticeModel_T::CollisionModel::tag, +struct CollisionModelString< LatticeModel_T, typename std::enable_if< std::is_same< typename LatticeModel_T::CollisionModel::tag, lbm::collision_model::SRT_tag >::value >::type > { static const char * str() { return "SRT"; } }; template< typename LatticeModel_T > -struct CollisionModelString< LatticeModel_T, typename boost::enable_if_c< boost::is_same< typename LatticeModel_T::CollisionModel::tag, +struct CollisionModelString< LatticeModel_T, typename std::enable_if< std::is_same< typename LatticeModel_T::CollisionModel::tag, lbm::collision_model::TRT_tag >::value >::type > { static const char * str() { return "TRT"; } }; template< typename LatticeModel_T > -struct CollisionModelString< LatticeModel_T, typename boost::enable_if_c< boost::is_same< typename LatticeModel_T::CollisionModel::tag, +struct CollisionModelString< LatticeModel_T, typename std::enable_if< std::is_same< typename LatticeModel_T::CollisionModel::tag, lbm::collision_model::MRT_tag >::value >::type > { static const char * str() { return "MRT"; } @@ -2313,11 +2310,11 @@ struct AddRefinementTimeStep }; template< typename LatticeModel_T > -struct AddRefinementTimeStep< LatticeModel_T, typename boost::enable_if< boost::mpl::or_< boost::is_same< typename LatticeModel_T::CollisionModel::tag, - lbm::collision_model::MRT_tag >, - boost::is_same< typename LatticeModel_T::Stencil, stencil::D2Q9 >, - boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q15 >, - boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q27 > > >::type > +struct AddRefinementTimeStep< LatticeModel_T, typename std::enable_if< std::is_same< typename LatticeModel_T::CollisionModel::tag, lbm::collision_model::MRT_tag >::value || + std::is_same< typename LatticeModel_T::Stencil, stencil::D2Q9 >::value || + std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q15 >::value || + std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q27 >::value + >::type > { static void add( SweepTimeloop & timeloop, shared_ptr< blockforest::StructuredBlockForest > & blocks, const BlockDataID & pdfFieldId, const BlockDataID & flagFieldId, const BlockDataID & boundaryHandlingId, diff --git a/apps/benchmarks/UniformGrid/UniformGrid.cpp b/apps/benchmarks/UniformGrid/UniformGrid.cpp index 0324c7190e3cd1692541a433d33992ab4c16f260..f237a4b8f51e342ef205e873393c109b9067b6db 100644 --- a/apps/benchmarks/UniformGrid/UniformGrid.cpp +++ b/apps/benchmarks/UniformGrid/UniformGrid.cpp @@ -143,14 +143,14 @@ template< typename LatticeModel_T, class Enable = void > struct StencilString; template< typename LatticeModel_T > -struct StencilString< LatticeModel_T, typename boost::enable_if_c< boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value >::type > +struct StencilString< LatticeModel_T, typename std::enable_if< std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value >::type > { static const char * str() { return "D3Q19"; } }; template< typename LatticeModel_T > -struct StencilString< LatticeModel_T, typename boost::enable_if_c< boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q27 >::value >::type > +struct StencilString< LatticeModel_T, typename std::enable_if< std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q27 >::value >::type > { static const char * str() { return "D3Q27"; } }; @@ -159,28 +159,28 @@ template< typename LatticeModel_T, class Enable = void > struct CollisionModelString; template< typename LatticeModel_T > -struct CollisionModelString< LatticeModel_T, typename boost::enable_if_c< boost::is_same< typename LatticeModel_T::CollisionModel::tag, +struct CollisionModelString< LatticeModel_T, typename std::enable_if< std::is_same< typename LatticeModel_T::CollisionModel::tag, lbm::collision_model::SRT_tag >::value >::type > { static const char * str() { return "SRT"; } }; template< typename LatticeModel_T > -struct CollisionModelString< LatticeModel_T, typename boost::enable_if_c< boost::is_same< typename LatticeModel_T::CollisionModel::tag, +struct CollisionModelString< LatticeModel_T, typename std::enable_if< std::is_same< typename LatticeModel_T::CollisionModel::tag, lbm::collision_model::TRT_tag >::value >::type > { static const char * str() { return "TRT"; } }; template< typename LatticeModel_T > -struct CollisionModelString< LatticeModel_T, typename boost::enable_if_c< boost::is_same< typename LatticeModel_T::CollisionModel::tag, +struct CollisionModelString< LatticeModel_T, typename std::enable_if< std::is_same< typename LatticeModel_T::CollisionModel::tag, lbm::collision_model::MRT_tag >::value >::type > { static const char * str() { return "MRT"; } }; template< typename LatticeModel_T > -struct CollisionModelString< LatticeModel_T, typename boost::enable_if_c< boost::is_same< typename LatticeModel_T::CollisionModel::tag, +struct CollisionModelString< LatticeModel_T, typename std::enable_if< std::is_same< typename LatticeModel_T::CollisionModel::tag, lbm::collision_model::Cumulant_tag >::value >::type > { static const char * str() { return "Cumulant"; } @@ -593,12 +593,9 @@ struct AddLB }; template< typename LatticeModel_T > -struct AddLB< LatticeModel_T, typename boost::enable_if_c< boost::mpl::or_< - boost::is_same< typename LatticeModel_T::CollisionModel::tag, - lbm::collision_model::MRT_tag >, - boost::is_same< typename LatticeModel_T::CollisionModel::tag, - lbm::collision_model::Cumulant_tag > - >::value >::type > +struct AddLB< LatticeModel_T, typename std::enable_if< std::is_same< typename LatticeModel_T::CollisionModel::tag, lbm::collision_model::MRT_tag >::value || + std::is_same< typename LatticeModel_T::CollisionModel::tag, lbm::collision_model::Cumulant_tag >::value + >::type > { using PdfField = typename Types< LatticeModel_T >::PdfField_T; using CommunicationStencil = typename Types< LatticeModel_T >::CommunicationStencil_T; diff --git a/src/blockforest/loadbalancing/DynamicCurve.h b/src/blockforest/loadbalancing/DynamicCurve.h index c7984261d016aae89a8ec5abc416199ae68419f5..678642067f037a2f8e95bbd61bed5116a0526de1 100644 --- a/src/blockforest/loadbalancing/DynamicCurve.h +++ b/src/blockforest/loadbalancing/DynamicCurve.h @@ -37,6 +37,7 @@ #include <map> #include <set> #include <stack> +#include <type_traits> #include <vector> @@ -176,7 +177,7 @@ private: bool weightedBlocks() const { - return ! boost::is_same< PhantomData_T, NoPhantomData >::value; + return ! std::is_same< PhantomData_T, NoPhantomData >::value; } template< typename T > diff --git a/src/blockforest/loadbalancing/DynamicDiffusive.h b/src/blockforest/loadbalancing/DynamicDiffusive.h index 0fb756206581c5e27d53ff5e2fce91e4f8854562..47a932e988a42805b451c6dbc5625d8c7b5d41c3 100644 --- a/src/blockforest/loadbalancing/DynamicDiffusive.h +++ b/src/blockforest/loadbalancing/DynamicDiffusive.h @@ -34,6 +34,7 @@ #include <map> #include <set> +#include <type_traits> #include <vector> @@ -115,7 +116,7 @@ private: double weight( const PhantomBlock * block ) const { - return boost::is_same< PhantomData_T, NoPhantomData >::value ? 1.0 : + return std::is_same< PhantomData_T, NoPhantomData >::value ? 1.0 : numeric_cast< double >( block->template getData< PhantomData_T >().weight() ); } diff --git a/src/boundary/Boundary.h b/src/boundary/Boundary.h index 2ba3afa7d4af8bfc72172fabc0e8929781ce590c..8d83aea92e3db51f7a045495dd19615e0ad071f0 100644 --- a/src/boundary/Boundary.h +++ b/src/boundary/Boundary.h @@ -26,8 +26,7 @@ #include "core/debug/Debug.h" #include "core/DataTypes.h" -#include <boost/type_traits/is_unsigned.hpp> -#include <boost/utility/enable_if.hpp> +#include <type_traits> namespace walberla { namespace boundary { @@ -118,7 +117,7 @@ template< typename flag_t > class Boundary { public: - static_assert( boost::is_unsigned<flag_t>::value, "You are trying to instantiate walberla::boundary::Boundary with " + static_assert( std::is_unsigned<flag_t>::value, "You are trying to instantiate walberla::boundary::Boundary with " "a flag_t which is not an unsigned integer!" ); #ifndef NDEBUG @@ -157,7 +156,7 @@ struct isThreadSafe }; template< typename Boundary_T > -struct isThreadSafe< Boundary_T, typename boost::enable_if_c< Boundary_T::threadsafe >::type > +struct isThreadSafe< Boundary_T, typename std::enable_if< Boundary_T::threadsafe >::type > { static const bool value = Boundary_T::threadsafe; }; diff --git a/src/boundary/BoundaryHandling.h b/src/boundary/BoundaryHandling.h index 0645ebc8839c8c6f512a8855d043255256a1f8eb..981cc3e4fc34f960951631c0202e428d6a5d3269 100644 --- a/src/boundary/BoundaryHandling.h +++ b/src/boundary/BoundaryHandling.h @@ -42,6 +42,7 @@ #include <boost/tuple/tuple.hpp> #include <ostream> #include <string> +#include <type_traits> #include <vector> @@ -391,9 +392,9 @@ private: template< typename Boundary_T, typename Head, typename Tail > inline const Boundary_T & getBoundaryCondition( const BoundaryUID & uid, const boost::tuples::cons<Head, Tail> & boundaryConditions, - typename boost::enable_if< boost::is_same< Boundary_T, Head > >::type* /*dummy*/ = 0, - typename boost::enable_if< boost::is_same< typename boost::is_same< Tail, boost::tuples::null_type >::type, - boost::false_type > >::type* /*dummy*/ = 0 ) const + typename std::enable_if< std::is_same< Boundary_T, Head >::value >::type* /*dummy*/ = 0, + typename std::enable_if< std::is_same< typename std::is_same< Tail, boost::tuples::null_type >::type, + std::false_type >::value >::type* /*dummy*/ = 0 ) const { if( uid == boundaryConditions.get_head().getUID() ) return boundaryConditions.get_head(); @@ -403,7 +404,7 @@ private: template< typename Boundary_T, typename Head, typename Tail > inline const Boundary_T & getBoundaryCondition( const BoundaryUID & uid, const boost::tuples::cons<Head, boost::tuples::null_type> & boundaryConditions, - typename boost::enable_if< boost::is_same< Boundary_T, Head > >::type* /*dummy*/ = 0 ) const + typename std::enable_if< std::is_same< Boundary_T, Head >::value >::type* /*dummy*/ = 0 ) const { if( uid == boundaryConditions.get_head().getUID() ) return boundaryConditions.get_head(); @@ -417,18 +418,18 @@ private: template< typename Boundary_T, typename Head, typename Tail > inline const Boundary_T & getBoundaryCondition( const BoundaryUID & uid, const boost::tuples::cons<Head, Tail> & boundaryConditions, - typename boost::enable_if< boost::is_same< typename boost::is_same< Boundary_T, Head >::type, - boost::false_type > >::type* /*dummy*/ = 0, - typename boost::enable_if< boost::is_same< typename boost::is_same< Tail, boost::tuples::null_type >::type, - boost::false_type > >::type* /*dummy*/ = 0 ) const + typename std::enable_if< std::is_same< typename std::is_same< Boundary_T, Head >::type, + std::false_type >::value >::type* /*dummy*/ = 0, + typename std::enable_if< std::is_same< typename std::is_same< Tail, boost::tuples::null_type >::type, + std::false_type >::value >::type* /*dummy*/ = 0 ) const { return getBoundaryCondition< Boundary_T, typename Tail::head_type, typename Tail::tail_type >( uid, boundaryConditions.get_tail() ); } template< typename Boundary_T, typename Head, typename Tail > inline const Boundary_T & getBoundaryCondition( const BoundaryUID & /*uid*/, const boost::tuples::cons<Head, boost::tuples::null_type> & /*boundaryConditions*/, - typename boost::enable_if< boost::is_same< typename boost::is_same< Boundary_T, Head >::type, - boost::false_type > >::type* /*dummy*/ = 0 ) const + typename std::enable_if< std::is_same< typename std::is_same< Boundary_T, Head >::type, + std::false_type >::value >::type* /*dummy*/ = 0 ) const { static_assert( sizeof(Boundary_T) == 0, "The requested boundary class is not part of this boundary handling." ); } @@ -443,9 +444,9 @@ private: template< typename Boundary_T, typename Head, typename Tail > inline const Boundary_T & getBoundaryCondition_TypeExists( const BoundaryUID & uid, const boost::tuples::cons<Head, Tail> & boundaryConditions, - typename boost::enable_if< boost::is_same< Boundary_T, Head > >::type* /*dummy*/ = 0, - typename boost::enable_if< boost::is_same< typename boost::is_same< Tail, boost::tuples::null_type >::type, - boost::false_type > >::type* /*dummy*/ = 0 ) const + typename std::enable_if< std::is_same< Boundary_T, Head >::value >::type* /*dummy*/ = 0, + typename std::enable_if< std::is_same< typename std::is_same< Tail, boost::tuples::null_type >::type, + std::false_type >::value >::type* /*dummy*/ = 0 ) const { if( uid == boundaryConditions.get_head().getUID() ) return boundaryConditions.get_head(); @@ -455,7 +456,7 @@ private: template< typename Boundary_T, typename Head, typename Tail > inline const Boundary_T & getBoundaryCondition_TypeExists( const BoundaryUID & uid, const boost::tuples::cons<Head, boost::tuples::null_type> & boundaryConditions, - typename boost::enable_if< boost::is_same< Boundary_T, Head > >::type* /*dummy*/ = 0 ) const + typename std::enable_if< std::is_same< Boundary_T, Head >::value >::type* /*dummy*/ = 0 ) const { if( uid == boundaryConditions.get_head().getUID() ) return boundaryConditions.get_head(); @@ -469,18 +470,18 @@ private: template< typename Boundary_T, typename Head, typename Tail > inline const Boundary_T & getBoundaryCondition_TypeExists( const BoundaryUID & uid, const boost::tuples::cons<Head, Tail> & boundaryConditions, - typename boost::enable_if< boost::is_same< typename boost::is_same< Boundary_T, Head >::type, - boost::false_type > >::type* /*dummy*/ = 0, - typename boost::enable_if< boost::is_same< typename boost::is_same< Tail, boost::tuples::null_type >::type, - boost::false_type > >::type* /*dummy*/ = 0 ) const + typename std::enable_if< std::is_same< typename std::is_same< Boundary_T, Head >::type, + std::false_type >::value >::type* /*dummy*/ = 0, + typename std::enable_if< std::is_same< typename std::is_same< Tail, boost::tuples::null_type >::type, + std::false_type >::value >::type* /*dummy*/ = 0 ) const { return getBoundaryCondition_TypeExists< Boundary_T, typename Tail::head_type, typename Tail::tail_type >( uid, boundaryConditions.get_tail() ); } template< typename Boundary_T, typename Head, typename Tail > inline const Boundary_T & getBoundaryCondition_TypeExists( const BoundaryUID & uid, const boost::tuples::cons<Head, boost::tuples::null_type> & /*boundaryConditions*/, - typename boost::enable_if< boost::is_same< typename boost::is_same< Boundary_T, Head >::type, - boost::false_type > >::type* /*dummy*/ = 0 ) const + typename std::enable_if< std::is_same< typename std::is_same< Boundary_T, Head >::type, + std::false_type >::value >::type* /*dummy*/ = 0 ) const { WALBERLA_ABORT( "The requested boundary condition " << uid.getIdentifier() << " is not part of this boundary handling." ); diff --git a/src/boundary/BoundaryHandlingCollection.h b/src/boundary/BoundaryHandlingCollection.h index 7154637364ed6b745507c647bf9dc2b1fa43b69f..b30ba815e269e241b76cb730f0c50c82e2503701 100644 --- a/src/boundary/BoundaryHandlingCollection.h +++ b/src/boundary/BoundaryHandlingCollection.h @@ -36,8 +36,10 @@ #include "field/FlagField.h" #include <boost/tuple/tuple.hpp> + #include <ostream> #include <string> +#include <type_traits> #include <vector> @@ -251,9 +253,9 @@ private: template< typename BoundaryHandling_T, typename Head, typename Tail > inline const BoundaryHandling_T & getBoundaryHandling( const BoundaryHandlingUID & uid, const boost::tuples::cons<Head, Tail> & boundaryHandlers, - typename boost::enable_if< boost::is_same< BoundaryHandling_T, Head > >::type* /*dummy*/ = 0, - typename boost::enable_if< boost::is_same< typename boost::is_same< Tail, boost::tuples::null_type >::type, - boost::false_type > >::type* /*dummy*/ = 0 ) const + typename std::enable_if< std::is_same< BoundaryHandling_T, Head >::value >::type* /*dummy*/ = 0, + typename std::enable_if< std::is_same< typename std::is_same< Tail, boost::tuples::null_type >::type, + std::false_type >::value >::type* /*dummy*/ = 0 ) const { if( uid == boundaryHandlers.get_head().getUID() ) return boundaryHandlers.get_head(); @@ -264,7 +266,7 @@ private: template< typename BoundaryHandling_T, typename Head, typename Tail > inline const BoundaryHandling_T & getBoundaryHandling( const BoundaryHandlingUID & uid, const boost::tuples::cons<Head, boost::tuples::null_type> & boundaryHandlers, - typename boost::enable_if< boost::is_same< BoundaryHandling_T, Head > >::type* /*dummy*/ = 0 ) const + typename std::enable_if< std::is_same< BoundaryHandling_T, Head >::value >::type* /*dummy*/ = 0 ) const { if( uid == boundaryHandlers.get_head().getUID() ) return boundaryHandlers.get_head(); @@ -274,18 +276,18 @@ private: template< typename BoundaryHandling_T, typename Head, typename Tail > inline const BoundaryHandling_T & getBoundaryHandling( const BoundaryHandlingUID & uid, const boost::tuples::cons<Head, Tail> & boundaryHandlers, - typename boost::enable_if< boost::is_same< typename boost::is_same< BoundaryHandling_T, Head >::type, - boost::false_type > >::type* /*dummy*/ = 0, - typename boost::enable_if< boost::is_same< typename boost::is_same< Tail, boost::tuples::null_type >::type, - boost::false_type > >::type* /*dummy*/ = 0 ) const + typename std::enable_if< std::is_same< typename std::is_same< BoundaryHandling_T, Head >::type, + std::false_type >::value >::type* /*dummy*/ = 0, + typename std::enable_if< std::is_same< typename std::is_same< Tail, boost::tuples::null_type >::type, + std::false_type >::value >::type* /*dummy*/ = 0 ) const { return getBoundaryHandling< BoundaryHandling_T, typename Tail::head_type, typename Tail::tail_type >( uid, boundaryHandlers.get_tail() ); } template< typename BoundaryHandling_T, typename Head, typename Tail > inline const BoundaryHandling_T & getBoundaryHandling( const BoundaryHandlingUID & /*uid*/, const boost::tuples::cons<Head, boost::tuples::null_type> & /*boundaryHandlers*/, - typename boost::enable_if< boost::is_same< typename boost::is_same< BoundaryHandling_T, Head >::type, - boost::false_type > >::type* /*dummy*/ = 0 ) const + typename std::enable_if< std::is_same< typename std::is_same< BoundaryHandling_T, Head >::type, + std::false_type >::value >::type* /*dummy*/ = 0 ) const { static_assert( sizeof(BoundaryHandling_T) == 0, "The requested boundary handling is not part of this boundary handling collection." ); } @@ -300,9 +302,9 @@ private: template< typename BoundaryHandling_T, typename Head, typename Tail > inline const BoundaryHandling_T & getBoundaryHandling_TypeExists( const BoundaryHandlingUID & uid, const boost::tuples::cons<Head, Tail> & boundaryHandlers, - typename boost::enable_if< boost::is_same< BoundaryHandling_T, Head > >::type* /*dummy*/ = 0, - typename boost::enable_if< boost::is_same< typename boost::is_same< Tail, boost::tuples::null_type >::type, - boost::false_type > >::type* /*dummy*/ = 0 ) const + typename std::enable_if< std::is_same< BoundaryHandling_T, Head >::value >::type* /*dummy*/ = 0, + typename std::enable_if< std::is_same< typename std::is_same< Tail, boost::tuples::null_type >::type, + std::false_type >::value >::type* /*dummy*/ = 0 ) const { if( uid == boundaryHandlers.get_head().getUID() ) return boundaryHandlers.get_head(); @@ -313,7 +315,7 @@ private: template< typename BoundaryHandling_T, typename Head, typename Tail > inline const BoundaryHandling_T & getBoundaryHandling_TypeExists( const BoundaryHandlingUID & uid, const boost::tuples::cons<Head, boost::tuples::null_type> & boundaryHandlers, - typename boost::enable_if< boost::is_same< BoundaryHandling_T, Head > >::type* /*dummy*/ = 0 ) const + typename std::enable_if< std::is_same< BoundaryHandling_T, Head >::value >::type* /*dummy*/ = 0 ) const { if( uid == boundaryHandlers.get_head().getUID() ) return boundaryHandlers.get_head(); @@ -323,18 +325,18 @@ private: template< typename BoundaryHandling_T, typename Head, typename Tail > inline const BoundaryHandling_T & getBoundaryHandling_TypeExists( const BoundaryHandlingUID & uid, const boost::tuples::cons<Head, Tail> & boundaryHandlers, - typename boost::enable_if< boost::is_same< typename boost::is_same< BoundaryHandling_T, Head >::type, - boost::false_type > >::type* /*dummy*/ = 0, - typename boost::enable_if< boost::is_same< typename boost::is_same< Tail, boost::tuples::null_type >::type, - boost::false_type > >::type* /*dummy*/ = 0 ) const + typename std::enable_if< std::is_same< typename std::is_same< BoundaryHandling_T, Head >::type, + std::false_type >::value >::type* /*dummy*/ = 0, + typename std::enable_if< std::is_same< typename std::is_same< Tail, boost::tuples::null_type >::type, + std::false_type >::value >::type* /*dummy*/ = 0 ) const { return getBoundaryHandling_TypeExists< BoundaryHandling_T, typename Tail::head_type, typename Tail::tail_type >( uid, boundaryHandlers.get_tail() ); } template< typename BoundaryHandling_T, typename Head, typename Tail > inline const BoundaryHandling_T & getBoundaryHandling_TypeExists( const BoundaryHandlingUID & uid, const boost::tuples::cons<Head, boost::tuples::null_type> & /*boundaryHandlers*/, - typename boost::enable_if< boost::is_same< typename boost::is_same< BoundaryHandling_T, Head >::type, - boost::false_type > >::type* /*dummy*/ = 0 ) const + typename std::enable_if< std::is_same< typename std::is_same< BoundaryHandling_T, Head >::type, + std::false_type >::value >::type* /*dummy*/ = 0 ) const { WALBERLA_ABORT( "The requested boundary handler " << uid.getIdentifier() << " is not part of this boundary handling collection." ); } diff --git a/src/core/FunctionTraits.h b/src/core/FunctionTraits.h new file mode 100644 index 0000000000000000000000000000000000000000..cc8b1e35f0f7d1aca1436507e4b971bd01170050 --- /dev/null +++ b/src/core/FunctionTraits.h @@ -0,0 +1,60 @@ +//====================================================================================================================== +// +// This file is part of waLBerla. waLBerla is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// waLBerla is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with waLBerla (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file FunctionTraits.h +//! \ingroup core +//! \author Christoph Schwarzmeier <christoph.schwarzmeier@fau.de> +// +//====================================================================================================================== + +#pragma once + +#include <cstddef> +#include <tuple> + +namespace walberla { + +//********************************************************************************************************************** +/*! Gives a function's return type as well as the number and type of arguments accepted by a function. +* +* This variadic template substitutes <boost/function_traits>. +* +* Usage: +* FunctionTraits<F>::return_type Type returned by function type F. +* FunctionTraits<F>::arity Number of arguments accepted by function type F. +* FunctionTraits<F>::argument<N> Type of the Nth argument of function type F with 0 <= N < arity of F. +* +*/ +//********************************************************************************************************************** + +template< typename F > +struct FunctionTraits; + +template< typename R, typename ...Args > +struct FunctionTraits< R( Args... ) > +{ + using return_type = R; + + static constexpr std::size_t arity = sizeof...(Args); + + template< std::size_t N > + struct argument + { + static_assert(N < arity, "Error: Parameter index is not valid!"); + using type = typename std::tuple_element< N, std::tuple<Args...> >::type; + }; +}; + +} // namespace walberla \ No newline at end of file diff --git a/src/core/VectorTrait.h b/src/core/VectorTrait.h index 20796c5fc190ecbbd07f918a1aa33988392db6bc..0909f4075011098526ada7d6cfb25678ed852f61 100644 --- a/src/core/VectorTrait.h +++ b/src/core/VectorTrait.h @@ -22,9 +22,7 @@ #pragma once -#include <boost/type_traits/is_arithmetic.hpp> - -#include <boost/utility/enable_if.hpp> +#include <type_traits> namespace walberla { @@ -45,7 +43,7 @@ struct VectorTrait static const uint_t F_SIZE = 1u; static T get ( T value, uint_t /*f*/ ) { return value; } static void set( T & value, uint_t /*f*/, T val ) { value = val; } - static_assert( boost::is_arithmetic<T>::value, "Specialize OutputTrait for your type!" ); + static_assert( std::is_arithmetic<T>::value, "Specialize OutputTrait for your type!" ); }; diff --git a/src/core/debug/CheckFunctions.h b/src/core/debug/CheckFunctions.h index 61808427be29dcb8d358e19b25a4c393c70ccd59..04444255cbec2bcf722ccee3d9f8788a6abb7b9a 100644 --- a/src/core/debug/CheckFunctions.h +++ b/src/core/debug/CheckFunctions.h @@ -28,10 +28,6 @@ #include "core/math/Utility.h" #include "core/VectorTrait.h" -#include <boost/type_traits/is_arithmetic.hpp> -#include <boost/type_traits/is_floating_point.hpp> -#include <boost/type_traits/has_left_shift.hpp> - #include <cmath> #include <cstdlib> #include <cstring> @@ -40,6 +36,7 @@ #include <limits> #include <locale> #include <sstream> +#include <type_traits> @@ -240,19 +237,19 @@ template< typename T, typename U > inline bool check_equal( const T & lhs, const U & rhs ); template< typename T, typename U > -inline bool check_equal( const T & lhs, const U & rhs, const boost::true_type & ); +inline bool check_equal( const T & lhs, const U & rhs, const std::true_type & ); template< typename T, typename U > -inline bool check_equal( const T & lhs, const U & rhs, const boost::false_type & ); +inline bool check_equal( const T & lhs, const U & rhs, const std::false_type & ); template< typename T, typename U > inline bool check_unequal( const T & lhs, const U & rhs ); template< typename T, typename U > -inline bool check_unequal( const T & lhs, const U & rhs, const boost::true_type & ); +inline bool check_unequal( const T & lhs, const U & rhs, const std::true_type & ); template< typename T, typename U > -inline bool check_unequal( const T & lhs, const U & rhs, const boost::false_type & ); +inline bool check_unequal( const T & lhs, const U & rhs, const std::false_type & ); template< typename T, typename U > inline bool check_float_equal( const T & lhs, const U & rhs ); @@ -270,55 +267,55 @@ template< typename T, typename U > inline bool check_identical( const T & lhs, const U & rhs ); template< typename T, typename U > -inline bool check_identical( const T & lhs, const U & rhs, const boost::true_type & ); +inline bool check_identical( const T & lhs, const U & rhs, const std::true_type & ); template< typename T, typename U > -inline bool check_identical( const T & lhs, const U & rhs, const boost::false_type & ); +inline bool check_identical( const T & lhs, const U & rhs, const std::false_type & ); template< typename T, typename U > inline bool check_not_identical( const T & lhs, const U & rhs ); template< typename T, typename U > -inline bool check_not_identical( const T & lhs, const U & rhs, const boost::true_type & ); +inline bool check_not_identical( const T & lhs, const U & rhs, const std::true_type & ); template< typename T, typename U > -inline bool check_not_identical( const T & lhs, const U & rhs, const boost::false_type & ); +inline bool check_not_identical( const T & lhs, const U & rhs, const std::false_type & ); template< typename T, typename U > inline bool check_less( const T & lhs, const U & rhs ); template< typename T, typename U > -inline bool check_less( const T & lhs, const U & rhs, const boost::true_type & ); +inline bool check_less( const T & lhs, const U & rhs, const std::true_type & ); template< typename T, typename U > -inline bool check_less( const T & lhs, const U & rhs, const boost::false_type & ); +inline bool check_less( const T & lhs, const U & rhs, const std::false_type & ); template< typename T, typename U > inline bool check_greater( const T & lhs, const U & rhs ); template< typename T, typename U > -inline bool check_greater( const T & lhs, const U & rhs, const boost::true_type & ); +inline bool check_greater( const T & lhs, const U & rhs, const std::true_type & ); template< typename T, typename U > -inline bool check_greater( const T & lhs, const U & rhs, const boost::false_type & ); +inline bool check_greater( const T & lhs, const U & rhs, const std::false_type & ); template< typename T, typename U > inline bool check_less_equal( const T & lhs, const U & rhs ); template< typename T, typename U > -inline bool check_less_equal( const T & lhs, const U & rhs, const boost::true_type & ); +inline bool check_less_equal( const T & lhs, const U & rhs, const std::true_type & ); template< typename T, typename U > -inline bool check_less_equal( const T & lhs, const U & rhs, const boost::false_type & ); +inline bool check_less_equal( const T & lhs, const U & rhs, const std::false_type & ); template< typename T, typename U > inline bool check_greater_equal( const T & lhs, const U & rhs ); template< typename T, typename U > -inline bool check_greater_equal( const T & lhs, const U & rhs, const boost::true_type & ); +inline bool check_greater_equal( const T & lhs, const U & rhs, const std::true_type & ); template< typename T, typename U > -inline bool check_greater_equal( const T & lhs, const U & rhs, const boost::false_type & ); +inline bool check_greater_equal( const T & lhs, const U & rhs, const std::false_type & ); @@ -394,10 +391,10 @@ template< typename T > std::ostream & printValue( std::ostream & os, const T & value ); template< typename T > -std::ostream & printValue( std::ostream & os, const T & value, const boost::true_type & ); +std::ostream & printValue( std::ostream & os, const T & value, const std::true_type & ); template< typename T > -std::ostream & printValue( std::ostream & os, const T & value, const boost::false_type & ); +std::ostream & printValue( std::ostream & os, const T & value, const std::false_type & ); template< typename T > std::ostream & printValue( std::ostream & os, const T * value ); diff --git a/src/core/debug/CheckFunctions.impl.h b/src/core/debug/CheckFunctions.impl.h index 71f0895654f7c16d2e3f49a0b76de941c196679a..d8f7e384cf0539a2533fcb563c7ab049afa2a705 100644 --- a/src/core/debug/CheckFunctions.impl.h +++ b/src/core/debug/CheckFunctions.impl.h @@ -20,9 +20,13 @@ //====================================================================================================================== + +#include "core/debug/OperatorCheck.h" + #include <algorithm> +#include <type_traits> -#include <boost/type_traits/integral_constant.hpp> +#include <type_traits> /// \cond internal @@ -57,19 +61,19 @@ inline bool check_not_nullptr( const shared_ptr<T> & p ) template< typename T, typename U > inline bool check_equal( const T & lhs, const U & rhs ) { - typedef boost::integral_constant<bool, boost::is_arithmetic<T>::value && boost::is_arithmetic<U>::value> truth_type; + typedef std::integral_constant<bool, std::is_arithmetic<T>::value && std::is_arithmetic<U>::value> truth_type; return check_equal( lhs, rhs, truth_type() ); } template< typename T, typename U > -inline bool check_equal( const T & lhs, const U & rhs, const boost::true_type & ) +inline bool check_equal( const T & lhs, const U & rhs, const std::true_type & ) { typedef typename math::MathTrait<T,U>::High HighType; return static_cast<HighType>(lhs) == static_cast<HighType>(rhs); } template< typename T, typename U > -inline bool check_equal( const T & lhs, const U & rhs, const boost::false_type & ) +inline bool check_equal( const T & lhs, const U & rhs, const std::false_type & ) { return lhs == rhs; } @@ -77,19 +81,19 @@ inline bool check_equal( const T & lhs, const U & rhs, const boost::false_type & template< typename T, typename U > inline bool check_unequal( const T & lhs, const U & rhs ) { - typedef boost::integral_constant<bool, boost::is_arithmetic<T>::value && boost::is_arithmetic<U>::value> truth_type; + typedef std::integral_constant<bool, std::is_arithmetic<T>::value && std::is_arithmetic<U>::value> truth_type; return check_unequal( lhs, rhs, truth_type() ); } template< typename T, typename U > -inline bool check_unequal( const T & lhs, const U & rhs, const boost::true_type & ) +inline bool check_unequal( const T & lhs, const U & rhs, const std::true_type & ) { typedef typename math::MathTrait<T,U>::High HighType; return static_cast<HighType>(lhs) != static_cast<HighType>(rhs); } template< typename T, typename U > -inline bool check_unequal( const T & lhs, const U & rhs, const boost::false_type & ) +inline bool check_unequal( const T & lhs, const U & rhs, const std::false_type & ) { return lhs != rhs; } @@ -97,8 +101,8 @@ inline bool check_unequal( const T & lhs, const U & rhs, const boost::false_type template< typename T, typename U > inline bool check_float_equal( const T & lhs, const U & rhs ) { - static_assert( boost::is_floating_point<T>::value, "First operand type T is not a floating point type!"); - static_assert( boost::is_floating_point<U>::value, "Second operand type U is not a floating point type!"); + static_assert( std::is_floating_point<T>::value, "First operand type T is not a floating point type!"); + static_assert( std::is_floating_point<U>::value, "Second operand type U is not a floating point type!"); typedef typename math::MathTrait<T,U>::Low LowType; @@ -111,8 +115,8 @@ inline bool check_float_equal( const T & lhs, const U & rhs ) template< typename T, typename U > inline bool check_float_unequal( const T & lhs, const U & rhs ) { - static_assert( boost::is_floating_point<T>::value, "First operand type T is not a floating point type!"); - static_assert( boost::is_floating_point<U>::value, "Second operand type U is not a floating point type!"); + static_assert( std::is_floating_point<T>::value, "First operand type T is not a floating point type!"); + static_assert( std::is_floating_point<U>::value, "Second operand type U is not a floating point type!"); typedef typename math::MathTrait<T,U>::Low LowType; @@ -126,8 +130,8 @@ template< typename T, typename U > inline bool check_float_equal_eps( const T & lhs, const U & rhs, const typename VectorTrait<typename math::MathTrait<T,U>::LowType>::OutputType epsilon ) { - static_assert( boost::is_floating_point<T>::value, "First operand type T is not a floating point type!"); - static_assert( boost::is_floating_point<U>::value, "Second operand type U is not a floating point type!"); + static_assert( std::is_floating_point<T>::value, "First operand type T is not a floating point type!"); + static_assert( std::is_floating_point<U>::value, "Second operand type U is not a floating point type!"); typedef typename math::MathTrait<T,U>::Low LowType; @@ -141,8 +145,8 @@ template< typename T, typename U > inline bool check_float_unequal_eps( const T & lhs, const U & rhs, const typename VectorTrait<typename math::MathTrait<T,U>::LowType>::OutputType epsilon ) { - static_assert( boost::is_floating_point<T>::value, "First operand type T is not a floating point type!"); - static_assert( boost::is_floating_point<U>::value, "Second operand type U is not a floating point type!"); + static_assert( std::is_floating_point<T>::value, "First operand type T is not a floating point type!"); + static_assert( std::is_floating_point<U>::value, "Second operand type U is not a floating point type!"); typedef typename math::MathTrait<T,U>::Low LowType; @@ -155,19 +159,19 @@ inline bool check_float_unequal_eps( const T & lhs, const U & rhs, template< typename T, typename U > inline bool check_identical( const T & lhs, const U & rhs ) { - typedef boost::integral_constant<bool, boost::is_arithmetic<T>::value && boost::is_arithmetic<U>::value> truth_type; + typedef std::integral_constant<bool, std::is_arithmetic<T>::value && std::is_arithmetic<U>::value> truth_type; return check_identical( lhs, rhs, truth_type() ); } template< typename T, typename U > -inline bool check_identical( const T & lhs, const U & rhs, const boost::true_type & ) +inline bool check_identical( const T & lhs, const U & rhs, const std::true_type & ) { typedef typename math::MathTrait<T,U>::High HighType; return isIdentical( static_cast<HighType>(lhs), static_cast<HighType>(rhs) ); } template< typename T, typename U > -inline bool check_identical( const T & lhs, const U & rhs, const boost::false_type & ) +inline bool check_identical( const T & lhs, const U & rhs, const std::false_type & ) { return lhs == rhs; } @@ -175,19 +179,19 @@ inline bool check_identical( const T & lhs, const U & rhs, const boost::false_ty template< typename T, typename U > inline bool check_not_identical( const T & lhs, const U & rhs ) { - typedef boost::integral_constant<bool, boost::is_arithmetic<T>::value && boost::is_arithmetic<U>::value> truth_type; + typedef std::integral_constant<bool, std::is_arithmetic<T>::value && std::is_arithmetic<U>::value> truth_type; return check_not_identical( lhs, rhs, truth_type() ); } template< typename T, typename U > -inline bool check_not_identical( const T & lhs, const U & rhs, const boost::true_type & ) +inline bool check_not_identical( const T & lhs, const U & rhs, const std::true_type & ) { typedef typename math::MathTrait<T,U>::High HighType; return !isIdentical( static_cast<HighType>(lhs), static_cast<HighType>(rhs) ); } template< typename T, typename U > -inline bool check_not_identical( const T & lhs, const U & rhs, const boost::false_type & ) +inline bool check_not_identical( const T & lhs, const U & rhs, const std::false_type & ) { return lhs != rhs; } @@ -195,19 +199,19 @@ inline bool check_not_identical( const T & lhs, const U & rhs, const boost::fals template< typename T, typename U > inline bool check_less( const T & lhs, const U & rhs ) { - typedef boost::integral_constant<bool, boost::is_arithmetic<T>::value && boost::is_arithmetic<U>::value> truth_type; + typedef std::integral_constant<bool, std::is_arithmetic<T>::value && std::is_arithmetic<U>::value> truth_type; return check_less( lhs, rhs, truth_type() ); } template< typename T, typename U > -inline bool check_less( const T & lhs, const U & rhs, const boost::true_type & ) +inline bool check_less( const T & lhs, const U & rhs, const std::true_type & ) { typedef typename math::MathTrait<T,U>::High HighType; return static_cast<HighType>(lhs) < static_cast<HighType>(rhs); } template< typename T, typename U > -inline bool check_less( const T & lhs, const U & rhs, const boost::false_type & ) +inline bool check_less( const T & lhs, const U & rhs, const std::false_type & ) { return lhs < rhs; } @@ -215,19 +219,19 @@ inline bool check_less( const T & lhs, const U & rhs, const boost::false_type & template< typename T, typename U > inline bool check_greater( const T & lhs, const U & rhs ) { - typedef boost::integral_constant<bool, boost::is_arithmetic<T>::value && boost::is_arithmetic<U>::value> truth_type; + typedef std::integral_constant<bool, std::is_arithmetic<T>::value && std::is_arithmetic<U>::value> truth_type; return check_greater( lhs, rhs, truth_type() ); } template< typename T, typename U > -inline bool check_greater( const T & lhs, const U & rhs, const boost::true_type & ) +inline bool check_greater( const T & lhs, const U & rhs, const std::true_type & ) { typedef typename math::MathTrait<T,U>::High HighType; return static_cast<HighType>(lhs) > static_cast<HighType>(rhs); } template< typename T, typename U > -inline bool check_greater( const T & lhs, const U & rhs, const boost::false_type & ) +inline bool check_greater( const T & lhs, const U & rhs, const std::false_type & ) { return lhs > rhs; } @@ -235,19 +239,19 @@ inline bool check_greater( const T & lhs, const U & rhs, const boost::false_type template< typename T, typename U > inline bool check_less_equal( const T & lhs, const U & rhs ) { - typedef boost::integral_constant<bool, boost::is_arithmetic<T>::value && boost::is_arithmetic<U>::value> truth_type; + typedef std::integral_constant<bool, std::is_arithmetic<T>::value && std::is_arithmetic<U>::value> truth_type; return check_less_equal( lhs, rhs, truth_type() ); } template< typename T, typename U > -inline bool check_less_equal( const T & lhs, const U & rhs, const boost::true_type & ) +inline bool check_less_equal( const T & lhs, const U & rhs, const std::true_type & ) { typedef typename math::MathTrait<T,U>::High HighType; return static_cast<HighType>(lhs) <= static_cast<HighType>(rhs); } template< typename T, typename U > -inline bool check_less_equal( const T & lhs, const U & rhs, const boost::false_type & ) +inline bool check_less_equal( const T & lhs, const U & rhs, const std::false_type & ) { return lhs <= rhs; } @@ -255,19 +259,19 @@ inline bool check_less_equal( const T & lhs, const U & rhs, const boost::false_t template< typename T, typename U > inline bool check_greater_equal( const T & lhs, const U & rhs ) { - typedef boost::integral_constant<bool, boost::is_arithmetic<T>::value && boost::is_arithmetic<U>::value> truth_type; + typedef std::integral_constant<bool, std::is_arithmetic<T>::value && std::is_arithmetic<U>::value> truth_type; return check_greater_equal( lhs, rhs, truth_type() ); } template< typename T, typename U > -inline bool check_greater_equal( const T & lhs, const U & rhs, const boost::true_type & ) +inline bool check_greater_equal( const T & lhs, const U & rhs, const std::true_type & ) { typedef typename math::MathTrait<T,U>::High HighType; return static_cast<HighType>(lhs) >= static_cast<HighType>(rhs); } template< typename T, typename U > -inline bool check_greater_equal( const T & lhs, const U & rhs, const boost::false_type & ) +inline bool check_greater_equal( const T & lhs, const U & rhs, const std::false_type & ) { return lhs >= rhs; } @@ -493,17 +497,17 @@ void printErrorAndExit( const T & lhs, const U & rhs, const char * const lhsExpr template< typename T > std::ostream & printValue( std::ostream & os, const T & value ) { - return printValue( os, value, boost::has_left_shift<std::ostream, T>() ); + return printValue( os, value, has_left_shift<std::ostream&, T&>() ); } template< typename T > -std::ostream & printValue( std::ostream & os, const T & value, const boost::true_type & ) +std::ostream & printValue( std::ostream & os, const T & value, const std::true_type & ) { return os << value; } template< typename T > -std::ostream & printValue( std::ostream & os, const T & /*value*/, const boost::false_type & ) +std::ostream & printValue( std::ostream & os, const T & /*value*/, const std::false_type & ) { return os << "[N/A: Type can not be streamed to std::ostream]"; } diff --git a/src/core/debug/OperatorCheck.h b/src/core/debug/OperatorCheck.h new file mode 100644 index 0000000000000000000000000000000000000000..a9b3792970dadab5ed9b7a9d0430cba83f7157f1 --- /dev/null +++ b/src/core/debug/OperatorCheck.h @@ -0,0 +1,92 @@ +//====================================================================================================================== +// +// This file is part of waLBerla. waLBerla is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// waLBerla is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with waLBerla (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file Debug.h +//! \ingroup core +//! \author Christoph Schwarzmeier <christoph.schwarzmeier@fau.de> +//! \brief Check whether a type implements a certain operator. +// +//====================================================================================================================== + +#include <algorithm> +#include <functional> +#include <iostream> +#include <string> +#include <utility> + +namespace walberla { +namespace debug { + +//********************************************************************************************************************** +/*! +* The implementation is directly taken from https://stackoverflow.com/a/39348287 +*/ +//********************************************************************************************************************** + +template<class X, class Y, class Op> +struct op_valid_impl +{ + template<class U, class L, class R> + static auto test(int) -> decltype(std::declval<U>()(std::declval<L>(), std::declval<R>()), void(), std::true_type()); + + template<class U, class L, class R> + static auto test(...) -> std::false_type; + + using type = decltype(test<Op, X, Y>(0)); + +}; + +template<class X, class Y, class Op> using op_valid = typename op_valid_impl<X, Y, Op>::type; + +namespace notstd { + +struct left_shift { + + template <class L, class R> + constexpr auto operator()(L&& l, R&& r) const + noexcept(noexcept(std::forward<L>(l) << std::forward<R>(r))) + -> decltype(std::forward<L>(l) << std::forward<R>(r)) + { + return std::forward<L>(l) << std::forward<R>(r); + } +}; + +struct right_shift { + + template <class L, class R> + constexpr auto operator()(L&& l, R&& r) const + noexcept(noexcept(std::forward<L>(l) >> std::forward<R>(r))) + -> decltype(std::forward<L>(l) >> std::forward<R>(r)) + { + return std::forward<L>(l) >> std::forward<R>(r); + } +}; + +} + +template<class X, class Y> using has_equality = op_valid<X, Y, std::equal_to<>>; +template<class X, class Y> using has_inequality = op_valid<X, Y, std::not_equal_to<>>; +template<class X, class Y> using has_less_than = op_valid<X, Y, std::less<>>; +template<class X, class Y> using has_less_equal = op_valid<X, Y, std::less_equal<>>; +template<class X, class Y> using has_greater_than = op_valid<X, Y, std::greater<>>; +template<class X, class Y> using has_greater_equal = op_valid<X, Y, std::greater_equal<>>; +template<class X, class Y> using has_bit_xor = op_valid<X, Y, std::bit_xor<>>; +template<class X, class Y> using has_bit_or = op_valid<X, Y, std::bit_or<>>; +template<class X, class Y> using has_left_shift = op_valid<X, Y, notstd::left_shift>; +template<class X, class Y> using has_right_shift = op_valid<X, Y, notstd::right_shift>; + + +} // namespace debug +} // namespace walberla \ No newline at end of file diff --git a/src/core/load_balancing/MetisWrapper.cpp b/src/core/load_balancing/MetisWrapper.cpp index 4d8d08a1177afd3464a2f0e86fe8793dca500fab..a3d89aaec14ed6259e8c754aecc18386ab3ea766 100644 --- a/src/core/load_balancing/MetisWrapper.cpp +++ b/src/core/load_balancing/MetisWrapper.cpp @@ -27,7 +27,7 @@ #include "core/Abort.h" -#include <boost/type_traits/is_same.hpp> +#include <type_traits> #ifdef WALBERLA_BUILD_WITH_METIS @@ -78,8 +78,8 @@ int METIS_PartGraphKway( ::walberla::int64_t *nvtxs, ::walberla::int64_t *ncon, ::walberla::int64_t *vwgt, ::walberla::int64_t *vsize, ::walberla::int64_t *adjwgt, ::walberla::int64_t *nparts, double *tpwgts, double *ubvec, ::walberla::int64_t *options, ::walberla::int64_t *edgecut, ::walberla::int64_t *part) { - static_assert(boost::is_same< ::walberla::int64_t, ::idx_t >::value, "You have to compile the metis library with 64-bit wide integer type support!"); - static_assert(boost::is_same< double, ::real_t >::value, "You have to compile the metis library with 64-bit wide floating-point type support!"); + static_assert(std::is_same< ::walberla::int64_t, ::idx_t >::value, "You have to compile the metis library with 64-bit wide integer type support!"); + static_assert(std::is_same< double, ::real_t >::value, "You have to compile the metis library with 64-bit wide floating-point type support!"); return ::METIS_PartGraphKway( nvtxs, ncon, xadj, adjncy, vwgt, vsize, adjwgt, nparts, tpwgts, ubvec, options, edgecut, part ); } @@ -89,15 +89,15 @@ int METIS_PartGraphRecursive( ::walberla::int64_t *nvtxs, ::walberla::int64_t *n ::walberla::int64_t *vwgt, ::walberla::int64_t *vsize, ::walberla::int64_t *adjwgt, ::walberla::int64_t *nparts, double *tpwgts, double *ubvec, ::walberla::int64_t *options, ::walberla::int64_t *edgecut, ::walberla::int64_t *part) { - static_assert(boost::is_same< ::walberla::int64_t, ::idx_t >::value, "You have to compile the metis library with 64-bit wide integer type support!"); - static_assert(boost::is_same< double, ::real_t >::value, "You have to compile the metis library with 64-bit wide floating-point type support!"); + static_assert(std::is_same< ::walberla::int64_t, ::idx_t >::value, "You have to compile the metis library with 64-bit wide integer type support!"); + static_assert(std::is_same< double, ::real_t >::value, "You have to compile the metis library with 64-bit wide floating-point type support!"); return ::METIS_PartGraphRecursive( nvtxs, ncon, xadj, adjncy, vwgt, vsize, adjwgt, nparts, tpwgts, ubvec, options, edgecut, part ); } int METIS_SetDefaultOptions( ::walberla::int64_t *options ) { - static_assert(boost::is_same< ::walberla::int64_t, ::idx_t >::value, "You have to compile the metis library with 64-bit wide integer type support!"); + static_assert(std::is_same< ::walberla::int64_t, ::idx_t >::value, "You have to compile the metis library with 64-bit wide integer type support!"); return ::METIS_SetDefaultOptions( options ); } diff --git a/src/core/load_balancing/ParMetisWrapper.cpp b/src/core/load_balancing/ParMetisWrapper.cpp index e1d2a237548934b45a7fd24ff0d7f04c238ce7c0..40a7c58e8e404dc2dce5c383344e7215b2485289 100644 --- a/src/core/load_balancing/ParMetisWrapper.cpp +++ b/src/core/load_balancing/ParMetisWrapper.cpp @@ -64,7 +64,7 @@ #include "core/Abort.h" -#include <boost/type_traits/is_same.hpp> +#include <type_traits> namespace walberla { @@ -79,8 +79,8 @@ int ParMETIS_V3_AdaptiveRepart( ::walberla::int64_t *options, ::walberla::int64_t *edgecut, ::walberla::int64_t *part, MPI_Comm *comm ) { - static_assert( boost::is_same< ::walberla::int64_t, ::idx_t >::value, "You have to compile the metis library with 64-bit wide integer type support!" ); - static_assert( boost::is_same< double, ::real_t >::value, "You have to compile the metis library with 64-bit wide floating-point type support!" ); + static_assert( std::is_same< ::walberla::int64_t, ::idx_t >::value, "You have to compile the metis library with 64-bit wide integer type support!" ); + static_assert( std::is_same< double, ::real_t >::value, "You have to compile the metis library with 64-bit wide floating-point type support!" ); return ::ParMETIS_V3_AdaptiveRepart( vtxdist, xadj, adjncy, vwgt, vsize, adjwgt, wgtflag, numflag, ncon, @@ -94,8 +94,8 @@ int ParMETIS_V3_PartKway( double *tpwgts, double *ubvec, ::walberla::int64_t *options, ::walberla::int64_t *edgecut, ::walberla::int64_t *part, MPI_Comm *comm ) { - static_assert( boost::is_same< ::walberla::int64_t, ::idx_t >::value, "You have to compile the metis library with 64-bit wide integer type support!" ); - static_assert( boost::is_same< double, ::real_t >::value, "You have to compile the metis library with 64-bit wide floating-point type support!" ); + static_assert( std::is_same< ::walberla::int64_t, ::idx_t >::value, "You have to compile the metis library with 64-bit wide integer type support!" ); + static_assert( std::is_same< double, ::real_t >::value, "You have to compile the metis library with 64-bit wide floating-point type support!" ); return ::ParMETIS_V3_PartKway( vtxdist, xadj, adjncy, vwgt, adjwgt, wgtflag, numflag, ncon, nparts, @@ -109,8 +109,8 @@ int ParMETIS_V3_PartGeomKway( ::walberla::int64_t *ncon, ::walberla::int64_t *nparts, double *tpwgts, double *ubvec, ::walberla::int64_t *options, ::walberla::int64_t *edgecut, ::walberla::int64_t *part, MPI_Comm *comm ) { - static_assert( boost::is_same< ::walberla::int64_t, ::idx_t >::value, "You have to compile the metis library with 64-bit wide integer type support!" ); - static_assert( boost::is_same< double, ::real_t >::value, "You have to compile the metis library with 64-bit wide floating-point type support!" ); + static_assert( std::is_same< ::walberla::int64_t, ::idx_t >::value, "You have to compile the metis library with 64-bit wide integer type support!" ); + static_assert( std::is_same< double, ::real_t >::value, "You have to compile the metis library with 64-bit wide floating-point type support!" ); return ::ParMETIS_V3_PartGeomKway( vtxdist, xadj, adjncy, vwgt, adjwgt, wgtflag, numflag, ndims, xyz, @@ -121,8 +121,8 @@ int ParMETIS_V3_PartGeomKway( int ParMETIS_V3_PartGeom( ::walberla::int64_t *vtxdist, ::walberla::int64_t *ndims, double *xyz, ::walberla::int64_t *part, MPI_Comm *comm ) { - static_assert( boost::is_same< ::walberla::int64_t, ::idx_t >::value, "You have to compile the metis library with 64-bit wide integer type support!" ); - static_assert( boost::is_same< double, ::real_t >::value, "You have to compile the metis library with 64-bit wide floating-point type support!" ); + static_assert( std::is_same< ::walberla::int64_t, ::idx_t >::value, "You have to compile the metis library with 64-bit wide integer type support!" ); + static_assert( std::is_same< double, ::real_t >::value, "You have to compile the metis library with 64-bit wide floating-point type support!" ); return ::ParMETIS_V3_PartGeom( vtxdist, ndims, xyz, part, comm ); } @@ -133,8 +133,8 @@ int ParMETIS_V3_RefineKway( double *tpwgts, double *ubvec, ::walberla::int64_t *options, ::walberla::int64_t *edgecut, ::walberla::int64_t *part, MPI_Comm *comm ) { - static_assert( boost::is_same< ::walberla::int64_t, ::idx_t >::value, "You have to compile the metis library with 64-bit wide integer type support!" ); - static_assert( boost::is_same< double, ::real_t >::value, "You have to compile the metis library with 64-bit wide floating-point type support!" ); + static_assert( std::is_same< ::walberla::int64_t, ::idx_t >::value, "You have to compile the metis library with 64-bit wide integer type support!" ); + static_assert( std::is_same< double, ::real_t >::value, "You have to compile the metis library with 64-bit wide floating-point type support!" ); return ::ParMETIS_V3_RefineKway( vtxdist, xadj, adjncy, vwgt, adjwgt, wgtflag, numflag, ncon, nparts, diff --git a/src/core/math/DistributedSample.h b/src/core/math/DistributedSample.h index 14e716e6a9ed159ea6c511ab0139dd682ebe45fa..e8c817d9506bee09b24b73ce6adc0bcc9b17a49f 100644 --- a/src/core/math/DistributedSample.h +++ b/src/core/math/DistributedSample.h @@ -24,9 +24,7 @@ #include "core/DataTypes.h" -#include <boost/type_traits/is_arithmetic.hpp> -#include <boost/type_traits/remove_reference.hpp> - +#include <type_traits> #include <iterator> #include <vector> @@ -101,7 +99,7 @@ private: template< typename T > void DistributedSample::castToRealAndInsert( const T & val ) { - static_assert( boost::is_arithmetic<T>::value, "You can only use DistributedSample::castToRealAndInsert with " \ + static_assert( std::is_arithmetic<T>::value, "You can only use DistributedSample::castToRealAndInsert with " \ "arithmetic types!" ); insert( numeric_cast< real_t >( val ) ); @@ -110,7 +108,7 @@ void DistributedSample::castToRealAndInsert( const T & val ) template <class InputIterator> void DistributedSample::castToRealAndInsert( InputIterator first, InputIterator last ) { - static_assert( boost::is_arithmetic< typename std::iterator_traits<InputIterator>::value_type >::value, + static_assert( std::is_arithmetic< typename std::iterator_traits<InputIterator>::value_type >::value, "You can only use DistributedSample::castToRealAndInsert with sequences of arithmetic types!" ); while( first != last ) diff --git a/src/core/math/GenericAABB.h b/src/core/math/GenericAABB.h index 9a11d29281b2d11da771c2ced3dc25f44f59ad54..4664a48a3e821e356488629fbf70fa2b3fbda897 100644 --- a/src/core/math/GenericAABB.h +++ b/src/core/math/GenericAABB.h @@ -27,9 +27,8 @@ #include "core/mpi/RecvBuffer.h" #include "core/mpi/SendBuffer.h" -#include <boost/type_traits/is_floating_point.hpp> - #include <random> +#include <type_traits> namespace walberla { @@ -45,7 +44,7 @@ namespace math { template< typename T > class GenericAABB { - static_assert( boost::is_floating_point< T >::value, "GenericAABB only works with floating point types for T!" ); + static_assert( std::is_floating_point< T >::value, "GenericAABB only works with floating point types for T!" ); public: // Typedefs diff --git a/src/core/math/Matrix3.h b/src/core/math/Matrix3.h index 54119bee96b0cdca50d44ffd4f1dee8ef054a53c..85efdb583907f405e0fe39ba546533444f4d03cc 100644 --- a/src/core/math/Matrix3.h +++ b/src/core/math/Matrix3.h @@ -32,8 +32,7 @@ #include "core/mpi/RecvBuffer.h" #include "core/mpi/SendBuffer.h" -#include <boost/type_traits/is_arithmetic.hpp> -#include <boost/utility/enable_if.hpp> +#include <type_traits> #include <algorithm> #include <cmath> @@ -148,8 +147,8 @@ public: template< typename Other > inline const Vector3<HIGH> operator* ( const Vector3<Other>& rhs ) const; template< typename Other > inline const Matrix3<HIGH> operator* ( const Matrix3<Other>& rhs ) const; - template< typename Other > inline typename boost::enable_if< boost::is_arithmetic<Other>, Matrix3& >::type operator*=( Other rhs ); - template< typename Other > inline typename boost::enable_if< boost::is_arithmetic<Other>, const Matrix3<HIGH> >::type operator* ( Other rhs ) const; + template< typename Other > inline typename std::enable_if< std::is_arithmetic<Other>::value, Matrix3& >::type operator*=( Other rhs ); + template< typename Other > inline typename std::enable_if< std::is_arithmetic<Other>::value, const Matrix3<HIGH> >::type operator* ( Other rhs ) const; //@} //******************************************************************************************************************* @@ -700,7 +699,7 @@ inline Matrix3<Type>& Matrix3<Type>::operator-=( const Matrix3<Other>& rhs ) */ template< typename Type > template< typename Other > -inline typename boost::enable_if< boost::is_arithmetic<Other>, Matrix3<Type>& >::type Matrix3<Type>::operator*=( Other rhs ) +inline typename std::enable_if< std::is_arithmetic<Other>::value, Matrix3<Type>& >::type Matrix3<Type>::operator*=( Other rhs ) { v_[0] *= rhs; v_[1] *= rhs; @@ -824,7 +823,7 @@ inline const Matrix3<Type> operator-( const Matrix3<Type>& rhs ) */ template< typename Type > template< typename Other > -inline typename boost::enable_if< boost::is_arithmetic<Other> ,const Matrix3<HIGH> >::type Matrix3<Type>::operator*( Other rhs ) const +inline typename std::enable_if< std::is_arithmetic<Other>::value ,const Matrix3<HIGH> >::type Matrix3<Type>::operator*( Other rhs ) const { return Matrix3<HIGH>( v_[0]*rhs, v_[1]*rhs, v_[2]*rhs, v_[3]*rhs, v_[4]*rhs, v_[5]*rhs, @@ -1423,7 +1422,7 @@ inline const Matrix3<Type> fabs( const Matrix3<Type>& m ); //template< typename Type, typename Other > //inline const Matrix3<HIGH> operator*( Other scalar, const Matrix3<Type>& matrix ) //{ -// static_assert( ! boost::is_scalar<Other>::value, "Only scalar types allowed" ); +// static_assert( ! std::is_scalar<Other>::value, "Only scalar types allowed" ); // return matrix*scalar; //} //********************************************************************************************************************** diff --git a/src/core/math/MatrixMxN.h b/src/core/math/MatrixMxN.h index b3d9facebb7fa5141cecf0388cd9d50d50ea603a..70854e2b6f029cfc29b009587cdd8681d024b1a3 100644 --- a/src/core/math/MatrixMxN.h +++ b/src/core/math/MatrixMxN.h @@ -35,9 +35,7 @@ #include <core/Macros.h> #include <core/math/Shims.h> -#include <boost/type_traits/is_const.hpp> -#include <boost/type_traits/is_arithmetic.hpp> -#include <boost/type_traits/is_volatile.hpp> +#include <type_traits> namespace walberla { @@ -91,8 +89,8 @@ class MatrixMxN { //**Compile time checks************************************************************************* /*! \cond internal */ - static_assert(!boost::is_const<Type>::value, "only non const Types are allowed!"); - static_assert(!boost::is_volatile<Type>::value, "only non volatile types are allowed!"); + static_assert(!std::is_const<Type>::value, "only non const Types are allowed!"); + static_assert(!std::is_volatile<Type>::value, "only non volatile types are allowed!"); /*! \endcond */ //********************************************************************************************** diff --git a/src/core/math/Quaternion.h b/src/core/math/Quaternion.h index f6822daf30e9e9c44350f69f7e892c0d4b567cbb..f61ac6f4d37616ecee1fba7f7969539c9699c395 100644 --- a/src/core/math/Quaternion.h +++ b/src/core/math/Quaternion.h @@ -38,9 +38,7 @@ #include "core/mpi/RecvBuffer.h" #include <core/logging/Logging.h> -#include <boost/type_traits/is_floating_point.hpp> -#include <boost/type_traits/is_const.hpp> -#include <boost/type_traits/is_volatile.hpp> +#include <type_traits> #include <cmath> #include <istream> @@ -102,9 +100,9 @@ class Quaternion { //**Compile time checks************************************************************************* /*! \cond internal */ - static_assert(boost::is_floating_point<Type>::value, "T has to be floating point!"); - static_assert(!boost::is_const<Type>::value, "T has to be non const!"); - static_assert(!boost::is_volatile<Type>::value, "T has to be non volatile!"); + static_assert(std::is_floating_point<Type>::value, "T has to be floating point!"); + static_assert(!std::is_const<Type>::value, "T has to be non const!"); + static_assert(!std::is_volatile<Type>::value, "T has to be non volatile!"); /*! \endcond */ //********************************************************************************************** @@ -259,7 +257,7 @@ template< typename Type > // Data type of the quaternion template< typename Axis > // Data type of the rotation axis inline Quaternion<Type>::Quaternion( Vector3<Axis> axis, Type angle ) { - static_assert(boost::is_floating_point<Axis>::value, "Axis has to be floating point!" ); + static_assert(std::is_floating_point<Axis>::value, "Axis has to be floating point!" ); auto axisLength = axis.length(); if( (floatIsEqual(axisLength, 0)) || (math::equal(std::fabs(angle), real_t(0))) ) { diff --git a/src/core/math/RotationMatrix.h b/src/core/math/RotationMatrix.h index 7bb34ac518c8a5d157c0b0abf0d4c4e79ccfaace..8a79b15de0cd3cfcbd0554a18123353a7b293667 100644 --- a/src/core/math/RotationMatrix.h +++ b/src/core/math/RotationMatrix.h @@ -34,14 +34,11 @@ #include "core/DataTypes.h" #include "core/debug/Debug.h" -#include <boost/type_traits/is_floating_point.hpp> -#include <boost/type_traits/is_const.hpp> -#include <boost/type_traits/is_volatile.hpp> - #include <algorithm> #include <cmath> #include <ostream> #include <limits> +#include <type_traits> namespace walberla { namespace math { @@ -142,9 +139,9 @@ class RotationMatrix : public Matrix3<Type> { //**Compile time checks************************************************************************* /*! \cond internal */ - static_assert(boost::is_floating_point<Type>::value, "T has to be floating point!"); - static_assert(!boost::is_const<Type>::value, "T has to be non const!"); - static_assert(!boost::is_volatile<Type>::value, "T has to be non volatile!"); + static_assert(std::is_floating_point<Type>::value, "T has to be floating point!"); + static_assert(!std::is_const<Type>::value, "T has to be non const!"); + static_assert(!std::is_volatile<Type>::value, "T has to be non volatile!"); /*! \endcond */ //********************************************************************************************** @@ -332,7 +329,7 @@ template< typename Type > // Data type of the rotation matrix template< typename Axis > // Data type of the rotation axis RotationMatrix<Type>::RotationMatrix( Vector3<Axis> axis, Type angle ) { - static_asser(boost::is_floating_point<Axis>::value, "Axis has to be floating point!"); + static_asser(std::is_floating_point<Axis>::value, "Axis has to be floating point!"); WALBERLA_ASSERT( ( axis.sqrLength() > Axis(0) || angle == Type(0) ), "Invalid matrix parameters" ); @@ -745,7 +742,7 @@ template< typename Other > // Data type of the standard matrix inline const Matrix3< typename MathTrait<Type,Other>::MultType > RotationMatrix<Type>::rotate( const Matrix3<Other>& m ) const { - static_assert(boost::is_floating_point<Other>::value, "Other has to be floating point!"); + static_assert(std::is_floating_point<Other>::value, "Other has to be floating point!"); typedef typename MathTrait<Type,Other>::MultType MT; @@ -809,7 +806,7 @@ template< typename Other > // Data type of the diagonal standard matrix inline const Matrix3< typename MathTrait<Type,Other>::MultType > RotationMatrix<Type>::diagRotate( const Matrix3<Other>& m ) const { - static_assert(boost::is_floating_point<Other>::value, "Other has to be floating point!"); + static_assert(std::is_floating_point<Other>::value, "Other has to be floating point!"); typedef typename MathTrait<Type,Other>::MultType MT; diff --git a/src/core/math/Sample.h b/src/core/math/Sample.h index 87d0ed4a9f140f24c89e9e67c90c2321ab4662e1..66328ea420df718321b05e408e17407e958787bd 100644 --- a/src/core/math/Sample.h +++ b/src/core/math/Sample.h @@ -26,9 +26,7 @@ #include "core/math/KahanSummation.h" #include "core/mpi/BufferDataTypeExtensions.h" -#include <boost/type_traits/is_arithmetic.hpp> -#include <boost/type_traits/remove_reference.hpp> - +#include <type_traits> #include <algorithm> #include <cmath> #include <iosfwd> @@ -94,7 +92,7 @@ std::ostream & operator<<( std::ostream & os, const Sample & statReal ); template< typename T > Sample::iterator Sample::castToRealAndInsert(const T& val) { - static_assert( boost::is_arithmetic<T>::value, "You can only use Sample::castToRealAndInsert with " \ + static_assert( std::is_arithmetic<T>::value, "You can only use Sample::castToRealAndInsert with " \ "arithmetic types!" ); return insert( numeric_cast<value_type>( val ) ); @@ -103,7 +101,7 @@ Sample::iterator Sample::castToRealAndInsert(const T& val) template< typename T > Sample::iterator Sample::castToRealAndInsert(const_iterator position, const T& val) { - static_assert( boost::is_arithmetic<T>::value, "You can only use Sample::castToRealAndInsert with " \ + static_assert( std::is_arithmetic<T>::value, "You can only use Sample::castToRealAndInsert with " \ "arithmetic types!" ); return insert( position, numeric_cast<value_type>( val ) ); @@ -112,7 +110,7 @@ Sample::iterator Sample::castToRealAndInsert(const_iterator position, const T& v template <class InputIterator> void Sample::castToRealAndInsert(InputIterator first, InputIterator last) { - static_assert( boost::is_arithmetic< typename std::iterator_traits<InputIterator>::value_type >::value, + static_assert( std::is_arithmetic< typename std::iterator_traits<InputIterator>::value_type >::value, "You can only use Sample::castToRealAndInsert with sequences of arithmetic types!" ); while( first != last ) diff --git a/src/core/math/Shims.h b/src/core/math/Shims.h index e25ed61a464ce7ea62b5221064635385bf38a907..6a62a996a087ed35a87bc659314498c0129f0b9a 100644 --- a/src/core/math/Shims.h +++ b/src/core/math/Shims.h @@ -23,7 +23,7 @@ #pragma once -#include <boost/type_traits/is_floating_point.hpp> +#include <type_traits> namespace walberla { namespace math { diff --git a/src/core/math/Uint.h b/src/core/math/Uint.h index fdfc8ca491490e8138fef4f07ae80c82342a1efc..71fe07fea66854388b105fc465f5c544ef9d37d8 100644 --- a/src/core/math/Uint.h +++ b/src/core/math/Uint.h @@ -25,7 +25,7 @@ #include "core/DataTypes.h" #include "core/debug/Debug.h" -#include <boost/type_traits/is_unsigned.hpp> +#include <type_traits> namespace walberla { @@ -150,7 +150,7 @@ static const uint8_t msbLookupTable[256] = //********************************************************************************************************************** template< typename UINT > uint_t uintMSBPosition( UINT value ) { - static_assert( boost::is_unsigned< UINT >::value, "uintMSBPosition can only be used with unsigned integer types!" ); + static_assert( std::is_unsigned< UINT >::value, "uintMSBPosition can only be used with unsigned integer types!" ); switch( std::numeric_limits<UINT>::digits ) { diff --git a/src/core/math/Utility.h b/src/core/math/Utility.h index ba1f62c108f555806fe92f9d62effe2187cf6e16..de5f00f75c5caf9e0d975926db3584625f712124 100644 --- a/src/core/math/Utility.h +++ b/src/core/math/Utility.h @@ -49,7 +49,7 @@ inline const T sign( T a ); template< typename T > inline const typename std::enable_if< std::is_unsigned<T>::value, T >::type abs( T a ); template< typename T > -inline const typename std::enable_if< !std::is_unsigned<T>::value, T >::type abs( T a ); +inline const typename std::enable_if< ! std::is_unsigned<T>::value, T >::type abs( T a ); template< typename T1, typename T2 > diff --git a/src/core/math/Vector2.h b/src/core/math/Vector2.h index 220bb21b060b4f81a7d0a48c244b34732bfd72bd..b09038329a709ec04af02e0246cd9529b2ca9639 100644 --- a/src/core/math/Vector2.h +++ b/src/core/math/Vector2.h @@ -37,15 +37,10 @@ #include "core/mpi/RecvBuffer.h" #include "core/mpi/SendBuffer.h" -#include <boost/type_traits/is_floating_point.hpp> -#include <boost/type_traits/is_fundamental.hpp> -#include <boost/type_traits/is_same.hpp> -#include <boost/utility/enable_if.hpp> - #include <cmath> #include <iostream> #include <limits> - +#include <type_traits> namespace walberla { namespace math { @@ -88,7 +83,7 @@ namespace math { template< typename Type > class Vector2 { - static_assert( boost::is_arithmetic<Type>::value, "Vector2 only accepts arithmetic data types" ); + static_assert( std::is_arithmetic<Type>::value, "Vector2 only accepts arithmetic data types" ); private: //**Friend declarations************************************************************************* @@ -222,7 +217,7 @@ template< typename Type > template< typename Other > inline Vector2<Type>::Vector2( Other init ) { - static_assert( boost::is_arithmetic<Other>::value, "Vector2 only accepts arithmetic data types in Vector2( Other init )"); + static_assert( std::is_arithmetic<Other>::value, "Vector2 only accepts arithmetic data types in Vector2( Other init )"); v_[0] = v_[1] = init; } @@ -1325,7 +1320,7 @@ inline bool operator!=( long double scalar, const Vector2<Type>& vec ) // \return The scaled result vector. */ template< typename Type, typename Other > -inline typename boost::enable_if_c< boost::is_fundamental<Other>::value, Vector2<HIGH> >::type +inline typename std::enable_if< std::is_fundamental<Other>::value, Vector2<HIGH> >::type operator*( Other scalar, const Vector2<Type>& vec ) { return vec * scalar; @@ -1523,9 +1518,9 @@ inline const Vector2<Type> fabs( const Vector2<Type>& v ) template<typename T> Vector2<T> & normalize( Vector2<T> & v ) { - static_assert( boost::is_floating_point<T>::value, + static_assert( std::is_floating_point<T>::value, "You can only normalize floating point vectors in-place!"); - static_assert( (boost::is_same<T, typename Vector2<T>::Length>::value), + static_assert( (std::is_same<T, typename Vector2<T>::Length>::value), "The type of your Vector2's length does not match its element type!" ); const T len( v.length() ); diff --git a/src/core/math/Vector3.h b/src/core/math/Vector3.h index e0c2965795ab2a9c00f06fff7af96d348c7e6ef6..eb0e848168ce0bd9aa31f11691756bc838e3a42b 100644 --- a/src/core/math/Vector3.h +++ b/src/core/math/Vector3.h @@ -38,16 +38,10 @@ #include "core/mpi/SendBuffer.h" #include "core/debug/CheckFunctions.h" -#include <boost/type_traits.hpp> -#include <boost/type_traits/is_floating_point.hpp> -#include <boost/type_traits/is_fundamental.hpp> -#include <boost/type_traits/is_same.hpp> -#include <boost/type_traits/is_arithmetic.hpp> -#include <boost/utility/enable_if.hpp> - #include <cmath> #include <iostream> #include <limits> +#include <type_traits> namespace walberla { @@ -89,7 +83,7 @@ namespace math { template< typename Type > class Vector3 { - static_assert( boost::is_arithmetic<Type>::value, "Vector3 only accepts arithmetic data types" ); + static_assert( std::is_arithmetic<Type>::value, "Vector3 only accepts arithmetic data types" ); private: //**Friend declarations************************************************************************* @@ -229,7 +223,7 @@ template< typename Type > template< typename Other > inline Vector3<Type>::Vector3( Other init ) { - static_assert( boost::is_arithmetic<Other>::value, "Vector3 only accepts arithmetic data types in Vector3( Other init )"); + static_assert( std::is_arithmetic<Other>::value, "Vector3 only accepts arithmetic data types in Vector3( Other init )"); v_[0] = v_[1] = v_[2] = numeric_cast<Type>(init); } @@ -1477,7 +1471,7 @@ inline bool operator!=( long double scalar, const Vector3<Type>& vec ) // \return The scaled result vector. */ template< typename Type, typename Other > -inline typename boost::enable_if_c< boost::is_fundamental<Other>::value, Vector3<HIGH> >::type +inline typename std::enable_if< std::is_fundamental<Other>::value, Vector3<HIGH> >::type operator*( Other scalar, const Vector3<Type>& vec ) { return vec * scalar; @@ -1744,9 +1738,9 @@ inline void normals(const Vector3<Type>& v, Vector3<Type>& defNor, Vector3<Type> template<typename T> Vector3<T> & normalize( Vector3<T> & v ) { - static_assert( boost::is_floating_point<T>::value, + static_assert( std::is_floating_point<T>::value, "You can only normalize floating point vectors in-place!"); - static_assert( (boost::is_same<T, typename Vector3<T>::Length>::value), + static_assert( (std::is_same<T, typename Vector3<T>::Length>::value), "The type of your Vector3's length does not match its element type!" ); const T len( v.length() ); diff --git a/src/core/mpi/BufferSizeTrait.h b/src/core/mpi/BufferSizeTrait.h index 097a09deafce30bca544ae7edc1e67e7876ed2cc..365c911544336370004a5e7da057964c3e234550 100644 --- a/src/core/mpi/BufferSizeTrait.h +++ b/src/core/mpi/BufferSizeTrait.h @@ -25,8 +25,7 @@ #include "core/DataTypes.h" -#include <boost/utility/enable_if.hpp> -#include <boost/type_traits/is_enum.hpp> +#include <type_traits> namespace walberla { @@ -68,7 +67,7 @@ namespace mpi { // Specialization for all enums template< typename T> - struct BufferSizeTrait< T, typename boost::enable_if< boost::is_enum< T > >::type > + struct BufferSizeTrait< T, typename std::enable_if< std::is_enum< T >::value >::type > { static const bool constantSize = true; static const size_t size = sizeof( T ) + BUFFER_DEBUG_OVERHEAD; diff --git a/src/core/mpi/RecvBuffer.h b/src/core/mpi/RecvBuffer.h index 19d45825ed2f6d00d8f8fdbd27e91cfc4dc23445..c35b0c2aaf427e90f775fb814e3fe95f96027598 100644 --- a/src/core/mpi/RecvBuffer.h +++ b/src/core/mpi/RecvBuffer.h @@ -32,13 +32,9 @@ #include "core/debug/Debug.h" #include "core/Sanitizer.h" -#include <boost/mpl/logical.hpp> -#include <boost/type_traits/is_enum.hpp> -#include <boost/type_traits/is_arithmetic.hpp> -#include <boost/utility/enable_if.hpp> - #include <algorithm> #include <cstring> +#include <type_traits> namespace walberla { namespace mpi { @@ -128,7 +124,7 @@ public: /*!\name Operators */ //@{ template< typename V > - typename boost::enable_if< boost::mpl::or_< boost::is_arithmetic<V>, boost::is_enum<V> >, + typename std::enable_if< std::is_arithmetic<V>::value || std::is_enum<V>::value, GenericRecvBuffer& >::type operator>>( V& value ); //@} @@ -163,7 +159,7 @@ private: /*!\name Utility functions */ //@{ template< typename V > - typename boost::enable_if< boost::mpl::or_< boost::is_arithmetic<V>, boost::is_enum<V> >, + typename std::enable_if< std::is_arithmetic<V>::value || std::is_enum<V>::value, GenericRecvBuffer& >::type get( V& value ); //@} @@ -172,7 +168,7 @@ private: //**Compile time checks********************************************************************************************** - static_assert( boost::is_arithmetic<T>::value, "SendBuffer<T>: T has to be native datatype" ) ; + static_assert( std::is_arithmetic<T>::value, "SendBuffer<T>: T has to be native datatype" ) ; //******************************************************************************************************************* }; //********************************************************************************************************************** @@ -389,12 +385,12 @@ inline bool GenericRecvBuffer<T>::isEmpty() const */ template< typename T > // Element type template< typename V > // Type of the built-in data value -typename boost::enable_if< boost::mpl::or_< boost::is_arithmetic<V>, boost::is_enum<V> >, +typename std::enable_if< std::is_arithmetic<V>::value || std::is_enum<V>::value, GenericRecvBuffer<T> & >::type GenericRecvBuffer<T>::get( V& value ) { // Compile time check that V is built-in data type - static_assert( boost::is_arithmetic<V>::value || boost::is_enum<V>::value, + static_assert( std::is_arithmetic<V>::value || std::is_enum<V>::value, "RecvBuffer accepts only built-in data types"); @@ -431,7 +427,7 @@ GenericRecvBuffer<T>::get( V& value ) */ template< typename T > // Element type template< typename V > // Type of the built-in data value -typename boost::enable_if< boost::mpl::or_< boost::is_arithmetic<V>, boost::is_enum<V> >, +typename std::enable_if< std::is_arithmetic<V>::value || std::is_enum<V>::value, GenericRecvBuffer<T> & >::type GenericRecvBuffer<T>::operator>>( V& value ) { @@ -554,7 +550,7 @@ template< typename T > // Element type template< typename V > // Type of the built-in data value inline void GenericRecvBuffer<T>::peek( V& value ) const { - WALBERLA_STATIC_ASSERT( boost::is_arithmetic<V>::value ); + WALBERLA_STATIC_ASSERT( std::is_arithmetic<V>::value ); WALBERLA_STATIC_ASSERT( sizeof(V) > sizeof(T) ); WALBERLA_STATIC_ASSERT( sizeof(V) % sizeof(T) == 0); diff --git a/src/core/mpi/Reduce.h b/src/core/mpi/Reduce.h index cc1ba91c2fd564b077458249f3740a9a94716850..f60502868477906d5981d85d013b055c43edd83d 100644 --- a/src/core/mpi/Reduce.h +++ b/src/core/mpi/Reduce.h @@ -29,8 +29,7 @@ #include "core/mpi/MPIManager.h" #include "core/mpi/MPIWrapper.h" -#include <boost/type_traits/is_arithmetic.hpp> -#include <boost/type_traits/is_same.hpp> +#include <type_traits> #include <vector> @@ -77,7 +76,7 @@ inline MPI_Op toMPI_Op( Operation operation ) template< typename T > void reduceInplace( T & value, Operation operation, int recvRank = 0, MPI_Comm comm = MPI_COMM_WORLD ) { - static_assert( boost::is_arithmetic<T>::value, "reduceInplace(...) may only by called with integer or floating point types!" ); + static_assert( std::is_arithmetic<T>::value, "reduceInplace(...) may only by called with integer or floating point types!" ); WALBERLA_NON_MPI_SECTION() { @@ -156,7 +155,7 @@ inline void reduceInplace( bool & value, Operation operation, int recvRank = 0, template< typename T > T reduce( const T value, Operation operation, int recvRank = 0, MPI_Comm comm = MPI_COMM_WORLD ) { - static_assert( boost::is_arithmetic<T>::value, "reduce(...) may only by called with integer or floating point types!" ); + static_assert( std::is_arithmetic<T>::value, "reduce(...) may only by called with integer or floating point types!" ); WALBERLA_NON_MPI_SECTION() { @@ -238,8 +237,8 @@ inline bool reduce( const bool value, Operation operation, int recvRank = 0, MPI template< typename T > void reduceInplace( std::vector<T> & values, Operation operation, int recvRank = 0, MPI_Comm comm = MPI_COMM_WORLD ) { - static_assert( boost::is_arithmetic<T>::value, "reduceInplace(...) may only by called with integer or floating point types!" ); - static_assert( (!boost::is_same<T, bool>::value), "reduceInplace(...) may not be called with std::vector<bool>!" ); + static_assert( std::is_arithmetic<T>::value, "reduceInplace(...) may only by called with integer or floating point types!" ); + static_assert( (!std::is_same<T, bool>::value), "reduceInplace(...) may not be called with std::vector<bool>!" ); WALBERLA_NON_MPI_SECTION() { @@ -321,7 +320,7 @@ inline void reduceInplace( std::vector<bool> & values, Operation operation, int template< typename T > T allReduce( const T & value, Operation operation, MPI_Comm comm = MPI_COMM_WORLD ) { - static_assert( boost::is_arithmetic<T>::value, "allReduce(...) may only by called with integer or floating point types!" ); + static_assert( std::is_arithmetic<T>::value, "allReduce(...) may only by called with integer or floating point types!" ); WALBERLA_NON_MPI_SECTION() { return value; } @@ -374,7 +373,7 @@ inline bool allReduce( const bool value, Operation operation, MPI_Comm comm = MP template< typename T > void allReduceInplace( T & value, Operation operation, MPI_Comm comm = MPI_COMM_WORLD ) { - static_assert( boost::is_arithmetic<T>::value, "allReduceInplace(...) may only by called with integer or floating point types!" ); + static_assert( std::is_arithmetic<T>::value, "allReduceInplace(...) may only by called with integer or floating point types!" ); WALBERLA_NON_MPI_SECTION() { return; } @@ -422,8 +421,8 @@ inline void allReduceInplace( bool & value, Operation operation, MPI_Comm comm = template< typename T > void allReduceInplace( std::vector<T> & values, Operation operation, MPI_Comm comm = MPI_COMM_WORLD ) { - static_assert( boost::is_arithmetic<T>::value, "allReduceInplace(...) may only by called with integer or floating point types!" ); - static_assert( (!boost::is_same<T, bool>::value), "allReduceInplace(...) may not be called with std::vector<bool>!" ); + static_assert( std::is_arithmetic<T>::value, "allReduceInplace(...) may only by called with integer or floating point types!" ); + static_assert( (!std::is_same<T, bool>::value), "allReduceInplace(...) may not be called with std::vector<bool>!" ); WALBERLA_NON_MPI_SECTION() { return; } diff --git a/src/core/mpi/SendBuffer.h b/src/core/mpi/SendBuffer.h index 2b1e11c17409a630b4723483b3dd486f23a4302a..60d8e471f5ed9891749fd9d75d82c12ad309cbd2 100644 --- a/src/core/mpi/SendBuffer.h +++ b/src/core/mpi/SendBuffer.h @@ -34,15 +34,10 @@ #include "core/debug/Debug.h" #include "core/Sanitizer.h" -#include <boost/mpl/logical.hpp> -#include <boost/type_traits/is_enum.hpp> -#include <boost/type_traits/is_arithmetic.hpp> -#include <boost/type_traits/is_fundamental.hpp> -#include <boost/utility/enable_if.hpp> - #include <algorithm> #include <typeinfo> #include <cstring> +#include <type_traits> namespace walberla { namespace mpi { @@ -91,7 +86,7 @@ public: class Ptr { public: - static_assert( boost::is_fundamental<VT>::value, "only fundamental data types are allowed"); + static_assert( std::is_fundamental<VT>::value, "only fundamental data types are allowed"); typedef VT value_type; Ptr(GenericSendBuffer<T, G>& buffer, const std::ptrdiff_t offset, const size_t length) @@ -146,7 +141,7 @@ public: /*!\name Operators */ //@{ template< typename V > - typename boost::enable_if< boost::mpl::or_< boost::is_arithmetic<V>, boost::is_enum<V> >, + typename std::enable_if< std::is_arithmetic<V>::value || std::is_enum<V>::value, GenericSendBuffer& >::type operator<<( V value ); @@ -194,7 +189,7 @@ private: void extendMemory( size_t newCapacity ); template< typename V > - typename boost::enable_if< boost::mpl::or_< boost::is_arithmetic<V>, boost::is_enum<V> >, + typename std::enable_if< std::is_arithmetic<V>::value || std::is_enum<V>::value, GenericSendBuffer& >::type put( V value ); @@ -213,7 +208,7 @@ private: //******************************************************************************************************************* //**Compile time checks********************************************************************************************** - static_assert( boost::is_arithmetic<T>::value, "SendBuffer<T>: T has to be native datatype" ) ; + static_assert( std::is_arithmetic<T>::value, "SendBuffer<T>: T has to be native datatype" ) ; //******************************************************************************************************************* template< typename U > @@ -443,12 +438,12 @@ inline bool GenericSendBuffer<T,G>::isEmpty() const template< typename T // Element type , typename G > // Growth policy template< typename V > // Type of the built-in data value -typename boost::enable_if< boost::mpl::or_< boost::is_arithmetic<V>, boost::is_enum<V> >, +typename std::enable_if< std::is_arithmetic<V>::value || std::is_enum<V>::value, GenericSendBuffer<T,G>& >::type GenericSendBuffer<T,G>::put( V value ) { // Compile time check that V is built-in data type - static_assert( boost::is_arithmetic<V>::value || boost::is_enum<V>::value, + static_assert( std::is_arithmetic<V>::value || std::is_enum<V>::value, "SendBuffer accepts only built-in data types"); static_assert( sizeof(V) >= sizeof(T), "Type that is stored has to be bigger than T" ); @@ -488,7 +483,7 @@ GenericSendBuffer<T,G>::put( V value ) template< typename T // Element type , typename G > // Growth policy template< typename V > // Type of the built-in data value -typename boost::enable_if< boost::mpl::or_< boost::is_arithmetic<V>, boost::is_enum<V> >, +typename std::enable_if< std::is_arithmetic<V>::value || std::is_enum<V>::value, GenericSendBuffer<T,G>& >::type GenericSendBuffer<T,G>::operator<<( V value ) { diff --git a/src/cuda/Kernel.h b/src/cuda/Kernel.h index 44c8d9ab05f3c9938b12cde5059d422dc602e547..cb69aa4fb238200c1bd332b9f2fbc2702f19eb97 100644 --- a/src/cuda/Kernel.h +++ b/src/cuda/Kernel.h @@ -23,11 +23,12 @@ #include "core/Abort.h" #include "core/debug/Debug.h" +#include "core/FunctionTraits.h" #include "ErrorChecking.h" #include <cuda_runtime.h> -#include <boost/type_traits.hpp> +#include <type_traits> #include <vector> @@ -125,18 +126,20 @@ namespace cuda { //** Type checking of parameters ********************************************************************************** /*! \name Type checking of parameters */ //@{ - typedef typename boost::remove_pointer<FuncPtr>::type FuncType; + typedef typename std::remove_pointer<FuncPtr>::type FuncType; #define CHECK_PARAMETER_FUNC( Number ) \ template<typename T> \ - bool checkParameter##Number( typename boost::enable_if_c< (boost::function_traits<FuncType>::arity >= Number ), T >::type * = 0 ) { \ - return boost::is_same< T, typename boost::function_traits<FuncType>::arg##Number##_type >::value; \ + bool checkParameter##Number( typename std::enable_if< (FunctionTraits<FuncType>::arity > Number ), T >::type * = 0 ) { \ + typedef typename FunctionTraits<FuncType>::template argument<Number>::type ArgType; \ + return std::is_same< T, ArgType >::value; \ } \ template<typename T> \ - bool checkParameter##Number( typename boost::disable_if_c< (boost::function_traits<FuncType>::arity >= Number ),T >::type * = 0 ) { \ + bool checkParameter##Number( typename std::enable_if< (FunctionTraits<FuncType>::arity <= Number ),T >::type * = 0 ) { \ return false; \ } + CHECK_PARAMETER_FUNC(0) CHECK_PARAMETER_FUNC(1) CHECK_PARAMETER_FUNC(2) CHECK_PARAMETER_FUNC(3) @@ -144,7 +147,6 @@ namespace cuda { CHECK_PARAMETER_FUNC(5) CHECK_PARAMETER_FUNC(6) CHECK_PARAMETER_FUNC(7) - CHECK_PARAMETER_FUNC(8) #undef CHECK_PARAMETER_FUNC @@ -186,8 +188,8 @@ namespace cuda { paramInfo.resize( sizeof(T) ); std::memcpy ( paramInfo.data(), ¶m, sizeof(T) ); - WALBERLA_ASSERT( checkParameter<T>( params_.size() +1 ), - "cuda::Kernel type mismatch of parameter " << params_.size() +1 ); + WALBERLA_ASSERT( checkParameter<T>( params_.size() ), + "cuda::Kernel type mismatch of parameter " << params_.size() ); params_.push_back( paramInfo ); } @@ -225,9 +227,9 @@ namespace cuda { void Kernel<FP>::operator() ( cudaStream_t stream ) const { // check for correct number of parameter calls - if ( params_.size() != boost::function_traits<FuncType>::arity ) { + if ( params_.size() != FunctionTraits<FuncType>::arity ) { WALBERLA_ABORT( "Error when calling cuda::Kernel - Wrong number of arguments. " << - "Expected " << boost::function_traits<FuncType>::arity << ", received " << params_.size() ); + "Expected " << FunctionTraits<FuncType>::arity << ", received " << params_.size() ); } // register all parameters @@ -248,6 +250,7 @@ namespace cuda { bool Kernel<FP>::checkParameter( uint_t n ) { switch (n) { + case 0: return checkParameter0<T>(); case 1: return checkParameter1<T>(); case 2: return checkParameter2<T>(); case 3: return checkParameter3<T>(); @@ -255,7 +258,6 @@ namespace cuda { case 5: return checkParameter5<T>(); case 6: return checkParameter6<T>(); case 7: return checkParameter7<T>(); - case 8: return checkParameter8<T>(); default: WALBERLA_ABORT("Too many parameters passed to kernel"); } @@ -267,5 +269,3 @@ namespace cuda { } // namespace cuda } // namespace walberla - - diff --git a/src/cuda/python/Exports.impl.h b/src/cuda/python/Exports.impl.h index b828163ed6a494d253f64e83045553079f8c0443..fa1352db9dbed3d49847ff975ce5b2a3b4d421aa 100644 --- a/src/cuda/python/Exports.impl.h +++ b/src/cuda/python/Exports.impl.h @@ -34,7 +34,7 @@ #include "python_coupling/helper/MplHelpers.h" #include "python_coupling/helper/BoostPythonHelpers.h" -#include <boost/type_traits/is_unsigned.hpp> +#include <type_traits> #include <iostream> namespace walberla { diff --git a/src/field/AccuracyEvaluation.h b/src/field/AccuracyEvaluation.h index 5c47ede7332d5cd308ab0b14455f7086878f5b41..036803b431c280d1b611d9e381bd6f7002a9280b 100644 --- a/src/field/AccuracyEvaluation.h +++ b/src/field/AccuracyEvaluation.h @@ -40,7 +40,7 @@ #include <cstdlib> #include <fstream> #include <string> - +#include <type_traits> namespace walberla { @@ -161,7 +161,7 @@ public: L1_( real_t(0) ), L2_( real_t(0) ), Lmax_( real_t(0) ), requiredSelectors_(requiredSelectors), incompatibleSelectors_( incompatibleSelectors ) { - static_assert( (boost::is_same< Filter_T, DefaultEvaluationFilter >::value), + static_assert( (std::is_same< Filter_T, DefaultEvaluationFilter >::value), "This constructor is only available if DefaultEvaluationFilter is set as filter type!" ); } diff --git a/src/field/AccuracyEvaluationLinePlot.h b/src/field/AccuracyEvaluationLinePlot.h index 949f76c3524533509afb24eca89c49f9fddd294f..51a18da5151a90d93179a0ebcf80809840233860 100644 --- a/src/field/AccuracyEvaluationLinePlot.h +++ b/src/field/AccuracyEvaluationLinePlot.h @@ -40,7 +40,7 @@ #include <cstdlib> #include <fstream> #include <string> - +#include <type_traits> namespace walberla { @@ -218,7 +218,7 @@ public: relLinePoint_( Vector3<real_t>( real_c(0.5) ) ), normalizationFactor_( real_t(1) ), requiredSelectors_(requiredSelectors), incompatibleSelectors_( incompatibleSelectors ) { - static_assert( (boost::is_same< Filter_T, DefaultEvaluationFilter >::value), + static_assert( (std::is_same< Filter_T, DefaultEvaluationFilter >::value), "This constructor is only available if DefaultEvaluationFilter is set as filter type!" ); auto _blocks = blocks_.lock(); diff --git a/src/field/AddToStorage.h b/src/field/AddToStorage.h index 7895d3b555663386540c135f755af734eca76435..dbb0b947d21d02133a4125808c99141edc110151 100644 --- a/src/field/AddToStorage.h +++ b/src/field/AddToStorage.h @@ -43,11 +43,7 @@ #include "GhostLayerField.h" #include "field/blockforest/BlockDataHandling.h" -#include <boost/mpl/logical.hpp> -#include <boost/type_traits/is_floating_point.hpp> -#include <boost/type_traits/is_integral.hpp> -#include <boost/type_traits/is_same.hpp> -#include <boost/utility/enable_if.hpp> +#include <type_traits> namespace walberla { @@ -120,8 +116,8 @@ struct AddToStorage template< typename GhostLayerField_T, typename BlockStorage_T > struct AddToStorage< GhostLayerField_T, BlockStorage_T, - typename boost::enable_if< boost::mpl::and_< boost::mpl::or_< boost::is_integral< typename GhostLayerField_T::value_type >, boost::is_floating_point< typename GhostLayerField_T::value_type > >, - boost::mpl::not_< boost::is_same< GhostLayerField_T, FlagField< typename GhostLayerField_T::value_type > > > > >::type > + typename std::enable_if< ( std::is_integral< typename GhostLayerField_T::value_type >::value || std::is_floating_point< typename GhostLayerField_T::value_type >::value ) && + ! std::is_same< GhostLayerField_T, FlagField< typename GhostLayerField_T::value_type > >::value >::type > { 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, @@ -301,8 +297,8 @@ struct Creator : public domain_decomposition::BlockDataCreator< GhostLayerField_ template< typename GhostLayerField_T > struct Creator< GhostLayerField_T, - typename boost::enable_if< boost::mpl::or_< boost::is_integral< typename GhostLayerField_T::value_type >, - boost::is_floating_point< typename GhostLayerField_T::value_type > > >::type > + typename std::enable_if< std::is_integral< typename GhostLayerField_T::value_type >::value || + std::is_floating_point< typename GhostLayerField_T::value_type >::value >::type > : public domain_decomposition::BlockDataCreator< GhostLayerField_T > { Creator( const shared_ptr< StructuredBlockStorage > & blocks, diff --git a/src/field/FlagField.h b/src/field/FlagField.h index 147ab57833f53d6d0b5c5e32ec6765399410ad39..62f9deef5b9f071923e6c8f4a149f032c4131f6f 100644 --- a/src/field/FlagField.h +++ b/src/field/FlagField.h @@ -31,14 +31,12 @@ #include "core/debug/Debug.h" #include "core/math/Uint.h" -#include <boost/type_traits/is_same.hpp> - #include <array> #include <iostream> #include <map> #include <sstream> #include <string> - +#include <type_traits> namespace walberla { namespace field { @@ -232,10 +230,10 @@ protected: - static_assert( (boost::is_same<T,uint8_t >::value || - boost::is_same<T,uint16_t>::value || - boost::is_same<T,uint32_t>::value || - boost::is_same<T,uint64_t>::value), + static_assert( (std::is_same<T,uint8_t >::value || + std::is_same<T,uint16_t>::value || + std::is_same<T,uint32_t>::value || + std::is_same<T,uint64_t>::value), "Only unsigned types of various lengths are allowed as type of FlagFields"); @@ -254,7 +252,7 @@ protected: friend bool isFlagInNeighborhood( const FieldPtrOrIterator & i, typename FieldPtrOrIterator::value_t mask); template <class Stencil, typename FieldPtrOrIterator> - friend typename boost::remove_const<typename FieldPtrOrIterator::value_type>::type + friend typename std::remove_const<typename FieldPtrOrIterator::value_type>::type getOredNeighborhood(const FieldPtrOrIterator & i); //@} diff --git a/src/field/FlagField.impl.h b/src/field/FlagField.impl.h index 40cebe515341d61d09364625625fc466f6b195e5..bc2c5e950f824021e19f9c829270d476f45ef997 100644 --- a/src/field/FlagField.impl.h +++ b/src/field/FlagField.impl.h @@ -20,7 +20,7 @@ // //====================================================================================================================== - +#include <type_traits> namespace walberla { namespace field { @@ -489,12 +489,12 @@ namespace field { template<class Sten, typename FieldPtrOrIterator> inline bool isFlagInNeighborhood(const FieldPtrOrIterator & i, typename FieldPtrOrIterator::value_type mask) { - typedef typename boost::remove_const< typename FieldPtrOrIterator::value_type >::type T; + typedef typename std::remove_const< typename FieldPtrOrIterator::value_type >::type T; - static_assert( (boost::is_same< T,uint8_t >::value || - boost::is_same< T,uint16_t>::value || - boost::is_same< T,uint32_t>::value || - boost::is_same< T,uint64_t>::value), + static_assert( (std::is_same< T,uint8_t >::value || + std::is_same< T,uint16_t>::value || + std::is_same< T,uint32_t>::value || + std::is_same< T,uint64_t>::value), "Only unsigned types of various lengths are allowed as type of FlagFields"); T flag = 0; @@ -509,10 +509,10 @@ namespace field { /*!\brief Ores the neighborhood of the specified stencil and returns mask ******************************************************************************************************************/ template<class Sten, typename FieldPtrOrIterator> - inline typename boost::remove_const<typename FieldPtrOrIterator::value_type>::type + inline typename std::remove_const<typename FieldPtrOrIterator::value_type>::type getOredNeighborhood(const FieldPtrOrIterator & i) { - typedef typename boost::remove_const<typename FieldPtrOrIterator::value_type>::type RetType; + typedef typename std::remove_const<typename FieldPtrOrIterator::value_type>::type RetType; RetType flag = 0; for( auto d = Sten::beginNoCenter(); d != Sten::end(); ++d ) { diff --git a/src/field/MassEvaluation.h b/src/field/MassEvaluation.h index 5337443efc61f96f149e93398078cc5161662cbc..a6aebf96f5200af1b5652826144fb83bfd0f47d9 100644 --- a/src/field/MassEvaluation.h +++ b/src/field/MassEvaluation.h @@ -39,6 +39,7 @@ #include <cstdlib> #include <fstream> #include <string> +#include <type_traits> @@ -155,7 +156,7 @@ public: initialMass_( real_t(0) ), minMass_( real_t(0) ), maxMass_( real_t(0) ), requiredSelectors_(requiredSelectors), incompatibleSelectors_( incompatibleSelectors ) { - static_assert( (boost::is_same< Filter_T, DefaultEvaluationFilter >::value), + static_assert( (std::is_same< Filter_T, DefaultEvaluationFilter >::value), "This constructor is only available if DefaultEvaluationFilter is set as filter type!" ); auto _blocks = blocks.lock(); diff --git a/src/field/StabilityChecker.h b/src/field/StabilityChecker.h index db69a7fb677abf963dc9c71de7f0f2338912ee38..8a6e80b281a84abc9889045d72e20ffe5f15b6f7 100644 --- a/src/field/StabilityChecker.h +++ b/src/field/StabilityChecker.h @@ -40,7 +40,7 @@ #include "vtk/DumpBlockStructureProcess.h" #include "vtk/VTKOutput.h" - +#include <type_traits> namespace walberla { namespace field { @@ -280,7 +280,7 @@ public: vtkForcePVTU_( internal::stabilityCheckerVTKForcePVTU ), requiredSelectors_(requiredSelectors), incompatibleSelectors_( incompatibleSelectors ) { - static_assert( (boost::is_same< Filter_T, DefaultEvaluationFilter >::value), + static_assert( (std::is_same< Filter_T, DefaultEvaluationFilter >::value), "This constructor is only available if DefaultEvaluationFilter is set as filter type!" ); } diff --git a/src/field/VolumetricFlowRateEvaluation.h b/src/field/VolumetricFlowRateEvaluation.h index 72880e7a59b8916f2046699fc4e59b4e6afd29e0..bbbcc01e0691de2aff1dbb3d86b41690171b2299 100644 --- a/src/field/VolumetricFlowRateEvaluation.h +++ b/src/field/VolumetricFlowRateEvaluation.h @@ -39,6 +39,7 @@ #include <cstdlib> #include <fstream> #include <string> +#include <type_traits> @@ -186,7 +187,7 @@ public: flowRate_( real_t(0) ), velocitySolutionFlowRate_( real_t(0) ), requiredSelectors_(requiredSelectors), incompatibleSelectors_( incompatibleSelectors ) { - static_assert( (boost::is_same< Filter_T, DefaultEvaluationFilter >::value), + static_assert( (std::is_same< Filter_T, DefaultEvaluationFilter >::value), "This constructor is only available if DefaultEvaluationFilter is set as filter type!" ); auto _blocks = blocks.lock(); diff --git a/src/field/adaptors/VectorFieldAccessor.h b/src/field/adaptors/VectorFieldAccessor.h index c06aa696eaaf6cbfac9d90b418aa044d4261ae0b..e41f4684a13d264d3d193599e6b8f01b11b9549c 100644 --- a/src/field/adaptors/VectorFieldAccessor.h +++ b/src/field/adaptors/VectorFieldAccessor.h @@ -23,6 +23,8 @@ #include "core/math/Vector3.h" +#include <type_traits> + namespace walberla { namespace field { @@ -32,7 +34,7 @@ namespace field { struct VectorFieldAccessor { static_assert( VectorField_T::F_SIZE == 3, "Only valid for Fields with 3 components (F_SIZE==3)" ); - static_assert( boost::is_same< typename VectorField_T::value_type, real_t >::value, "Only works for real valued fields" ); + static_assert( std::is_same< typename VectorField_T::value_type, real_t >::value, "Only works for real valued fields" ); typedef Vector3<real_t> vector_or_constRefVector; @@ -51,7 +53,7 @@ namespace field { template<typename VectorField_T> struct VectorFieldAccessor<VectorField_T, - typename boost::enable_if_c< boost::is_same< typename VectorField_T::value_type, + typename std::enable_if< std::is_same< typename VectorField_T::value_type, Vector3<real_t> >::value >::type > { typedef const Vector3<real_t> & vector_or_constRefVector; diff --git a/src/field/blockforest/BlockDataHandling.h b/src/field/blockforest/BlockDataHandling.h index f2925452f49a4d0334a830f96986581d95df56ba..49968c760379b1ac99ff0ccee3b194562b41b583 100644 --- a/src/field/blockforest/BlockDataHandling.h +++ b/src/field/blockforest/BlockDataHandling.h @@ -28,6 +28,7 @@ #include "core/math/Vector3.h" #include "field/FlagField.h" +#include <type_traits> namespace walberla { @@ -414,7 +415,7 @@ public: 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, + static_assert( !std::is_same< GhostLayerField_T, FlagField< Value_T > >::value, "When using class FlagField, only constructors without the explicit specification of an initial value and the field layout are available!" ); } @@ -477,7 +478,7 @@ public: 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, + static_assert( ! std::is_same< GhostLayerField_T, FlagField< Value_T > >::value, "When using class FlagField, only constructors without the explicit specification of an initial value and the field layout are available!" ); } diff --git a/src/field/iterators/FieldIterator.h b/src/field/iterators/FieldIterator.h index a1c328e7ad0195e1f839cbbd0cb9435ffdae56cd..0136ce72728aee1fe8e4495925a37b166a8b50ce 100644 --- a/src/field/iterators/FieldIterator.h +++ b/src/field/iterators/FieldIterator.h @@ -30,11 +30,9 @@ #include "stencil/Directions.h" -#include <boost/type_traits/remove_const.hpp> - #include <iostream> #include <iterator> - +#include <type_traits> namespace walberla { namespace field { @@ -71,7 +69,7 @@ namespace field { class FieldIterator : public std::iterator <std::forward_iterator_tag,T> { public: - typedef Field<typename boost::remove_const<T>::type, fieldFSize> FieldType; + typedef Field<typename std::remove_const<T>::type, fieldFSize> FieldType; typedef T value_type; static const uint_t F_SIZE = fieldFSize; @@ -159,7 +157,7 @@ namespace field { //**************************************************************************************************************** - friend class Field<typename boost::remove_const<T>::type, fieldFSize>; + friend class Field<typename std::remove_const<T>::type, fieldFSize>; void incrementLine(); void decrementLine(); @@ -217,7 +215,7 @@ namespace field { { public: typedef FieldIterator<T,fieldFSize> Parent; - typedef Field<typename boost::remove_const<T>::type, fieldFSize> FieldType; + typedef Field<typename std::remove_const<T>::type, fieldFSize> FieldType; //**Constructor/Destructor**************************************************************************************** /*!\name Constructor/Destructor */ @@ -260,7 +258,7 @@ namespace field { { public: typedef FieldIterator<T,fieldFSize> Parent; - typedef Field<typename boost::remove_const<T>::type, fieldFSize> FieldType; + typedef Field<typename std::remove_const<T>::type, fieldFSize> FieldType; //**Constructor/Destructor**************************************************************************************** /*!\name Constructor/Destructor */ diff --git a/src/field/iterators/FieldIterator.impl.h b/src/field/iterators/FieldIterator.impl.h index 0da1105554249e68e4f2ec7bf208c1d42e153f64..0a132ae01aee0d0615c4655c6f13cc7f5b25a3bf 100644 --- a/src/field/iterators/FieldIterator.impl.h +++ b/src/field/iterators/FieldIterator.impl.h @@ -47,7 +47,7 @@ FieldIterator<T,fs>::FieldIterator( const typename FieldIterator<T,fs>::FieldTyp return; } - typedef typename boost::remove_const<T>::type NonConstT; + typedef typename std::remove_const<T>::type NonConstT; cur_[0] = cur_[1] = cur_[2] = 0; if( f_->layout() == fzyx ) diff --git a/src/field/python/FieldExport.impl.h b/src/field/python/FieldExport.impl.h index 79571333f9d6736d79fa79037dc9e79a958ec846..83e3b42397f407933dbb711faaca6e2bfa4c9a44 100644 --- a/src/field/python/FieldExport.impl.h +++ b/src/field/python/FieldExport.impl.h @@ -39,9 +39,10 @@ #include "python_coupling/helper/MplHelpers.h" #include "python_coupling/helper/BoostPythonHelpers.h" -#include <boost/type_traits/is_unsigned.hpp> +#include <boost/mpl/vector.hpp> #include <iostream> +#include <type_traits> namespace walberla { namespace field { @@ -778,7 +779,7 @@ namespace internal { //=================================================================================================================== template<typename T> - void exportFlagFieldIfUnsigned( typename boost::enable_if<boost::is_unsigned<T> >::type* = 0 ) + void exportFlagFieldIfUnsigned( typename std::enable_if<std::is_unsigned<T>::value >::type* = 0 ) { using namespace boost::python; @@ -795,7 +796,7 @@ namespace internal { } template<typename T> - void exportFlagFieldIfUnsigned( typename boost::disable_if<boost::is_unsigned<T> >::type* = 0 ) {} + void exportFlagFieldIfUnsigned( typename std::enable_if< ! std::is_unsigned<T>::value >::type* = 0 ) {} struct FieldExporter diff --git a/src/gather/CellGatherPackInfo.h b/src/gather/CellGatherPackInfo.h index bafc4032d6cb59caa10eb8a1a830a495af251c5d..d4cee6c5dff688bdadb1cf2726c02713be98c356 100644 --- a/src/gather/CellGatherPackInfo.h +++ b/src/gather/CellGatherPackInfo.h @@ -27,7 +27,7 @@ #include "core/mpi/BufferDataTypeExtensions.h" #include "domain_decomposition/StructuredBlockStorage.h" -#include <boost/type_traits/is_fundamental.hpp> +#include <type_traits> namespace walberla { @@ -90,7 +90,7 @@ public: protected: - static_assert( boost::is_fundamental<typename Field_T::value_type >::value, + static_assert( std::is_fundamental<typename Field_T::value_type >::value, "CellGatherPackInfo supports fields of build in datatypes" ); diff --git a/src/gui/BlockSliceView/FlagFieldDisplayAdaptor.h b/src/gui/BlockSliceView/FlagFieldDisplayAdaptor.h index d235cac408b91786fea552519ba3dec2d960da71..98bc8246a708a67b29ee8a08fbae5c0d0ebfa995 100644 --- a/src/gui/BlockSliceView/FlagFieldDisplayAdaptor.h +++ b/src/gui/BlockSliceView/FlagFieldDisplayAdaptor.h @@ -27,6 +27,7 @@ #include <QVector> #include <QMap> +#include <type_traits> namespace walberla { namespace gui { @@ -59,10 +60,10 @@ namespace gui { typedef typename field_t::value_type T; static_assert( field_t::F_SIZE == 1, "Flag fields have no F_SIZE > 1 " ); - static_assert( boost::is_same<T,uint8_t >::value || - boost::is_same<T,uint16_t>::value || - boost::is_same<T,uint32_t>::value || - boost::is_same<T,uint64_t>::value, + static_assert( std::is_same<T,uint8_t >::value || + std::is_same<T,uint16_t>::value || + std::is_same<T,uint32_t>::value || + std::is_same<T,uint64_t>::value, "Flag fields have unsigned integers as value"); using FieldDisplayAdaptor<field_t>::sliceDim_; diff --git a/src/gui/BlockSliceView/ScalarField3DisplayAdaptor.h b/src/gui/BlockSliceView/ScalarField3DisplayAdaptor.h index 33baf43467d41c6a74fdb17b2206d7a48ffee7bf..f24346fe8580ca1a3d188291ede75cfe0ed4974e 100644 --- a/src/gui/BlockSliceView/ScalarField3DisplayAdaptor.h +++ b/src/gui/BlockSliceView/ScalarField3DisplayAdaptor.h @@ -25,7 +25,7 @@ #include "FieldDisplayAdaptor.h" #include "core/math/Vector3.h" -#include <boost/type_traits/is_same.hpp> +#include <type_traits> namespace walberla { diff --git a/src/gui/BlockSliceView/ScalarField3DisplayAdaptor.impl.h b/src/gui/BlockSliceView/ScalarField3DisplayAdaptor.impl.h index 25c49edb5507f0fdceeae7d028be6934debdc5f0..72a0d2ca439df252949915ef85ff5fced96f1bbb 100644 --- a/src/gui/BlockSliceView/ScalarField3DisplayAdaptor.impl.h +++ b/src/gui/BlockSliceView/ScalarField3DisplayAdaptor.impl.h @@ -28,7 +28,7 @@ #include <cassert> #include <cmath> - +#include <type_traits> namespace walberla { namespace gui { @@ -119,7 +119,7 @@ namespace walberla { template< typename field_t> void ScalarField3DisplayAdaptor<field_t>::drawVectorFieldNumeric( CellView * cell, const typename field_t::const_iterator & it ) { - if( boost::is_same<T,float>::value || boost::is_same<T,double>::value ) + if( std::is_same<T,float>::value || std::is_same<T,double>::value ) cell->setText( QString("%1\n%2\n%3").arg( real_c( it[0]), 0,'g',6) .arg( real_c( it[1]), 0,'g',6) .arg( real_c( it[2]), 0,'g',6) ); diff --git a/src/gui/BlockSliceView/ScalarFieldDisplayAdaptor.impl.h b/src/gui/BlockSliceView/ScalarFieldDisplayAdaptor.impl.h index 22dde7f8967d6cbe78e66082d860c6cdc1cbb337..1eeaf26e92b23d3921cd42b13266fcb34ab4fac7 100644 --- a/src/gui/BlockSliceView/ScalarFieldDisplayAdaptor.impl.h +++ b/src/gui/BlockSliceView/ScalarFieldDisplayAdaptor.impl.h @@ -28,6 +28,7 @@ #include <cassert> #include <limits> +#include <type_traits> namespace walberla { @@ -132,7 +133,7 @@ template< typename field_t> void ScalarFieldDisplayAdaptor<field_t>::drawScalarFieldNumeric( CellView * cell, const typename field_t::const_iterator & it) { - if( boost::is_same<T,float>::value || boost::is_same<T,double>::value ) + if( std::is_same<T,float>::value || std::is_same<T,double>::value ) cell->setText(QString("%1").arg(real_c(it.getF(f)), 0, 'g', 6)); else if ( it.getF(f) < std::numeric_limits<T>::max() ) cell->setText( QString("%1").arg(it.getF(f)) ); diff --git a/src/gui/BlockSliceView/VectorFieldDisplayAdaptor.h b/src/gui/BlockSliceView/VectorFieldDisplayAdaptor.h index 753106328a2b63b1215ae61360728eccf5b40bce..9ac42d5ab9709e47ef632d563d7503b46f9dbc1e 100644 --- a/src/gui/BlockSliceView/VectorFieldDisplayAdaptor.h +++ b/src/gui/BlockSliceView/VectorFieldDisplayAdaptor.h @@ -25,7 +25,7 @@ #include "FieldDisplayAdaptor.h" #include "core/math/Vector3.h" -#include <boost/type_traits/is_same.hpp> +#include <type_traits> namespace walberla { @@ -63,7 +63,7 @@ namespace gui { protected: // first value_type for field, second for Vector3 - static_assert( (boost::is_same<typename field_t::value_type, Vector3<T> >::value), "Can only display Vector3" ); + static_assert( (std::is_same<typename field_t::value_type, Vector3<T> >::value), "Can only display Vector3" ); void drawVectorFieldNumeric ( CellView * cell, const typename field_t::const_iterator & it ); void drawVectorFieldColormap( CellView * cell, const typename field_t::const_iterator & it, length_t min, length_t max ); diff --git a/src/gui/BlockSliceView/VectorFieldDisplayAdaptor.impl.h b/src/gui/BlockSliceView/VectorFieldDisplayAdaptor.impl.h index c3306a1da808b4c6dd53dbafe691304d08cae4e6..c3dde812135ea909e4ea41cb4c605da31285fdbb 100644 --- a/src/gui/BlockSliceView/VectorFieldDisplayAdaptor.impl.h +++ b/src/gui/BlockSliceView/VectorFieldDisplayAdaptor.impl.h @@ -28,6 +28,7 @@ #include <cassert> #include <cmath> +#include <type_traits> namespace walberla { @@ -119,7 +120,7 @@ namespace gui { template< typename field_t> void VectorFieldDisplayAdaptor<field_t>::drawVectorFieldNumeric( CellView * cell, const typename field_t::const_iterator & it ) { - if( boost::is_same<T,float>::value || boost::is_same<T,double>::value ) + if( std::is_same<T,float>::value || std::is_same<T,double>::value ) cell->setText( QString("%1\n%2\n%3").arg( real_c( (*it)[0]), 0,'g',6) .arg( real_c( (*it)[1]), 0,'g',6) .arg( real_c( (*it)[2]), 0,'g',6) ); diff --git a/src/lbm/boundary/DiffusionDirichlet.h b/src/lbm/boundary/DiffusionDirichlet.h index 75563c3da8d0e2e1ce96dcec5a5a8e5447211c44..4f07d41b809e0b375606b0dc13a30d4e24a0fe74 100644 --- a/src/lbm/boundary/DiffusionDirichlet.h +++ b/src/lbm/boundary/DiffusionDirichlet.h @@ -49,7 +49,7 @@ template< typename LatticeModel_T, typename flag_t > class DiffusionDirichlet : public Boundary<flag_t> { static_assert( LatticeModel_T::compressible, "Only works with compressible models!" ); - //static_assert( (boost::is_same< typename LatticeModel_T::ForceModel::tag, force_model::None_tag >::value), "Only works without additional forces!" ); + //static_assert( (std::is_same< typename LatticeModel_T::ForceModel::tag, force_model::None_tag >::value), "Only works without additional forces!" ); typedef PdfField< LatticeModel_T > PDFField; typedef typename LatticeModel_T::Stencil Stencil; diff --git a/src/lbm/boundary/Pressure.h b/src/lbm/boundary/Pressure.h index ae8afb05372001a7062c72df7e53a645e566e1b5..8dafb7e46b84f95afd3585efe1338cd3fd51388e 100644 --- a/src/lbm/boundary/Pressure.h +++ b/src/lbm/boundary/Pressure.h @@ -37,8 +37,6 @@ #include "stencil/Directions.h" -#include <boost/utility/enable_if.hpp> - #include <vector> diff --git a/src/lbm/boundary/SimpleDiffusionDirichlet.h b/src/lbm/boundary/SimpleDiffusionDirichlet.h index f57f4a8bcd27990944f0a18db84aec3a7652635d..1aca569bb201764765954b6a1b9c2471a7322262 100644 --- a/src/lbm/boundary/SimpleDiffusionDirichlet.h +++ b/src/lbm/boundary/SimpleDiffusionDirichlet.h @@ -49,7 +49,7 @@ template< typename LatticeModel_T, typename flag_t > class SimpleDiffusionDirichlet : public Boundary<flag_t> { static_assert( LatticeModel_T::compressible, "Only works with compressible models!" ); - //static_assert( (boost::is_same< typename LatticeModel_T::ForceModel::tag, force_model::None_tag >::value), "Only works without additional forces!" ); + //static_assert( (std::is_same< typename LatticeModel_T::ForceModel::tag, force_model::None_tag >::value), "Only works without additional forces!" ); typedef PdfField< LatticeModel_T > PDFField; typedef typename LatticeModel_T::Stencil Stencil; diff --git a/src/lbm/boundary/SimplePAB.h b/src/lbm/boundary/SimplePAB.h index b4319a7c8f3aedbdcc1f65772c150f7f5c8121e3..b4cd589cf04de8c5d5b448ea6ae2f31e16bcd182 100644 --- a/src/lbm/boundary/SimplePAB.h +++ b/src/lbm/boundary/SimplePAB.h @@ -40,7 +40,7 @@ #include "stencil/Directions.h" -#include <boost/type_traits/is_same.hpp> +#include <type_traits> #include <vector> @@ -53,9 +53,9 @@ namespace lbm { template< typename LatticeModel_T, typename FlagFieldT > class SimplePAB : public Boundary<typename FlagFieldT::flag_t> { - static_assert( (boost::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::SRT_tag >::value), "Only works with SRT!" ); + static_assert( (std::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::SRT_tag >::value), "Only works with SRT!" ); static_assert( LatticeModel_T::compressible == false, "Only works with incompressible models!" ); - static_assert( (boost::is_same< typename LatticeModel_T::ForceModel::tag, force_model::None_tag >::value), "Only works without additional forces!" ); + static_assert( (std::is_same< typename LatticeModel_T::ForceModel::tag, force_model::None_tag >::value), "Only works without additional forces!" ); typedef PdfField< LatticeModel_T > PDFField; typedef typename LatticeModel_T::Stencil Stencil; diff --git a/src/lbm/cumulant/CellwiseSweep.impl.h b/src/lbm/cumulant/CellwiseSweep.impl.h index 7b65e4c74fda1747753412761ae606d57153a537..bb40b8d50849906cb61cfaa018a87d28a404d6b2 100644 --- a/src/lbm/cumulant/CellwiseSweep.impl.h +++ b/src/lbm/cumulant/CellwiseSweep.impl.h @@ -35,12 +35,7 @@ #include "field/EvaluationFilter.h" #include "field/iterators/IteratorMacros.h" -#include <boost/mpl/logical.hpp> -#include <boost/mpl/equal_to.hpp> -#include <boost/mpl/bool.hpp> -#include <boost/mpl/int.hpp> -#include <boost/type_traits/is_same.hpp> -#include <boost/utility/enable_if.hpp> +#include <type_traits> namespace walberla{ @@ -52,13 +47,12 @@ namespace lbm{ // I will need to some changes to this also #define WALBERLA_LBM_CELLWISE_SWEEP_SPECIALIZATION_CUMULANT_1 \ - boost::mpl::and_< boost::mpl::and_< boost::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::Cumulant_tag >, \ - boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q27 >, \ - boost::mpl::bool_< LatticeModel_T::compressible >, \ - boost::mpl::equal_to< boost::mpl::int_< LatticeModel_T::equilibriumAccuracyOrder >, boost::mpl::int_<2> >, \ - boost::is_same< typename LatticeModel_T::ForceModel::tag, force_model::None_tag > >, \ - boost::is_same< DensityVelocityIn_T, DefaultDensityEquilibriumVelocityCalculation > \ - > + (std::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::Cumulant_tag >::value && \ + std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q27 >::value && \ + LatticeModel_T::compressible && \ + LatticeModel_T::equilibriumAccuracyOrder == 2 && \ + std::is_same< typename LatticeModel_T::ForceModel::tag, force_model::None_tag >::value && \ + std::is_same< DensityVelocityIn_T, DefaultDensityEquilibriumVelocityCalculation >::value) WALBERLA_LBM_CELLWISE_SWEEP_CLASS_HEAD_AND_STREAM( WALBERLA_LBM_CELLWISE_SWEEP_SPECIALIZATION_CUMULANT_1 ) // changed to SRT_1 for cumulant only in this file diff --git a/src/lbm/field/AddToStorage.h b/src/lbm/field/AddToStorage.h index 912b0135e3f738a0f1b5b59be110a88caf2f8d53..3cf80dc43b9783f76b90c003e1d7ccce6a35573a 100644 --- a/src/lbm/field/AddToStorage.h +++ b/src/lbm/field/AddToStorage.h @@ -27,10 +27,6 @@ #include "core/uid/SUID.h" #include "field/blockforest/BlockDataHandling.h" -#include <boost/mpl/int.hpp> -#include <boost/mpl/equal_to.hpp> - - namespace walberla { namespace lbm { @@ -40,12 +36,12 @@ namespace internal { template< typename LatticeModel_T > class PdfFieldHandling : public field::BlockDataHandling< PdfField<LatticeModel_T>, - boost::mpl::equal_to< boost::mpl::int_<LatticeModel_T::Stencil::D>, boost::mpl::int_<2> >::value > + LatticeModel_T::Stencil::D == 2 > { public: typedef PdfField<LatticeModel_T> PdfField_T; - typedef field::BlockDataHandling< PdfField_T, boost::mpl::equal_to< boost::mpl::int_<LatticeModel_T::Stencil::D>, boost::mpl::int_<2> >::value > Base_T; + typedef field::BlockDataHandling< PdfField_T, LatticeModel_T::Stencil::D == 2 > Base_T; PdfFieldHandling( const weak_ptr< StructuredBlockStorage > & blocks, const LatticeModel_T & latticeModel, const bool _initialize, const Vector3<real_t> & initialVelocity, const real_t initialDensity, diff --git a/src/lbm/field/Density.h b/src/lbm/field/Density.h index f45983dfa80b1b2aea7c59e2f98d97d9880f9799..a7c346e13721c9215b67316d440415b3f482607b 100644 --- a/src/lbm/field/Density.h +++ b/src/lbm/field/Density.h @@ -23,9 +23,7 @@ #include "core/DataTypes.h" -#include <boost/mpl/bool.hpp> -#include <boost/mpl/logical.hpp> -#include <boost/utility/enable_if.hpp> +#include <type_traits> // Back-end for calculating macroscopic values @@ -45,7 +43,7 @@ struct Density; ////////////////// template< typename LatticeModel_T > -struct Density< LatticeModel_T, typename boost::enable_if_c< LatticeModel_T::compressible >::type > +struct Density< LatticeModel_T, typename std::enable_if< LatticeModel_T::compressible >::type > { static_assert( LatticeModel_T::compressible, "Only works with compressible models!" ); @@ -80,7 +78,7 @@ struct Density< LatticeModel_T, typename boost::enable_if_c< LatticeModel_T::com //////////////////// template< typename LatticeModel_T > -struct Density< LatticeModel_T, typename boost::enable_if< boost::mpl::not_< boost::mpl::bool_< LatticeModel_T::compressible > > >::type > +struct Density< LatticeModel_T, typename std::enable_if< ! LatticeModel_T::compressible >::type > { static_assert( LatticeModel_T::compressible == false, "Only works with incompressible models!" ); diff --git a/src/lbm/field/DensityAndMomentumDensity.h b/src/lbm/field/DensityAndMomentumDensity.h index 8502b38d8703d096c1f54bd25b9471a247fbbf3c..db732eb01596c5913f96d6c89f581009f68abd27 100644 --- a/src/lbm/field/DensityAndMomentumDensity.h +++ b/src/lbm/field/DensityAndMomentumDensity.h @@ -27,9 +27,7 @@ #include "core/DataTypes.h" #include "core/math/Vector3.h" -#include <boost/mpl/logical.hpp> -#include <boost/type_traits/is_same.hpp> -#include <boost/utility/enable_if.hpp> +#include <type_traits> // Back-end for calculating macroscopic values @@ -44,7 +42,7 @@ namespace internal { template< typename LatticeModel_T, typename FieldPtrOrIterator > real_t getDensityAndMomentumDensity( Vector3< real_t > & momentumDensity, const FieldPtrOrIterator & it ) { - static_assert( (boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value == false), + static_assert( (std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value == false), "If you have the D3Q19 stencil, you should use the optimized function!" ); auto d = LatticeModel_T::Stencil::begin(); @@ -77,7 +75,7 @@ template< typename LatticeModel_T, typename PdfField_T > real_t getDensityAndMomentumDensity( Vector3< real_t > & momentumDensity, const PdfField_T & pdf, const cell_idx_t x, const cell_idx_t y, const cell_idx_t z ) { - static_assert( (boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value == false), + static_assert( (std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value == false), "If you have the D3Q19 stencil, you should use the optimized function!" ); const auto & xyz0 = pdf(x,y,z,0); @@ -111,7 +109,7 @@ real_t getDensityAndMomentumDensity( Vector3< real_t > & momentumDensity, const template< typename LatticeModel_T, typename FieldPtrOrIterator > real_t getDensityAndMomentumDensityD3Q19( Vector3< real_t > & momentumDensity, const FieldPtrOrIterator & it ) { - static_assert( (boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value), "This function works with D3Q19 stencils only!" ); + static_assert( (std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value), "This function works with D3Q19 stencils only!" ); using namespace stencil; typedef typename LatticeModel_T::Stencil Stencil; @@ -137,7 +135,7 @@ template< typename LatticeModel_T, typename PdfField_T > real_t getDensityAndMomentumDensityD3Q19( Vector3< real_t > & momentumDensity, const PdfField_T & pdf, const cell_idx_t x, const cell_idx_t y, const cell_idx_t z ) { - static_assert( (boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value), "This function works with D3Q19 stencils only!" ); + static_assert( (std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value), "This function works with D3Q19 stencils only!" ); using namespace stencil; typedef typename LatticeModel_T::Stencil Stencil; @@ -178,10 +176,9 @@ struct DensityAndMomentumDensity }; template< typename LatticeModel_T > -struct DensityAndMomentumDensity< LatticeModel_T, typename boost::enable_if< boost::mpl::not_< boost::is_same< typename LatticeModel_T::Stencil, - stencil::D3Q19 > > >::type > +struct DensityAndMomentumDensity< LatticeModel_T, typename std::enable_if< ! std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value >::type > { - static_assert( (boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value == false), "For D3Q19 there is an optimized version!" ); + static_assert( (std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value == false), "For D3Q19 there is an optimized version!" ); template< typename FieldPtrOrIterator > static real_t getEquilibrium( Vector3< real_t > & momentumDensity, const LatticeModel_T & latticeModel, const FieldPtrOrIterator & it ) @@ -219,10 +216,9 @@ struct DensityAndMomentumDensity< LatticeModel_T, typename boost::enable_if< boo }; template< typename LatticeModel_T > -struct DensityAndMomentumDensity< LatticeModel_T, typename boost::enable_if< boost::is_same< typename LatticeModel_T::Stencil, - stencil::D3Q19 > >::type > +struct DensityAndMomentumDensity< LatticeModel_T, typename std::enable_if< std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value >::type > { - static_assert( (boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value), "Only works with D3Q19!" ); + static_assert( (std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value), "Only works with D3Q19!" ); template< typename FieldPtrOrIterator > static real_t getEquilibrium( Vector3< real_t > & momentumDensity, const LatticeModel_T & latticeModel, const FieldPtrOrIterator & it ) diff --git a/src/lbm/field/DensityAndVelocity.h b/src/lbm/field/DensityAndVelocity.h index d6957f9d3614513cec6617b3cf3f691fa727b118..540357d565b132ebe23d16a40345cf0847130fca 100644 --- a/src/lbm/field/DensityAndVelocity.h +++ b/src/lbm/field/DensityAndVelocity.h @@ -25,9 +25,7 @@ #include "core/DataTypes.h" #include "core/math/Vector3.h" -#include <boost/mpl/bool.hpp> -#include <boost/mpl/logical.hpp> -#include <boost/utility/enable_if.hpp> +#include <type_traits> // Back-end for calculating macroscopic values @@ -48,9 +46,10 @@ struct AdaptVelocityToForce }; template< typename LatticeModel_T > -struct AdaptVelocityToForce< LatticeModel_T, typename boost::enable_if< boost::mpl::and_< boost::mpl::bool_< LatticeModel_T::compressible >, - boost::mpl::bool_< LatticeModel_T::ForceModel::constant >, - boost::mpl::bool_< LatticeModel_T::ForceModel::shiftMacVel > > >::type > +struct AdaptVelocityToForce< LatticeModel_T, typename std::enable_if< LatticeModel_T::compressible && + LatticeModel_T::ForceModel::constant && + LatticeModel_T::ForceModel::shiftMacVel + >::type > { static Vector3<real_t> get( const LatticeModel_T & latticeModel, const Vector3< real_t > & velocity, const real_t rho ) { @@ -71,9 +70,10 @@ struct AdaptVelocityToForce< LatticeModel_T, typename boost::enable_if< boost::m }; template< typename LatticeModel_T > -struct AdaptVelocityToForce< LatticeModel_T, typename boost::enable_if< boost::mpl::and_< boost::mpl::not_< boost::mpl::bool_< LatticeModel_T::compressible > >, - boost::mpl::bool_< LatticeModel_T::ForceModel::constant >, - boost::mpl::bool_< LatticeModel_T::ForceModel::shiftMacVel > > >::type > +struct AdaptVelocityToForce< LatticeModel_T, typename std::enable_if< ! LatticeModel_T::compressible && + LatticeModel_T::ForceModel::constant && + LatticeModel_T::ForceModel::shiftMacVel + >::type > { static Vector3<real_t> get( const LatticeModel_T & latticeModel, const Vector3< real_t > & velocity, const real_t ) { @@ -94,9 +94,10 @@ struct AdaptVelocityToForce< LatticeModel_T, typename boost::enable_if< boost::m }; template< typename LatticeModel_T > -struct AdaptVelocityToForce< LatticeModel_T, typename boost::enable_if< boost::mpl::and_< boost::mpl::bool_< LatticeModel_T::compressible >, - boost::mpl::not_< boost::mpl::bool_< LatticeModel_T::ForceModel::constant > >, - boost::mpl::bool_< LatticeModel_T::ForceModel::shiftMacVel > > >::type > +struct AdaptVelocityToForce< LatticeModel_T, typename std::enable_if< LatticeModel_T::compressible && + ! LatticeModel_T::ForceModel::constant && + LatticeModel_T::ForceModel::shiftMacVel + >::type > { /* static Vector3<real_t> get( const LatticeModel_T & latticeModel, const Vector3< real_t > & velocity, const real_t rho ) @@ -119,9 +120,10 @@ struct AdaptVelocityToForce< LatticeModel_T, typename boost::enable_if< boost::m }; template< typename LatticeModel_T > -struct AdaptVelocityToForce< LatticeModel_T, typename boost::enable_if< boost::mpl::and_< boost::mpl::not_< boost::mpl::bool_< LatticeModel_T::compressible > >, - boost::mpl::not_< boost::mpl::bool_< LatticeModel_T::ForceModel::constant > >, - boost::mpl::bool_< LatticeModel_T::ForceModel::shiftMacVel > > >::type > +struct AdaptVelocityToForce< LatticeModel_T, typename std::enable_if< ! LatticeModel_T::compressible && + ! LatticeModel_T::ForceModel::constant && + LatticeModel_T::ForceModel::shiftMacVel + >::type > { /* static Vector3<real_t> get( const LatticeModel_T & latticeModel, const Vector3< real_t > & velocity, const real_t ) @@ -144,7 +146,7 @@ struct AdaptVelocityToForce< LatticeModel_T, typename boost::enable_if< boost::m }; template< typename LatticeModel_T > -struct AdaptVelocityToForce< LatticeModel_T, typename boost::enable_if< boost::mpl::not_< boost::mpl::bool_< LatticeModel_T::ForceModel::shiftMacVel > > >::type > +struct AdaptVelocityToForce< LatticeModel_T, typename std::enable_if< ! LatticeModel_T::ForceModel::shiftMacVel >::type > { static Vector3<real_t> get( const LatticeModel_T &, const Vector3< real_t > & velocity, const real_t ) { @@ -207,7 +209,7 @@ struct DensityAndVelocityRange template< typename LatticeModel_T, typename FieldIteratorXYZ > -struct DensityAndVelocityRange< LatticeModel_T, FieldIteratorXYZ, typename boost::enable_if_c< LatticeModel_T::ForceModel::constant >::type > +struct DensityAndVelocityRange< LatticeModel_T, FieldIteratorXYZ, typename std::enable_if< LatticeModel_T::ForceModel::constant >::type > { static_assert( LatticeModel_T::ForceModel::constant, "Only works with constant forces!" ); @@ -222,7 +224,7 @@ struct DensityAndVelocityRange< LatticeModel_T, FieldIteratorXYZ, typename boost template< typename LatticeModel_T, typename FieldIteratorXYZ > -struct DensityAndVelocityRange< LatticeModel_T, FieldIteratorXYZ, typename boost::enable_if< boost::mpl::not_< boost::mpl::bool_< LatticeModel_T::ForceModel::constant > > >::type > +struct DensityAndVelocityRange< LatticeModel_T, FieldIteratorXYZ, typename std::enable_if< ! LatticeModel_T::ForceModel::constant >::type > { static_assert( LatticeModel_T::ForceModel::constant == false, "Does not work with constant forces!" ); diff --git a/src/lbm/field/DensityVelocityCallback.h b/src/lbm/field/DensityVelocityCallback.h index 60c9c817990d494750892048b9ab812c868f7fa4..3c7c69087c7a0b302be099642e4ed471ffc1be11 100644 --- a/src/lbm/field/DensityVelocityCallback.h +++ b/src/lbm/field/DensityVelocityCallback.h @@ -30,9 +30,7 @@ #include "field/AddToStorage.h" #include "field/GhostLayerField.h" -#include <boost/mpl/logical.hpp> -#include <boost/mpl/bool.hpp> -#include <boost/utility/enable_if.hpp> +#include <type_traits> @@ -68,10 +66,11 @@ struct VelocityCallbackCorrection }; template< typename LatticeModel_T > -struct VelocityCallbackCorrection< LatticeModel_T, typename boost::enable_if< boost::mpl::and_< boost::mpl::bool_< LatticeModel_T::compressible >, - boost::mpl::bool_< LatticeModel_T::ForceModel::constant >, - boost::mpl::bool_< LatticeModel_T::ForceModel::shiftMacVel >, - boost::mpl::not_< boost::mpl::bool_< LatticeModel_T::ForceModel::shiftEquVel > > > >::type > +struct VelocityCallbackCorrection< LatticeModel_T, typename std::enable_if< LatticeModel_T::compressible && + LatticeModel_T::ForceModel::constant && + LatticeModel_T::ForceModel::shiftMacVel && + ! LatticeModel_T::ForceModel::shiftEquVel + >::type > { static void apply( Vector3< real_t > & velocity, const cell_idx_t, const cell_idx_t, const cell_idx_t, const LatticeModel_T & latticeModel, const real_t rho ) @@ -81,10 +80,11 @@ struct VelocityCallbackCorrection< LatticeModel_T, typename boost::enable_if< bo }; template< typename LatticeModel_T > -struct VelocityCallbackCorrection< LatticeModel_T, typename boost::enable_if< boost::mpl::and_< boost::mpl::not_< boost::mpl::bool_< LatticeModel_T::compressible > >, - boost::mpl::bool_< LatticeModel_T::ForceModel::constant >, - boost::mpl::bool_< LatticeModel_T::ForceModel::shiftMacVel >, - boost::mpl::not_< boost::mpl::bool_< LatticeModel_T::ForceModel::shiftEquVel > > > >::type > +struct VelocityCallbackCorrection< LatticeModel_T, typename std::enable_if< ! LatticeModel_T::compressible && + LatticeModel_T::ForceModel::constant && + LatticeModel_T::ForceModel::shiftMacVel && + ! LatticeModel_T::ForceModel::shiftEquVel + >::type > { static void apply( Vector3< real_t > & velocity, const cell_idx_t, const cell_idx_t, const cell_idx_t, const LatticeModel_T & latticeModel, const real_t ) @@ -94,10 +94,11 @@ struct VelocityCallbackCorrection< LatticeModel_T, typename boost::enable_if< bo }; template< typename LatticeModel_T > -struct VelocityCallbackCorrection< LatticeModel_T, typename boost::enable_if< boost::mpl::and_< boost::mpl::bool_< LatticeModel_T::compressible >, - boost::mpl::not_< boost::mpl::bool_< LatticeModel_T::ForceModel::constant > >, - boost::mpl::bool_< LatticeModel_T::ForceModel::shiftMacVel >, - boost::mpl::not_< boost::mpl::bool_< LatticeModel_T::ForceModel::shiftEquVel > > > >::type > +struct VelocityCallbackCorrection< LatticeModel_T, typename std::enable_if< LatticeModel_T::compressible && + ! LatticeModel_T::ForceModel::constant && + LatticeModel_T::ForceModel::shiftMacVel && + ! LatticeModel_T::ForceModel::shiftEquVel + >::type > { static void apply( Vector3< real_t > & velocity, const cell_idx_t x, const cell_idx_t y, const cell_idx_t z, const LatticeModel_T & latticeModel, const real_t rho ) @@ -107,10 +108,11 @@ struct VelocityCallbackCorrection< LatticeModel_T, typename boost::enable_if< bo }; template< typename LatticeModel_T > -struct VelocityCallbackCorrection< LatticeModel_T, typename boost::enable_if< boost::mpl::and_< boost::mpl::not_< boost::mpl::bool_< LatticeModel_T::compressible > >, - boost::mpl::not_< boost::mpl::bool_< LatticeModel_T::ForceModel::constant > >, - boost::mpl::bool_< LatticeModel_T::ForceModel::shiftMacVel >, - boost::mpl::not_< boost::mpl::bool_< LatticeModel_T::ForceModel::shiftEquVel > > > >::type > +struct VelocityCallbackCorrection< LatticeModel_T, typename std::enable_if< ! LatticeModel_T::compressible && + ! LatticeModel_T::ForceModel::constant && + LatticeModel_T::ForceModel::shiftMacVel && + ! LatticeModel_T::ForceModel::shiftEquVel + >::type > { static void apply( Vector3< real_t > & velocity, const cell_idx_t x, const cell_idx_t y, const cell_idx_t z, const LatticeModel_T & latticeModel, const real_t ) @@ -120,10 +122,11 @@ struct VelocityCallbackCorrection< LatticeModel_T, typename boost::enable_if< bo }; template< typename LatticeModel_T > -struct VelocityCallbackCorrection< LatticeModel_T, typename boost::enable_if< boost::mpl::and_< boost::mpl::bool_< LatticeModel_T::compressible >, - boost::mpl::bool_< LatticeModel_T::ForceModel::constant >, - boost::mpl::bool_< LatticeModel_T::ForceModel::shiftEquVel >, - boost::mpl::not_< boost::mpl::bool_< LatticeModel_T::ForceModel::shiftMacVel > > > >::type > +struct VelocityCallbackCorrection< LatticeModel_T, typename std::enable_if< LatticeModel_T::compressible && + LatticeModel_T::ForceModel::constant && + LatticeModel_T::ForceModel::shiftEquVel && + ! LatticeModel_T::ForceModel::shiftMacVel + >::type > { static void apply( Vector3< real_t > & velocity, const cell_idx_t, const cell_idx_t, const cell_idx_t, const LatticeModel_T & latticeModel, const real_t rho ) @@ -133,10 +136,11 @@ struct VelocityCallbackCorrection< LatticeModel_T, typename boost::enable_if< bo }; template< typename LatticeModel_T > -struct VelocityCallbackCorrection< LatticeModel_T, typename boost::enable_if< boost::mpl::and_< boost::mpl::not_< boost::mpl::bool_< LatticeModel_T::compressible > >, - boost::mpl::bool_< LatticeModel_T::ForceModel::constant >, - boost::mpl::bool_< LatticeModel_T::ForceModel::shiftEquVel >, - boost::mpl::not_< boost::mpl::bool_< LatticeModel_T::ForceModel::shiftMacVel > > > >::type > +struct VelocityCallbackCorrection< LatticeModel_T, typename std::enable_if< ! LatticeModel_T::compressible && + LatticeModel_T::ForceModel::constant && + LatticeModel_T::ForceModel::shiftEquVel && + ! LatticeModel_T::ForceModel::shiftMacVel + >::type > { static void apply( Vector3< real_t > & velocity, const cell_idx_t, const cell_idx_t, const cell_idx_t, const LatticeModel_T & latticeModel, const real_t ) @@ -146,10 +150,11 @@ struct VelocityCallbackCorrection< LatticeModel_T, typename boost::enable_if< bo }; template< typename LatticeModel_T > -struct VelocityCallbackCorrection< LatticeModel_T, typename boost::enable_if< boost::mpl::and_< boost::mpl::bool_< LatticeModel_T::compressible >, - boost::mpl::not_< boost::mpl::bool_< LatticeModel_T::ForceModel::constant > >, - boost::mpl::bool_< LatticeModel_T::ForceModel::shiftEquVel >, - boost::mpl::not_< boost::mpl::bool_< LatticeModel_T::ForceModel::shiftMacVel > > > >::type > +struct VelocityCallbackCorrection< LatticeModel_T, typename std::enable_if< LatticeModel_T::compressible && + ! LatticeModel_T::ForceModel::constant && + LatticeModel_T::ForceModel::shiftEquVel && + ! LatticeModel_T::ForceModel::shiftMacVel + >::type > { static void apply( Vector3< real_t > & velocity, const cell_idx_t x, const cell_idx_t y, const cell_idx_t z, const LatticeModel_T & latticeModel, const real_t rho ) @@ -159,10 +164,11 @@ struct VelocityCallbackCorrection< LatticeModel_T, typename boost::enable_if< bo }; template< typename LatticeModel_T > -struct VelocityCallbackCorrection< LatticeModel_T, typename boost::enable_if< boost::mpl::and_< boost::mpl::not_< boost::mpl::bool_< LatticeModel_T::compressible > >, - boost::mpl::not_< boost::mpl::bool_< LatticeModel_T::ForceModel::constant > >, - boost::mpl::bool_< LatticeModel_T::ForceModel::shiftEquVel >, - boost::mpl::not_< boost::mpl::bool_< LatticeModel_T::ForceModel::shiftMacVel > > > >::type > +struct VelocityCallbackCorrection< LatticeModel_T, typename std::enable_if< ! LatticeModel_T::compressible && + ! LatticeModel_T::ForceModel::constant && + LatticeModel_T::ForceModel::shiftEquVel && + ! LatticeModel_T::ForceModel::shiftMacVel + >::type > { static void apply( Vector3< real_t > & velocity, const cell_idx_t x, const cell_idx_t y, const cell_idx_t z, const LatticeModel_T & latticeModel, const real_t ) @@ -172,15 +178,17 @@ struct VelocityCallbackCorrection< LatticeModel_T, typename boost::enable_if< bo }; template< typename LatticeModel_T > -struct VelocityCallbackCorrection< LatticeModel_T, typename boost::enable_if< boost::mpl::and_< boost::mpl::bool_< LatticeModel_T::ForceModel::shiftMacVel >, - boost::mpl::bool_< LatticeModel_T::ForceModel::shiftEquVel > > >::type > +struct VelocityCallbackCorrection< LatticeModel_T, typename std::enable_if< LatticeModel_T::ForceModel::shiftMacVel && + LatticeModel_T::ForceModel::shiftEquVel + >::type > { static void apply( Vector3< real_t > &, const cell_idx_t, const cell_idx_t, const cell_idx_t, const LatticeModel_T &, const real_t ) {} }; template< typename LatticeModel_T > -struct VelocityCallbackCorrection< LatticeModel_T, typename boost::enable_if< boost::mpl::and_< boost::mpl::not_< boost::mpl::bool_< LatticeModel_T::ForceModel::shiftMacVel > >, - boost::mpl::not_< boost::mpl::bool_< LatticeModel_T::ForceModel::shiftEquVel > > > >::type > +struct VelocityCallbackCorrection< LatticeModel_T, typename std::enable_if< ! LatticeModel_T::ForceModel::shiftMacVel && + ! LatticeModel_T::ForceModel::shiftEquVel + >::type > { static void apply( Vector3< real_t > &, const cell_idx_t, const cell_idx_t, const cell_idx_t, const LatticeModel_T &, const real_t ) {} }; @@ -338,7 +346,7 @@ private: template< typename VelocityField_T > -class VelocityCallback<VelocityField_T, typename boost::enable_if_c< boost::is_same< typename VelocityField_T::value_type, Vector3<real_t> >::value >::type > +class VelocityCallback<VelocityField_T, typename std::enable_if< std::is_same< typename VelocityField_T::value_type, Vector3<real_t> >::value >::type > { public: VelocityCallback( const BlockDataID & fieldId ) : fieldId_( fieldId ), field_( NULL ) {} @@ -438,8 +446,6 @@ private: //namespace walberla { //namespace lbm { // -//using boost::type_traits::ice_and; -//using boost::type_traits::ice_not; // // // @@ -450,7 +456,7 @@ private: //}; // //template< typename LatticeModel_T > -//struct VelocityField< LatticeModel_T, typename boost::enable_if_c< LatticeModel_T::ForceModel::shiftMacVel >::type > +//struct VelocityField< LatticeModel_T, typename std::enable_if< LatticeModel_T::ForceModel::shiftMacVel >::type > //{ // typedef walberla::field::GhostLayerField< Vector3<real_t>, uint_t(2) > type; //}; @@ -477,10 +483,11 @@ private: //}; // //template< typename LatticeModel_T > -//struct VelocityCallbackCorrection< LatticeModel_T, typename boost::enable_if_c< ice_and< LatticeModel_T::compressible, -// LatticeModel_T::ForceModel::constant, -// LatticeModel_T::ForceModel::shiftMacVel, -// ice_not< LatticeModel_T::ForceModel::shiftEquVel >::value >::value >::type > +//struct VelocityCallbackCorrection< LatticeModel_T, typename std::enable_if< LatticeModel_T::compressible && +// LatticeModel_T::ForceModel::constant && +// LatticeModel_T::ForceModel::shiftMacVel && +// ! LatticeModel_T::ForceModel::shiftEquVel +// >::type > //{ // template< typename VelocityField_T > // static void apply( VelocityField_T * const & field, const Vector3< real_t > & velocity, const cell_idx_t x, const cell_idx_t y, const cell_idx_t z, @@ -493,10 +500,11 @@ private: //}; // //template< typename LatticeModel_T > -//struct VelocityCallbackCorrection< LatticeModel_T, typename boost::enable_if_c< ice_and< ice_not< LatticeModel_T::compressible >::value, -// LatticeModel_T::ForceModel::constant, -// LatticeModel_T::ForceModel::shiftMacVel, -// ice_not< LatticeModel_T::ForceModel::shiftEquVel >::value >::value >::type > +//struct VelocityCallbackCorrection< LatticeModel_T, typename std::enable_if< ! LatticeModel_T::compressible && +// LatticeModel_T::ForceModel::constant && +// LatticeModel_T::ForceModel::shiftMacVel && +// ! LatticeModel_T::ForceModel::shiftEquVel +// >::type > //{ // template< typename VelocityField_T > // static void apply( VelocityField_T * const & field, const Vector3< real_t > & velocity, const cell_idx_t x, const cell_idx_t y, const cell_idx_t z, @@ -509,10 +517,11 @@ private: //}; // //template< typename LatticeModel_T > -//struct VelocityCallbackCorrection< LatticeModel_T, typename boost::enable_if_c< ice_and< LatticeModel_T::compressible, -// ice_not< LatticeModel_T::ForceModel::constant >::value, -// LatticeModel_T::ForceModel::shiftMacVel, -// ice_not< LatticeModel_T::ForceModel::shiftEquVel >::value >::value >::type > +//struct VelocityCallbackCorrection< LatticeModel_T, typename std::enable_if< LatticeModel_T::compressible && +// ! LatticeModel_T::ForceModel::constant && +// LatticeModel_T::ForceModel::shiftMacVel && +// ! LatticeModel_T::ForceModel::shiftEquVel +// >::type > //{ // template< typename VelocityField_T > // static void apply( VelocityField_T * const & field, const Vector3< real_t > & velocity, const cell_idx_t x, const cell_idx_t y, const cell_idx_t z, @@ -525,10 +534,11 @@ private: //}; // //template< typename LatticeModel_T > -//struct VelocityCallbackCorrection< LatticeModel_T, typename boost::enable_if_c< ice_and< ice_not< LatticeModel_T::compressible >::value, -// ice_not< LatticeModel_T::ForceModel::constant >::value, -// LatticeModel_T::ForceModel::shiftMacVel, -// ice_not< LatticeModel_T::ForceModel::shiftEquVel >::value >::value >::type > +//struct VelocityCallbackCorrection< LatticeModel_T, typename std::enable_if< ! LatticeModel_T::compressible && +// ! LatticeModel_T::ForceModel::constant && +// LatticeModel_T::ForceModel::shiftMacVel && +// ! LatticeModel_T::ForceModel::shiftEquVel +// >::type > //{ // template< typename VelocityField_T > // static void apply( VelocityField_T * const & field, const Vector3< real_t > & velocity, const cell_idx_t x, const cell_idx_t y, const cell_idx_t z, @@ -541,10 +551,11 @@ private: //}; // //template< typename LatticeModel_T > -//struct VelocityCallbackCorrection< LatticeModel_T, typename boost::enable_if_c< ice_and< LatticeModel_T::compressible, -// LatticeModel_T::ForceModel::constant, -// LatticeModel_T::ForceModel::shiftEquVel, -// ice_not< LatticeModel_T::ForceModel::shiftMacVel >::value >::value >::type > +//struct VelocityCallbackCorrection< LatticeModel_T, typename std::enable_if< LatticeModel_T::compressible && +// LatticeModel_T::ForceModel::constant && +// LatticeModel_T::ForceModel::shiftEquVel && +// ! LatticeModel_T::ForceModel::shiftMacVel +// >::type > //{ // template< typename VelocityField_T > // static void apply( VelocityField_T * const & field, const Vector3< real_t > & velocity, const cell_idx_t x, const cell_idx_t y, const cell_idx_t z, @@ -555,10 +566,11 @@ private: //}; // //template< typename LatticeModel_T > -//struct VelocityCallbackCorrection< LatticeModel_T, typename boost::enable_if_c< ice_and< ice_not< LatticeModel_T::compressible >::value, -// LatticeModel_T::ForceModel::constant, -// LatticeModel_T::ForceModel::shiftEquVel, -// ice_not< LatticeModel_T::ForceModel::shiftMacVel >::value >::value >::type > +//struct VelocityCallbackCorrection< LatticeModel_T, typename std::enable_if< ! LatticeModel_T::compressible && +// LatticeModel_T::ForceModel::constant && +// LatticeModel_T::ForceModel::shiftEquVel && +// ! LatticeModel_T::ForceModel::shiftMacVel +// >::type > //{ // template< typename VelocityField_T > // static void apply( VelocityField_T * const & field, const Vector3< real_t > & velocity, const cell_idx_t x, const cell_idx_t y, const cell_idx_t z, @@ -569,10 +581,11 @@ private: //}; // //template< typename LatticeModel_T > -//struct VelocityCallbackCorrection< LatticeModel_T, typename boost::enable_if_c< ice_and< LatticeModel_T::compressible, -// ice_not< LatticeModel_T::ForceModel::constant >::value, -// LatticeModel_T::ForceModel::shiftEquVel, -// ice_not< LatticeModel_T::ForceModel::shiftMacVel >::value >::value >::type > +//struct VelocityCallbackCorrection< LatticeModel_T, typename std::enable_if< LatticeModel_T::compressible && +// ! LatticeModel_T::ForceModel::constant && +// LatticeModel_T::ForceModel::shiftEquVel && +// ! LatticeModel_T::ForceModel::shiftMacVel +// >::type > //{ // template< typename VelocityField_T > // static void apply( VelocityField_T * const & field, const Vector3< real_t > & velocity, const cell_idx_t x, const cell_idx_t y, const cell_idx_t z, @@ -583,10 +596,11 @@ private: //}; // //template< typename LatticeModel_T > -//struct VelocityCallbackCorrection< LatticeModel_T, typename boost::enable_if_c< ice_and< ice_not< LatticeModel_T::compressible >::value, -// ice_not< LatticeModel_T::ForceModel::constant >::value, -// LatticeModel_T::ForceModel::shiftEquVel, -// ice_not< LatticeModel_T::ForceModel::shiftMacVel >::value >::value >::type > +//struct VelocityCallbackCorrection< LatticeModel_T, typename std::enable_if< ! LatticeModel_T::compressible && +// ! LatticeModel_T::ForceModel::constant && +// LatticeModel_T::ForceModel::shiftEquVel && +// ! LatticeModel_T::ForceModel::shiftMacVel +// >::type > //{ // template< typename VelocityField_T > // static void apply( VelocityField_T * const & field, const Vector3< real_t > & velocity, const cell_idx_t x, const cell_idx_t y, const cell_idx_t z, @@ -597,10 +611,11 @@ private: //}; // //template< typename LatticeModel_T > -//struct VelocityCallbackCorrection< LatticeModel_T, typename boost::enable_if_c< ice_and< LatticeModel_T::compressible, -// LatticeModel_T::ForceModel::constant, -// LatticeModel_T::ForceModel::shiftEquVel, -// LatticeModel_T::ForceModel::shiftMacVel >::value >::type > +//struct VelocityCallbackCorrection< LatticeModel_T, typename std::enable_if< LatticeModel_T::compressible && +// LatticeModel_T::ForceModel::constant && +// LatticeModel_T::ForceModel::shiftEquVel && +// LatticeModel_T::ForceModel::shiftMacVel +// >::type > //{ // template< typename VelocityField_T > // static void apply( VelocityField_T * const & field, const Vector3< real_t > & velocity, const cell_idx_t x, const cell_idx_t y, const cell_idx_t z, @@ -614,10 +629,11 @@ private: //}; // //template< typename LatticeModel_T > -//struct VelocityCallbackCorrection< LatticeModel_T, typename boost::enable_if_c< ice_and< ice_not< LatticeModel_T::compressible >::value, -// LatticeModel_T::ForceModel::constant, -// LatticeModel_T::ForceModel::shiftEquVel, -// LatticeModel_T::ForceModel::shiftMacVel >::value >::type > +//struct VelocityCallbackCorrection< LatticeModel_T, typename std::enable_if< ! LatticeModel_T::compressible && +// LatticeModel_T::ForceModel::constant && +// LatticeModel_T::ForceModel::shiftEquVel && +// LatticeModel_T::ForceModel::shiftMacVel +// >::type > //{ // template< typename VelocityField_T > // static void apply( VelocityField_T * const & field, const Vector3< real_t > & velocity, const cell_idx_t x, const cell_idx_t y, const cell_idx_t z, @@ -631,10 +647,11 @@ private: //}; // //template< typename LatticeModel_T > -//struct VelocityCallbackCorrection< LatticeModel_T, typename boost::enable_if_c< ice_and< LatticeModel_T::compressible, -// ice_not< LatticeModel_T::ForceModel::constant >::value, -// LatticeModel_T::ForceModel::shiftEquVel, -// LatticeModel_T::ForceModel::shiftMacVel >::value >::type > +//struct VelocityCallbackCorrection< LatticeModel_T, typename std::enable_if< LatticeModel_T::compressible && +// ! LatticeModel_T::ForceModel::constant && +// LatticeModel_T::ForceModel::shiftEquVel && +// LatticeModel_T::ForceModel::shiftMacVel +// >::type > //{ // template< typename VelocityField_T > // static void apply( VelocityField_T * const & field, const Vector3< real_t > & velocity, const cell_idx_t x, const cell_idx_t y, const cell_idx_t z, @@ -648,10 +665,11 @@ private: //}; // //template< typename LatticeModel_T > -//struct VelocityCallbackCorrection< LatticeModel_T, typename boost::enable_if_c< ice_and< ice_not< LatticeModel_T::compressible >::value, -// ice_not< LatticeModel_T::ForceModel::constant >::value, -// LatticeModel_T::ForceModel::shiftEquVel, -// LatticeModel_T::ForceModel::shiftMacVel >::value >::type > +//struct VelocityCallbackCorrection< LatticeModel_T, typename std::enable_if< ! LatticeModel_T::compressible && +// ! LatticeModel_T::ForceModel::constant && +// LatticeModel_T::ForceModel::shiftEquVel && +// LatticeModel_T::ForceModel::shiftMacVel +// >::type > //{ // template< typename VelocityField_T > // static void apply( VelocityField_T * const & field, const Vector3< real_t > & velocity, const cell_idx_t x, const cell_idx_t y, const cell_idx_t z, @@ -665,8 +683,9 @@ private: //}; // //template< typename LatticeModel_T > -//struct VelocityCallbackCorrection< LatticeModel_T, typename boost::enable_if_c< ice_and< ice_not< LatticeModel_T::ForceModel::shiftMacVel >::value, -// ice_not< LatticeModel_T::ForceModel::shiftEquVel >::value >::value >::type > +//struct VelocityCallbackCorrection< LatticeModel_T, typename std::enable_if< ! LatticeModel_T::ForceModel::shiftMacVel && +// ! LatticeModel_T::ForceModel::shiftEquVel +// >::type > //{ // template< typename VelocityField_T > // static void apply( VelocityField_T * const & field, const Vector3< real_t > &, const cell_idx_t, const cell_idx_t, const cell_idx_t, diff --git a/src/lbm/field/Equilibrium.h b/src/lbm/field/Equilibrium.h index 4c2294f9d9057850ea4b63ba2a3faddaad06348a..8b6635431de998b1b13fb1eb26861d2c1a297b0f 100644 --- a/src/lbm/field/Equilibrium.h +++ b/src/lbm/field/Equilibrium.h @@ -26,12 +26,7 @@ #include "stencil/D3Q19.h" -#include <boost/mpl/equal_to.hpp> -#include <boost/mpl/logical.hpp> -#include <boost/mpl/int.hpp> -#include <boost/mpl/bool.hpp> -#include <boost/type_traits/is_same.hpp> -#include <boost/utility/enable_if.hpp> +#include <type_traits> // Back-end for calculating macroscopic values @@ -56,12 +51,12 @@ struct Equilibrium template< typename LatticeModel_T > -struct Equilibrium< LatticeModel_T, typename boost::enable_if< boost::mpl::and_< boost::mpl::not_< boost::is_same< typename LatticeModel_T::Stencil, - stencil::D3Q19 > >, - boost::mpl::not_< boost::mpl::bool_< LatticeModel_T::compressible > >, - boost::mpl::equal_to< boost::mpl::int_<LatticeModel_T::equilibriumAccuracyOrder>, boost::mpl::int_<2> > > >::type > +struct Equilibrium< LatticeModel_T, typename std::enable_if< ! std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value && + ! LatticeModel_T::compressible && + LatticeModel_T::equilibriumAccuracyOrder == 2 + >::type > { - static_assert( (boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value == false), "There is a specialization for D3Q19!" ); + static_assert( (std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value == false), "There is a specialization for D3Q19!" ); static_assert( LatticeModel_T::compressible == false, "Only works with incompressible models!" ); static_assert( LatticeModel_T::equilibriumAccuracyOrder == 2, "Only works for lattice models that require the equilibrium distribution to be order 2 accurate!" ); @@ -94,8 +89,9 @@ struct Equilibrium< LatticeModel_T, typename boost::enable_if< boost::mpl::and_< template< typename LatticeModel_T > -struct Equilibrium< LatticeModel_T, typename boost::enable_if< boost::mpl::and_< boost::mpl::not_< boost::mpl::bool_< LatticeModel_T::compressible > >, - boost::mpl::equal_to< boost::mpl::int_< LatticeModel_T::equilibriumAccuracyOrder >, boost::mpl::int_<1> > > >::type > +struct Equilibrium< LatticeModel_T, typename std::enable_if< ! LatticeModel_T::compressible && + LatticeModel_T::equilibriumAccuracyOrder == 1 + >::type > { static_assert( LatticeModel_T::compressible == false, "Only works with incompressible models!" ); static_assert( LatticeModel_T::equilibriumAccuracyOrder == 1, "Only works for lattice models that require the equilibrium distribution to be order 1 accurate!" ); @@ -131,12 +127,12 @@ struct Equilibrium< LatticeModel_T, typename boost::enable_if< boost::mpl::and_< template< typename LatticeModel_T > -struct Equilibrium< LatticeModel_T, typename boost::enable_if< boost::mpl::and_< boost::mpl::not_< boost::is_same< typename LatticeModel_T::Stencil, - stencil::D3Q19 > >, - boost::mpl::bool_< LatticeModel_T::compressible >, - boost::mpl::equal_to< boost::mpl::int_< LatticeModel_T::equilibriumAccuracyOrder >, boost::mpl::int_< 2 > > > >::type > +struct Equilibrium< LatticeModel_T, typename std::enable_if< ! std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value && + LatticeModel_T::compressible && + LatticeModel_T::equilibriumAccuracyOrder == 2 + >::type > { - static_assert( (boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value == false), "There is a specialization for D3Q19!" ); + static_assert( (std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value == false), "There is a specialization for D3Q19!" ); static_assert( LatticeModel_T::compressible, "Only works with compressible models!" ); static_assert( LatticeModel_T::equilibriumAccuracyOrder == 2, "Only works for lattice models that require the equilibrium distribution to be order 2 accurate!" ); @@ -169,8 +165,9 @@ struct Equilibrium< LatticeModel_T, typename boost::enable_if< boost::mpl::and_< template< typename LatticeModel_T > -struct Equilibrium< LatticeModel_T, typename boost::enable_if< boost::mpl::and_< boost::mpl::bool_< LatticeModel_T::compressible >, - boost::mpl::equal_to< boost::mpl::int_< LatticeModel_T::equilibriumAccuracyOrder >, boost::mpl::int_< 1 > > > >::type > +struct Equilibrium< LatticeModel_T, typename std::enable_if< LatticeModel_T::compressible && + LatticeModel_T::equilibriumAccuracyOrder == 1 + >::type > { static_assert( LatticeModel_T::compressible, "Only works with compressible models!" ); static_assert( LatticeModel_T::equilibriumAccuracyOrder == 1, "Only works for lattice models that require the equilibrium distribution to be order 1 accurate!" ); @@ -204,12 +201,12 @@ struct Equilibrium< LatticeModel_T, typename boost::enable_if< boost::mpl::and_< template< typename LatticeModel_T > -struct Equilibrium< LatticeModel_T, typename boost::enable_if< boost::mpl::and_< boost::is_same< typename LatticeModel_T::Stencil, - stencil::D3Q19 >, - boost::mpl::not_< boost::mpl::bool_< LatticeModel_T::compressible > >, - boost::mpl::equal_to< boost::mpl::int_< LatticeModel_T::equilibriumAccuracyOrder >, boost::mpl::int_< 2 > > > >::type > +struct Equilibrium< LatticeModel_T, typename std::enable_if< std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value && + ! LatticeModel_T::compressible && + LatticeModel_T::equilibriumAccuracyOrder == 2 + >::type > { - static_assert( (boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value), "Only works with D3Q19!" ); + static_assert( (std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value), "Only works with D3Q19!" ); static_assert( LatticeModel_T::compressible == false, "Only works with incompressible models!" ); static_assert( LatticeModel_T::equilibriumAccuracyOrder == 2, "Only works for lattice models that require the equilibrium distribution to be order 2 accurate!" ); @@ -353,12 +350,12 @@ struct Equilibrium< LatticeModel_T, typename boost::enable_if< boost::mpl::and_< template< typename LatticeModel_T > -struct Equilibrium< LatticeModel_T, typename boost::enable_if< boost::mpl::and_< boost::is_same< typename LatticeModel_T::Stencil, - stencil::D3Q19 >, - boost::mpl::bool_< LatticeModel_T::compressible >, - boost::mpl::equal_to< boost::mpl::int_< LatticeModel_T::equilibriumAccuracyOrder >, boost::mpl::int_< 2 > > > >::type > +struct Equilibrium< LatticeModel_T, typename std::enable_if< std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value && + LatticeModel_T::compressible && + LatticeModel_T::equilibriumAccuracyOrder == 2 + >::type > { - static_assert( (boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value), "Only works with D3Q19!" ); + static_assert( (std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value), "Only works with D3Q19!" ); static_assert( LatticeModel_T::compressible, "Only works with compressible models!" ); static_assert( LatticeModel_T::equilibriumAccuracyOrder == 2, "Only works for lattice models that require the equilibrium distribution to be order 2 accurate!" ); @@ -514,8 +511,9 @@ struct EquilibriumRange }; template< typename LatticeModel_T, typename FieldIteratorXYZ > -struct EquilibriumRange< LatticeModel_T, FieldIteratorXYZ, typename boost::enable_if< boost::mpl::and_< boost::mpl::not_< boost::mpl::bool_< LatticeModel_T::compressible > >, - boost::mpl::equal_to< boost::mpl::int_< LatticeModel_T::equilibriumAccuracyOrder >, boost::mpl::int_< 2 > > > >::type > +struct EquilibriumRange< LatticeModel_T, FieldIteratorXYZ, typename std::enable_if< ! LatticeModel_T::compressible && + LatticeModel_T::equilibriumAccuracyOrder == 2 + >::type > { static void set( FieldIteratorXYZ & begin, const FieldIteratorXYZ & end, const Vector3< real_t > & velocity = Vector3< real_t >( real_t(0.0) ), const real_t rho = real_t(1.0) ) @@ -536,8 +534,9 @@ struct EquilibriumRange< LatticeModel_T, FieldIteratorXYZ, typename boost::enabl }; template< typename LatticeModel_T, typename FieldIteratorXYZ > -struct EquilibriumRange< LatticeModel_T, FieldIteratorXYZ, typename boost::enable_if< boost::mpl::and_< boost::mpl::not_< boost::mpl::bool_< LatticeModel_T::compressible > >, - boost::mpl::equal_to< boost::mpl::int_< LatticeModel_T::equilibriumAccuracyOrder >, boost::mpl::int_<1> > > >::type > +struct EquilibriumRange< LatticeModel_T, FieldIteratorXYZ, typename std::enable_if< ! LatticeModel_T::compressible && + LatticeModel_T::equilibriumAccuracyOrder == 1 + >::type > { static void set( FieldIteratorXYZ & begin, const FieldIteratorXYZ & end, const Vector3< real_t > & velocity = Vector3< real_t >( real_t(0.0) ), const real_t rho = real_t(1.0) ) @@ -558,8 +557,9 @@ struct EquilibriumRange< LatticeModel_T, FieldIteratorXYZ, typename boost::enabl }; template< typename LatticeModel_T, typename FieldIteratorXYZ > -struct EquilibriumRange< LatticeModel_T, FieldIteratorXYZ, typename boost::enable_if< boost::mpl::and_< boost::mpl::bool_< LatticeModel_T::compressible >, - boost::mpl::equal_to< boost::mpl::int_<LatticeModel_T::equilibriumAccuracyOrder>, boost::mpl::int_<2> > > >::type > +struct EquilibriumRange< LatticeModel_T, FieldIteratorXYZ, typename std::enable_if< LatticeModel_T::compressible && + LatticeModel_T::equilibriumAccuracyOrder == 2 + >::type > { static void set( FieldIteratorXYZ & begin, const FieldIteratorXYZ & end, const Vector3< real_t > & velocity = Vector3< real_t >( real_t(0.0) ), const real_t rho = real_t(1.0) ) @@ -580,8 +580,9 @@ struct EquilibriumRange< LatticeModel_T, FieldIteratorXYZ, typename boost::enabl }; template< typename LatticeModel_T, typename FieldIteratorXYZ > -struct EquilibriumRange< LatticeModel_T, FieldIteratorXYZ, typename boost::enable_if< boost::mpl::and_< boost::mpl::bool_< LatticeModel_T::compressible >, - boost::mpl::equal_to< boost::mpl::int_<LatticeModel_T::equilibriumAccuracyOrder>, boost::mpl::int_<1> > > >::type > +struct EquilibriumRange< LatticeModel_T, FieldIteratorXYZ, typename std::enable_if< LatticeModel_T::compressible && + LatticeModel_T::equilibriumAccuracyOrder == 1 + >::type > { static void set( FieldIteratorXYZ & begin, const FieldIteratorXYZ & end, const Vector3< real_t > & velocity = Vector3< real_t >( real_t(0.0) ), const real_t rho = real_t(1.0) ) diff --git a/src/lbm/field/MomentumDensity.h b/src/lbm/field/MomentumDensity.h index 28e092c8a908e0550ef79fbb89e3813ee918be39..782e82ef42f1d16e788245ebe548de3bb8ca94ed 100644 --- a/src/lbm/field/MomentumDensity.h +++ b/src/lbm/field/MomentumDensity.h @@ -26,10 +26,7 @@ #include "core/DataTypes.h" #include "core/math/Vector3.h" -#include <boost/mpl/logical.hpp> -#include <boost/mpl/bool.hpp> -#include <boost/type_traits/is_same.hpp> -#include <boost/utility/enable_if.hpp> +#include <type_traits> // Back-end for calculating macroscopic values @@ -44,7 +41,7 @@ namespace internal { template< typename LatticeModel_T, typename FieldPtrOrIterator > void getMomentumDensity( Vector3< real_t > & momentumDensity, const FieldPtrOrIterator & it ) { - static_assert( (boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value == false), + static_assert( (std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value == false), "If you have the D3Q19 stencil, you should use the optimized function!" ); auto d = LatticeModel_T::Stencil::begin(); @@ -73,7 +70,7 @@ template< typename LatticeModel_T, typename PdfField_T > void getMomentumDensity( Vector3< real_t > & momentumDensity, const PdfField_T & pdf, const cell_idx_t x, const cell_idx_t y, const cell_idx_t z ) { - static_assert( (boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value == false), + static_assert( (std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value == false), "If you have the D3Q19 stencil, you should use the optimized function!" ); const auto & xyz0 = pdf(x,y,z,0); @@ -103,7 +100,7 @@ void getMomentumDensity( Vector3< real_t > & momentumDensity, const PdfField_T & template< typename LatticeModel_T, typename FieldPtrOrIterator > void getMomentumDensityD3Q19( Vector3< real_t > & momentumDensity, const FieldPtrOrIterator & it ) { - static_assert( (boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value), "This function works with D3Q19 stencils only!" ); + static_assert( (std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value), "This function works with D3Q19 stencils only!" ); using namespace stencil; typedef typename LatticeModel_T::Stencil Stencil; @@ -120,7 +117,7 @@ template< typename LatticeModel_T, typename PdfField_T > void getMomentumDensityD3Q19( Vector3< real_t > & momentumDensity, const PdfField_T & pdf, const cell_idx_t x, const cell_idx_t y, const cell_idx_t z ) { - static_assert( (boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value), "This function works with D3Q19 stencils only!" ); + static_assert( (std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value), "This function works with D3Q19 stencils only!" ); using namespace stencil; typedef typename LatticeModel_T::Stencil Stencil; @@ -154,8 +151,9 @@ struct MacroscopicForceCorrection }; template< typename LatticeModel_T > -struct MacroscopicForceCorrection< LatticeModel_T, typename boost::enable_if< boost::mpl::and_< boost::mpl::bool_< LatticeModel_T::ForceModel::constant >, - boost::mpl::bool_< LatticeModel_T::ForceModel::shiftMacVel > > >::type > +struct MacroscopicForceCorrection< LatticeModel_T, typename std::enable_if< LatticeModel_T::ForceModel::constant && + LatticeModel_T::ForceModel::shiftMacVel + >::type > { static void apply( const LatticeModel_T & latticeModel, Vector3< real_t > & momentumDensity ) { @@ -180,8 +178,9 @@ struct MacroscopicForceCorrection< LatticeModel_T, typename boost::enable_if< bo }; template< typename LatticeModel_T > -struct MacroscopicForceCorrection< LatticeModel_T, typename boost::enable_if< boost::mpl::and_< boost::mpl::not_< boost::mpl::bool_< LatticeModel_T::ForceModel::constant > >, - boost::mpl::bool_< LatticeModel_T::ForceModel::shiftMacVel > > >::type > +struct MacroscopicForceCorrection< LatticeModel_T, typename std::enable_if< ! LatticeModel_T::ForceModel::constant && + LatticeModel_T::ForceModel::shiftMacVel + >::type > { /* static void apply( const LatticeModel_T & latticeModel, Vector3< real_t > & momentumDensity ) @@ -218,7 +217,7 @@ struct MacroscopicForceCorrection< LatticeModel_T, typename boost::enable_if< bo }; template< typename LatticeModel_T > -struct MacroscopicForceCorrection< LatticeModel_T, typename boost::enable_if< boost::mpl::not_< boost::mpl::bool_< LatticeModel_T::ForceModel::shiftMacVel > > >::type > +struct MacroscopicForceCorrection< LatticeModel_T, typename std::enable_if< ! LatticeModel_T::ForceModel::shiftMacVel >::type > { static void apply( const LatticeModel_T &, Vector3< real_t > & ) {} @@ -241,8 +240,9 @@ struct EquilibriumForceCorrection }; template< typename LatticeModel_T > -struct EquilibriumForceCorrection< LatticeModel_T, typename boost::enable_if< boost::mpl::and_< boost::mpl::bool_< LatticeModel_T::ForceModel::constant >, - boost::mpl::bool_< LatticeModel_T::ForceModel::shiftEquVel > > >::type > +struct EquilibriumForceCorrection< LatticeModel_T, typename std::enable_if< LatticeModel_T::ForceModel::constant && + LatticeModel_T::ForceModel::shiftEquVel + >::type > { static void apply( const LatticeModel_T & latticeModel, Vector3< real_t > & momentumDensity ) { @@ -267,8 +267,9 @@ struct EquilibriumForceCorrection< LatticeModel_T, typename boost::enable_if< bo }; template< typename LatticeModel_T > -struct EquilibriumForceCorrection< LatticeModel_T, typename boost::enable_if< boost::mpl::and_< boost::mpl::not_< boost::mpl::bool_< LatticeModel_T::ForceModel::constant > >, - boost::mpl::bool_< LatticeModel_T::ForceModel::shiftEquVel > > >::type > +struct EquilibriumForceCorrection< LatticeModel_T, typename std::enable_if< ! LatticeModel_T::ForceModel::constant && + LatticeModel_T::ForceModel::shiftEquVel + >::type > { /* static void apply( const LatticeModel_T & latticeModel, Vector3< real_t > & momentumDensity ) @@ -305,7 +306,7 @@ struct EquilibriumForceCorrection< LatticeModel_T, typename boost::enable_if< bo }; template< typename LatticeModel_T > -struct EquilibriumForceCorrection< LatticeModel_T, typename boost::enable_if< boost::mpl::not_< boost::mpl::bool_< LatticeModel_T::ForceModel::shiftEquVel > > >::type > +struct EquilibriumForceCorrection< LatticeModel_T, typename std::enable_if< ! LatticeModel_T::ForceModel::shiftEquVel >::type > { static void apply( const LatticeModel_T &, Vector3< real_t > & ) {} @@ -328,10 +329,9 @@ struct MomentumDensity }; template< typename LatticeModel_T > -struct MomentumDensity< LatticeModel_T, typename boost::enable_if< boost::mpl::not_< boost::is_same< typename LatticeModel_T::Stencil, - stencil::D3Q19 > > >::type > +struct MomentumDensity< LatticeModel_T, typename std::enable_if< ! std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value >::type > { - static_assert( (boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value == false), "For D3Q19 there is an optimized version!" ); + static_assert( (std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value == false), "For D3Q19 there is an optimized version!" ); template< typename FieldPtrOrIterator > static void getEquilibrium( Vector3< real_t > & momentumDensity, const LatticeModel_T & latticeModel, const FieldPtrOrIterator & it ) @@ -365,9 +365,9 @@ struct MomentumDensity< LatticeModel_T, typename boost::enable_if< boost::mpl::n }; template< typename LatticeModel_T > -struct MomentumDensity< LatticeModel_T, typename boost::enable_if< boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 > >::type > +struct MomentumDensity< LatticeModel_T, typename std::enable_if< std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value >::type > { - static_assert( (boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value), "Only works with D3Q19!" ); + static_assert( (std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value), "Only works with D3Q19!" ); template< typename FieldPtrOrIterator > static void getEquilibrium( Vector3< real_t > & momentumDensity, const LatticeModel_T & latticeModel, const FieldPtrOrIterator & it ) diff --git a/src/lbm/field/ShearRate.h b/src/lbm/field/ShearRate.h index 29577948add7dc061223108494d38bcee19cdb2c..2352a9782cb9fd0c87bf231a64f0f11c8a285308 100644 --- a/src/lbm/field/ShearRate.h +++ b/src/lbm/field/ShearRate.h @@ -27,6 +27,8 @@ #include "lbm/lattice_model/CollisionModel.h" #include "lbm/lattice_model/EquilibriumDistribution.h" +#include <type_traits> + // Back-end for calculating macroscopic values @@ -45,7 +47,7 @@ namespace internal { }; template<typename CollisionModel_T> - struct ShearRelaxationParameter<CollisionModel_T, typename boost::enable_if_c<boost::is_same<typename CollisionModel_T::tag, + struct ShearRelaxationParameter<CollisionModel_T, typename std::enable_if<std::is_same<typename CollisionModel_T::tag, collision_model::SRT_tag>::value>::type> { static inline real_t get(const CollisionModel_T &lm, cell_idx_t x, cell_idx_t y, cell_idx_t z) @@ -55,7 +57,7 @@ namespace internal { }; template<typename CollisionModel_T> - struct ShearRelaxationParameter<CollisionModel_T, typename boost::enable_if_c<boost::is_same<typename CollisionModel_T::tag, + struct ShearRelaxationParameter<CollisionModel_T, typename std::enable_if<std::is_same<typename CollisionModel_T::tag, collision_model::TRT_tag>::value>::type> { static inline real_t get(const CollisionModel_T &lm, cell_idx_t, cell_idx_t, cell_idx_t) { @@ -64,7 +66,7 @@ namespace internal { }; template<typename CollisionModel_T> - struct ShearRelaxationParameter<CollisionModel_T, typename boost::enable_if_c<boost::is_same<typename CollisionModel_T::tag, + struct ShearRelaxationParameter<CollisionModel_T, typename std::enable_if<std::is_same<typename CollisionModel_T::tag, collision_model::MRT_tag>::value>::type> { static inline real_t get(const CollisionModel_T &lm, cell_idx_t, cell_idx_t, cell_idx_t) { @@ -73,7 +75,7 @@ namespace internal { }; template<typename CollisionModel_T> - struct ShearRelaxationParameter<CollisionModel_T, typename boost::enable_if_c<boost::is_same<typename CollisionModel_T::tag, + struct ShearRelaxationParameter<CollisionModel_T, typename std::enable_if<std::is_same<typename CollisionModel_T::tag, collision_model::Cumulant_tag>::value>::type> { static inline real_t get(const CollisionModel_T &cm, cell_idx_t, cell_idx_t, cell_idx_t) { diff --git a/src/lbm/gui/PdfFieldDisplayAdaptor.h b/src/lbm/gui/PdfFieldDisplayAdaptor.h index 4712d5f3281e0acafdfb89b06b65785c5fccf3bf..d5460c85f09516662dfddae2097d1b1e2c8404d6 100644 --- a/src/lbm/gui/PdfFieldDisplayAdaptor.h +++ b/src/lbm/gui/PdfFieldDisplayAdaptor.h @@ -24,7 +24,7 @@ #include "gui/BlockSliceView/DisplayPropertiesItem.h" #include "gui/BlockSliceView/FieldDisplayAdaptor.h" -#include <boost/type_traits/is_same.hpp> +#include <type_traits> namespace walberla { @@ -58,7 +58,7 @@ namespace lbm { private: typedef typename field_t::value_type T; - static_assert( (boost::is_same<T,double>::value || boost::is_same<T,float>::value), + static_assert( (std::is_same<T,double>::value || std::is_same<T,float>::value), "Only floating point fields are supported" ); using gui::FieldDisplayAdaptor<field_t>::sliceDim_; diff --git a/src/lbm/lattice_model/D2Q9.h b/src/lbm/lattice_model/D2Q9.h index 5cdebfd10de2f446468534faecce7e1deec9c503..a4080f3bc2a89ad6b201039e6308607f1216a848 100644 --- a/src/lbm/lattice_model/D2Q9.h +++ b/src/lbm/lattice_model/D2Q9.h @@ -24,8 +24,7 @@ #include "LatticeModelBase.h" #include "stencil/D2Q9.h" -#include <boost/mpl/not.hpp> -#include <boost/type_traits/is_same.hpp> +#include <type_traits> namespace walberla { @@ -38,7 +37,7 @@ class D2Q9 : public LatticeModelBase< CollisionModel_T, Compressible, ForceModel { public: - static_assert( (boost::mpl::not_< boost::is_same< CollisionModel_T, collision_model::D3Q19MRT > >::value), "D3Q19MRT only works with D3Q19!" ); + static_assert( ( ! std::is_same< CollisionModel_T, collision_model::D3Q19MRT >::value), "D3Q19MRT only works with D3Q19!" ); typedef typename LatticeModelBase< CollisionModel_T, Compressible, ForceModel_T, EquilibriumAccuracyOrder >::CollisionModel CollisionModel; typedef typename LatticeModelBase< CollisionModel_T, Compressible, ForceModel_T, EquilibriumAccuracyOrder >::ForceModel ForceModel; @@ -61,7 +60,7 @@ public: D2Q9( const CollisionModel_T & cm ) : LatticeModelBase< CollisionModel_T, Compressible, ForceModel_T, EquilibriumAccuracyOrder >( cm, force_model::None() ) { - static_assert( (boost::is_same< ForceModel_T, force_model::None >::value), "This constructor is only available if the force model is equal to force_model::None!" ); + static_assert( (std::is_same< ForceModel_T, force_model::None >::value), "This constructor is only available if the force model is equal to force_model::None!" ); } virtual ~D2Q9() {} diff --git a/src/lbm/lattice_model/D3Q15.h b/src/lbm/lattice_model/D3Q15.h index 35a849cd36a08fd6fd8c095ae9cff1c08272c367..e969749a4907fbb270350475c0d0a60bb4aa6cb9 100644 --- a/src/lbm/lattice_model/D3Q15.h +++ b/src/lbm/lattice_model/D3Q15.h @@ -25,7 +25,7 @@ #include "stencil/D3Q15.h" #include "stencil/D3Q27.h" -#include <boost/type_traits/is_same.hpp> +#include <type_traits> namespace walberla { @@ -59,7 +59,7 @@ public: D3Q15( const CollisionModel_T & cm ) : LatticeModelBase< CollisionModel_T, Compressible, ForceModel_T, EquilibriumAccuracyOrder >( cm, force_model::None() ) { - static_assert( (boost::is_same< ForceModel_T, force_model::None >::value), "This constructor is only available if the force model is equal to force_model::None!" ); + static_assert( (std::is_same< ForceModel_T, force_model::None >::value), "This constructor is only available if the force model is equal to force_model::None!" ); } virtual ~D3Q15() {} diff --git a/src/lbm/lattice_model/D3Q19.h b/src/lbm/lattice_model/D3Q19.h index 4f008d8683fd31d95b7e942fb5532b7a0039a24a..e196e4ede7b1fefc1394b53ae8e9d6b55a05cc39 100644 --- a/src/lbm/lattice_model/D3Q19.h +++ b/src/lbm/lattice_model/D3Q19.h @@ -24,7 +24,7 @@ #include "LatticeModelBase.h" #include "stencil/D3Q19.h" -#include <boost/type_traits/is_same.hpp> +#include <type_traits> namespace walberla { @@ -58,7 +58,7 @@ public: D3Q19( const CollisionModel_T & cm ) : LatticeModelBase< CollisionModel_T, Compressible, ForceModel_T, EquilibriumAccuracyOrder >( cm, force_model::None() ) { - static_assert( (boost::is_same< ForceModel_T, force_model::None >::value), "This constructor is only available if the force model is equal to force_model::None!" ); + static_assert( (std::is_same< ForceModel_T, force_model::None >::value), "This constructor is only available if the force model is equal to force_model::None!" ); } virtual ~D3Q19() {} diff --git a/src/lbm/lattice_model/D3Q27.h b/src/lbm/lattice_model/D3Q27.h index 5ca2ade61afb613d3720dbcd16ac931f6b1023dd..72b5188f5d471069d3e42fece3cdf2b146bbc46e 100644 --- a/src/lbm/lattice_model/D3Q27.h +++ b/src/lbm/lattice_model/D3Q27.h @@ -24,7 +24,7 @@ #include "LatticeModelBase.h" #include "stencil/D3Q27.h" -#include <boost/mpl/not.hpp> +#include <type_traits> namespace walberla { @@ -37,7 +37,7 @@ class D3Q27 : public LatticeModelBase< CollisionModel_T, Compressible, ForceMode { public: - static_assert( (boost::mpl::not_< boost::is_same< CollisionModel_T, collision_model::D3Q19MRT > >::value), "D3Q19MRT only works with D3Q19!" ); + static_assert( ( ! std::is_same< CollisionModel_T, collision_model::D3Q19MRT >::value), "D3Q19MRT only works with D3Q19!" ); typedef typename LatticeModelBase< CollisionModel_T, Compressible, ForceModel_T, EquilibriumAccuracyOrder >::CollisionModel CollisionModel; typedef typename LatticeModelBase< CollisionModel_T, Compressible, ForceModel_T, EquilibriumAccuracyOrder >::ForceModel ForceModel; @@ -61,7 +61,7 @@ public: D3Q27( const CollisionModel_T & cm ) : LatticeModelBase< CollisionModel_T, Compressible, ForceModel_T, EquilibriumAccuracyOrder >( cm, force_model::None() ) { - static_assert( (boost::is_same< ForceModel_T, force_model::None >::value), "This constructor is only available if the force model is equal to force_model::None!" ); + static_assert( (std::is_same< ForceModel_T, force_model::None >::value), "This constructor is only available if the force model is equal to force_model::None!" ); } virtual ~D3Q27() {} diff --git a/src/lbm/lattice_model/EquilibriumDistribution.h b/src/lbm/lattice_model/EquilibriumDistribution.h index b9b16e878b307b8267d987f27ca569146f2671a3..31daeb24681a6a0cc3f0391ca1946f85cb5273ea 100644 --- a/src/lbm/lattice_model/EquilibriumDistribution.h +++ b/src/lbm/lattice_model/EquilibriumDistribution.h @@ -26,11 +26,7 @@ #include "stencil/Directions.h" -#include <boost/mpl/bool.hpp> -#include <boost/mpl/logical.hpp> -#include <boost/mpl/equal_to.hpp> -#include <boost/mpl/int.hpp> -#include <boost/utility/enable_if.hpp> +#include <type_traits> namespace walberla { @@ -66,8 +62,9 @@ class EquilibriumDistribution; template< typename LatticeModel_T > -class EquilibriumDistribution< LatticeModel_T, typename boost::enable_if< boost::mpl::and_< boost::mpl::not_< boost::mpl::bool_< LatticeModel_T::compressible > >, - boost::mpl::equal_to< boost::mpl::int_<LatticeModel_T::equilibriumAccuracyOrder>, boost::mpl::int_<2> > > >::type > +class EquilibriumDistribution< LatticeModel_T, typename std::enable_if< ! LatticeModel_T::compressible && + LatticeModel_T::equilibriumAccuracyOrder == 2 + >::type > { public: @@ -121,8 +118,9 @@ public: template< typename LatticeModel_T > -class EquilibriumDistribution< LatticeModel_T, typename boost::enable_if< boost::mpl::and_< boost::mpl::not_< boost::mpl::bool_< LatticeModel_T::compressible > >, - boost::mpl::equal_to< boost::mpl::int_<LatticeModel_T::equilibriumAccuracyOrder>, boost::mpl::int_<1> > > >::type > +class EquilibriumDistribution< LatticeModel_T, typename std::enable_if< ! LatticeModel_T::compressible && + LatticeModel_T::equilibriumAccuracyOrder == 1 + >::type > { public: @@ -170,8 +168,8 @@ public: template< typename LatticeModel_T > -class EquilibriumDistribution< LatticeModel_T, typename boost::enable_if< boost::mpl::and_< boost::mpl::bool_<LatticeModel_T::compressible>, - boost::mpl::equal_to< boost::mpl::int_<LatticeModel_T::equilibriumAccuracyOrder>, boost::mpl::int_<2> > > >::type > +class EquilibriumDistribution< LatticeModel_T, typename std::enable_if< LatticeModel_T::compressible && + LatticeModel_T::equilibriumAccuracyOrder == 2 >::type > { public: @@ -225,8 +223,8 @@ public: template< typename LatticeModel_T > -class EquilibriumDistribution< LatticeModel_T, typename boost::enable_if< boost::mpl::and_< boost::mpl::bool_<LatticeModel_T::compressible>, - boost::mpl::equal_to< boost::mpl::int_<LatticeModel_T::equilibriumAccuracyOrder>, boost::mpl::int_<1> > > >::type > +class EquilibriumDistribution< LatticeModel_T, typename std::enable_if< LatticeModel_T::compressible && + LatticeModel_T::equilibriumAccuracyOrder == 1 >::type > { public: diff --git a/src/lbm/lattice_model/ForceModel.h b/src/lbm/lattice_model/ForceModel.h index 33a21bca3a43beb4bbac62109dbb6aeb2f7abffa..c670713dc1b8dd2b46d80529563cc4d2e0895006 100644 --- a/src/lbm/lattice_model/ForceModel.h +++ b/src/lbm/lattice_model/ForceModel.h @@ -33,6 +33,8 @@ #include "lbm/lattice_model/CollisionModel.h" #include "lbm/lattice_model/EquilibriumDistribution.h" +#include <type_traits> + namespace walberla { @@ -251,7 +253,7 @@ private: static real_t get( const real_t ) { return real_t(0); } }; template< typename LatticeModel_T > - struct DirectionIndependentTerm< LatticeModel_T, typename boost::enable_if_c< LatticeModel_T::compressible >::type > + struct DirectionIndependentTerm< LatticeModel_T, typename std::enable_if< LatticeModel_T::compressible >::type > { static real_t get( const real_t rho ) { return real_t(1) / rho; } }; @@ -265,7 +267,7 @@ private: } }; template< typename LatticeModel_T > - struct ShiftedVelocity< LatticeModel_T, typename boost::enable_if_c< LatticeModel_T::compressible >::type > + struct ShiftedVelocity< LatticeModel_T, typename std::enable_if< LatticeModel_T::compressible >::type > { static Vector3<real_t> get( const Vector3<real_t> & velocity, const Vector3<real_t> & force, const real_t rhoInv ) { @@ -494,7 +496,7 @@ public: DirectionIndependentTerms_T directionIndependentTerms( const cell_idx_t /*x*/, const cell_idx_t /*y*/, const cell_idx_t /*z*/, const Vector3<real_t> & velocity, const real_t /*rho*/, const real_t omega, const real_t omega_bulk ) const { - if (!boost::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::SRT_tag >::value) + if (!std::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::SRT_tag >::value) { const real_t one_third = real_t(1) / real_t(3); @@ -516,7 +518,7 @@ public: const real_t cx, const real_t cy, const real_t cz, const real_t omega, const real_t /*omega_bulk*/ ) const { const Vector3<real_t> c( cx, cy, cz ); - if (!boost::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::SRT_tag >::value) + if (!std::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::SRT_tag >::value) { const real_t one_third = real_t(1) / real_t(3); @@ -580,7 +582,7 @@ public: DirectionIndependentTerms_T directionIndependentTerms( const cell_idx_t x, const cell_idx_t y, const cell_idx_t z, const Vector3<real_t> & velocity, const real_t /*rho*/, const real_t omega, const real_t omega_bulk ) const { - if (!boost::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::SRT_tag >::value) + if (!std::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::SRT_tag >::value) { const real_t one_third = real_t(1) / real_t(3); @@ -603,7 +605,7 @@ public: const real_t cx, const real_t cy, const real_t cz, const real_t omega, const real_t /*omega_bulk*/ ) const { const Vector3<real_t> c( cx, cy, cz ); - if (!boost::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::SRT_tag >::value) + if (!std::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::SRT_tag >::value) { const real_t one_third = real_t(1) / real_t(3); diff --git a/src/lbm/lattice_model/NeighborsStencil.h b/src/lbm/lattice_model/NeighborsStencil.h index fb488a2c70770ffe1e8acb2edb1cc816c8945848..32badbbd354f5b87e97a865bc8f33b7ee438232b 100644 --- a/src/lbm/lattice_model/NeighborsStencil.h +++ b/src/lbm/lattice_model/NeighborsStencil.h @@ -24,9 +24,7 @@ #include "stencil/D2Q9.h" #include "stencil/D3Q27.h" -#include <boost/mpl/equal_to.hpp> -#include <boost/mpl/int.hpp> -#include <boost/utility/enable_if.hpp> +#include <type_traits> @@ -39,13 +37,13 @@ template< typename LatticeModel_T, class Enable = void > struct NeighborsStencil; template< typename LatticeModel_T > -struct NeighborsStencil< LatticeModel_T, typename boost::enable_if< boost::mpl::equal_to< boost::mpl::int_< LatticeModel_T::Stencil::D >, boost::mpl::int_<2> > >::type > +struct NeighborsStencil< LatticeModel_T, typename std::enable_if< LatticeModel_T::Stencil::D == 2 >::type > { typedef stencil::D2Q9 type; }; template< typename LatticeModel_T > -struct NeighborsStencil< LatticeModel_T, typename boost::enable_if< boost::mpl::equal_to< boost::mpl::int_< LatticeModel_T::Stencil::D >, boost::mpl::int_<3> > >::type > +struct NeighborsStencil< LatticeModel_T, typename std::enable_if< LatticeModel_T::Stencil::D == 3 >::type > { typedef stencil::D3Q27 type; }; diff --git a/src/lbm/mrt/CellwiseSweep.impl.h b/src/lbm/mrt/CellwiseSweep.impl.h index 4c0726c47743b47de66bc10c50122611bcdbb1fc..67c96e084096dcaf5bfc24ab88217705a7573385 100644 --- a/src/lbm/mrt/CellwiseSweep.impl.h +++ b/src/lbm/mrt/CellwiseSweep.impl.h @@ -31,12 +31,7 @@ #include "field/EvaluationFilter.h" #include "field/iterators/IteratorMacros.h" -#include <boost/mpl/logical.hpp> -#include <boost/mpl/equal_to.hpp> -#include <boost/mpl/bool.hpp> -#include <boost/mpl/int.hpp> -#include <boost/type_traits/is_same.hpp> -#include <boost/utility/enable_if.hpp> +#include <type_traits> namespace walberla { @@ -47,12 +42,11 @@ namespace lbm { ////////////////////////// #define WALBERLA_LBM_CELLWISE_SWEEP_SPECIALIZATION_MRT_1 \ - boost::mpl::and_< boost::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::MRT_tag >, \ - boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >, \ - boost::mpl::not_< boost::mpl::bool_< LatticeModel_T::compressible > >, \ - boost::mpl::equal_to< boost::mpl::int_< LatticeModel_T::equilibriumAccuracyOrder >, boost::mpl::int_< 2 > >, \ - boost::is_same< DensityVelocityIn_T, DefaultDensityEquilibriumVelocityCalculation > \ - > + std::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::MRT_tag >::value && \ + std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value && \ + ! LatticeModel_T::compressible && \ + LatticeModel_T::equilibriumAccuracyOrder == 2 && \ + std::is_same< DensityVelocityIn_T, DefaultDensityEquilibriumVelocityCalculation >::value WALBERLA_LBM_CELLWISE_SWEEP_CLASS_HEAD_AND_STREAM( WALBERLA_LBM_CELLWISE_SWEEP_SPECIALIZATION_MRT_1 ) @@ -183,7 +177,7 @@ WALBERLA_LBM_CELLWISE_SWEEP_STREAM_COLLIDE_HEAD( WALBERLA_LBM_CELLWISE_SWEEP_SPE _1_12 * mStar7 - _1_24 * mStar8 + _1_48 * mStar9 + _1_48 * mStar10 - _1_16 * mStar11 - _1_16 * mStar12 - _1_4 * mStar15 - _1_8 * mStar16 - _1_8 * mStar18; - if (boost::is_same< typename LatticeModel_T::ForceModel::tag, force_model::None_tag >::value == false) + if (std::is_same< typename LatticeModel_T::ForceModel::tag, force_model::None_tag >::value == false) { const auto commonForceTerms = lm.forceModel().template directionIndependentTerms< LatticeModel_T >( x, y, z, velocity, rho + real_t(1.0), collisionModel.omega(), collisionModel.omega_bulk() ); for( auto d = Stencil_T::begin(); d != Stencil_T::end(); ++d ) @@ -322,7 +316,7 @@ WALBERLA_LBM_CELLWISE_SWEEP_COLLIDE_HEAD( WALBERLA_LBM_CELLWISE_SWEEP_SPECIALIZA _1_12 * mStar7 - _1_24 * mStar8 + _1_48 * mStar9 + _1_48 * mStar10 - _1_16 * mStar11 - _1_16 * mStar12 - _1_4 * mStar15 - _1_8 * mStar16 - _1_8 * mStar18; - if (boost::is_same< typename LatticeModel_T::ForceModel::tag, force_model::None_tag >::value == false) + if (std::is_same< typename LatticeModel_T::ForceModel::tag, force_model::None_tag >::value == false) { const auto commonForceTerms = lm.forceModel().template directionIndependentTerms< LatticeModel_T >( x, y, z, velocity, rho + real_t(1.0), collisionModel.omega(), collisionModel.omega_bulk() ); for( auto d = Stencil_T::begin(); d != Stencil_T::end(); ++d ) diff --git a/src/lbm/refinement/EqualLevelBorderStreamCorrection.h b/src/lbm/refinement/EqualLevelBorderStreamCorrection.h index 39d4dec457a78d00d106fcfe4b679ec72be0e6a4..2cc428b98c35add1263d4a988d72287cab414b46 100644 --- a/src/lbm/refinement/EqualLevelBorderStreamCorrection.h +++ b/src/lbm/refinement/EqualLevelBorderStreamCorrection.h @@ -31,8 +31,7 @@ #include "stencil/D2CornerStencil.h" #include "stencil/D3EdgeCornerStencil.h" -#include <boost/mpl/int.hpp> -#include <boost/mpl/equal_to.hpp> +#include <type_traits> @@ -46,12 +45,12 @@ namespace internal { template< typename LatticeModel_T, class Enable = void > struct EdgeCornerStencil; template< typename LatticeModel_T > -struct EdgeCornerStencil< LatticeModel_T, typename boost::enable_if< boost::mpl::equal_to< boost::mpl::int_< LatticeModel_T::Stencil::D >, boost::mpl::int_<2> > >::type > +struct EdgeCornerStencil< LatticeModel_T, typename std::enable_if< LatticeModel_T::Stencil::D == 2 >::type > { typedef stencil::D2CornerStencil type; }; template< typename LatticeModel_T > -struct EdgeCornerStencil< LatticeModel_T, typename boost::enable_if< boost::mpl::equal_to< boost::mpl::int_< LatticeModel_T::Stencil::D >, boost::mpl::int_<3> > >::type > +struct EdgeCornerStencil< LatticeModel_T, typename std::enable_if< LatticeModel_T::Stencil::D == 3 >::type > { typedef stencil::D3EdgeCornerStencil type; }; diff --git a/src/lbm/srt/AdvectionDiffusionSweep.impl.h b/src/lbm/srt/AdvectionDiffusionSweep.impl.h index 996996eb9bfae30c511182f4475ffdc1ecfd91fe..6caadf6895c36a5a802ce49a6fcf44383050e02d 100644 --- a/src/lbm/srt/AdvectionDiffusionSweep.impl.h +++ b/src/lbm/srt/AdvectionDiffusionSweep.impl.h @@ -31,12 +31,7 @@ #include "lbm/sweeps/FlagFieldSweepBase.h" #include "lbm/sweeps/Streaming.h" -#include <boost/mpl/bool.hpp> -#include <boost/mpl/equal_to.hpp> -#include <boost/mpl/int.hpp> -#include <boost/mpl/logical.hpp> -#include <boost/type_traits/is_same.hpp> -#include <boost/utility/enable_if.hpp> +#include <type_traits> namespace walberla { @@ -52,19 +47,18 @@ class AdvectionDiffusionSweep template< typename LM_AdvDiff, typename VelocityAdapter_T, typename FlagField_T, typename VectorField_T > class AdvectionDiffusionSweep< LM_AdvDiff, VelocityAdapter_T, FlagField_T, VectorField_T, - typename boost::enable_if< boost::mpl::and_< boost::is_same< typename LM_AdvDiff::CollisionModel::tag, collision_model::SRT_tag >, - boost::mpl::bool_< LM_AdvDiff::CollisionModel::constant >, - boost::mpl::bool_< LM_AdvDiff::compressible >, - boost::is_same< typename LM_AdvDiff::ForceModel::tag, force_model::None_tag >, - boost::mpl::not_< boost::mpl::and_< boost::is_same< typename LM_AdvDiff::Stencil, stencil::D3Q19 >, - boost::mpl::equal_to< boost::mpl::int_< LM_AdvDiff::equilibriumAccuracyOrder >, boost::mpl::int_< 1 > > > > - > >::type > : + typename std::enable_if< std::is_same< typename LM_AdvDiff::CollisionModel::tag, collision_model::SRT_tag >::value && + LM_AdvDiff::CollisionModel::constant && + LM_AdvDiff::compressible && + std::is_same< typename LM_AdvDiff::ForceModel::tag, force_model::None_tag >::value && + ! ( std::is_same< typename LM_AdvDiff::Stencil, stencil::D3Q19 >::value && LM_AdvDiff::equilibriumAccuracyOrder == 1 ) + >::type > : public FlagFieldSweepBase< LM_AdvDiff, FlagField_T > { public: - static_assert( (boost::is_same< typename LM_AdvDiff::CollisionModel::tag, collision_model::SRT_tag >::value), "Only works with SRT!" ); + static_assert( (std::is_same< typename LM_AdvDiff::CollisionModel::tag, collision_model::SRT_tag >::value), "Only works with SRT!" ); static_assert( LM_AdvDiff::compressible, "Only works with compressible models!" ); - static_assert( (boost::is_same< typename LM_AdvDiff::ForceModel::tag, force_model::None_tag >::value), "Only works without additional forces!" ); + static_assert( (std::is_same< typename LM_AdvDiff::ForceModel::tag, force_model::None_tag >::value), "Only works without additional forces!" ); typedef typename FlagFieldSweepBase<LM_AdvDiff,FlagField_T>::PdfField_T AdvDiffPdfField_T; typedef typename LM_AdvDiff::Stencil Stencil; @@ -86,13 +80,13 @@ protected: template< typename LM_AdvDiff, typename VelocityAdapter_T, typename FlagField_T, typename VectorField_T > void AdvectionDiffusionSweep< LM_AdvDiff, VelocityAdapter_T, FlagField_T, VectorField_T, - typename boost::enable_if< boost::mpl::and_< boost::is_same< typename LM_AdvDiff::CollisionModel::tag, collision_model::SRT_tag >, - boost::mpl::bool_< LM_AdvDiff::CollisionModel::constant >, - boost::mpl::bool_< LM_AdvDiff::compressible >, - boost::is_same< typename LM_AdvDiff::ForceModel::tag, force_model::None_tag >, - boost::mpl::not_< boost::mpl::and_< boost::is_same< typename LM_AdvDiff::Stencil, stencil::D3Q19 >, - boost::mpl::equal_to< boost::mpl::int_< LM_AdvDiff::equilibriumAccuracyOrder >, boost::mpl::int_< 1 > > > > - > >::type > ::operator() ( IBlock * block ) + typename std::enable_if< std::is_same< typename LM_AdvDiff::CollisionModel::tag, collision_model::SRT_tag >::value && + LM_AdvDiff::CollisionModel::constant && + LM_AdvDiff::compressible && + std::is_same< typename LM_AdvDiff::ForceModel::tag, force_model::None_tag >::value && + ! ( std::is_same< typename LM_AdvDiff::Stencil, stencil::D3Q19 >::value && LM_AdvDiff::equilibriumAccuracyOrder == 1 ) + >::type + > ::operator() ( IBlock * block ) { AdvDiffPdfField_T * src( NULL ); AdvDiffPdfField_T * dst( NULL ); @@ -162,13 +156,13 @@ void AdvectionDiffusionSweep< LM_AdvDiff, VelocityAdapter_T, FlagField_T, Vecto template< typename LM_AdvDiff, typename VelocityAdapter_T, typename FlagField_T, typename VectorField_T > void AdvectionDiffusionSweep< LM_AdvDiff, VelocityAdapter_T, FlagField_T, VectorField_T, - typename boost::enable_if< boost::mpl::and_< boost::is_same< typename LM_AdvDiff::CollisionModel::tag, collision_model::SRT_tag >, - boost::mpl::bool_< LM_AdvDiff::CollisionModel::constant >, - boost::mpl::bool_< LM_AdvDiff::compressible >, - boost::is_same< typename LM_AdvDiff::ForceModel::tag, force_model::None_tag >, - boost::mpl::not_< boost::mpl::and_< boost::is_same< typename LM_AdvDiff::Stencil, stencil::D3Q19 >, - boost::mpl::equal_to< boost::mpl::int_< LM_AdvDiff::equilibriumAccuracyOrder >, boost::mpl::int_< 1 > > > > - > >::type > ::stream( IBlock * const block, const uint_t numberOfGhostLayersToInclude ) + typename std::enable_if< std::is_same< typename LM_AdvDiff::CollisionModel::tag, collision_model::SRT_tag >::value && + LM_AdvDiff::CollisionModel::constant && + LM_AdvDiff::compressible && + std::is_same< typename LM_AdvDiff::ForceModel::tag, force_model::None_tag >::value && + ! ( std::is_same< typename LM_AdvDiff::Stencil, stencil::D3Q19 >::value && LM_AdvDiff::equilibriumAccuracyOrder > == 1 ) + >::type + > ::stream( IBlock * const block, const uint_t numberOfGhostLayersToInclude ) { AdvDiffPdfField_T * src( NULL ); AdvDiffPdfField_T * dst( NULL ); @@ -183,13 +177,13 @@ void AdvectionDiffusionSweep< LM_AdvDiff, VelocityAdapter_T, FlagField_T, Vector template< typename LM_AdvDiff, typename VelocityAdapter_T, typename FlagField_T, typename VectorField_T > void AdvectionDiffusionSweep< LM_AdvDiff, VelocityAdapter_T, FlagField_T, VectorField_T, - typename boost::enable_if< boost::mpl::and_< boost::is_same< typename LM_AdvDiff::CollisionModel::tag, collision_model::SRT_tag >, - boost::mpl::bool_< LM_AdvDiff::CollisionModel::constant >, - boost::mpl::bool_< LM_AdvDiff::compressible >, - boost::is_same< typename LM_AdvDiff::ForceModel::tag, force_model::None_tag >, - boost::mpl::not_< boost::mpl::and_< boost::is_same< typename LM_AdvDiff::Stencil, stencil::D3Q19 >, - boost::mpl::equal_to< boost::mpl::int_< LM_AdvDiff::equilibriumAccuracyOrder >, boost::mpl::int_< 1 > > > > - > >::type > ::collide( IBlock * const block, const uint_t numberOfGhostLayersToInclude ) + typename std::enable_if< std::is_same< typename LM_AdvDiff::CollisionModel::tag, collision_model::SRT_tag >::value && + LM_AdvDiff::CollisionModel::constant && + LM_AdvDiff::compressible && + std::is_same< typename LM_AdvDiff::ForceModel::tag, force_model::None_tag >::value && + ! ( std::is_same< typename LM_AdvDiff::Stencil, stencil::D3Q19 >::value && LM_AdvDiff::equilibriumAccuracyOrder == 1 ) + >::type + > ::collide( IBlock * const block, const uint_t numberOfGhostLayersToInclude ) { AdvDiffPdfField_T * src( NULL ); const FlagField_T * flag( NULL ); @@ -250,19 +244,18 @@ void AdvectionDiffusionSweep< LM_AdvDiff, VelocityAdapter_T, FlagField_T, Vector template< typename LM_AdvDiff, typename VelocityAdapter_T, typename FlagField_T, typename VectorField_T > class AdvectionDiffusionSweep< LM_AdvDiff, VelocityAdapter_T, FlagField_T, VectorField_T, - typename boost::enable_if< boost::mpl::and_< boost::is_same< typename LM_AdvDiff::CollisionModel::tag, collision_model::SRT_tag >, - boost::mpl::not_< boost::mpl::bool_< LM_AdvDiff::CollisionModel::constant > >, - boost::mpl::bool_< LM_AdvDiff::compressible >, - boost::is_same< typename LM_AdvDiff::ForceModel::tag, force_model::None_tag >, - boost::mpl::not_< boost::mpl::and_< boost::is_same< typename LM_AdvDiff::Stencil, stencil::D3Q19 >, - boost::mpl::equal_to< boost::mpl::int_< LM_AdvDiff::equilibriumAccuracyOrder >, boost::mpl::int_< 1 > > > > - > >::type > : + typename std::enable_if< std::is_same< typename LM_AdvDiff::CollisionModel::tag, collision_model::SRT_tag >::value && + ! LM_AdvDiff::CollisionModel::constant && + LM_AdvDiff::compressible && + std::is_same< typename LM_AdvDiff::ForceModel::tag, force_model::None_tag >::value && + ! ( std::is_same< typename LM_AdvDiff::Stencil, stencil::D3Q19 >::value && LM_AdvDiff::equilibriumAccuracyOrder == 1 ) + >::type > : public FlagFieldSweepBase< LM_AdvDiff, FlagField_T > { public: - static_assert( (boost::is_same< typename LM_AdvDiff::CollisionModel::tag, collision_model::SRT_tag >::value), "Only works with SRT!" ); + static_assert( (std::is_same< typename LM_AdvDiff::CollisionModel::tag, collision_model::SRT_tag >::value), "Only works with SRT!" ); static_assert( LM_AdvDiff::compressible, "Only works with compressible models!" ); - static_assert( (boost::is_same< typename LM_AdvDiff::ForceModel::tag, force_model::None_tag >::value), "Only works without additional forces!" ); + static_assert( (std::is_same< typename LM_AdvDiff::ForceModel::tag, force_model::None_tag >::value), "Only works without additional forces!" ); typedef typename FlagFieldSweepBase<LM_AdvDiff,FlagField_T>::PdfField_T AdvDiffPdfField_T; typedef typename LM_AdvDiff::Stencil Stencil; @@ -285,13 +278,13 @@ protected: template< typename LM_AdvDiff, typename VelocityAdapter_T, typename FlagField_T, typename VectorField_T > void AdvectionDiffusionSweep< LM_AdvDiff, VelocityAdapter_T, FlagField_T, VectorField_T, - typename boost::enable_if< boost::mpl::and_< boost::is_same< typename LM_AdvDiff::CollisionModel::tag, collision_model::SRT_tag >, - boost::mpl::not_< boost::mpl::bool_< LM_AdvDiff::CollisionModel::constant > >, - boost::mpl::bool_< LM_AdvDiff::compressible >, - boost::is_same< typename LM_AdvDiff::ForceModel::tag, force_model::None_tag >, - boost::mpl::not_< boost::mpl::and_< boost::is_same< typename LM_AdvDiff::Stencil, stencil::D3Q19 >, - boost::mpl::equal_to< boost::mpl::int_< LM_AdvDiff::equilibriumAccuracyOrder >, boost::mpl::int_< 1 > > > > - > >::type > ::operator() ( IBlock * block ) + typename std::enable_if< std::is_same< typename LM_AdvDiff::CollisionModel::tag, collision_model::SRT_tag >::value && + ! LM_AdvDiff::CollisionModel::constant && + LM_AdvDiff::compressible && + std::is_same< typename LM_AdvDiff::ForceModel::tag, force_model::None_tag >::value && + !( std::is_same< typename LM_AdvDiff::Stencil, stencil::D3Q19 > && LM_AdvDiff::equilibriumAccuracyOrder == 1 ) + >::type + > ::operator() ( IBlock * block ) { AdvDiffPdfField_T * src( NULL ); AdvDiffPdfField_T * dst( NULL ); @@ -361,13 +354,13 @@ void AdvectionDiffusionSweep< LM_AdvDiff, VelocityAdapter_T, FlagField_T, Vector template< typename LM_AdvDiff, typename VelocityAdapter_T, typename FlagField_T, typename VectorField_T > void AdvectionDiffusionSweep< LM_AdvDiff, VelocityAdapter_T, FlagField_T, VectorField_T, - typename boost::enable_if< boost::mpl::and_< boost::is_same< typename LM_AdvDiff::CollisionModel::tag, collision_model::SRT_tag >, - boost::mpl::not_< boost::mpl::bool_< LM_AdvDiff::CollisionModel::constant > >, - boost::mpl::bool_< LM_AdvDiff::compressible >, - boost::is_same< typename LM_AdvDiff::ForceModel::tag, force_model::None_tag >, - boost::mpl::not_< boost::mpl::and_< boost::is_same< typename LM_AdvDiff::Stencil, stencil::D3Q19 >, - boost::mpl::equal_to< boost::mpl::int_< LM_AdvDiff::equilibriumAccuracyOrder >, boost::mpl::int_< 1 > > > > - > >::type > ::stream( IBlock * const block, const uint_t numberOfGhostLayersToInclude ) + typename std::enable_if< std::is_same< typename LM_AdvDiff::CollisionModel::tag, collision_model::SRT_tag >::value && + ! LM_AdvDiff::CollisionModel::constant && + LM_AdvDiff::compressible && + std::is_same< typename LM_AdvDiff::ForceModel::tag, force_model::None_tag >::value && + ! ( std::is_same< typename LM_AdvDiff::Stencil, stencil::D3Q19 >::value && LM_AdvDiff::equilibriumAccuracyOrder == 1 ) + >::type + > ::stream( IBlock * const block, const uint_t numberOfGhostLayersToInclude ) { AdvDiffPdfField_T * src( NULL ); AdvDiffPdfField_T * dst( NULL ); @@ -382,13 +375,13 @@ void AdvectionDiffusionSweep< LM_AdvDiff, VelocityAdapter_T, FlagField_T, Vector template< typename LM_AdvDiff, typename VelocityAdapter_T, typename FlagField_T, typename VectorField_T > void AdvectionDiffusionSweep< LM_AdvDiff, VelocityAdapter_T, FlagField_T, VectorField_T, - typename boost::enable_if< boost::mpl::and_< boost::is_same< typename LM_AdvDiff::CollisionModel::tag, collision_model::SRT_tag >, - boost::mpl::not_< boost::mpl::bool_< LM_AdvDiff::CollisionModel::constant > >, - boost::mpl::bool_< LM_AdvDiff::compressible >, - boost::is_same< typename LM_AdvDiff::ForceModel::tag, force_model::None_tag >, - boost::mpl::not_< boost::mpl::and_< boost::is_same< typename LM_AdvDiff::Stencil, stencil::D3Q19 >, - boost::mpl::equal_to< boost::mpl::int_< LM_AdvDiff::equilibriumAccuracyOrder >, boost::mpl::int_< 1 > > > > - > >::type > ::collide( IBlock * const block, const uint_t numberOfGhostLayersToInclude ) + typename std::enable_if< std::is_same< typename LM_AdvDiff::CollisionModel::tag, collision_model::SRT_tag >::value && + ! LM_AdvDiff::CollisionModel::constant && + LM_AdvDiff::compressible && + std::is_same< typename LM_AdvDiff::ForceModel::tag, force_model::None_tag >::value && + ! ( std::is_same< typename LM_AdvDiff::Stencil, stencil::D3Q19 >::value && LM_AdvDiff::equilibriumAccuracyOrder == 1 ) + >::type + > ::collide( IBlock * const block, const uint_t numberOfGhostLayersToInclude ) { AdvDiffPdfField_T * src( NULL ); const FlagField_T * flag( NULL ); @@ -449,19 +442,18 @@ void AdvectionDiffusionSweep< LM_AdvDiff, VelocityAdapter_T, FlagField_T, Vector template< typename LM_AdvDiff, typename VelocityAdapter_T, typename FlagField_T, typename VectorField_T > class AdvectionDiffusionSweep< LM_AdvDiff, VelocityAdapter_T, FlagField_T, VectorField_T, - typename boost::enable_if< boost::mpl::and_< boost::is_same< typename LM_AdvDiff::CollisionModel::tag, collision_model::SRT_tag >, - boost::mpl::bool_< LM_AdvDiff::CollisionModel::constant >, - boost::mpl::bool_< LM_AdvDiff::compressible >, - boost::is_same< typename LM_AdvDiff::ForceModel::tag, force_model::Correction_tag >, - boost::mpl::not_< boost::mpl::and_< boost::is_same< typename LM_AdvDiff::Stencil, stencil::D3Q19 >, - boost::mpl::equal_to< boost::mpl::int_< LM_AdvDiff::equilibriumAccuracyOrder >, boost::mpl::int_< 1 > > > > - > >::type > : + typename std::enable_if< std::is_same< typename LM_AdvDiff::CollisionModel::tag, collision_model::SRT_tag >::value && + LM_AdvDiff::CollisionModel::constant && + LM_AdvDiff::compressible && + std::is_same< typename LM_AdvDiff::ForceModel::tag, force_model::Correction_tag >::value && + ! ( std::is_same< typename LM_AdvDiff::Stencil, stencil::D3Q19 >::value && LM_AdvDiff::equilibriumAccuracyOrder == 1 ) + >::type > : public FlagFieldSweepBase< LM_AdvDiff, FlagField_T > { public: - static_assert( (boost::is_same< typename LM_AdvDiff::CollisionModel::tag, collision_model::SRT_tag >::value), "Only works with SRT!" ); + static_assert( (std::is_same< typename LM_AdvDiff::CollisionModel::tag, collision_model::SRT_tag >::value), "Only works with SRT!" ); static_assert( LM_AdvDiff::compressible, "Only works with compressible models!" ); - static_assert( (boost::is_same< typename LM_AdvDiff::ForceModel::tag, force_model::Correction_tag >::value), "Only works with correction force!" ); + static_assert( (std::is_same< typename LM_AdvDiff::ForceModel::tag, force_model::Correction_tag >::value), "Only works with correction force!" ); typedef typename FlagFieldSweepBase<LM_AdvDiff,FlagField_T>::PdfField_T AdvDiffPdfField_T; typedef typename LM_AdvDiff::Stencil Stencil; @@ -484,13 +476,13 @@ protected: template< typename LM_AdvDiff, typename VelocityAdapter_T, typename FlagField_T, typename VectorField_T > void AdvectionDiffusionSweep< LM_AdvDiff, VelocityAdapter_T, FlagField_T, VectorField_T, - typename boost::enable_if< boost::mpl::and_< boost::is_same< typename LM_AdvDiff::CollisionModel::tag, collision_model::SRT_tag >, - boost::mpl::bool_< LM_AdvDiff::CollisionModel::constant >, - boost::mpl::bool_< LM_AdvDiff::compressible >, - boost::is_same< typename LM_AdvDiff::ForceModel::tag, force_model::Correction_tag >, - boost::mpl::not_< boost::mpl::and_< boost::is_same< typename LM_AdvDiff::Stencil, stencil::D3Q19 >, - boost::mpl::equal_to< boost::mpl::int_< LM_AdvDiff::equilibriumAccuracyOrder >, boost::mpl::int_< 1 > > > > - > >::type > ::operator() ( IBlock * block ) + typename std::enable_if< std::is_same< typename LM_AdvDiff::CollisionModel::tag, collision_model::SRT_tag >::value && + LM_AdvDiff::CollisionModel::constant && + LM_AdvDiff::compressible && + std::is_same< typename LM_AdvDiff::ForceModel::tag, force_model::Correction_tag >::value && + ! ( std::is_same< typename LM_AdvDiff::Stencil, stencil::D3Q19 >::value && LM_AdvDiff::equilibriumAccuracyOrder == 1) + >::type + > ::operator() ( IBlock * block ) { AdvDiffPdfField_T * src( NULL ); AdvDiffPdfField_T * dst( NULL ); @@ -574,13 +566,13 @@ void AdvectionDiffusionSweep< LM_AdvDiff, VelocityAdapter_T, FlagField_T, Vector template< typename LM_AdvDiff, typename VelocityAdapter_T, typename FlagField_T, typename VectorField_T > void AdvectionDiffusionSweep< LM_AdvDiff, VelocityAdapter_T, FlagField_T, VectorField_T, - typename boost::enable_if< boost::mpl::and_< boost::is_same< typename LM_AdvDiff::CollisionModel::tag, collision_model::SRT_tag >, - boost::mpl::bool_< LM_AdvDiff::CollisionModel::constant >, - boost::mpl::bool_< LM_AdvDiff::compressible >, - boost::is_same< typename LM_AdvDiff::ForceModel::tag, force_model::Correction_tag >, - boost::mpl::not_< boost::mpl::and_< boost::is_same< typename LM_AdvDiff::Stencil, stencil::D3Q19 >, - boost::mpl::equal_to< boost::mpl::int_< LM_AdvDiff::equilibriumAccuracyOrder >, boost::mpl::int_< 1 > > > > - > >::type > ::stream( IBlock * const block, const uint_t numberOfGhostLayersToInclude ) + typename std::enable_if< std::is_same< typename LM_AdvDiff::CollisionModel::tag, collision_model::SRT_tag >::value && + LM_AdvDiff::CollisionModel::constant && + LM_AdvDiff::compressible && + std::is_same< typename LM_AdvDiff::ForceModel::tag, force_model::Correction_tag >::value && + ! ( std::is_same< typename LM_AdvDiff::Stencil, stencil::D3Q19 >::value && LM_AdvDiff::equilibriumAccuracyOrder == 1 ) + >::type + > ::stream( IBlock * const block, const uint_t numberOfGhostLayersToInclude ) { AdvDiffPdfField_T * src( NULL ); AdvDiffPdfField_T * dst( NULL ); @@ -595,13 +587,13 @@ void AdvectionDiffusionSweep< LM_AdvDiff, VelocityAdapter_T, FlagField_T, Vector template< typename LM_AdvDiff, typename VelocityAdapter_T, typename FlagField_T, typename VectorField_T > void AdvectionDiffusionSweep< LM_AdvDiff, VelocityAdapter_T, FlagField_T, VectorField_T, - typename boost::enable_if< boost::mpl::and_< boost::is_same< typename LM_AdvDiff::CollisionModel::tag, collision_model::SRT_tag >, - boost::mpl::bool_< LM_AdvDiff::CollisionModel::constant >, - boost::mpl::bool_< LM_AdvDiff::compressible >, - boost::is_same< typename LM_AdvDiff::ForceModel::tag, force_model::Correction_tag >, - boost::mpl::not_< boost::mpl::and_< boost::is_same< typename LM_AdvDiff::Stencil, stencil::D3Q19 >, - boost::mpl::equal_to< boost::mpl::int_< LM_AdvDiff::equilibriumAccuracyOrder >, boost::mpl::int_< 1 > > > > - > >::type > ::collide( IBlock * const block, const uint_t numberOfGhostLayersToInclude ) + typename std::enable_if< std::is_same< typename LM_AdvDiff::CollisionModel::tag, collision_model::SRT_tag >::value && + LM_AdvDiff::CollisionModel::constant && + LM_AdvDiff::compressible && + std::is_same< typename LM_AdvDiff::ForceModel::tag, force_model::Correction_tag >::value && + ! ( std::is_same< typename LM_AdvDiff::Stencil, stencil::D3Q19 >::value && LM_AdvDiff::equilibriumAccuracyOrder == 1 ) + >::type + > ::collide( IBlock * const block, const uint_t numberOfGhostLayersToInclude ) { AdvDiffPdfField_T * src( NULL ); const FlagField_T * flag( NULL ); @@ -683,20 +675,20 @@ void AdvectionDiffusionSweep< LM_AdvDiff, VelocityAdapter_T, FlagField_T, Vector template< typename LM_AdvDiff, typename VelocityAdapter_T, typename FlagField_T, typename VectorField_T > class AdvectionDiffusionSweep< LM_AdvDiff, VelocityAdapter_T, FlagField_T, VectorField_T, - typename boost::enable_if< boost::mpl::and_< boost::mpl::and_< boost::is_same< typename LM_AdvDiff::CollisionModel::tag, collision_model::SRT_tag >, - boost::mpl::bool_< LM_AdvDiff::CollisionModel::constant >, - boost::is_same< typename LM_AdvDiff::ForceModel::tag, force_model::None_tag >, - boost::is_same< typename LM_AdvDiff::Stencil, stencil::D3Q19 >, - boost::mpl::bool_< LM_AdvDiff::compressible > >, - boost::mpl::equal_to< boost::mpl::int_< LM_AdvDiff::equilibriumAccuracyOrder >, boost::mpl::int_< 1 > > - > >::type > : + typename std::enable_if< std::is_same< typename LM_AdvDiff::CollisionModel::tag, collision_model::SRT_tag >::value && + LM_AdvDiff::CollisionModel::constant && + std::is_same< typename LM_AdvDiff::ForceModel::tag, force_model::None_tag >::value && + std::is_same< typename LM_AdvDiff::Stencil, stencil::D3Q19>::value && + LM_AdvDiff::compressible && + LM_AdvDiff::equilibriumAccuracyOrder == 1 + >::type > : public FlagFieldSweepBase< LM_AdvDiff, FlagField_T > { public: - static_assert( (boost::is_same< typename LM_AdvDiff::CollisionModel::tag, collision_model::SRT_tag >::value), "Only works with SRT!" ); - static_assert( (boost::is_same< typename LM_AdvDiff::Stencil, stencil::D3Q19 >::value), "Only works with D3Q19!" ); + static_assert( (std::is_same< typename LM_AdvDiff::CollisionModel::tag, collision_model::SRT_tag >::value), "Only works with SRT!" ); + static_assert( (std::is_same< typename LM_AdvDiff::Stencil, stencil::D3Q19 >::value), "Only works with D3Q19!" ); static_assert( LM_AdvDiff::compressible, "Only works with compressible models!" ); - static_assert( (boost::is_same< typename LM_AdvDiff::ForceModel::tag, force_model::None_tag >::value), "Only works without additional forces!" ); + static_assert( (std::is_same< typename LM_AdvDiff::ForceModel::tag, force_model::None_tag >::value), "Only works without additional forces!" ); static_assert( LM_AdvDiff::equilibriumAccuracyOrder == 1, "Only works with equilibrium order 1!" ); typedef typename FlagFieldSweepBase<LM_AdvDiff,FlagField_T>::PdfField_T AdvDiffPdfField_T; @@ -719,13 +711,14 @@ protected: template< typename LM_AdvDiff, typename VelocityAdapter_T, typename FlagField_T, typename VectorField_T > void AdvectionDiffusionSweep< LM_AdvDiff, VelocityAdapter_T, FlagField_T, VectorField_T, - typename boost::enable_if< boost::mpl::and_< boost::mpl::and_< boost::is_same< typename LM_AdvDiff::CollisionModel::tag, collision_model::SRT_tag >, - boost::mpl::bool_< LM_AdvDiff::CollisionModel::constant >, - boost::is_same< typename LM_AdvDiff::ForceModel::tag, force_model::None_tag >, - boost::is_same< typename LM_AdvDiff::Stencil, stencil::D3Q19 >, - boost::mpl::bool_< LM_AdvDiff::compressible > >, - boost::mpl::equal_to< boost::mpl::int_< LM_AdvDiff::equilibriumAccuracyOrder >, boost::mpl::int_< 1 > > - > >::type > ::operator()( IBlock * const block ) + typename std::enable_if< std::is_same< typename LM_AdvDiff::CollisionModel::tag, collision_model::SRT_tag >::value && + LM_AdvDiff::CollisionModel::constant && + std::is_same< typename LM_AdvDiff::ForceModel::tag, force_model::None_tag >::value && + std::is_same< typename LM_AdvDiff::Stencil, stencil::D3Q19>::value && + LM_AdvDiff::compressible && + LM_AdvDiff::equilibriumAccuracyOrder == 1 + >::type + > ::operator()( IBlock * const block ) { AdvDiffPdfField_T * src( NULL ); AdvDiffPdfField_T * dst( NULL ); @@ -863,13 +856,14 @@ void AdvectionDiffusionSweep< LM_AdvDiff, VelocityAdapter_T, FlagField_T, Vector template< typename LM_AdvDiff, typename VelocityAdapter_T, typename FlagField_T, typename VectorField_T > void AdvectionDiffusionSweep< LM_AdvDiff, VelocityAdapter_T, FlagField_T, VectorField_T, - typename boost::enable_if< boost::mpl::and_< boost::mpl::and_< boost::is_same< typename LM_AdvDiff::CollisionModel::tag, collision_model::SRT_tag >, - boost::mpl::bool_< LM_AdvDiff::CollisionModel::constant >, - boost::is_same< typename LM_AdvDiff::ForceModel::tag, force_model::None_tag >, - boost::is_same< typename LM_AdvDiff::Stencil, stencil::D3Q19 >, - boost::mpl::bool_< LM_AdvDiff::compressible > >, - boost::mpl::equal_to< boost::mpl::int_< LM_AdvDiff::equilibriumAccuracyOrder >, boost::mpl::int_< 1 > > - > >::type > ::stream( IBlock * const block, const uint_t numberOfGhostLayersToInclude ) + typename std::enable_if< std::is_same< typename LM_AdvDiff::CollisionModel::tag, collision_model::SRT_tag >::value && + LM_AdvDiff::CollisionModel::constant && + std::is_same< typename LM_AdvDiff::ForceModel::tag, force_model::None_tag >::value && + std::is_same< typename LM_AdvDiff::Stencil, stencil::D3Q19>::value && + LM_AdvDiff::compressible && + LM_AdvDiff::equilibriumAccuracyOrder == 1 + >::type +> ::stream( IBlock * const block, const uint_t numberOfGhostLayersToInclude ) { AdvDiffPdfField_T * src( NULL ); AdvDiffPdfField_T * dst( NULL ); @@ -882,13 +876,14 @@ void AdvectionDiffusionSweep< LM_AdvDiff, VelocityAdapter_T, FlagField_T, Vector template< typename LM_AdvDiff, typename VelocityAdapter_T, typename FlagField_T, typename VectorField_T > void AdvectionDiffusionSweep< LM_AdvDiff, VelocityAdapter_T, FlagField_T, VectorField_T, - typename boost::enable_if< boost::mpl::and_< boost::mpl::and_< boost::is_same< typename LM_AdvDiff::CollisionModel::tag, collision_model::SRT_tag >, - boost::mpl::bool_< LM_AdvDiff::CollisionModel::constant >, - boost::is_same< typename LM_AdvDiff::ForceModel::tag, force_model::None_tag >, - boost::is_same< typename LM_AdvDiff::Stencil, stencil::D3Q19 >, - boost::mpl::bool_< LM_AdvDiff::compressible > >, - boost::mpl::equal_to< boost::mpl::int_< LM_AdvDiff::equilibriumAccuracyOrder >, boost::mpl::int_< 1 > > - > >::type > ::collide( IBlock * const block, const uint_t numberOfGhostLayersToInclude ) + typename std::enable_if< std::is_same< typename LM_AdvDiff::CollisionModel::tag, collision_model::SRT_tag >::value && + LM_AdvDiff::CollisionModel::constant && + std::is_same< typename LM_AdvDiff::ForceModel::tag, force_model::None_tag >::value && + std::is_same< typename LM_AdvDiff::Stencil, stencil::D3Q19>::value && + LM_AdvDiff::compressible && + LM_AdvDiff::equilibriumAccuracyOrder == 1 + >::type +> ::collide( IBlock * const block, const uint_t numberOfGhostLayersToInclude ) { AdvDiffPdfField_T * src( NULL ); const FlagField_T * flagField( NULL ); @@ -1032,20 +1027,20 @@ void AdvectionDiffusionSweep< LM_AdvDiff, VelocityAdapter_T, FlagField_T, Vector template< typename LM_AdvDiff, typename VelocityAdapter_T, typename FlagField_T, typename VectorField_T > class AdvectionDiffusionSweep< LM_AdvDiff, VelocityAdapter_T, FlagField_T, VectorField_T, - typename boost::enable_if< boost::mpl::and_< boost::mpl::and_< boost::is_same< typename LM_AdvDiff::CollisionModel::tag, collision_model::SRT_tag >, - boost::mpl::not_< boost::mpl::bool_< LM_AdvDiff::CollisionModel::constant > >, - boost::is_same< typename LM_AdvDiff::ForceModel::tag, force_model::None_tag >, - boost::is_same< typename LM_AdvDiff::Stencil, stencil::D3Q19 >, - boost::mpl::bool_< LM_AdvDiff::compressible > >, - boost::mpl::equal_to< boost::mpl::int_< LM_AdvDiff::equilibriumAccuracyOrder >, boost::mpl::int_< 1 > > - > >::type > : + typename std::enable_if< std::is_same< typename LM_AdvDiff::CollisionModel::tag, collision_model::SRT_tag >::value && + ! LM_AdvDiff::CollisionModel::constant && + std::is_same< typename LM_AdvDiff::ForceModel::tag, force_model::None_tag >::value && + std::is_same< typename LM_AdvDiff::Stencil, stencil::D3Q19 >::value && + LM_AdvDiff::compressible && + LM_AdvDiff::equilibriumAccuracyOrder == 1 + >::type > : public FlagFieldSweepBase< LM_AdvDiff, FlagField_T > { public: - static_assert( (boost::is_same< typename LM_AdvDiff::CollisionModel::tag, collision_model::SRT_tag >::value), "Only works with SRT!" ); - static_assert( (boost::is_same< typename LM_AdvDiff::Stencil, stencil::D3Q19 >::value), "Only works with D3Q19!" ); + static_assert( (std::is_same< typename LM_AdvDiff::CollisionModel::tag, collision_model::SRT_tag >::value), "Only works with SRT!" ); + static_assert( (std::is_same< typename LM_AdvDiff::Stencil, stencil::D3Q19 >::value), "Only works with D3Q19!" ); static_assert( LM_AdvDiff::compressible, "Only works with compressible models!" ); - static_assert( (boost::is_same< typename LM_AdvDiff::ForceModel::tag, force_model::None_tag >::value), "Only works without additional forces!" ); + static_assert( (std::is_same< typename LM_AdvDiff::ForceModel::tag, force_model::None_tag >::value), "Only works without additional forces!" ); static_assert( LM_AdvDiff::equilibriumAccuracyOrder == 1, "Only works with equilibrium order 1!" ); typedef typename FlagFieldSweepBase<LM_AdvDiff,FlagField_T>::PdfField_T AdvDiffPdfField_T; @@ -1068,13 +1063,13 @@ protected: template< typename LM_AdvDiff, typename VelocityAdapter_T, typename FlagField_T, typename VectorField_T > void AdvectionDiffusionSweep< LM_AdvDiff, VelocityAdapter_T, FlagField_T, VectorField_T, - typename boost::enable_if< boost::mpl::and_< boost::mpl::and_< boost::is_same< typename LM_AdvDiff::CollisionModel::tag, collision_model::SRT_tag >, - boost::mpl::not_< boost::mpl::bool_< LM_AdvDiff::CollisionModel::constant > >, - boost::is_same< typename LM_AdvDiff::ForceModel::tag, force_model::None_tag >, - boost::is_same< typename LM_AdvDiff::Stencil, stencil::D3Q19 >, - boost::mpl::bool_< LM_AdvDiff::compressible > >, - boost::mpl::equal_to< boost::mpl::int_< LM_AdvDiff::equilibriumAccuracyOrder >, boost::mpl::int_< 1 > > - > >::type > ::operator()( IBlock * const block ) + typename std::enable_if< std::is_same< typename LM_AdvDiff::CollisionModel::tag, collision_model::SRT_tag >::value && + ! LM_AdvDiff::CollisionModel::constant && + std::is_same< typename LM_AdvDiff::ForceModel::tag, force_model::None_tag >::value && + std::is_same< typename LM_AdvDiff::Stencil, stencil::D3Q19 >::value && + LM_AdvDiff::compressible && + LM_AdvDiff::equilibriumAccuracyOrder == 1 + >::type > ::operator()( IBlock * const block ) { AdvDiffPdfField_T * src( NULL ); AdvDiffPdfField_T * dst( NULL ); @@ -1211,13 +1206,13 @@ void AdvectionDiffusionSweep< LM_AdvDiff, VelocityAdapter_T, FlagField_T, Vector template< typename LM_AdvDiff, typename VelocityAdapter_T, typename FlagField_T, typename VectorField_T > void AdvectionDiffusionSweep< LM_AdvDiff, VelocityAdapter_T, FlagField_T, VectorField_T, - typename boost::enable_if< boost::mpl::and_< boost::mpl::and_< boost::is_same< typename LM_AdvDiff::CollisionModel::tag, collision_model::SRT_tag >, - boost::mpl::not_< boost::mpl::bool_< LM_AdvDiff::CollisionModel::constant > >, - boost::is_same< typename LM_AdvDiff::ForceModel::tag, force_model::None_tag >, - boost::is_same< typename LM_AdvDiff::Stencil, stencil::D3Q19 >, - boost::mpl::bool_< LM_AdvDiff::compressible > >, - boost::mpl::equal_to< boost::mpl::int_< LM_AdvDiff::equilibriumAccuracyOrder >, boost::mpl::int_< 1 > > - > >::type > ::stream( IBlock * const block, const uint_t numberOfGhostLayersToInclude ) + typename std::enable_if< std::is_same< typename LM_AdvDiff::CollisionModel::tag, collision_model::SRT_tag >::value && + ! LM_AdvDiff::CollisionModel::constant && + std::is_same< typename LM_AdvDiff::ForceModel::tag, force_model::None_tag >::value && + std::is_same< typename LM_AdvDiff::Stencil, stencil::D3Q19 >::value && + LM_AdvDiff::compressible && + LM_AdvDiff::equilibriumAccuracyOrder == 1 + >::type > ::stream( IBlock * const block, const uint_t numberOfGhostLayersToInclude ) { AdvDiffPdfField_T * src( NULL ); AdvDiffPdfField_T * dst( NULL ); @@ -1230,13 +1225,13 @@ void AdvectionDiffusionSweep< LM_AdvDiff, VelocityAdapter_T, FlagField_T, Vector template< typename LM_AdvDiff, typename VelocityAdapter_T, typename FlagField_T, typename VectorField_T > void AdvectionDiffusionSweep< LM_AdvDiff, VelocityAdapter_T, FlagField_T, VectorField_T, - typename boost::enable_if< boost::mpl::and_< boost::mpl::and_< boost::is_same< typename LM_AdvDiff::CollisionModel::tag, collision_model::SRT_tag >, - boost::mpl::not_< boost::mpl::bool_< LM_AdvDiff::CollisionModel::constant > >, - boost::is_same< typename LM_AdvDiff::ForceModel::tag, force_model::None_tag >, - boost::is_same< typename LM_AdvDiff::Stencil, stencil::D3Q19 >, - boost::mpl::bool_< LM_AdvDiff::compressible > >, - boost::mpl::equal_to< boost::mpl::int_< LM_AdvDiff::equilibriumAccuracyOrder >, boost::mpl::int_< 1 > > - > >::type > ::collide( IBlock * const block, const uint_t numberOfGhostLayersToInclude ) + typename std::enable_if< std::is_same< typename LM_AdvDiff::CollisionModel::tag, collision_model::SRT_tag >::value && + ! LM_AdvDiff::CollisionModel::constant && + std::is_same< typename LM_AdvDiff::ForceModel::tag, force_model::None_tag >::value && + std::is_same< typename LM_AdvDiff::Stencil, stencil::D3Q19 >::value && + LM_AdvDiff::compressible && + LM_AdvDiff::equilibriumAccuracyOrder == 1 + >::type > ::collide( IBlock * const block, const uint_t numberOfGhostLayersToInclude ) { AdvDiffPdfField_T * src( NULL ); const FlagField_T * flagField( NULL ); @@ -1377,20 +1372,20 @@ void AdvectionDiffusionSweep< LM_AdvDiff, VelocityAdapter_T, FlagField_T, Vector /////////////////////////////// template< typename LM_AdvDiff, typename VelocityAdapter_T, typename FlagField_T, typename VectorField_T > class AdvectionDiffusionSweep< LM_AdvDiff, VelocityAdapter_T, FlagField_T, VectorField_T, - typename boost::enable_if< boost::mpl::and_< boost::mpl::and_< boost::is_same< typename LM_AdvDiff::CollisionModel::tag, collision_model::SRT_tag >, - boost::mpl::bool_< LM_AdvDiff::CollisionModel::constant >, - boost::is_same< typename LM_AdvDiff::ForceModel::tag, force_model::Correction_tag >, - boost::is_same< typename LM_AdvDiff::Stencil, stencil::D3Q19 >, - boost::mpl::bool_< LM_AdvDiff::compressible > >, - boost::mpl::equal_to< boost::mpl::int_< LM_AdvDiff::equilibriumAccuracyOrder >, boost::mpl::int_< 1 > > - > >::type > : + typename std::enable_if< std::is_same< typename LM_AdvDiff::CollisionModel::tag, collision_model::SRT_tag >::value && + LM_AdvDiff::CollisionModel::constant && + std::is_same< typename LM_AdvDiff::ForceModel::tag, force_model::Correction_tag >::value && + std::is_same< typename LM_AdvDiff::Stencil, stencil::D3Q19 >::value && + LM_AdvDiff::compressible && + LM_AdvDiff::equilibriumAccuracyOrder == 1 + >::type > : public FlagFieldSweepBase< LM_AdvDiff, FlagField_T > { public: - static_assert( (boost::is_same< typename LM_AdvDiff::CollisionModel::tag, collision_model::SRT_tag >::value), "Only works with SRT!" ); - static_assert( (boost::is_same< typename LM_AdvDiff::Stencil, stencil::D3Q19 >::value), "Only works with D3Q19!" ); + static_assert( (std::is_same< typename LM_AdvDiff::CollisionModel::tag, collision_model::SRT_tag >::value), "Only works with SRT!" ); + static_assert( (std::is_same< typename LM_AdvDiff::Stencil, stencil::D3Q19 >::value), "Only works with D3Q19!" ); static_assert( LM_AdvDiff::compressible, "Only works with compressible models!" ); - static_assert( (boost::is_same< typename LM_AdvDiff::ForceModel::tag, force_model::Correction_tag >::value), "Only works with correction force!" ); + static_assert( (std::is_same< typename LM_AdvDiff::ForceModel::tag, force_model::Correction_tag >::value), "Only works with correction force!" ); static_assert( LM_AdvDiff::equilibriumAccuracyOrder == 1, "Only works with equilibrium order 1!" ); typedef typename FlagFieldSweepBase<LM_AdvDiff,FlagField_T>::PdfField_T AdvDiffPdfField_T; @@ -1415,13 +1410,13 @@ protected: template< typename LM_AdvDiff, typename VelocityAdapter_T, typename FlagField_T, typename VectorField_T > void AdvectionDiffusionSweep< LM_AdvDiff, VelocityAdapter_T, FlagField_T, VectorField_T, - typename boost::enable_if< boost::mpl::and_< boost::mpl::and_< boost::is_same< typename LM_AdvDiff::CollisionModel::tag, collision_model::SRT_tag >, - boost::mpl::bool_< LM_AdvDiff::CollisionModel::constant >, - boost::is_same< typename LM_AdvDiff::ForceModel::tag, force_model::Correction_tag >, - boost::is_same< typename LM_AdvDiff::Stencil, stencil::D3Q19 >, - boost::mpl::bool_< LM_AdvDiff::compressible > >, - boost::mpl::equal_to< boost::mpl::int_< LM_AdvDiff::equilibriumAccuracyOrder >, boost::mpl::int_< 1 > > - > >::type > ::operator()( IBlock * const block ) + typename std::enable_if< std::is_same< typename LM_AdvDiff::CollisionModel::tag, collision_model::SRT_tag >::value && + LM_AdvDiff::CollisionModel::constant && + std::is_same< typename LM_AdvDiff::ForceModel::tag, force_model::Correction_tag >::value && + std::is_same< typename LM_AdvDiff::Stencil, stencil::D3Q19 >::value && + LM_AdvDiff::compressible && + LM_AdvDiff::equilibriumAccuracyOrder == 1 + >::type > ::operator()( IBlock * const block ) { AdvDiffPdfField_T * src( NULL ); AdvDiffPdfField_T * dst( NULL ); @@ -1584,13 +1579,13 @@ void AdvectionDiffusionSweep< LM_AdvDiff, VelocityAdapter_T, FlagField_T, Vector template< typename LM_AdvDiff, typename VelocityAdapter_T, typename FlagField_T, typename VectorField_T > void AdvectionDiffusionSweep< LM_AdvDiff, VelocityAdapter_T, FlagField_T, VectorField_T, - typename boost::enable_if< boost::mpl::and_< boost::mpl::and_< boost::is_same< typename LM_AdvDiff::CollisionModel::tag, collision_model::SRT_tag >, - boost::mpl::bool_< LM_AdvDiff::CollisionModel::constant >, - boost::is_same< typename LM_AdvDiff::ForceModel::tag, force_model::Correction_tag >, - boost::is_same< typename LM_AdvDiff::Stencil, stencil::D3Q19 >, - boost::mpl::bool_< LM_AdvDiff::compressible > >, - boost::mpl::equal_to< boost::mpl::int_< LM_AdvDiff::equilibriumAccuracyOrder >, boost::mpl::int_< 1 > > - > >::type > ::stream( IBlock * const block, const uint_t numberOfGhostLayersToInclude ) + typename std::enable_if< std::is_same< typename LM_AdvDiff::CollisionModel::tag, collision_model::SRT_tag >::value && + LM_AdvDiff::CollisionModel::constant && + std::is_same< typename LM_AdvDiff::ForceModel::tag, force_model::Correction_tag >::value && + std::is_same< typename LM_AdvDiff::Stencil, stencil::D3Q19 >::value && + LM_AdvDiff::compressible && + LM_AdvDiff::equilibriumAccuracyOrder == 1 + >::type > ::stream( IBlock * const block, const uint_t numberOfGhostLayersToInclude ) { AdvDiffPdfField_T * src( NULL ); AdvDiffPdfField_T * dst( NULL ); @@ -1603,13 +1598,13 @@ void AdvectionDiffusionSweep< LM_AdvDiff, VelocityAdapter_T, FlagField_T, Vector template< typename LM_AdvDiff, typename VelocityAdapter_T, typename FlagField_T, typename VectorField_T > void AdvectionDiffusionSweep< LM_AdvDiff, VelocityAdapter_T, FlagField_T, VectorField_T, - typename boost::enable_if< boost::mpl::and_< boost::mpl::and_< boost::is_same< typename LM_AdvDiff::CollisionModel::tag, collision_model::SRT_tag >, - boost::mpl::bool_< LM_AdvDiff::CollisionModel::constant >, - boost::is_same< typename LM_AdvDiff::ForceModel::tag, force_model::Correction_tag >, - boost::is_same< typename LM_AdvDiff::Stencil, stencil::D3Q19 >, - boost::mpl::bool_< LM_AdvDiff::compressible > >, - boost::mpl::equal_to< boost::mpl::int_< LM_AdvDiff::equilibriumAccuracyOrder >, boost::mpl::int_< 1 > > - > >::type > ::collide( IBlock * const block, const uint_t numberOfGhostLayersToInclude ) + typename std::enable_if< std::is_same< typename LM_AdvDiff::CollisionModel::tag, collision_model::SRT_tag >::value && + LM_AdvDiff::CollisionModel::constant && + std::is_same< typename LM_AdvDiff::ForceModel::tag, force_model::Correction_tag >::value && + std::is_same< typename LM_AdvDiff::Stencil, stencil::D3Q19 >::value && + LM_AdvDiff::compressible && + LM_AdvDiff::equilibriumAccuracyOrder == 1 + >::type > ::collide( IBlock * const block, const uint_t numberOfGhostLayersToInclude ) { AdvDiffPdfField_T * src( NULL ); const FlagField_T * flagField( NULL ); diff --git a/src/lbm/srt/CellwiseSweep.impl.h b/src/lbm/srt/CellwiseSweep.impl.h index 01f0c265fe6791ebf9f24bf4a627707b72d7df2d..37e156f57dcf1a150946db8c1ae96ad707bbee63 100644 --- a/src/lbm/srt/CellwiseSweep.impl.h +++ b/src/lbm/srt/CellwiseSweep.impl.h @@ -31,12 +31,8 @@ #include "field/EvaluationFilter.h" #include "field/iterators/IteratorMacros.h" -#include <boost/mpl/logical.hpp> -#include <boost/mpl/equal_to.hpp> -#include <boost/mpl/bool.hpp> -#include <boost/mpl/int.hpp> -#include <boost/type_traits/is_same.hpp> -#include <boost/utility/enable_if.hpp> +#include <type_traits> + namespace walberla { @@ -51,14 +47,13 @@ namespace lbm { ////////////////////////// #define WALBERLA_LBM_CELLWISE_SWEEP_SPECIALIZATION_SRT_9 \ - boost::mpl::and_< boost::mpl::and_< boost::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::SRT_tag >, \ - boost::is_same< typename LatticeModel_T::Stencil, stencil::D2Q9 >, \ - boost::mpl::bool_< LatticeModel_T::CollisionModel::constant >, \ - boost::mpl::not_< boost::mpl::bool_< LatticeModel_T::compressible > >, \ - boost::mpl::equal_to< boost::mpl::int_< LatticeModel_T::equilibriumAccuracyOrder >, boost::mpl::int_<2> > >, \ - boost::mpl::and_< boost::is_same< typename LatticeModel_T::ForceModel::tag, force_model::None_tag >, \ - boost::is_same< DensityVelocityIn_T, DefaultDensityEquilibriumVelocityCalculation > > \ - > + (std::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::SRT_tag >::value && \ + std::is_same< typename LatticeModel_T::Stencil, stencil::D2Q9 >::value && \ + LatticeModel_T::CollisionModel::constant && \ + ! LatticeModel_T::compressible && \ + LatticeModel_T::equilibriumAccuracyOrder == 2 && \ + std::is_same< typename LatticeModel_T::ForceModel::tag, force_model::None_tag >::value && \ + std::is_same< DensityVelocityIn_T, DefaultDensityEquilibriumVelocityCalculation >::value) WALBERLA_LBM_CELLWISE_SWEEP_CLASS_HEAD_AND_STREAM( WALBERLA_LBM_CELLWISE_SWEEP_SPECIALIZATION_SRT_9 ) @@ -183,14 +178,13 @@ WALBERLA_LBM_CELLWISE_SWEEP_COLLIDE_FOOT() /////////////////////////// #define WALBERLA_LBM_CELLWISE_SWEEP_SPECIALIZATION_SRT_1 \ - boost::mpl::and_< boost::mpl::and_< boost::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::SRT_tag >, \ - boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >, \ - boost::mpl::bool_< LatticeModel_T::CollisionModel::constant >, \ - boost::mpl::not_< boost::mpl::bool_< LatticeModel_T::compressible > >, \ - boost::mpl::equal_to< boost::mpl::int_< LatticeModel_T::equilibriumAccuracyOrder >, boost::mpl::int_< 2 > > >, \ - boost::mpl::and_< boost::is_same< typename LatticeModel_T::ForceModel::tag, force_model::None_tag >, \ - boost::is_same< DensityVelocityIn_T, DefaultDensityEquilibriumVelocityCalculation > > \ - > + (std::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::SRT_tag >::value && \ + std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value && \ + LatticeModel_T::CollisionModel::constant && \ + ! LatticeModel_T::compressible && \ + LatticeModel_T::equilibriumAccuracyOrder == 2 && \ + std::is_same< typename LatticeModel_T::ForceModel::tag, force_model::None_tag >::value && \ + std::is_same< DensityVelocityIn_T, DefaultDensityEquilibriumVelocityCalculation >::value) WALBERLA_LBM_CELLWISE_SWEEP_CLASS_HEAD_AND_STREAM( WALBERLA_LBM_CELLWISE_SWEEP_SPECIALIZATION_SRT_1 ) @@ -367,14 +361,13 @@ WALBERLA_LBM_CELLWISE_SWEEP_COLLIDE_FOOT() #define WALBERLA_LBM_CELLWISE_SWEEP_SPECIALIZATION_SRT_2 \ - boost::mpl::and_< boost::mpl::and_< boost::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::SRT_tag >, \ - boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >, \ - boost::mpl::bool_< LatticeModel_T::CollisionModel::constant >, \ - boost::mpl::bool_< LatticeModel_T::compressible >, \ - boost::mpl::equal_to< boost::mpl::int_< LatticeModel_T::equilibriumAccuracyOrder >, boost::mpl::int_<2> > >, \ - boost::mpl::and_< boost::is_same< typename LatticeModel_T::ForceModel::tag, force_model::None_tag >, \ - boost::is_same< DensityVelocityIn_T, DefaultDensityEquilibriumVelocityCalculation > > \ - > + (std::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::SRT_tag >::value && \ + std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value && \ + LatticeModel_T::CollisionModel::constant && \ + LatticeModel_T::compressible && \ + LatticeModel_T::equilibriumAccuracyOrder == 2 && \ + std::is_same< typename LatticeModel_T::ForceModel::tag, force_model::None_tag >::value && \ + std::is_same< DensityVelocityIn_T, DefaultDensityEquilibriumVelocityCalculation >::value) WALBERLA_LBM_CELLWISE_SWEEP_CLASS_HEAD_AND_STREAM( WALBERLA_LBM_CELLWISE_SWEEP_SPECIALIZATION_SRT_2 ) @@ -559,14 +552,13 @@ WALBERLA_LBM_CELLWISE_SWEEP_COLLIDE_FOOT() #define WALBERLA_LBM_CELLWISE_SWEEP_SPECIALIZATION_SRT_3 \ - boost::mpl::and_< boost::mpl::and_< boost::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::SRT_tag >, \ - boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >, \ - boost::mpl::bool_< LatticeModel_T::CollisionModel::constant >, \ - boost::mpl::not_< boost::mpl::bool_< LatticeModel_T::compressible > >, \ - boost::mpl::equal_to< boost::mpl::int_< LatticeModel_T::equilibriumAccuracyOrder >, boost::mpl::int_<2> > >, \ - boost::mpl::and_< boost::is_same< typename LatticeModel_T::ForceModel::tag, force_model::Simple_tag >, \ - boost::is_same< DensityVelocityIn_T, DefaultDensityEquilibriumVelocityCalculation > > \ - > + (std::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::SRT_tag >::value && \ + std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value && \ + LatticeModel_T::CollisionModel::constant && \ + ! LatticeModel_T::compressible && \ + LatticeModel_T::equilibriumAccuracyOrder == 2 && \ + std::is_same< typename LatticeModel_T::ForceModel::tag, force_model::Simple_tag >::value && \ + std::is_same< DensityVelocityIn_T, DefaultDensityEquilibriumVelocityCalculation >::value) WALBERLA_LBM_CELLWISE_SWEEP_CLASS_HEAD_AND_STREAM( WALBERLA_LBM_CELLWISE_SWEEP_SPECIALIZATION_SRT_3 ) @@ -753,14 +745,13 @@ WALBERLA_LBM_CELLWISE_SWEEP_COLLIDE_FOOT() #define WALBERLA_LBM_CELLWISE_SWEEP_SPECIALIZATION_SRT_4 \ - boost::mpl::and_< boost::mpl::and_< boost::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::SRT_tag >, \ - boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >, \ - boost::mpl::bool_< LatticeModel_T::CollisionModel::constant >, \ - boost::mpl::bool_< LatticeModel_T::compressible >, \ - boost::mpl::equal_to< boost::mpl::int_< LatticeModel_T::equilibriumAccuracyOrder >, boost::mpl::int_<2> > >, \ - boost::mpl::and_< boost::is_same< typename LatticeModel_T::ForceModel::tag, force_model::Simple_tag >, \ - boost::is_same< DensityVelocityIn_T, DefaultDensityEquilibriumVelocityCalculation > > \ - > + (std::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::SRT_tag >::value && \ + std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value && \ + LatticeModel_T::CollisionModel::constant && \ + LatticeModel_T::compressible && \ + LatticeModel_T::equilibriumAccuracyOrder == 2 && \ + std::is_same< typename LatticeModel_T::ForceModel::tag, force_model::Simple_tag >::value && \ + std::is_same< DensityVelocityIn_T, DefaultDensityEquilibriumVelocityCalculation >::value) WALBERLA_LBM_CELLWISE_SWEEP_CLASS_HEAD_AND_STREAM( WALBERLA_LBM_CELLWISE_SWEEP_SPECIALIZATION_SRT_4 ) @@ -959,14 +950,13 @@ WALBERLA_LBM_CELLWISE_SWEEP_COLLIDE_FOOT() /////////////////////////// #define WALBERLA_LBM_CELLWISE_SWEEP_SPECIALIZATION_SRT_5 \ - boost::mpl::and_< boost::mpl::and_< boost::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::SRT_tag >, \ - boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q27 >, \ - boost::mpl::bool_< LatticeModel_T::CollisionModel::constant >, \ - boost::mpl::not_< boost::mpl::bool_< LatticeModel_T::compressible > >, \ - boost::mpl::equal_to< boost::mpl::int_< LatticeModel_T::equilibriumAccuracyOrder >, boost::mpl::int_<2> > >, \ - boost::mpl::and_< boost::is_same< typename LatticeModel_T::ForceModel::tag, force_model::None_tag >, \ - boost::is_same< DensityVelocityIn_T, DefaultDensityEquilibriumVelocityCalculation > > \ - > + (std::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::SRT_tag >::value && \ + std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q27 >::value && \ + LatticeModel_T::CollisionModel::constant && \ + ! LatticeModel_T::compressible && \ + LatticeModel_T::equilibriumAccuracyOrder == 2 && \ + std::is_same< typename LatticeModel_T::ForceModel::tag, force_model::None_tag >::value && \ + std::is_same< DensityVelocityIn_T, DefaultDensityEquilibriumVelocityCalculation >::value) WALBERLA_LBM_CELLWISE_SWEEP_CLASS_HEAD_AND_STREAM( WALBERLA_LBM_CELLWISE_SWEEP_SPECIALIZATION_SRT_5 ) @@ -1194,14 +1184,13 @@ WALBERLA_LBM_CELLWISE_SWEEP_COLLIDE_FOOT() #define WALBERLA_LBM_CELLWISE_SWEEP_SPECIALIZATION_SRT_6 \ - boost::mpl::and_< boost::mpl::and_< boost::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::SRT_tag >, \ - boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q27 >, \ - boost::mpl::bool_< LatticeModel_T::CollisionModel::constant >, \ - boost::mpl::bool_< LatticeModel_T::compressible >, \ - boost::mpl::equal_to< boost::mpl::int_< LatticeModel_T::equilibriumAccuracyOrder >, boost::mpl::int_<2> > >, \ - boost::mpl::and_< boost::is_same< typename LatticeModel_T::ForceModel::tag, force_model::None_tag >, \ - boost::is_same< DensityVelocityIn_T, DefaultDensityEquilibriumVelocityCalculation > > \ - > + (std::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::SRT_tag >::value && \ + std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q27 >::value && \ + LatticeModel_T::CollisionModel::constant && \ + LatticeModel_T::compressible && \ + LatticeModel_T::equilibriumAccuracyOrder == 2 && \ + std::is_same< typename LatticeModel_T::ForceModel::tag, force_model::None_tag >::value && \ + std::is_same< DensityVelocityIn_T, DefaultDensityEquilibriumVelocityCalculation >::value) WALBERLA_LBM_CELLWISE_SWEEP_CLASS_HEAD_AND_STREAM( WALBERLA_LBM_CELLWISE_SWEEP_SPECIALIZATION_SRT_6 ) @@ -1440,14 +1429,13 @@ WALBERLA_LBM_CELLWISE_SWEEP_COLLIDE_FOOT() #define WALBERLA_LBM_CELLWISE_SWEEP_SPECIALIZATION_SRT_7 \ - boost::mpl::and_< boost::mpl::and_< boost::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::SRT_tag >, \ - boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q27 >, \ - boost::mpl::bool_< LatticeModel_T::CollisionModel::constant >, \ - boost::mpl::not_< boost::mpl::bool_< LatticeModel_T::compressible > >, \ - boost::mpl::equal_to< boost::mpl::int_< LatticeModel_T::equilibriumAccuracyOrder >, boost::mpl::int_<2> > >, \ - boost::mpl::and_< boost::is_same< typename LatticeModel_T::ForceModel::tag, force_model::Simple_tag >, \ - boost::is_same< DensityVelocityIn_T, DefaultDensityEquilibriumVelocityCalculation > > \ - > + (std::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::SRT_tag >::value && \ + std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q27 >::value && \ + LatticeModel_T::CollisionModel::constant && \ + ! LatticeModel_T::compressible && \ + LatticeModel_T::equilibriumAccuracyOrder == 2 && \ + std::is_same< typename LatticeModel_T::ForceModel::tag, force_model::Simple_tag >::value && \ + std::is_same< DensityVelocityIn_T, DefaultDensityEquilibriumVelocityCalculation >::value) WALBERLA_LBM_CELLWISE_SWEEP_CLASS_HEAD_AND_STREAM( WALBERLA_LBM_CELLWISE_SWEEP_SPECIALIZATION_SRT_7 ) @@ -1686,14 +1674,13 @@ WALBERLA_LBM_CELLWISE_SWEEP_COLLIDE_FOOT() #define WALBERLA_LBM_CELLWISE_SWEEP_SPECIALIZATION_SRT_8 \ - boost::mpl::and_< boost::mpl::and_< boost::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::SRT_tag >, \ - boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q27 >, \ - boost::mpl::bool_< LatticeModel_T::CollisionModel::constant >, \ - boost::mpl::bool_< LatticeModel_T::compressible >, \ - boost::mpl::equal_to< boost::mpl::int_< LatticeModel_T::equilibriumAccuracyOrder >, boost::mpl::int_<2> > >, \ - boost::mpl::and_< boost::is_same< typename LatticeModel_T::ForceModel::tag, force_model::Simple_tag >, \ - boost::is_same< DensityVelocityIn_T, DefaultDensityEquilibriumVelocityCalculation > > \ - > + (std::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::SRT_tag >::value && \ + std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q27 >::value && \ + LatticeModel_T::CollisionModel::constant && \ + LatticeModel_T::compressible && \ + LatticeModel_T::equilibriumAccuracyOrder == 2 && \ + std::is_same< typename LatticeModel_T::ForceModel::tag, force_model::Simple_tag >::value && \ + std::is_same< DensityVelocityIn_T, DefaultDensityEquilibriumVelocityCalculation >::value) WALBERLA_LBM_CELLWISE_SWEEP_CLASS_HEAD_AND_STREAM( WALBERLA_LBM_CELLWISE_SWEEP_SPECIALIZATION_SRT_8 ) @@ -1948,21 +1935,16 @@ WALBERLA_LBM_CELLWISE_SWEEP_COLLIDE_FOOT() //////////////////////////////// #define WALBERLA_LBM_CELLWISE_SWEEP_SPECIALIZATION_SRT \ - boost::mpl::and_< boost::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::SRT_tag >, \ - boost::mpl::not_< boost::mpl::or_< boost::mpl::or_< WALBERLA_LBM_CELLWISE_SWEEP_SPECIALIZATION_SRT_1, \ - WALBERLA_LBM_CELLWISE_SWEEP_SPECIALIZATION_SRT_2, \ - WALBERLA_LBM_CELLWISE_SWEEP_SPECIALIZATION_SRT_3, \ - WALBERLA_LBM_CELLWISE_SWEEP_SPECIALIZATION_SRT_4, \ - WALBERLA_LBM_CELLWISE_SWEEP_SPECIALIZATION_SRT_5 \ - >, \ - boost::mpl::or_< WALBERLA_LBM_CELLWISE_SWEEP_SPECIALIZATION_SRT_6, \ - WALBERLA_LBM_CELLWISE_SWEEP_SPECIALIZATION_SRT_7, \ - WALBERLA_LBM_CELLWISE_SWEEP_SPECIALIZATION_SRT_8, \ - WALBERLA_LBM_CELLWISE_SWEEP_SPECIALIZATION_SRT_9 \ - > \ - > \ - > \ - > + std::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::SRT_tag >::value && \ + ! ( WALBERLA_LBM_CELLWISE_SWEEP_SPECIALIZATION_SRT_1 || \ + WALBERLA_LBM_CELLWISE_SWEEP_SPECIALIZATION_SRT_2 || \ + WALBERLA_LBM_CELLWISE_SWEEP_SPECIALIZATION_SRT_3 || \ + WALBERLA_LBM_CELLWISE_SWEEP_SPECIALIZATION_SRT_4 || \ + WALBERLA_LBM_CELLWISE_SWEEP_SPECIALIZATION_SRT_5 || \ + WALBERLA_LBM_CELLWISE_SWEEP_SPECIALIZATION_SRT_6 || \ + WALBERLA_LBM_CELLWISE_SWEEP_SPECIALIZATION_SRT_7 || \ + WALBERLA_LBM_CELLWISE_SWEEP_SPECIALIZATION_SRT_8 || \ + WALBERLA_LBM_CELLWISE_SWEEP_SPECIALIZATION_SRT_9 ) WALBERLA_LBM_CELLWISE_SWEEP_CLASS_HEAD_AND_STREAM( WALBERLA_LBM_CELLWISE_SWEEP_SPECIALIZATION_SRT ) diff --git a/src/lbm/srt/SplitPureSweep.impl.h b/src/lbm/srt/SplitPureSweep.impl.h index d545a9d1269be9cbd48833d610a37f12b91f8e3c..b193c8636ada13a602e0d112ce13e4e361c30610 100644 --- a/src/lbm/srt/SplitPureSweep.impl.h +++ b/src/lbm/srt/SplitPureSweep.impl.h @@ -33,11 +33,7 @@ #include "field/iterators/IteratorMacros.h" -#include <boost/mpl/logical.hpp> -#include <boost/mpl/bool.hpp> -#include <boost/mpl/int.hpp> -#include <boost/type_traits/is_same.hpp> -#include <boost/utility/enable_if.hpp> +#include <type_traits> namespace walberla { @@ -61,22 +57,20 @@ namespace lbm { /////////////////////////////// template< typename LatticeModel_T > -class SplitPureSweep< LatticeModel_T, typename boost::enable_if< boost::mpl::and_< boost::is_same< typename LatticeModel_T::CollisionModel::tag, - collision_model::SRT_tag >, - boost::mpl::bool_< LatticeModel_T::CollisionModel::constant >, - boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >, - boost::mpl::not_< boost::mpl::bool_< LatticeModel_T::compressible > >, - boost::is_same< typename LatticeModel_T::ForceModel::tag, - force_model::None_tag > - > >::type > : +class SplitPureSweep< LatticeModel_T, typename std::enable_if< std::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::SRT_tag >::value && + LatticeModel_T::CollisionModel::constant && + std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value && + ! LatticeModel_T::compressible && + std::is_same< typename LatticeModel_T::ForceModel::tag, force_model::None_tag >::value + >::type > : public SweepBase< LatticeModel_T > { public: - static_assert( (boost::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::SRT_tag >::value), "Only works with SRT!" ); - static_assert( (boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value), "Only works with D3Q19!" ); + static_assert( (std::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::SRT_tag >::value), "Only works with SRT!" ); + static_assert( (std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value), "Only works with D3Q19!" ); static_assert( LatticeModel_T::compressible == false, "Only works with incompressible models!" ); - static_assert( (boost::is_same< typename LatticeModel_T::ForceModel::tag, force_model::None_tag >::value), "Only works without additional forces!" ); + static_assert( (std::is_same< typename LatticeModel_T::ForceModel::tag, force_model::None_tag >::value), "Only works without additional forces!" ); static_assert( LatticeModel_T::equilibriumAccuracyOrder == 2, "Only works for lattice models that require the equilibrium distribution to be order 2 accurate!" ); typedef typename SweepBase<LatticeModel_T>::PdfField_T PdfField_T; @@ -97,13 +91,12 @@ public: }; template< typename LatticeModel_T > -void SplitPureSweep< LatticeModel_T, typename boost::enable_if< boost::mpl::and_< boost::is_same< typename LatticeModel_T::CollisionModel::tag, - collision_model::SRT_tag >, - boost::mpl::bool_< LatticeModel_T::CollisionModel::constant >, - boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >, - boost::mpl::not_< boost::mpl::bool_< LatticeModel_T::compressible > >, - boost::is_same< typename LatticeModel_T::ForceModel::tag, - force_model::None_tag > > >::type +void SplitPureSweep< LatticeModel_T, typename std::enable_if< std::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::SRT_tag >::value && + LatticeModel_T::CollisionModel::constant && + std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value && + ! LatticeModel_T::compressible && + std::is_same< typename LatticeModel_T::ForceModel::tag, force_model::None_tag >::value + >::type >::operator()( IBlock * const block ) { PdfField_T * src( NULL ); @@ -430,13 +423,12 @@ void SplitPureSweep< LatticeModel_T, typename boost::enable_if< boost::mpl::and_ template< typename LatticeModel_T > -void SplitPureSweep< LatticeModel_T, typename boost::enable_if< boost::mpl::and_< boost::is_same< typename LatticeModel_T::CollisionModel::tag, - collision_model::SRT_tag >, - boost::mpl::bool_< LatticeModel_T::CollisionModel::constant >, - boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >, - boost::mpl::not_< boost::mpl::bool_< LatticeModel_T::compressible > >, - boost::is_same< typename LatticeModel_T::ForceModel::tag, - force_model::None_tag > > >::type +void SplitPureSweep< LatticeModel_T, typename std::enable_if< std::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::SRT_tag >::value && + LatticeModel_T::CollisionModel::constant && + std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value && + ! LatticeModel_T::compressible && + std::is_same< typename LatticeModel_T::ForceModel::tag, force_model::None_tag >::value + >::type >::stream( IBlock * const block, const uint_t numberOfGhostLayersToInclude ) { PdfField_T * src( NULL ); @@ -450,13 +442,12 @@ void SplitPureSweep< LatticeModel_T, typename boost::enable_if< boost::mpl::and_ template< typename LatticeModel_T > -void SplitPureSweep< LatticeModel_T, typename boost::enable_if< boost::mpl::and_< boost::is_same< typename LatticeModel_T::CollisionModel::tag, - collision_model::SRT_tag >, - boost::mpl::bool_< LatticeModel_T::CollisionModel::constant >, - boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >, - boost::mpl::not_< boost::mpl::bool_< LatticeModel_T::compressible > >, - boost::is_same< typename LatticeModel_T::ForceModel::tag, - force_model::None_tag > > >::type +void SplitPureSweep< LatticeModel_T, typename std::enable_if< std::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::SRT_tag >::value && + LatticeModel_T::CollisionModel::constant && + std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value && + ! LatticeModel_T::compressible && + std::is_same< typename LatticeModel_T::ForceModel::tag, force_model::None_tag >::value + >::type #ifdef NDEBUG >::collide( IBlock * const block, const uint_t /*numberOfGhostLayersToInclude*/ ) #else @@ -761,22 +752,20 @@ void SplitPureSweep< LatticeModel_T, typename boost::enable_if< boost::mpl::and_ /////////////////////////////// template< typename LatticeModel_T > -class SplitPureSweep< LatticeModel_T, typename boost::enable_if< boost::mpl::and_< boost::is_same< typename LatticeModel_T::CollisionModel::tag, - collision_model::SRT_tag >, - boost::mpl::bool_< LatticeModel_T::CollisionModel::constant >, - boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >, - boost::mpl::bool_< LatticeModel_T::compressible >, - boost::is_same< typename LatticeModel_T::ForceModel::tag, - force_model::None_tag > - > >::type > : +class SplitPureSweep< LatticeModel_T, typename std::enable_if< std::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::SRT_tag >::value && + LatticeModel_T::CollisionModel::constant && + std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value && + LatticeModel_T::compressible && + std::is_same< typename LatticeModel_T::ForceModel::tag, force_model::None_tag >::value + >::type > : public SweepBase< LatticeModel_T > { public: - static_assert( (boost::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::SRT_tag >::value), "Only works with SRT!" ); - static_assert( (boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value), "Only works with D3Q19!" ); + static_assert( (std::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::SRT_tag >::value), "Only works with SRT!" ); + static_assert( (std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value), "Only works with D3Q19!" ); static_assert( LatticeModel_T::compressible, "Only works with compressible models!" ); - static_assert( (boost::is_same< typename LatticeModel_T::ForceModel::tag, force_model::None_tag >::value), "Only works without additional forces!" ); + static_assert( (std::is_same< typename LatticeModel_T::ForceModel::tag, force_model::None_tag >::value), "Only works without additional forces!" ); static_assert( LatticeModel_T::equilibriumAccuracyOrder == 2, "Only works for lattice models that require the equilibrium distribution to be order 2 accurate!" ); typedef typename SweepBase<LatticeModel_T>::PdfField_T PdfField_T; @@ -797,13 +786,12 @@ public: }; template< typename LatticeModel_T > -void SplitPureSweep< LatticeModel_T, typename boost::enable_if< boost::mpl::and_< boost::is_same< typename LatticeModel_T::CollisionModel::tag, - collision_model::SRT_tag >, - boost::mpl::bool_< LatticeModel_T::CollisionModel::constant >, - boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >, - boost::mpl::bool_< LatticeModel_T::compressible >, - boost::is_same< typename LatticeModel_T::ForceModel::tag, - force_model::None_tag > > >::type +void SplitPureSweep< LatticeModel_T, typename std::enable_if< std::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::SRT_tag >::value && + LatticeModel_T::CollisionModel::constant && + std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value && + LatticeModel_T::compressible && + std::is_same< typename LatticeModel_T::ForceModel::tag, force_model::None_tag >::value + >::type >::operator()( IBlock * const block ) { PdfField_T * src( NULL ); @@ -1134,13 +1122,12 @@ void SplitPureSweep< LatticeModel_T, typename boost::enable_if< boost::mpl::and_ } template< typename LatticeModel_T > -void SplitPureSweep< LatticeModel_T, typename boost::enable_if< boost::mpl::and_< boost::is_same< typename LatticeModel_T::CollisionModel::tag, - collision_model::SRT_tag >, - boost::mpl::bool_< LatticeModel_T::CollisionModel::constant >, - boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >, - boost::mpl::bool_< LatticeModel_T::compressible >, - boost::is_same< typename LatticeModel_T::ForceModel::tag, - force_model::None_tag > > >::type +void SplitPureSweep< LatticeModel_T, typename std::enable_if< std::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::SRT_tag >::value && + LatticeModel_T::CollisionModel::constant && + std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value && + LatticeModel_T::compressible && + std::is_same< typename LatticeModel_T::ForceModel::tag, force_model::None_tag >::value + >::type >::stream( IBlock * const block, const uint_t numberOfGhostLayersToInclude ) { PdfField_T * src( NULL ); @@ -1152,13 +1139,12 @@ void SplitPureSweep< LatticeModel_T, typename boost::enable_if< boost::mpl::and_ } template< typename LatticeModel_T > -void SplitPureSweep< LatticeModel_T, typename boost::enable_if< boost::mpl::and_< boost::is_same< typename LatticeModel_T::CollisionModel::tag, - collision_model::SRT_tag >, - boost::mpl::bool_< LatticeModel_T::CollisionModel::constant >, - boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >, - boost::mpl::bool_< LatticeModel_T::compressible >, - boost::is_same< typename LatticeModel_T::ForceModel::tag, - force_model::None_tag > > >::type +void SplitPureSweep< LatticeModel_T, typename std::enable_if< std::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::SRT_tag >::value && + LatticeModel_T::CollisionModel::constant && + std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value && + LatticeModel_T::compressible && + std::is_same< typename LatticeModel_T::ForceModel::tag, force_model::None_tag >::value + >::type #ifdef NDEBUG >::collide( IBlock * const block, const uint_t /*numberOfGhostLayersToInclude*/ ) #else diff --git a/src/lbm/srt/SplitSweep.impl.h b/src/lbm/srt/SplitSweep.impl.h index fca8be64fe097069ea8f8892177e27d0cb0691e8..b7e630c2222f5c7ccd05954b277c5fcb9bd8c016 100644 --- a/src/lbm/srt/SplitSweep.impl.h +++ b/src/lbm/srt/SplitSweep.impl.h @@ -27,10 +27,7 @@ #include "field/iterators/IteratorMacros.h" -#include <boost/mpl/logical.hpp> -#include <boost/mpl/bool.hpp> -#include <boost/type_traits/is_same.hpp> -#include <boost/utility/enable_if.hpp> +#include <type_traits> namespace walberla { @@ -54,22 +51,20 @@ namespace lbm { /////////////////////////////// template< typename LatticeModel_T, typename FlagField_T > -class SplitSweep< LatticeModel_T, FlagField_T, typename boost::enable_if< boost::mpl::and_< boost::is_same< typename LatticeModel_T::CollisionModel::tag, - collision_model::SRT_tag >, - boost::mpl::bool_< LatticeModel_T::CollisionModel::constant >, - boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >, - boost::mpl::not_< boost::mpl::bool_< LatticeModel_T::compressible > >, - boost::is_same< typename LatticeModel_T::ForceModel::tag, - force_model::None_tag > - > >::type > : +class SplitSweep< LatticeModel_T, FlagField_T, typename std::enable_if< std::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::SRT_tag >::value && + LatticeModel_T::CollisionModel::constant && + std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19>::value && + ! LatticeModel_T::compressible && + std::is_same< typename LatticeModel_T::ForceModel::tag, force_model::None_tag >::value + >::type > : public FlagFieldSweepBase< LatticeModel_T, FlagField_T > { public: - static_assert( (boost::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::SRT_tag >::value), "Only works with SRT!" ); - static_assert( (boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value), "Only works with D3Q19!" ); + static_assert( (std::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::SRT_tag >::value), "Only works with SRT!" ); + static_assert( (std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value), "Only works with D3Q19!" ); static_assert( LatticeModel_T::compressible == false, "Only works with incompressible models!" ); - static_assert( (boost::is_same< typename LatticeModel_T::ForceModel::tag, force_model::None_tag >::value), "Only works without additional forces!" ); + static_assert( (std::is_same< typename LatticeModel_T::ForceModel::tag, force_model::None_tag >::value), "Only works without additional forces!" ); static_assert( LatticeModel_T::equilibriumAccuracyOrder == 2, "Only works for lattice models that require the equilibrium distribution to be order 2 accurate!" ); typedef typename FlagFieldSweepBase<LatticeModel_T,FlagField_T>::PdfField_T PdfField_T; @@ -90,13 +85,12 @@ public: }; template< typename LatticeModel_T, typename FlagField_T > -void SplitSweep< LatticeModel_T, FlagField_T, typename boost::enable_if< boost::mpl::and_< boost::is_same< typename LatticeModel_T::CollisionModel::tag, - collision_model::SRT_tag >, - boost::mpl::bool_< LatticeModel_T::CollisionModel::constant >, - boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >, - boost::mpl::not_< boost::mpl::bool_< LatticeModel_T::compressible > >, - boost::is_same< typename LatticeModel_T::ForceModel::tag, - force_model::None_tag > > >::type +void SplitSweep< LatticeModel_T, FlagField_T, typename std::enable_if< std::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::SRT_tag >::value && + LatticeModel_T::CollisionModel::constant && + std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value && + ! LatticeModel_T::compressible && + std::is_same< typename LatticeModel_T::ForceModel::tag, force_model::None_tag >::value + >::type >::operator()( IBlock * const block ) { PdfField_T * src( NULL ); @@ -491,13 +485,12 @@ void SplitSweep< LatticeModel_T, FlagField_T, typename boost::enable_if< boost:: } template< typename LatticeModel_T, typename FlagField_T > -void SplitSweep< LatticeModel_T, FlagField_T, typename boost::enable_if< boost::mpl::and_< boost::is_same< typename LatticeModel_T::CollisionModel::tag, - collision_model::SRT_tag >, - boost::mpl::bool_< LatticeModel_T::CollisionModel::constant >, - boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >, - boost::mpl::not_< boost::mpl::bool_< LatticeModel_T::compressible > >, - boost::is_same< typename LatticeModel_T::ForceModel::tag, - force_model::None_tag > > >::type +void SplitSweep< LatticeModel_T, FlagField_T, typename std::enable_if< std::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::SRT_tag >::value && + LatticeModel_T::CollisionModel::constant && + std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value && + ! LatticeModel_T::compressible && + std::is_same< typename LatticeModel_T::ForceModel::tag, force_model::None_tag >::value + >::type >::stream( IBlock * const block, const uint_t numberOfGhostLayersToInclude ) { PdfField_T * src( NULL ); @@ -510,13 +503,12 @@ void SplitSweep< LatticeModel_T, FlagField_T, typename boost::enable_if< boost:: } template< typename LatticeModel_T, typename FlagField_T > -void SplitSweep< LatticeModel_T, FlagField_T, typename boost::enable_if< boost::mpl::and_< boost::is_same< typename LatticeModel_T::CollisionModel::tag, - collision_model::SRT_tag >, - boost::mpl::bool_< LatticeModel_T::CollisionModel::constant >, - boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >, - boost::mpl::not_< boost::mpl::bool_< LatticeModel_T::compressible > >, - boost::is_same< typename LatticeModel_T::ForceModel::tag, - force_model::None_tag > > >::type +void SplitSweep< LatticeModel_T, FlagField_T, typename std::enable_if< std::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::SRT_tag >::value && + LatticeModel_T::CollisionModel::constant && + std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value && + ! LatticeModel_T::compressible && + std::is_same< typename LatticeModel_T::ForceModel::tag, force_model::None_tag >::value + >::type #ifdef NDEBUG >::collide( IBlock * const block, const uint_t /*numberOfGhostLayersToInclude*/ ) #else @@ -894,22 +886,20 @@ void SplitSweep< LatticeModel_T, FlagField_T, typename boost::enable_if< boost:: /////////////////////////////// template< typename LatticeModel_T, typename FlagField_T > -class SplitSweep< LatticeModel_T, FlagField_T, typename boost::enable_if< boost::mpl::and_< boost::is_same< typename LatticeModel_T::CollisionModel::tag, - collision_model::SRT_tag >, - boost::mpl::bool_< LatticeModel_T::CollisionModel::constant >, - boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >, - boost::mpl::bool_< LatticeModel_T::compressible >, - boost::is_same< typename LatticeModel_T::ForceModel::tag, - force_model::None_tag > - > >::type > : +class SplitSweep< LatticeModel_T, FlagField_T, typename std::enable_if< std::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::SRT_tag >::value && + LatticeModel_T::CollisionModel::constant && + std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value && + LatticeModel_T::compressible && + std::is_same< typename LatticeModel_T::ForceModel::tag, force_model::None_tag >::value + >::type > : public FlagFieldSweepBase< LatticeModel_T, FlagField_T > { public: - static_assert( (boost::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::SRT_tag >::value), "Only works with SRT!" ); - static_assert( (boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value), "Only works with D3Q19!" ); + static_assert( (std::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::SRT_tag >::value), "Only works with SRT!" ); + static_assert( (std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value), "Only works with D3Q19!" ); static_assert( LatticeModel_T::compressible, "Only works with compressible models!" ); - static_assert( (boost::is_same< typename LatticeModel_T::ForceModel::tag, force_model::None_tag >::value), "Only works without additional forces!" ); + static_assert( (std::is_same< typename LatticeModel_T::ForceModel::tag, force_model::None_tag >::value), "Only works without additional forces!" ); static_assert( LatticeModel_T::equilibriumAccuracyOrder == 2, "Only works for lattice models that require the equilibrium distribution to be order 2 accurate!" ); typedef typename FlagFieldSweepBase<LatticeModel_T,FlagField_T>::PdfField_T PdfField_T; @@ -930,13 +920,12 @@ public: }; template< typename LatticeModel_T, typename FlagField_T > -void SplitSweep< LatticeModel_T, FlagField_T, typename boost::enable_if< boost::mpl::and_< boost::is_same< typename LatticeModel_T::CollisionModel::tag, - collision_model::SRT_tag >, - boost::mpl::bool_< LatticeModel_T::CollisionModel::constant >, - boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >, - boost::mpl::bool_< LatticeModel_T::compressible >, - boost::is_same< typename LatticeModel_T::ForceModel::tag, - force_model::None_tag > > >::type +void SplitSweep< LatticeModel_T, FlagField_T, typename std::enable_if< std::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::SRT_tag >::value && + LatticeModel_T::CollisionModel::constant && + std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value && + LatticeModel_T::compressible && + std::is_same< typename LatticeModel_T::ForceModel::tag, force_model::None_tag >::value + >::type >::operator()( IBlock * const block ) { PdfField_T * src( NULL ); @@ -1336,13 +1325,12 @@ void SplitSweep< LatticeModel_T, FlagField_T, typename boost::enable_if< boost:: } template< typename LatticeModel_T, typename FlagField_T > -void SplitSweep< LatticeModel_T, FlagField_T, typename boost::enable_if< boost::mpl::and_< boost::is_same< typename LatticeModel_T::CollisionModel::tag, - collision_model::SRT_tag >, - boost::mpl::bool_< LatticeModel_T::CollisionModel::constant >, - boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >, - boost::mpl::bool_< LatticeModel_T::compressible >, - boost::is_same< typename LatticeModel_T::ForceModel::tag, - force_model::None_tag > > >::type +void SplitSweep< LatticeModel_T, FlagField_T, typename std::enable_if< std::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::SRT_tag >::value && + LatticeModel_T::CollisionModel::constant && + std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value && + LatticeModel_T::compressible && + std::is_same< typename LatticeModel_T::ForceModel::tag, force_model::None_tag >::value + >::type >::stream( IBlock * const block, const uint_t numberOfGhostLayersToInclude ) { PdfField_T * src( NULL ); @@ -1355,13 +1343,12 @@ void SplitSweep< LatticeModel_T, FlagField_T, typename boost::enable_if< boost:: } template< typename LatticeModel_T, typename FlagField_T > -void SplitSweep< LatticeModel_T, FlagField_T, typename boost::enable_if< boost::mpl::and_< boost::is_same< typename LatticeModel_T::CollisionModel::tag, - collision_model::SRT_tag >, - boost::mpl::bool_< LatticeModel_T::CollisionModel::constant >, - boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >, - boost::mpl::bool_< LatticeModel_T::compressible >, - boost::is_same< typename LatticeModel_T::ForceModel::tag, - force_model::None_tag > > >::type +void SplitSweep< LatticeModel_T, FlagField_T, typename std::enable_if< std::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::SRT_tag >::value && + LatticeModel_T::CollisionModel::constant && + std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value && + LatticeModel_T::compressible && + std::is_same< typename LatticeModel_T::ForceModel::tag, force_model::None_tag >::value + >::type #ifdef NDEBUG >::collide( IBlock * const block, const uint_t /*numberOfGhostLayersToInclude*/ ) #else diff --git a/src/lbm/srt/bluegeneq/SplitPureSweep.impl.h b/src/lbm/srt/bluegeneq/SplitPureSweep.impl.h index 865e3dfa7dd579c1518094c9214b8139418841e9..972fb742481be6186aaa03733d2674efdf5ef28e 100644 --- a/src/lbm/srt/bluegeneq/SplitPureSweep.impl.h +++ b/src/lbm/srt/bluegeneq/SplitPureSweep.impl.h @@ -30,8 +30,7 @@ #include "lbm/sweeps/Streaming.h" #include "lbm/sweeps/SweepBase.h" -#include <boost/utility/enable_if.hpp> -#include <boost/type_traits.hpp> +#include <type_traits> #include <builtins.h> @@ -45,10 +44,6 @@ namespace walberla { namespace lbm { -using boost::type_traits::ice_and; -using boost::type_traits::ice_not; - - /////////////////////////////////////////////////////// // Available SRT implementations: // @@ -68,22 +63,20 @@ using boost::type_traits::ice_not; /////////////////////////////// template< typename LatticeModel_T > -class SplitPureSweep< LatticeModel_T, typename boost::enable_if_c< ice_and< boost::is_same< typename LatticeModel_T::CollisionModel::tag, - collision_model::SRT_tag >::value, - LatticeModel_T::CollisionModel::constant, - boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value, - ice_not< LatticeModel_T::compressible >::value, - boost::is_same< typename LatticeModel_T::ForceModel::tag, - force_model::None_tag >::value - >::value >::type > : +class SplitPureSweep< LatticeModel_T, typename std::enable_if< std::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::SRT_tag >::value && + LatticeModel_T::CollisionModel::constant && + std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value && + ! LatticeModel_T::compressible && + std::is_same< typename LatticeModel_T::ForceModel::tag, force_model::None_tag >::value + >::type > : public SweepBase< LatticeModel_T > { public: - static_assert( (boost::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::SRT_tag >::value), "Only works with SRT!" ); - static_assert( (boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value), "Only works with D3Q19!" ); + static_assert( (std::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::SRT_tag >::value), "Only works with SRT!" ); + static_assert( (std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value), "Only works with D3Q19!" ); static_assert( LatticeModel_T::compressible == false, "Only works with incompressible models!" ); - static_assert( (boost::is_same< typename LatticeModel_T::ForceModel::tag, force_model::None_tag >::value), "Only works without additional forces!" ); + static_assert( (std::is_same< typename LatticeModel_T::ForceModel::tag, force_model::None_tag >::value), "Only works without additional forces!" ); static_assert( LatticeModel_T::equilibriumAccuracyOrder == 2, "Only works for lattice models that require the equilibrium distribution to be order 2 accurate!" ); typedef typename SweepBase<LatticeModel_T>::PdfField_T PdfField_T; @@ -104,13 +97,12 @@ public: }; template< typename LatticeModel_T > -void SplitPureSweep< LatticeModel_T, typename boost::enable_if_c< ice_and< boost::is_same< typename LatticeModel_T::CollisionModel::tag, - collision_model::SRT_tag >::value, - LatticeModel_T::CollisionModel::constant, - boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value, - ice_not< LatticeModel_T::compressible >::value, - boost::is_same< typename LatticeModel_T::ForceModel::tag, - force_model::None_tag >::value >::value >::type +void SplitPureSweep< LatticeModel_T, typename std::enable_if< std::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::SRT_tag >::value && + LatticeModel_T::CollisionModel::constant && + std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value && + ! LatticeModel_T::compressible >::value && + std::is_same< typename LatticeModel_T::ForceModel::tag, force_model::None_tag>::value + >::type >::operator()( IBlock * const block ) { PdfField_T * src( NULL ); @@ -571,13 +563,12 @@ void SplitPureSweep< LatticeModel_T, typename boost::enable_if_c< ice_and< boost template< typename LatticeModel_T > -void SplitPureSweep< LatticeModel_T, typename boost::enable_if_c< ice_and< boost::is_same< typename LatticeModel_T::CollisionModel::tag, - collision_model::SRT_tag >::value, - LatticeModel_T::CollisionModel::constant, - boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value, - ice_not< LatticeModel_T::compressible >::value, - boost::is_same< typename LatticeModel_T::ForceModel::tag, - force_model::None_tag >::value >::value >::type +void SplitPureSweep< LatticeModel_T, typename std::enable_if< std::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::SRT_tag >::value && + LatticeModel_T::CollisionModel::constant && + std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value && + ! LatticeModel_T::compressible >::value && + std::is_same< typename LatticeModel_T::ForceModel::tag, force_model::None_tag >::value + >::type >::stream( IBlock * const block, const uint_t numberOfGhostLayersToInclude ) { PdfField_T * src( NULL ); @@ -591,13 +582,12 @@ void SplitPureSweep< LatticeModel_T, typename boost::enable_if_c< ice_and< boost template< typename LatticeModel_T > -void SplitPureSweep< LatticeModel_T, typename boost::enable_if_c< ice_and< boost::is_same< typename LatticeModel_T::CollisionModel::tag, - collision_model::SRT_tag >::value, - LatticeModel_T::CollisionModel::constant, - boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value, - ice_not< LatticeModel_T::compressible >::value, - boost::is_same< typename LatticeModel_T::ForceModel::tag, - force_model::None_tag >::value >::value >::type +void SplitPureSweep< LatticeModel_T, typename std::enable_if< std::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::SRT_tag >::value && + LatticeModel_T::CollisionModel::constant && + std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value && + ! LatticeModel_T::compressible >::value && + std::is_same< typename LatticeModel_T::ForceModel::tag, force_model::None_tag >::value + >::type #ifdef NDEBUG >::collide( IBlock * const block, const uint_t /*numberOfGhostLayersToInclude*/ ) #else @@ -961,22 +951,20 @@ void SplitPureSweep< LatticeModel_T, typename boost::enable_if_c< ice_and< boost /////////////////////////////// template< typename LatticeModel_T > -class SplitPureSweep< LatticeModel_T, typename boost::enable_if_c< ice_and< boost::is_same< typename LatticeModel_T::CollisionModel::tag, - collision_model::SRT_tag >::value, - LatticeModel_T::CollisionModel::constant, - boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value, - LatticeModel_T::compressible, - boost::is_same< typename LatticeModel_T::ForceModel::tag, - force_model::None_tag >::value - >::value >::type > : +class SplitPureSweep< LatticeModel_T, typename std::enable_if< std::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::SRT_tag >::value && + LatticeModel_T::CollisionModel::constant && + std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value && + LatticeModel_T::compressible, + std::is_same< typename LatticeModel_T::ForceModel::tag, force_model::None_tag >::value + >::type > : public SweepBase< LatticeModel_T > { public: - static_assert( (boost::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::SRT_tag >::value), "Only works with SRT!" ); - static_assert( (boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value), "Only works with D3Q19!" ); + static_assert( (std::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::SRT_tag >::value), "Only works with SRT!" ); + static_assert( (std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value), "Only works with D3Q19!" ); static_assert( LatticeModel_T::compressible, "Only works with compressible models!" ); - static_assert( (boost::is_same< typename LatticeModel_T::ForceModel::tag, force_model::None_tag >::value), "Only works without additional forces!" ); + static_assert( (std::is_same< typename LatticeModel_T::ForceModel::tag, force_model::None_tag >::value), "Only works without additional forces!" ); static_assert( LatticeModel_T::equilibriumAccuracyOrder == 2, "Only works for lattice models that require the equilibrium distribution to be order 2 accurate!" ); typedef typename SweepBase<LatticeModel_T>::PdfField_T PdfField_T; @@ -997,13 +985,12 @@ public: }; template< typename LatticeModel_T > -void SplitPureSweep< LatticeModel_T, typename boost::enable_if_c< ice_and< boost::is_same< typename LatticeModel_T::CollisionModel::tag, - collision_model::SRT_tag >::value, - LatticeModel_T::CollisionModel::constant, - boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value, - LatticeModel_T::compressible, - boost::is_same< typename LatticeModel_T::ForceModel::tag, - force_model::None_tag >::value >::value >::type +void SplitPureSweep< LatticeModel_T, typename std::enable_if< std::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::SRT_tag >::value && + LatticeModel_T::CollisionModel::constant && + std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value && + LatticeModel_T::compressible && + std::is_same< typename LatticeModel_T::ForceModel::tag, force_model::None_tag >::value + >::type >::operator()( IBlock * const block ) { PdfField_T * src( NULL ); @@ -1468,13 +1455,12 @@ void SplitPureSweep< LatticeModel_T, typename boost::enable_if_c< ice_and< boost } template< typename LatticeModel_T > -void SplitPureSweep< LatticeModel_T, typename boost::enable_if_c< ice_and< boost::is_same< typename LatticeModel_T::CollisionModel::tag, - collision_model::SRT_tag >::value, - LatticeModel_T::CollisionModel::constant, - boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value, - LatticeModel_T::compressible, - boost::is_same< typename LatticeModel_T::ForceModel::tag, - force_model::None_tag >::value >::value >::type +void SplitPureSweep< LatticeModel_T, typename std::enable_if< std::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::SRT_tag >::value && + LatticeModel_T::CollisionModel::constant && + std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value && + LatticeModel_T::compressible && + std::is_same< typename LatticeModel_T::ForceModel::tag, force_model::None_tag >::value + >::type >::stream( IBlock * const block, const uint_t numberOfGhostLayersToInclude ) { PdfField_T * src( NULL ); @@ -1486,13 +1472,12 @@ void SplitPureSweep< LatticeModel_T, typename boost::enable_if_c< ice_and< boost } template< typename LatticeModel_T > -void SplitPureSweep< LatticeModel_T, typename boost::enable_if_c< ice_and< boost::is_same< typename LatticeModel_T::CollisionModel::tag, - collision_model::SRT_tag >::value, - LatticeModel_T::CollisionModel::constant, - boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value, - LatticeModel_T::compressible, - boost::is_same< typename LatticeModel_T::ForceModel::tag, - force_model::None_tag >::value >::value >::type +void SplitPureSweep< LatticeModel_T, typename std::enable_if< std::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::SRT_tag >::value && + LatticeModel_T::CollisionModel::constant && + std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value && + LatticeModel_T::compressible && + std::is_same< typename LatticeModel_T::ForceModel::tag, force_model::None_tag >::value + >::type #ifdef NDEBUG >::collide( IBlock * const block, const uint_t /*numberOfGhostLayersToInclude*/ ) #else diff --git a/src/lbm/srt/cell_operations/AdvectionDiffusionCellOperation.impl.h b/src/lbm/srt/cell_operations/AdvectionDiffusionCellOperation.impl.h index 13d7767a940c561cd6b0c0409187684766548c6a..44883340ff6eaed38c053c6f9391c8171537e02d 100644 --- a/src/lbm/srt/cell_operations/AdvectionDiffusionCellOperation.impl.h +++ b/src/lbm/srt/cell_operations/AdvectionDiffusionCellOperation.impl.h @@ -25,9 +25,7 @@ #include "lbm/lattice_model/EquilibriumDistribution.h" #include "lbm/lattice_model/LatticeModelBase.h" -#include <boost/mpl/logical.hpp> -#include <boost/type_traits/is_same.hpp> -#include <boost/utility/enable_if.hpp> +#include <type_traits> namespace walberla { @@ -53,19 +51,17 @@ namespace lbm { /////////////////////////////// template< typename LM_AdvDiff, typename LM_Hydro > -class AdvectionDiffusionCellOperation< LM_AdvDiff, LM_Hydro, typename boost::enable_if< boost::mpl::and_< boost::is_same< typename LM_AdvDiff::CollisionModel::tag, - collision_model::SRT_tag >, - boost::mpl::bool_< LM_AdvDiff::CollisionModel::constant >, - boost::mpl::bool_< LM_AdvDiff::compressible >, - boost::is_same< typename LM_AdvDiff::ForceModel::tag, - force_model::None_tag > - > >::type > +class AdvectionDiffusionCellOperation< LM_AdvDiff, LM_Hydro, typename std::enable_if< std::is_same< typename LM_AdvDiff::CollisionModel::tag, collision_model::SRT_tag >::value && + LM_AdvDiff::CollisionModel::constant && + LM_AdvDiff::compressible && + std::is_same< typename LM_AdvDiff::ForceModel::tag, force_model::None_tag >::value + >::type > { public: - static_assert( (boost::is_same< typename LM_AdvDiff::CollisionModel::tag, collision_model::SRT_tag >::value), "Only works with SRT!" ); + static_assert( (std::is_same< typename LM_AdvDiff::CollisionModel::tag, collision_model::SRT_tag >::value), "Only works with SRT!" ); static_assert( LM_AdvDiff::compressible, "Only works with compressible models!" ); - static_assert( (boost::is_same< typename LM_AdvDiff::ForceModel::tag, force_model::None_tag >::value), "Only works without additional forces!" ); + static_assert( (std::is_same< typename LM_AdvDiff::ForceModel::tag, force_model::None_tag >::value), "Only works without additional forces!" ); typedef PdfField< LM_AdvDiff > AdvDiffPdfField_T; typedef PdfField< LM_Hydro > HydroPdfField_T; @@ -130,19 +126,17 @@ private: /////////////////////////////// template< typename LM_AdvDiff, typename LM_Hydro > -class AdvectionDiffusionCellOperation< LM_AdvDiff, LM_Hydro, typename boost::enable_if< boost::mpl::and_< boost::is_same< typename LM_AdvDiff::CollisionModel::tag, - collision_model::SRT_tag >, - boost::mpl::bool_< LM_AdvDiff::CollisionModel::constant >, - boost::mpl::bool_< LM_AdvDiff::compressible >, - boost::is_same< typename LM_AdvDiff::ForceModel::tag, - force_model::Correction_tag > - > >::type > +class AdvectionDiffusionCellOperation< LM_AdvDiff, LM_Hydro, typename std::enable_if< std::is_same< typename LM_AdvDiff::CollisionModel::tag, collision_model::SRT_tag >::value && + LM_AdvDiff::CollisionModel::constant && + LM_AdvDiff::compressible && + std::is_same< typename LM_AdvDiff::ForceModel::tag, force_model::Correction_tag >::value + >::type > { public: - static_assert( (boost::is_same< typename LM_AdvDiff::CollisionModel::tag, collision_model::SRT_tag >::value), "Only works with SRT!" ); + static_assert( (std::is_same< typename LM_AdvDiff::CollisionModel::tag, collision_model::SRT_tag >::value), "Only works with SRT!" ); static_assert( LM_AdvDiff::compressible, "Only works with compressible models!" ); - static_assert( (boost::is_same< typename LM_AdvDiff::ForceModel::tag, force_model::Correction_tag >::value), "Only works with correction force!" ); + static_assert( (std::is_same< typename LM_AdvDiff::ForceModel::tag, force_model::Correction_tag >::value), "Only works with correction force!" ); typedef PdfField< LM_AdvDiff > AdvDiffPdfField_T; typedef PdfField< LM_Hydro > HydroPdfField_T; diff --git a/src/lbm/srt/cell_operations/DefaultCellOperation.impl.h b/src/lbm/srt/cell_operations/DefaultCellOperation.impl.h index bae0832ee2db316ea641119ed3d4bd0e7b547c6f..7f1086e77cc77a89360e1ce8a5f87dcfb4054fee 100644 --- a/src/lbm/srt/cell_operations/DefaultCellOperation.impl.h +++ b/src/lbm/srt/cell_operations/DefaultCellOperation.impl.h @@ -25,9 +25,7 @@ #include "lbm/lattice_model/EquilibriumDistribution.h" #include "lbm/lattice_model/LatticeModelBase.h" -#include <boost/mpl/logical.hpp> -#include <boost/type_traits/is_same.hpp> -#include <boost/utility/enable_if.hpp> +#include <type_traits> namespace walberla { @@ -54,19 +52,17 @@ namespace lbm { /////////////////////////////// template< typename LatticeModel_T > -class DefaultCellOperation< LatticeModel_T, typename boost::enable_if< boost::mpl::and_< boost::is_same< typename LatticeModel_T::CollisionModel::tag, - collision_model::SRT_tag >, - boost::mpl::bool_< LatticeModel_T::CollisionModel::constant >, - boost::mpl::not_< boost::is_same< typename LatticeModel_T::Stencil, - stencil::D3Q19 > >, - boost::is_same< typename LatticeModel_T::ForceModel::tag, - force_model::None_tag > > >::type > +class DefaultCellOperation< LatticeModel_T, typename std::enable_if< std::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::SRT_tag >::value && + LatticeModel_T::CollisionModel::constant && + std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value && + std::is_same< typename LatticeModel_T::ForceModel::tag, force_model::None_tag >::value + >::type > { public: - static_assert( (boost::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::SRT_tag >::value), "Only works with SRT!" ); - static_assert( (boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value == false), "There is a specialization for D3Q19!" ); - static_assert( (boost::is_same< typename LatticeModel_T::ForceModel::tag, force_model::None_tag >::value), "Only works without additional forces!" ); + static_assert( (std::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::SRT_tag >::value), "Only works with SRT!" ); + static_assert( (std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value == false), "There is a specialization for D3Q19!" ); + static_assert( (std::is_same< typename LatticeModel_T::ForceModel::tag, force_model::None_tag >::value), "Only works without additional forces!" ); static_assert( LatticeModel_T::equilibriumAccuracyOrder == 2, "Only works for lattice models that require the equilibrium distribution to be order 2 accurate!" ); typedef PdfField< LatticeModel_T > PdfField_T; @@ -129,16 +125,15 @@ private: ///////////////////////////////////////////// template< typename LatticeModel_T > -class DefaultCellOperation< LatticeModel_T, typename boost::enable_if< boost::mpl::and_< boost::is_same< typename LatticeModel_T::CollisionModel::tag, - collision_model::SRT_tag >, - boost::mpl::bool_< LatticeModel_T::CollisionModel::constant >, - boost::is_same< typename LatticeModel_T::ForceModel::tag, - force_model::Guo_tag > > >::type > +class DefaultCellOperation< LatticeModel_T, typename std::enable_if< std::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::SRT_tag >::value && + LatticeModel_T::CollisionModel::constant && + std::is_same< typename LatticeModel_T::ForceModel::tag, force_model::Guo_tag >::value + >::type > { public: - static_assert( (boost::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::SRT_tag >::value), "Only works with SRT!" ); - static_assert( (boost::is_same< typename LatticeModel_T::ForceModel::tag, force_model::Guo_tag >::value), "Only works with Guo constant force model !" ); + static_assert( (std::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::SRT_tag >::value), "Only works with SRT!" ); + static_assert( (std::is_same< typename LatticeModel_T::ForceModel::tag, force_model::Guo_tag >::value), "Only works with Guo constant force model !" ); static_assert( LatticeModel_T::equilibriumAccuracyOrder == 2, "Only works for lattice models that require the equilibrium distribution to be order 2 accurate!" ); typedef PdfField< LatticeModel_T > PdfField_T; @@ -220,20 +215,19 @@ private: /////////////////////////////// template< typename LatticeModel_T > -class DefaultCellOperation< LatticeModel_T, typename boost::enable_if< boost::mpl::and_< boost::is_same< typename LatticeModel_T::CollisionModel::tag, - collision_model::SRT_tag >, - boost::mpl::bool_< LatticeModel_T::CollisionModel::constant >, - boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >, - boost::mpl::not_< boost::mpl::bool_< LatticeModel_T::compressible > >, - boost::is_same< typename LatticeModel_T::ForceModel::tag, - force_model::None_tag > > >::type > +class DefaultCellOperation< LatticeModel_T, typename std::enable_if< std::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::SRT_tag >::value && + LatticeModel_T::CollisionModel::constant && + std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value && + ! LatticeModel_T::compressible && + std::is_same< typename LatticeModel_T::ForceModel::tag, force_model::None_tag >::value + >::type > { public: - static_assert( (boost::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::SRT_tag >::value), "Only works with SRT!" ); - static_assert( (boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value), "Only works with D3Q19!" ); + static_assert( (std::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::SRT_tag >::value), "Only works with SRT!" ); + static_assert( (std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value), "Only works with D3Q19!" ); static_assert( LatticeModel_T::compressible == false, "Only works with incompressible models!" ); - static_assert( (boost::is_same< typename LatticeModel_T::ForceModel::tag, force_model::None_tag >::value), "Only works without additional forces!" ); + static_assert( (std::is_same< typename LatticeModel_T::ForceModel::tag, force_model::None_tag >::value), "Only works without additional forces!" ); static_assert( LatticeModel_T::equilibriumAccuracyOrder == 2, "Only works for lattice models that require the equilibrium distribution to be order 2 accurate!" ); typedef PdfField< LatticeModel_T > PdfField_T; @@ -264,13 +258,12 @@ private: }; template< typename LatticeModel_T > -void DefaultCellOperation< LatticeModel_T, typename boost::enable_if< boost::mpl::and_< boost::is_same< typename LatticeModel_T::CollisionModel::tag, - collision_model::SRT_tag >, - boost::mpl::bool_< LatticeModel_T::CollisionModel::constant >, - boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >, - boost::mpl::not_< boost::mpl::bool_< LatticeModel_T::compressible > >, - boost::is_same< typename LatticeModel_T::ForceModel::tag, - force_model::None_tag > > >::type +void DefaultCellOperation< LatticeModel_T, typename std::enable_if< std::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::SRT_tag >::value && + LatticeModel_T::CollisionModel::constant && + std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value && + ! LatticeModel_T::compressible && + std::is_same< typename LatticeModel_T::ForceModel::tag, force_model::None_tag >::value + >::type >::operator()( PdfField_T * src, PdfField_T * dst, cell_idx_t x, cell_idx_t y, cell_idx_t z ) const { using namespace stencil; @@ -363,13 +356,12 @@ void DefaultCellOperation< LatticeModel_T, typename boost::enable_if< boost::mpl template< typename LatticeModel_T > template< typename FieldPtrOrIterator > -void DefaultCellOperation< LatticeModel_T, typename boost::enable_if< boost::mpl::and_< boost::is_same< typename LatticeModel_T::CollisionModel::tag, - collision_model::SRT_tag >, - boost::mpl::bool_< LatticeModel_T::CollisionModel::constant >, - boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >, - boost::mpl::not_< boost::mpl::bool_< LatticeModel_T::compressible > >, - boost::is_same< typename LatticeModel_T::ForceModel::tag, - force_model::None_tag > > >::type +void DefaultCellOperation< LatticeModel_T, typename std::enable_if< std::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::SRT_tag >::value && + LatticeModel_T::CollisionModel::constant && + std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value && + ! LatticeModel_T::compressible && + std::is_same< typename LatticeModel_T::ForceModel::tag, force_model::None_tag >::value + >::type >::operator()( FieldPtrOrIterator & src, FieldPtrOrIterator & dst ) const { using namespace stencil; @@ -469,20 +461,19 @@ void DefaultCellOperation< LatticeModel_T, typename boost::enable_if< boost::mpl /////////////////////////////// template< typename LatticeModel_T > -class DefaultCellOperation< LatticeModel_T, typename boost::enable_if< boost::mpl::and_< boost::is_same< typename LatticeModel_T::CollisionModel::tag, - collision_model::SRT_tag >, - boost::mpl::bool_< LatticeModel_T::CollisionModel::constant >, - boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >, - boost::mpl::bool_< LatticeModel_T::compressible >, - boost::is_same< typename LatticeModel_T::ForceModel::tag, - force_model::None_tag > > >::type > +class DefaultCellOperation< LatticeModel_T, typename std::enable_if< std::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::SRT_tag >::value && + LatticeModel_T::CollisionModel::constant && + std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value && + LatticeModel_T::compressible && + std::is_same< typename LatticeModel_T::ForceModel::tag, force_model::None_tag >::value + >::type > { public: - static_assert( (boost::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::SRT_tag >::value), "Only works with SRT!" ); - static_assert( (boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value), "Only works with D3Q19!" ); + static_assert( (std::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::SRT_tag >::value), "Only works with SRT!" ); + static_assert( (std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value), "Only works with D3Q19!" ); static_assert( LatticeModel_T::compressible, "Only works with compressible models!" ); - static_assert( (boost::is_same< typename LatticeModel_T::ForceModel::tag, force_model::None_tag >::value), "Only works without additional forces!" ); + static_assert( (std::is_same< typename LatticeModel_T::ForceModel::tag, force_model::None_tag >::value), "Only works without additional forces!" ); static_assert( LatticeModel_T::equilibriumAccuracyOrder == 2, "Only works for lattice models that require the equilibrium distribution to be order 2 accurate!" ); typedef PdfField< LatticeModel_T > PdfField_T; @@ -514,13 +505,12 @@ private: }; template< typename LatticeModel_T > -void DefaultCellOperation< LatticeModel_T, typename boost::enable_if< boost::mpl::and_< boost::is_same< typename LatticeModel_T::CollisionModel::tag, - collision_model::SRT_tag >, - boost::mpl::bool_< LatticeModel_T::CollisionModel::constant >, - boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >, - boost::mpl::bool_< LatticeModel_T::compressible >, - boost::is_same< typename LatticeModel_T::ForceModel::tag, - force_model::None_tag > > >::type +void DefaultCellOperation< LatticeModel_T, typename std::enable_if< std::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::SRT_tag >::value && + LatticeModel_T::CollisionModel::constant && + std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value && + LatticeModel_T::compressible && + std::is_same< typename LatticeModel_T::ForceModel::tag, force_model::None_tag >::value + >::type >::operator()( PdfField_T * src, PdfField_T * dst, cell_idx_t x, cell_idx_t y, cell_idx_t z ) const { using namespace stencil; @@ -618,13 +608,12 @@ void DefaultCellOperation< LatticeModel_T, typename boost::enable_if< boost::mpl template< typename LatticeModel_T > template< typename FieldPtrOrIterator > -void DefaultCellOperation< LatticeModel_T, typename boost::enable_if< boost::mpl::and_< boost::is_same< typename LatticeModel_T::CollisionModel::tag, - collision_model::SRT_tag >, - boost::mpl::bool_< LatticeModel_T::CollisionModel::constant >, - boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >, - boost::mpl::bool_< LatticeModel_T::compressible >, - boost::is_same< typename LatticeModel_T::ForceModel::tag, - force_model::None_tag > > >::type +void DefaultCellOperation< LatticeModel_T, typename std::enable_if< std::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::SRT_tag >::value && + LatticeModel_T::CollisionModel::constant && + std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value && + LatticeModel_T::compressible && + std::is_same< typename LatticeModel_T::ForceModel::tag, force_model::None_tag >::value + >::type >::operator()( FieldPtrOrIterator & src, FieldPtrOrIterator & dst ) const { using namespace stencil; diff --git a/src/lbm/sweeps/CellwiseSweep.h b/src/lbm/sweeps/CellwiseSweep.h index d403ac79c88d561cf33e763b69a17fd14e1784a8..2879f19ae2c56d5244706ec8c3cd9be5f6e852ae 100644 --- a/src/lbm/sweeps/CellwiseSweep.h +++ b/src/lbm/sweeps/CellwiseSweep.h @@ -104,7 +104,7 @@ class CellwiseSweep #define WALBERLA_LBM_CELLWISE_SWEEP_CLASS_HEAD_AND_STREAM( specialization ) \ template< typename LatticeModel_T, typename Filter_T, typename DensityVelocityIn_T, typename DensityVelocityOut_T > \ - class CellwiseSweep< LatticeModel_T, Filter_T, DensityVelocityIn_T, DensityVelocityOut_T, typename boost::enable_if< specialization >::type > \ + class CellwiseSweep< LatticeModel_T, Filter_T, DensityVelocityIn_T, DensityVelocityOut_T, typename std::enable_if< specialization >::type > \ : public SweepBase< LatticeModel_T, Filter_T, DensityVelocityIn_T, DensityVelocityOut_T > \ { \ public: \ @@ -136,7 +136,7 @@ class CellwiseSweep }; \ \ template< typename LatticeModel_T, typename Filter_T, typename DensityVelocityIn_T, typename DensityVelocityOut_T > \ - void CellwiseSweep< LatticeModel_T, Filter_T, DensityVelocityIn_T, DensityVelocityOut_T, typename boost::enable_if< specialization >::type \ + void CellwiseSweep< LatticeModel_T, Filter_T, DensityVelocityIn_T, DensityVelocityOut_T, typename std::enable_if< specialization >::type \ >::stream( IBlock * const block, const uint_t numberOfGhostLayersToInclude ) \ { \ PdfField_T * src( NULL ); \ @@ -149,7 +149,7 @@ class CellwiseSweep #define WALBERLA_LBM_CELLWISE_SWEEP_STREAM_COLLIDE_HEAD( specialization) \ template< typename LatticeModel_T, typename Filter_T, typename DensityVelocityIn_T, typename DensityVelocityOut_T > \ - void CellwiseSweep< LatticeModel_T, Filter_T, DensityVelocityIn_T, DensityVelocityOut_T, typename boost::enable_if< specialization >::type \ + void CellwiseSweep< LatticeModel_T, Filter_T, DensityVelocityIn_T, DensityVelocityOut_T, typename std::enable_if< specialization >::type \ >::streamCollide( IBlock * const block, const uint_t numberOfGhostLayersToInclude ) \ { \ PdfField_T * src( NULL ); \ @@ -173,7 +173,7 @@ class CellwiseSweep #define WALBERLA_LBM_CELLWISE_SWEEP_COLLIDE_HEAD( specialization ) \ template< typename LatticeModel_T, typename Filter_T, typename DensityVelocityIn_T, typename DensityVelocityOut_T > \ - void CellwiseSweep< LatticeModel_T, Filter_T, DensityVelocityIn_T, DensityVelocityOut_T, typename boost::enable_if< specialization >::type \ + void CellwiseSweep< LatticeModel_T, Filter_T, DensityVelocityIn_T, DensityVelocityOut_T, typename std::enable_if< specialization >::type \ >::collide( IBlock * const block, const uint_t numberOfGhostLayersToInclude ) \ { \ PdfField_T * src = this->getSrcField( block ); \ diff --git a/src/lbm/sweeps/StreamPull.h b/src/lbm/sweeps/StreamPull.h index efb1ed467c84e845fec6769647f6920e2333d8c1..136712f8bcd8cc09ceb3dc25db0d89bf1caf7fe5 100644 --- a/src/lbm/sweeps/StreamPull.h +++ b/src/lbm/sweeps/StreamPull.h @@ -36,6 +36,7 @@ #include "stencil/D3Q27.h" #include "stencil/Directions.h" +#include <type_traits> namespace walberla { namespace lbm { @@ -57,9 +58,9 @@ namespace lbm { template< typename LatticeModel_T, class Enable = void > struct StreamPullEverything { - static_assert( (boost::is_same< typename LatticeModel_T::Stencil, stencil::D2Q9 >::value == false), "There is a specialization for D2Q9!" ); - static_assert( (boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value == false), "There is a specialization for D3Q19!" ); - static_assert( (boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q27 >::value == false), "There is a specialization for D3Q27!" ); + static_assert( (std::is_same< typename LatticeModel_T::Stencil, stencil::D2Q9 >::value == false), "There is a specialization for D2Q9!" ); + static_assert( (std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value == false), "There is a specialization for D3Q19!" ); + static_assert( (std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q27 >::value == false), "There is a specialization for D3Q27!" ); typedef PdfField< LatticeModel_T > PdfField_T; typedef typename LatticeModel_T::Stencil Stencil_T; @@ -108,10 +109,10 @@ void StreamPullEverything< LatticeModel_T, Enable >::execute( PdfField_T * src, // D2Q9 // template< typename LatticeModel_T > -struct StreamPullEverything< LatticeModel_T, typename boost::enable_if_c< boost::is_same< typename LatticeModel_T::Stencil, +struct StreamPullEverything< LatticeModel_T, typename std::enable_if< std::is_same< typename LatticeModel_T::Stencil, stencil::D2Q9 >::value >::type > { - static_assert( (boost::is_same< typename LatticeModel_T::Stencil, stencil::D2Q9 >::value), "Only works with D2Q9!" ); + static_assert( (std::is_same< typename LatticeModel_T::Stencil, stencil::D2Q9 >::value), "Only works with D2Q9!" ); typedef PdfField< LatticeModel_T > PdfField_T; typedef typename LatticeModel_T::Stencil Stencil_T; @@ -120,7 +121,7 @@ struct StreamPullEverything< LatticeModel_T, typename boost::enable_if_c< boost: }; template< typename LatticeModel_T > -void StreamPullEverything< LatticeModel_T, typename boost::enable_if_c< boost::is_same< typename LatticeModel_T::Stencil, +void StreamPullEverything< LatticeModel_T, typename std::enable_if< std::is_same< typename LatticeModel_T::Stencil, stencil::D2Q9 >::value >::type >::execute( PdfField_T * src, PdfField_T * dst, const uint_t numberOfGhostLayersToInclude ) { @@ -171,10 +172,10 @@ void StreamPullEverything< LatticeModel_T, typename boost::enable_if_c< boost::i // D3Q19 // template< typename LatticeModel_T > -struct StreamPullEverything< LatticeModel_T, typename boost::enable_if_c< boost::is_same< typename LatticeModel_T::Stencil, +struct StreamPullEverything< LatticeModel_T, typename std::enable_if< std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value >::type > { - static_assert( (boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value), "Only works with D3Q19!" ); + static_assert( (std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value), "Only works with D3Q19!" ); typedef PdfField< LatticeModel_T > PdfField_T; typedef typename LatticeModel_T::Stencil Stencil_T; @@ -183,7 +184,7 @@ struct StreamPullEverything< LatticeModel_T, typename boost::enable_if_c< boost: }; template< typename LatticeModel_T > -void StreamPullEverything< LatticeModel_T, typename boost::enable_if_c< boost::is_same< typename LatticeModel_T::Stencil, +void StreamPullEverything< LatticeModel_T, typename std::enable_if< std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value >::type >::execute( PdfField_T * src, PdfField_T * dst, const uint_t numberOfGhostLayersToInclude ) { @@ -244,10 +245,10 @@ void StreamPullEverything< LatticeModel_T, typename boost::enable_if_c< boost::i // D3Q27 // template< typename LatticeModel_T > -struct StreamPullEverything< LatticeModel_T, typename boost::enable_if_c< boost::is_same< typename LatticeModel_T::Stencil, +struct StreamPullEverything< LatticeModel_T, typename std::enable_if< std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q27 >::value >::type > { - static_assert( (boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q27 >::value), "Only works with D3Q27!" ); + static_assert( (std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q27 >::value), "Only works with D3Q27!" ); typedef PdfField< LatticeModel_T > PdfField_T; typedef typename LatticeModel_T::Stencil Stencil_T; @@ -256,7 +257,7 @@ struct StreamPullEverything< LatticeModel_T, typename boost::enable_if_c< boost: }; template< typename LatticeModel_T > -void StreamPullEverything< LatticeModel_T, typename boost::enable_if_c< boost::is_same< typename LatticeModel_T::Stencil, +void StreamPullEverything< LatticeModel_T, typename std::enable_if< std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q27 >::value >::type >::execute( PdfField_T * src, PdfField_T * dst, const uint_t numberOfGhostLayersToInclude ) { @@ -329,9 +330,9 @@ void StreamPullEverything< LatticeModel_T, typename boost::enable_if_c< boost::i template< typename LatticeModel_T, class Enable = void > struct StreamPull { - static_assert( (boost::is_same< typename LatticeModel_T::Stencil, stencil::D2Q9 >::value == false), "There is a specialization for D2Q9!" ); - static_assert( (boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value == false), "There is a specialization for D3Q19!" ); - static_assert( (boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q27 >::value == false), "There is a specialization for D3Q27!" ); + static_assert( (std::is_same< typename LatticeModel_T::Stencil, stencil::D2Q9 >::value == false), "There is a specialization for D2Q9!" ); + static_assert( (std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value == false), "There is a specialization for D3Q19!" ); + static_assert( (std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q27 >::value == false), "There is a specialization for D3Q27!" ); typedef PdfField< LatticeModel_T > PdfField_T; typedef typename LatticeModel_T::Stencil Stencil_T; @@ -386,10 +387,10 @@ void StreamPull< LatticeModel_T, Enable >::execute( PdfField_T * src, PdfField_T // D2Q9 // template< typename LatticeModel_T > -struct StreamPull< LatticeModel_T, typename boost::enable_if_c< boost::is_same< typename LatticeModel_T::Stencil, +struct StreamPull< LatticeModel_T, typename std::enable_if< std::is_same< typename LatticeModel_T::Stencil, stencil::D2Q9 >::value >::type > { - static_assert( (boost::is_same< typename LatticeModel_T::Stencil, stencil::D2Q9 >::value), "Only works with D2Q9!" ); + static_assert( (std::is_same< typename LatticeModel_T::Stencil, stencil::D2Q9 >::value), "Only works with D2Q9!" ); typedef PdfField< LatticeModel_T > PdfField_T; typedef typename LatticeModel_T::Stencil Stencil_T; @@ -405,7 +406,7 @@ struct StreamPull< LatticeModel_T, typename boost::enable_if_c< boost::is_same< template< typename LatticeModel_T > template< typename Filter_T > -void StreamPull< LatticeModel_T, typename boost::enable_if_c< boost::is_same< typename LatticeModel_T::Stencil, +void StreamPull< LatticeModel_T, typename std::enable_if< std::is_same< typename LatticeModel_T::Stencil, stencil::D2Q9 >::value >::type >::execute( PdfField_T * src, PdfField_T * dst, IBlock * block, Filter_T & filter, const uint_t numberOfGhostLayersToInclude ) { @@ -428,7 +429,7 @@ void StreamPull< LatticeModel_T, typename boost::enable_if_c< boost::is_same< ty } template< typename LatticeModel_T > -void StreamPull< LatticeModel_T, typename boost::enable_if_c< boost::is_same< typename LatticeModel_T::Stencil, +void StreamPull< LatticeModel_T, typename std::enable_if< std::is_same< typename LatticeModel_T::Stencil, stencil::D2Q9 >::value >::type >::execute( PdfField_T * src, PdfField_T * dst, IBlock * /*block*/, walberla::field::DefaultEvaluationFilter & /*filter*/, const uint_t numberOfGhostLayersToInclude ) { @@ -436,7 +437,7 @@ void StreamPull< LatticeModel_T, typename boost::enable_if_c< boost::is_same< ty } template< typename LatticeModel_T > -void StreamPull< LatticeModel_T, typename boost::enable_if_c< boost::is_same< typename LatticeModel_T::Stencil, +void StreamPull< LatticeModel_T, typename std::enable_if< std::is_same< typename LatticeModel_T::Stencil, stencil::D2Q9 >::value >::type >::execute( PdfField_T * src, PdfField_T * dst, cell_idx_t x, cell_idx_t y, cell_idx_t z ) { @@ -458,10 +459,10 @@ void StreamPull< LatticeModel_T, typename boost::enable_if_c< boost::is_same< ty // D3Q19 // template< typename LatticeModel_T > -struct StreamPull< LatticeModel_T, typename boost::enable_if_c< boost::is_same< typename LatticeModel_T::Stencil, +struct StreamPull< LatticeModel_T, typename std::enable_if< std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value >::type > { - static_assert( (boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value), "Only works with D3Q19!" ); + static_assert( (std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value), "Only works with D3Q19!" ); typedef PdfField< LatticeModel_T > PdfField_T; typedef typename LatticeModel_T::Stencil Stencil_T; @@ -477,7 +478,7 @@ struct StreamPull< LatticeModel_T, typename boost::enable_if_c< boost::is_same< template< typename LatticeModel_T > template< typename Filter_T > -void StreamPull< LatticeModel_T, typename boost::enable_if_c< boost::is_same< typename LatticeModel_T::Stencil, +void StreamPull< LatticeModel_T, typename std::enable_if< std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value >::type >::execute( PdfField_T * src, PdfField_T * dst, IBlock * block, Filter_T & filter, const uint_t numberOfGhostLayersToInclude ) { @@ -500,7 +501,7 @@ void StreamPull< LatticeModel_T, typename boost::enable_if_c< boost::is_same< ty } template< typename LatticeModel_T > -void StreamPull< LatticeModel_T, typename boost::enable_if_c< boost::is_same< typename LatticeModel_T::Stencil, +void StreamPull< LatticeModel_T, typename std::enable_if< std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value >::type >::execute( PdfField_T * src, PdfField_T * dst, IBlock * /*block*/, walberla::field::DefaultEvaluationFilter & /*filter*/, const uint_t numberOfGhostLayersToInclude ) { @@ -508,7 +509,7 @@ void StreamPull< LatticeModel_T, typename boost::enable_if_c< boost::is_same< ty } template< typename LatticeModel_T > -void StreamPull< LatticeModel_T, typename boost::enable_if_c< boost::is_same< typename LatticeModel_T::Stencil, +void StreamPull< LatticeModel_T, typename std::enable_if< std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value >::type >::execute( PdfField_T * src, PdfField_T * dst, cell_idx_t x, cell_idx_t y, cell_idx_t z ) { @@ -540,10 +541,10 @@ void StreamPull< LatticeModel_T, typename boost::enable_if_c< boost::is_same< ty // D3Q27 // template< typename LatticeModel_T > -struct StreamPull< LatticeModel_T, typename boost::enable_if_c< boost::is_same< typename LatticeModel_T::Stencil, +struct StreamPull< LatticeModel_T, typename std::enable_if< std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q27 >::value >::type > { - static_assert( (boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q27 >::value), "Only works with D3Q27!" ); + static_assert( (std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q27 >::value), "Only works with D3Q27!" ); typedef PdfField< LatticeModel_T > PdfField_T; typedef typename LatticeModel_T::Stencil Stencil_T; @@ -559,7 +560,7 @@ struct StreamPull< LatticeModel_T, typename boost::enable_if_c< boost::is_same< template< typename LatticeModel_T > template< typename Filter_T > -void StreamPull< LatticeModel_T, typename boost::enable_if_c< boost::is_same< typename LatticeModel_T::Stencil, +void StreamPull< LatticeModel_T, typename std::enable_if< std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q27 >::value >::type >::execute( PdfField_T * src, PdfField_T * dst, IBlock * block, Filter_T & filter, const uint_t numberOfGhostLayersToInclude ) { @@ -582,7 +583,7 @@ void StreamPull< LatticeModel_T, typename boost::enable_if_c< boost::is_same< ty } template< typename LatticeModel_T > -void StreamPull< LatticeModel_T, typename boost::enable_if_c< boost::is_same< typename LatticeModel_T::Stencil, +void StreamPull< LatticeModel_T, typename std::enable_if< std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q27 >::value >::type >::execute( PdfField_T * src, PdfField_T * dst, IBlock * /*block*/, walberla::field::DefaultEvaluationFilter & /*filter*/, const uint_t numberOfGhostLayersToInclude ) { @@ -590,7 +591,7 @@ void StreamPull< LatticeModel_T, typename boost::enable_if_c< boost::is_same< ty } template< typename LatticeModel_T > -void StreamPull< LatticeModel_T, typename boost::enable_if_c< boost::is_same< typename LatticeModel_T::Stencil, +void StreamPull< LatticeModel_T, typename std::enable_if< std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q27 >::value >::type >::execute( PdfField_T * src, PdfField_T * dst, cell_idx_t x, cell_idx_t y, cell_idx_t z ) { diff --git a/src/lbm/sweeps/Streaming.h b/src/lbm/sweeps/Streaming.h index 5122bd997aa4b0729c0d3ca6c2ab5180292e3aa4..f4d87fe4a4427591f7873d61d2a24932efe71902 100644 --- a/src/lbm/sweeps/Streaming.h +++ b/src/lbm/sweeps/Streaming.h @@ -31,9 +31,7 @@ #include "stencil/D3Q19.h" #include "stencil/Directions.h" - -#include <boost/mpl/logical.hpp> -#include <boost/utility/enable_if.hpp> +#include <type_traits> namespace walberla { @@ -54,10 +52,10 @@ struct StreamEverything; // streaming performed for all cells //////////// template< typename LatticeModel_T, typename FlagField_T > -struct Stream< LatticeModel_T, FlagField_T, typename boost::enable_if< boost::mpl::not_< boost::is_same< typename LatticeModel_T::Stencil, - stencil::D3Q19 > > >::type > +struct Stream< LatticeModel_T, FlagField_T, typename std::enable_if< ! std::is_same< typename LatticeModel_T::Stencil, + stencil::D3Q19>::value >::type > { - static_assert( (boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value == false), "There is a specialization for D3Q19!" ); + static_assert( (std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value == false), "There is a specialization for D3Q19!" ); typedef PdfField< LatticeModel_T > PdfField_T; typedef typename LatticeModel_T::Stencil Stencil; @@ -67,8 +65,8 @@ struct Stream< LatticeModel_T, FlagField_T, typename boost::enable_if< boost::mp }; template< typename LatticeModel_T, typename FlagField_T > -void Stream< LatticeModel_T, FlagField_T, typename boost::enable_if< boost::mpl::not_< boost::is_same< typename LatticeModel_T::Stencil, - stencil::D3Q19 > > >::type +void Stream< LatticeModel_T, FlagField_T, typename std::enable_if< ! std::is_same< typename LatticeModel_T::Stencil, + stencil::D3Q19 >::value >::type >::execute( PdfField_T * src, PdfField_T * dst, const FlagField_T * flagField, const typename FlagField_T::flag_t lbm, const uint_t numberOfGhostLayersToInclude ) { @@ -96,10 +94,10 @@ void Stream< LatticeModel_T, FlagField_T, typename boost::enable_if< boost::mpl: template< typename LatticeModel_T, typename FlagField_T > -struct Stream< LatticeModel_T, FlagField_T, typename boost::enable_if< boost::is_same< typename LatticeModel_T::Stencil, - stencil::D3Q19 > >::type > +struct Stream< LatticeModel_T, FlagField_T, typename std::enable_if< std::is_same< typename LatticeModel_T::Stencil, + stencil::D3Q19 >::value >::type > { - static_assert( (boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value), "Only works with D3Q19!" ); + static_assert( (std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value), "Only works with D3Q19!" ); typedef PdfField< LatticeModel_T > PdfField_T; typedef typename LatticeModel_T::Stencil Stencil; @@ -109,8 +107,8 @@ struct Stream< LatticeModel_T, FlagField_T, typename boost::enable_if< boost::is }; template< typename LatticeModel_T, typename FlagField_T > -void Stream< LatticeModel_T, FlagField_T, typename boost::enable_if< boost::is_same< typename LatticeModel_T::Stencil, - stencil::D3Q19 > >::type +void Stream< LatticeModel_T, FlagField_T, typename std::enable_if< std::is_same< typename LatticeModel_T::Stencil, + stencil::D3Q19 >::value >::type >::execute( PdfField_T * src, PdfField_T * dst, const FlagField_T * flagField, const typename FlagField_T::flag_t lbm, const uint_t numberOfGhostLayersToInclude ) { @@ -161,10 +159,10 @@ void Stream< LatticeModel_T, FlagField_T, typename boost::enable_if< boost::is_s /////////////////////// template< typename LatticeModel_T > -struct StreamEverything< LatticeModel_T, typename boost::enable_if< boost::mpl::not_< boost::is_same< typename LatticeModel_T::Stencil, - stencil::D3Q19 > > >::type > +struct StreamEverything< LatticeModel_T, typename std::enable_if< ! std::is_same< typename LatticeModel_T::Stencil, + stencil::D3Q19 >::value >::type > { - static_assert( (boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value == false), "There is a specialization for D3Q19!" ); + static_assert( (std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value == false), "There is a specialization for D3Q19!" ); typedef PdfField< LatticeModel_T > PdfField_T; typedef typename LatticeModel_T::Stencil Stencil; @@ -173,8 +171,8 @@ struct StreamEverything< LatticeModel_T, typename boost::enable_if< boost::mpl:: }; template< typename LatticeModel_T > -void StreamEverything< LatticeModel_T, typename boost::enable_if< boost::mpl::not_< boost::is_same< typename LatticeModel_T::Stencil, - stencil::D3Q19 > > >::type +void StreamEverything< LatticeModel_T, typename std::enable_if< ! std::is_same< typename LatticeModel_T::Stencil, + stencil::D3Q19 >::value >::type >::execute( PdfField_T * src, PdfField_T * dst, const uint_t numberOfGhostLayersToInclude ) { WALBERLA_ASSERT_NOT_NULLPTR( src ); @@ -213,10 +211,10 @@ void StreamEverything< LatticeModel_T, typename boost::enable_if< boost::mpl::no template< typename LatticeModel_T > -struct StreamEverything< LatticeModel_T, typename boost::enable_if< boost::is_same< typename LatticeModel_T::Stencil, - stencil::D3Q19 > >::type > +struct StreamEverything< LatticeModel_T, typename std::enable_if< std::is_same< typename LatticeModel_T::Stencil, + stencil::D3Q19 >::value >::type > { - static_assert( (boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value), "Only works with D3Q19!" ); + static_assert( (std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value), "Only works with D3Q19!" ); typedef PdfField< LatticeModel_T > PdfField_T; typedef typename LatticeModel_T::Stencil Stencil; @@ -225,8 +223,8 @@ struct StreamEverything< LatticeModel_T, typename boost::enable_if< boost::is_sa }; template< typename LatticeModel_T > -void StreamEverything< LatticeModel_T, typename boost::enable_if< boost::is_same< typename LatticeModel_T::Stencil, - stencil::D3Q19 > >::type +void StreamEverything< LatticeModel_T, typename std::enable_if< std::is_same< typename LatticeModel_T::Stencil, + stencil::D3Q19 >::value >::type >::execute( PdfField_T * src, PdfField_T * dst, const uint_t numberOfGhostLayersToInclude ) { WALBERLA_ASSERT_NOT_NULLPTR( src ); diff --git a/src/lbm/trt/CellwiseSweep.impl.h b/src/lbm/trt/CellwiseSweep.impl.h index b1fa4a68a58acf312b856c4b4a55d5d700a5fbe9..241aeedfce15834f6d6cc8bac42fde42f27c5de4 100644 --- a/src/lbm/trt/CellwiseSweep.impl.h +++ b/src/lbm/trt/CellwiseSweep.impl.h @@ -31,12 +31,7 @@ #include "field/EvaluationFilter.h" #include "field/iterators/IteratorMacros.h" -#include <boost/mpl/logical.hpp> -#include <boost/mpl/equal_to.hpp> -#include <boost/mpl/bool.hpp> -#include <boost/mpl/int.hpp> -#include <boost/type_traits/is_same.hpp> -#include <boost/utility/enable_if.hpp> +#include <type_traits> namespace walberla { @@ -51,13 +46,12 @@ namespace lbm { ////////////////////////// #define WALBERLA_LBM_CELLWISE_SWEEP_SPECIALIZATION_TRT_7 \ - boost::mpl::and_< boost::mpl::and_< boost::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::TRT_tag >, \ - boost::is_same< typename LatticeModel_T::Stencil, stencil::D2Q9 >, \ - boost::mpl::not_< boost::mpl::bool_< LatticeModel_T::compressible > >, \ - boost::mpl::equal_to< boost::mpl::int_< LatticeModel_T::equilibriumAccuracyOrder >, boost::mpl::int_<2> >, \ - boost::is_same< typename LatticeModel_T::ForceModel::tag, force_model::None_tag > >, \ - boost::is_same< DensityVelocityIn_T, DefaultDensityEquilibriumVelocityCalculation > \ - > + (std::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::TRT_tag >::value && \ + std::is_same< typename LatticeModel_T::Stencil, stencil::D2Q9 >::value && \ + ! LatticeModel_T::compressible && \ + LatticeModel_T::equilibriumAccuracyOrder == 2 && \ + std::is_same< typename LatticeModel_T::ForceModel::tag, force_model::None_tag >::value && \ + std::is_same< DensityVelocityIn_T, DefaultDensityEquilibriumVelocityCalculation >::value) WALBERLA_LBM_CELLWISE_SWEEP_CLASS_HEAD_AND_STREAM( WALBERLA_LBM_CELLWISE_SWEEP_SPECIALIZATION_TRT_7 ) @@ -196,13 +190,12 @@ WALBERLA_LBM_CELLWISE_SWEEP_COLLIDE_FOOT() /////////////////////////// #define WALBERLA_LBM_CELLWISE_SWEEP_SPECIALIZATION_TRT_1 \ - boost::mpl::and_< boost::mpl::and_< boost::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::TRT_tag >, \ - boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >, \ - boost::mpl::not_< boost::mpl::bool_< LatticeModel_T::compressible > >, \ - boost::mpl::equal_to< boost::mpl::int_< LatticeModel_T::equilibriumAccuracyOrder >, boost::mpl::int_<2> >, \ - boost::is_same< typename LatticeModel_T::ForceModel::tag, force_model::None_tag > >, \ - boost::is_same< DensityVelocityIn_T, DefaultDensityEquilibriumVelocityCalculation > \ - > + (std::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::TRT_tag >::value && \ + std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value && \ + ! LatticeModel_T::compressible && \ + LatticeModel_T::equilibriumAccuracyOrder == 2 && \ + std::is_same< typename LatticeModel_T::ForceModel::tag, force_model::None_tag >::value && \ + std::is_same< DensityVelocityIn_T, DefaultDensityEquilibriumVelocityCalculation >::value) WALBERLA_LBM_CELLWISE_SWEEP_CLASS_HEAD_AND_STREAM( WALBERLA_LBM_CELLWISE_SWEEP_SPECIALIZATION_TRT_1 ) @@ -395,13 +388,12 @@ WALBERLA_LBM_CELLWISE_SWEEP_COLLIDE_FOOT() #define WALBERLA_LBM_CELLWISE_SWEEP_SPECIALIZATION_TRT_2 \ - boost::mpl::and_< boost::mpl::and_< boost::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::TRT_tag >, \ - boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >, \ - boost::mpl::bool_< LatticeModel_T::compressible >, \ - boost::mpl::equal_to< boost::mpl::int_< LatticeModel_T::equilibriumAccuracyOrder >, boost::mpl::int_<2> >, \ - boost::is_same< typename LatticeModel_T::ForceModel::tag, force_model::None_tag > >, \ - boost::is_same< DensityVelocityIn_T, DefaultDensityEquilibriumVelocityCalculation > \ - > + (std::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::TRT_tag >::value && \ + std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value && \ + LatticeModel_T::compressible && \ + LatticeModel_T::equilibriumAccuracyOrder == 2 && \ + std::is_same< typename LatticeModel_T::ForceModel::tag, force_model::None_tag >::value && \ + std::is_same< DensityVelocityIn_T, DefaultDensityEquilibriumVelocityCalculation >::value) WALBERLA_LBM_CELLWISE_SWEEP_CLASS_HEAD_AND_STREAM( WALBERLA_LBM_CELLWISE_SWEEP_SPECIALIZATION_TRT_2 ) @@ -602,13 +594,12 @@ WALBERLA_LBM_CELLWISE_SWEEP_COLLIDE_FOOT() #define WALBERLA_LBM_CELLWISE_SWEEP_SPECIALIZATION_TRT_3 \ - boost::mpl::and_< boost::mpl::and_< boost::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::TRT_tag >, \ - boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >, \ - boost::mpl::not_< boost::mpl::bool_< LatticeModel_T::compressible > >, \ - boost::mpl::equal_to< boost::mpl::int_< LatticeModel_T::equilibriumAccuracyOrder >, boost::mpl::int_<2> >, \ - boost::is_same< typename LatticeModel_T::ForceModel::tag, force_model::Simple_tag > >, \ - boost::is_same< DensityVelocityIn_T, DefaultDensityEquilibriumVelocityCalculation > \ - > + (std::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::TRT_tag >::value && \ + std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value && \ + ! LatticeModel_T::compressible && \ + LatticeModel_T::equilibriumAccuracyOrder == 2 && \ + std::is_same< typename LatticeModel_T::ForceModel::tag, force_model::Simple_tag >::value && \ + std::is_same< DensityVelocityIn_T, DefaultDensityEquilibriumVelocityCalculation >::value) WALBERLA_LBM_CELLWISE_SWEEP_CLASS_HEAD_AND_STREAM( WALBERLA_LBM_CELLWISE_SWEEP_SPECIALIZATION_TRT_3 ) @@ -815,13 +806,12 @@ WALBERLA_LBM_CELLWISE_SWEEP_COLLIDE_FOOT() /////////////////////////// #define WALBERLA_LBM_CELLWISE_SWEEP_SPECIALIZATION_TRT_4 \ - boost::mpl::and_< boost::mpl::and_< boost::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::TRT_tag >, \ - boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q27 >, \ - boost::mpl::not_< boost::mpl::bool_< LatticeModel_T::compressible > >, \ - boost::mpl::equal_to< boost::mpl::int_< LatticeModel_T::equilibriumAccuracyOrder >, boost::mpl::int_<2> >, \ - boost::is_same< typename LatticeModel_T::ForceModel::tag, force_model::None_tag > >, \ - boost::is_same< DensityVelocityIn_T, DefaultDensityEquilibriumVelocityCalculation > \ - > + (std::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::TRT_tag >::value && \ + std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q27 >::value && \ + ! LatticeModel_T::compressible && \ + LatticeModel_T::equilibriumAccuracyOrder == 2 && \ + std::is_same< typename LatticeModel_T::ForceModel::tag, force_model::None_tag >::value && \ + std::is_same< DensityVelocityIn_T, DefaultDensityEquilibriumVelocityCalculation>::value) WALBERLA_LBM_CELLWISE_SWEEP_CLASS_HEAD_AND_STREAM( WALBERLA_LBM_CELLWISE_SWEEP_SPECIALIZATION_TRT_4 ) @@ -1068,13 +1058,12 @@ WALBERLA_LBM_CELLWISE_SWEEP_COLLIDE_FOOT() #define WALBERLA_LBM_CELLWISE_SWEEP_SPECIALIZATION_TRT_5 \ - boost::mpl::and_< boost::mpl::and_< boost::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::TRT_tag >, \ - boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q27 >, \ - boost::mpl::bool_< LatticeModel_T::compressible >, \ - boost::mpl::equal_to< boost::mpl::int_< LatticeModel_T::equilibriumAccuracyOrder >, boost::mpl::int_<2> >, \ - boost::is_same< typename LatticeModel_T::ForceModel::tag, force_model::None_tag > >, \ - boost::is_same< DensityVelocityIn_T, DefaultDensityEquilibriumVelocityCalculation > \ - > + (std::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::TRT_tag >::value && \ + std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q27 >::value && \ + LatticeModel_T::compressible && \ + LatticeModel_T::equilibriumAccuracyOrder == 2 && \ + std::is_same< typename LatticeModel_T::ForceModel::tag, force_model::None_tag >::value && \ + std::is_same< DensityVelocityIn_T, DefaultDensityEquilibriumVelocityCalculation >::value) WALBERLA_LBM_CELLWISE_SWEEP_CLASS_HEAD_AND_STREAM( WALBERLA_LBM_CELLWISE_SWEEP_SPECIALIZATION_TRT_5 ) @@ -1331,13 +1320,12 @@ WALBERLA_LBM_CELLWISE_SWEEP_COLLIDE_FOOT() #define WALBERLA_LBM_CELLWISE_SWEEP_SPECIALIZATION_TRT_6 \ - boost::mpl::and_< boost::mpl::and_< boost::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::TRT_tag >, \ - boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q27 >, \ - boost::mpl::not_< boost::mpl::bool_< LatticeModel_T::compressible > >, \ - boost::mpl::equal_to< boost::mpl::int_< LatticeModel_T::equilibriumAccuracyOrder >, boost::mpl::int_<2> >, \ - boost::is_same< typename LatticeModel_T::ForceModel::tag, force_model::Simple_tag > >, \ - boost::is_same< DensityVelocityIn_T, DefaultDensityEquilibriumVelocityCalculation > \ - > + (std::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::TRT_tag >::value && \ + std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q27 >::value && \ + ! LatticeModel_T::compressible && \ + LatticeModel_T::equilibriumAccuracyOrder == 2 && \ + std::is_same< typename LatticeModel_T::ForceModel::tag, force_model::Simple_tag >::value && \ + std::is_same< DensityVelocityIn_T, DefaultDensityEquilibriumVelocityCalculation >::value) WALBERLA_LBM_CELLWISE_SWEEP_CLASS_HEAD_AND_STREAM( WALBERLA_LBM_CELLWISE_SWEEP_SPECIALIZATION_TRT_6 ) @@ -1599,17 +1587,14 @@ WALBERLA_LBM_CELLWISE_SWEEP_COLLIDE_FOOT() //////////////////////////////// #define WALBERLA_LBM_CELLWISE_SWEEP_SPECIALIZATION_TRT \ - boost::mpl::and_< boost::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::TRT_tag >, \ - boost::mpl::not_< boost::mpl::or_< boost::mpl::or_< WALBERLA_LBM_CELLWISE_SWEEP_SPECIALIZATION_TRT_1, \ - WALBERLA_LBM_CELLWISE_SWEEP_SPECIALIZATION_TRT_2, \ - WALBERLA_LBM_CELLWISE_SWEEP_SPECIALIZATION_TRT_3, \ - WALBERLA_LBM_CELLWISE_SWEEP_SPECIALIZATION_TRT_4, \ - WALBERLA_LBM_CELLWISE_SWEEP_SPECIALIZATION_TRT_5 >, \ - boost::mpl::or_< WALBERLA_LBM_CELLWISE_SWEEP_SPECIALIZATION_TRT_6, \ - WALBERLA_LBM_CELLWISE_SWEEP_SPECIALIZATION_TRT_7 > \ - > \ - > \ - > + std::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::TRT_tag >::value && \ + ! ( WALBERLA_LBM_CELLWISE_SWEEP_SPECIALIZATION_TRT_1 || \ + WALBERLA_LBM_CELLWISE_SWEEP_SPECIALIZATION_TRT_2 || \ + WALBERLA_LBM_CELLWISE_SWEEP_SPECIALIZATION_TRT_3 || \ + WALBERLA_LBM_CELLWISE_SWEEP_SPECIALIZATION_TRT_4 || \ + WALBERLA_LBM_CELLWISE_SWEEP_SPECIALIZATION_TRT_5 || \ + WALBERLA_LBM_CELLWISE_SWEEP_SPECIALIZATION_TRT_6 || \ + WALBERLA_LBM_CELLWISE_SWEEP_SPECIALIZATION_TRT_7 ) WALBERLA_LBM_CELLWISE_SWEEP_CLASS_HEAD_AND_STREAM( WALBERLA_LBM_CELLWISE_SWEEP_SPECIALIZATION_TRT ) @@ -1640,7 +1625,7 @@ WALBERLA_LBM_CELLWISE_SWEEP_STREAM_COLLIDE_HEAD( WALBERLA_LBM_CELLWISE_SWEEP_SPE Vector3<real_t> velocity; real_t rho = this->densityVelocityIn( velocity, dst, x, y, z ); - if (boost::is_same< typename LatticeModel_T::ForceModel::tag, force_model::Guo_tag >::value) + if (std::is_same< typename LatticeModel_T::ForceModel::tag, force_model::Guo_tag >::value) velocity -= real_c(0.5) * lm.forceModel().force(x,y,z); this->densityVelocityOut( x, y, z, lm, velocity, rho ); @@ -1691,7 +1676,7 @@ WALBERLA_LBM_CELLWISE_SWEEP_COLLIDE_HEAD( WALBERLA_LBM_CELLWISE_SWEEP_SPECIALIZA Vector3<real_t> velocity; real_t rho = this->densityVelocityIn( velocity, src, x, y, z ); - if (boost::is_same< typename LatticeModel_T::ForceModel::tag, force_model::Guo_tag >::value) + if (std::is_same< typename LatticeModel_T::ForceModel::tag, force_model::Guo_tag >::value) velocity -= real_c(0.5) * lm.forceModel().force(x,y,z); this->densityVelocityOut( x, y, z, lm, velocity, rho ); diff --git a/src/lbm/trt/SplitPureSweep.impl.h b/src/lbm/trt/SplitPureSweep.impl.h index 0c60f11b440c230bff7c211b24e51e59700bdbda..695cebccf47b618a3d65c2fd4fd6cfea900c5bca 100644 --- a/src/lbm/trt/SplitPureSweep.impl.h +++ b/src/lbm/trt/SplitPureSweep.impl.h @@ -33,11 +33,7 @@ #include "field/iterators/IteratorMacros.h" -#include <boost/mpl/logical.hpp> -#include <boost/mpl/bool.hpp> -#include <boost/mpl/int.hpp> -#include <boost/type_traits/is_same.hpp> -#include <boost/utility/enable_if.hpp> +#include <type_traits> @@ -62,21 +58,19 @@ namespace lbm { /////////////////////////////// template< typename LatticeModel_T > -class SplitPureSweep< LatticeModel_T, typename boost::enable_if< boost::mpl::and_< boost::is_same< typename LatticeModel_T::CollisionModel::tag, - collision_model::TRT_tag >, - boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >, - boost::mpl::not_< boost::mpl::bool_< LatticeModel_T::compressible > >, - boost::is_same< typename LatticeModel_T::ForceModel::tag, - force_model::None_tag > - > >::type > : +class SplitPureSweep< LatticeModel_T, typename std::enable_if< std::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::TRT_tag >::value && + std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value && + ! LatticeModel_T::compressible && + std::is_same< typename LatticeModel_T::ForceModel::tag, force_model::None_tag >::value + >::type > : public SweepBase< LatticeModel_T > { public: - static_assert( (boost::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::TRT_tag >::value), "Only works with TRT!" ); - static_assert( (boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value), "Only works with D3Q19!" ); + static_assert( (std::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::TRT_tag >::value), "Only works with TRT!" ); + static_assert( (std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value), "Only works with D3Q19!" ); static_assert( LatticeModel_T::compressible == false, "Only works with incompressible models!" ); - static_assert( (boost::is_same< typename LatticeModel_T::ForceModel::tag, force_model::None_tag >::value), "Only works without additional forces!" ); + static_assert( (std::is_same< typename LatticeModel_T::ForceModel::tag, force_model::None_tag >::value), "Only works without additional forces!" ); static_assert( LatticeModel_T::equilibriumAccuracyOrder == 2, "Only works for lattice models that require the equilibrium distribution to be order 2 accurate!" ); typedef typename SweepBase<LatticeModel_T>::PdfField_T PdfField_T; @@ -97,12 +91,11 @@ public: }; template< typename LatticeModel_T > -void SplitPureSweep< LatticeModel_T, typename boost::enable_if< boost::mpl::and_< boost::is_same< typename LatticeModel_T::CollisionModel::tag, - collision_model::TRT_tag >, - boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >, - boost::mpl::not_< boost::mpl::bool_< LatticeModel_T::compressible > >, - boost::is_same< typename LatticeModel_T::ForceModel::tag, - force_model::None_tag > > >::type +void SplitPureSweep< LatticeModel_T, typename std::enable_if< std::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::TRT_tag >::value && + std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value && + ! LatticeModel_T::compressible && + std::is_same< typename LatticeModel_T::ForceModel::tag, force_model::None_tag >::value + >::type >::operator()( IBlock * const block ) { PdfField_T * src( NULL ); @@ -480,12 +473,11 @@ void SplitPureSweep< LatticeModel_T, typename boost::enable_if< boost::mpl::and_ } template< typename LatticeModel_T > -void SplitPureSweep< LatticeModel_T, typename boost::enable_if< boost::mpl::and_< boost::is_same< typename LatticeModel_T::CollisionModel::tag, - collision_model::TRT_tag >, - boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >, - boost::mpl::not_< boost::mpl::bool_< LatticeModel_T::compressible > >, - boost::is_same< typename LatticeModel_T::ForceModel::tag, - force_model::None_tag > > >::type +void SplitPureSweep< LatticeModel_T, typename std::enable_if< std::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::TRT_tag >::value && + std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value && + ! LatticeModel_T::compressible && + std::is_same< typename LatticeModel_T::ForceModel::tag, force_model::None_tag >::value + >::type >::stream( IBlock * const block, const uint_t numberOfGhostLayersToInclude ) { PdfField_T * src( NULL ); @@ -497,12 +489,11 @@ void SplitPureSweep< LatticeModel_T, typename boost::enable_if< boost::mpl::and_ } template< typename LatticeModel_T > -void SplitPureSweep< LatticeModel_T, typename boost::enable_if< boost::mpl::and_< boost::is_same< typename LatticeModel_T::CollisionModel::tag, - collision_model::TRT_tag >, - boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >, - boost::mpl::not_< boost::mpl::bool_< LatticeModel_T::compressible > >, - boost::is_same< typename LatticeModel_T::ForceModel::tag, - force_model::None_tag > > >::type +void SplitPureSweep< LatticeModel_T, typename std::enable_if< std::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::TRT_tag >::value && + std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value && + ! LatticeModel_T::compressible && + std::is_same< typename LatticeModel_T::ForceModel::tag, force_model::None_tag >::value + >::type #ifdef NDEBUG >::collide( IBlock * const block, const uint_t /*numberOfGhostLayersToInclude*/ ) #else @@ -860,21 +851,19 @@ void SplitPureSweep< LatticeModel_T, typename boost::enable_if< boost::mpl::and_ /////////////////////////////// template< typename LatticeModel_T > -class SplitPureSweep< LatticeModel_T, typename boost::enable_if< boost::mpl::and_< boost::is_same< typename LatticeModel_T::CollisionModel::tag, - collision_model::TRT_tag >, - boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >, - boost::mpl::bool_< LatticeModel_T::compressible >, - boost::is_same< typename LatticeModel_T::ForceModel::tag, - force_model::None_tag > - > >::type > : +class SplitPureSweep< LatticeModel_T, typename std::enable_if< std::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::TRT_tag >::value && + std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value && + LatticeModel_T::compressible && + std::is_same< typename LatticeModel_T::ForceModel::tag, force_model::None_tag >::value + >::type > : public SweepBase< LatticeModel_T > { public: - static_assert( (boost::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::TRT_tag >::value), "Only works with TRT!" ); - static_assert( (boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value), "Only works with D3Q19!" ); + static_assert( (std::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::TRT_tag >::value), "Only works with TRT!" ); + static_assert( (std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value), "Only works with D3Q19!" ); static_assert( LatticeModel_T::compressible, "Only works with compressible models!" ); - static_assert( (boost::is_same< typename LatticeModel_T::ForceModel::tag, force_model::None_tag >::value), "Only works without additional forces!" ); + static_assert( (std::is_same< typename LatticeModel_T::ForceModel::tag, force_model::None_tag >::value), "Only works without additional forces!" ); static_assert( LatticeModel_T::equilibriumAccuracyOrder == 2, "Only works for lattice models that require the equilibrium distribution to be order 2 accurate!" ); typedef typename SweepBase<LatticeModel_T>::PdfField_T PdfField_T; @@ -895,12 +884,11 @@ public: }; template< typename LatticeModel_T > -void SplitPureSweep< LatticeModel_T, typename boost::enable_if< boost::mpl::and_< boost::is_same< typename LatticeModel_T::CollisionModel::tag, - collision_model::TRT_tag >, - boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >, - boost::mpl::bool_< LatticeModel_T::compressible >, - boost::is_same< typename LatticeModel_T::ForceModel::tag, - force_model::None_tag > > >::type +void SplitPureSweep< LatticeModel_T, typename std::enable_if< std::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::TRT_tag >::value && + std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value && + LatticeModel_T::compressible && + std::is_same< typename LatticeModel_T::ForceModel::tag, force_model::None_tag >::value + >::type >::operator()( IBlock * const block ) { PdfField_T * src( NULL ); @@ -1297,12 +1285,11 @@ void SplitPureSweep< LatticeModel_T, typename boost::enable_if< boost::mpl::and_ } template< typename LatticeModel_T > -void SplitPureSweep< LatticeModel_T, typename boost::enable_if< boost::mpl::and_< boost::is_same< typename LatticeModel_T::CollisionModel::tag, - collision_model::TRT_tag >, - boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >, - boost::mpl::bool_< LatticeModel_T::compressible >, - boost::is_same< typename LatticeModel_T::ForceModel::tag, - force_model::None_tag > > >::type +void SplitPureSweep< LatticeModel_T, typename std::enable_if< std::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::TRT_tag >::value && + std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value && + LatticeModel_T::compressible && + std::is_same< typename LatticeModel_T::ForceModel::tag, force_model::None_tag >::value + >::type >::stream( IBlock * const block, const uint_t numberOfGhostLayersToInclude ) { PdfField_T * src( NULL ); @@ -1314,12 +1301,11 @@ void SplitPureSweep< LatticeModel_T, typename boost::enable_if< boost::mpl::and_ } template< typename LatticeModel_T > -void SplitPureSweep< LatticeModel_T, typename boost::enable_if< boost::mpl::and_< boost::is_same< typename LatticeModel_T::CollisionModel::tag, - collision_model::TRT_tag >, - boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >, - boost::mpl::bool_< LatticeModel_T::compressible >, - boost::is_same< typename LatticeModel_T::ForceModel::tag, - force_model::None_tag > > >::type +void SplitPureSweep< LatticeModel_T, typename std::enable_if< std::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::TRT_tag >::value && + std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value && + LatticeModel_T::compressible && + std::is_same< typename LatticeModel_T::ForceModel::tag, force_model::None_tag >::value + >::type #ifdef NDEBUG >::collide( IBlock * const block, const uint_t /*numberOfGhostLayersToInclude*/ ) #else diff --git a/src/lbm/trt/SplitSweep.impl.h b/src/lbm/trt/SplitSweep.impl.h index fed687b167e9f1f89e20d7e64d63ce3941732cf4..fadc10b487a0bd88f627e46fe72eb8f817c8575e 100644 --- a/src/lbm/trt/SplitSweep.impl.h +++ b/src/lbm/trt/SplitSweep.impl.h @@ -27,10 +27,8 @@ #include "field/iterators/IteratorMacros.h" -#include <boost/mpl/logical.hpp> -#include <boost/mpl/bool.hpp> -#include <boost/type_traits/is_same.hpp> -#include <boost/utility/enable_if.hpp> +#include <type_traits> + namespace walberla { @@ -55,21 +53,19 @@ namespace lbm { /////////////////////////////// template< typename LatticeModel_T, typename FlagField_T > -class SplitSweep< LatticeModel_T, FlagField_T, typename boost::enable_if< boost::mpl::and_< boost::is_same< typename LatticeModel_T::CollisionModel::tag, - collision_model::TRT_tag >, - boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >, - boost::mpl::not_< boost::mpl::bool_< LatticeModel_T::compressible > >, - boost::is_same< typename LatticeModel_T::ForceModel::tag, - force_model::None_tag > - > >::type > : +class SplitSweep< LatticeModel_T, FlagField_T, typename std::enable_if< std::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::TRT_tag >::value && + std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value && + ! LatticeModel_T::compressible && + std::is_same< typename LatticeModel_T::ForceModel::tag, force_model::None_tag >::value + >::type > : public FlagFieldSweepBase< LatticeModel_T, FlagField_T > { public: - static_assert( (boost::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::TRT_tag >::value), "Only works with TRT!" ); - static_assert( (boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value), "Only works with D3Q19!" ); + static_assert( (std::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::TRT_tag >::value), "Only works with TRT!" ); + static_assert( (std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value), "Only works with D3Q19!" ); static_assert( LatticeModel_T::compressible == false, "Only works with incompressible models!" ); - static_assert( (boost::is_same< typename LatticeModel_T::ForceModel::tag, force_model::None_tag >::value), "Only works without additional forces!" ); + static_assert( (std::is_same< typename LatticeModel_T::ForceModel::tag, force_model::None_tag >::value), "Only works without additional forces!" ); static_assert( LatticeModel_T::equilibriumAccuracyOrder == 2, "Only works for lattice models that require the equilibrium distribution to be order 2 accurate!" ); typedef typename FlagFieldSweepBase<LatticeModel_T,FlagField_T>::PdfField_T PdfField_T; @@ -90,12 +86,11 @@ public: }; template< typename LatticeModel_T, typename FlagField_T > -void SplitSweep< LatticeModel_T, FlagField_T, typename boost::enable_if< boost::mpl::and_< boost::is_same< typename LatticeModel_T::CollisionModel::tag, - collision_model::TRT_tag >, - boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >, - boost::mpl::not_< boost::mpl::bool_< LatticeModel_T::compressible > >, - boost::is_same< typename LatticeModel_T::ForceModel::tag, - force_model::None_tag > > >::type +void SplitSweep< LatticeModel_T, FlagField_T, typename std::enable_if< std::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::TRT_tag >::value && + std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value && + ! LatticeModel_T::compressible && + std::is_same< typename LatticeModel_T::ForceModel::tag, force_model::None_tag >::value + >::type >::operator()( IBlock * const block ) { PdfField_T * src( NULL ); @@ -543,12 +538,11 @@ void SplitSweep< LatticeModel_T, FlagField_T, typename boost::enable_if< boost:: } template< typename LatticeModel_T, typename FlagField_T > -void SplitSweep< LatticeModel_T, FlagField_T, typename boost::enable_if< boost::mpl::and_< boost::is_same< typename LatticeModel_T::CollisionModel::tag, - collision_model::TRT_tag >, - boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >, - boost::mpl::not_< boost::mpl::bool_< LatticeModel_T::compressible > >, - boost::is_same< typename LatticeModel_T::ForceModel::tag, - force_model::None_tag > > >::type +void SplitSweep< LatticeModel_T, FlagField_T, typename std::enable_if< std::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::TRT_tag >::value && + std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value && + ! LatticeModel_T::compressible && + std::is_same< typename LatticeModel_T::ForceModel::tag, force_model::None_tag >::value + >::type >::stream( IBlock * const block, const uint_t numberOfGhostLayersToInclude ) { PdfField_T * src( NULL ); @@ -561,12 +555,11 @@ void SplitSweep< LatticeModel_T, FlagField_T, typename boost::enable_if< boost:: } template< typename LatticeModel_T, typename FlagField_T > -void SplitSweep< LatticeModel_T, FlagField_T, typename boost::enable_if< boost::mpl::and_< boost::is_same< typename LatticeModel_T::CollisionModel::tag, - collision_model::TRT_tag >, - boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >, - boost::mpl::not_< boost::mpl::bool_< LatticeModel_T::compressible > >, - boost::is_same< typename LatticeModel_T::ForceModel::tag, - force_model::None_tag > > >::type +void SplitSweep< LatticeModel_T, FlagField_T, typename std::enable_if< std::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::TRT_tag >::value && + std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value && + ! LatticeModel_T::compressible && + std::is_same< typename LatticeModel_T::ForceModel::tag, force_model::None_tag >::value + >::type #ifdef NDEBUG >::collide( IBlock * const block, const uint_t /*numberOfGhostLayersToInclude*/ ) #else @@ -997,21 +990,19 @@ void SplitSweep< LatticeModel_T, FlagField_T, typename boost::enable_if< boost:: /////////////////////////////// template< typename LatticeModel_T, typename FlagField_T > -class SplitSweep< LatticeModel_T, FlagField_T, typename boost::enable_if< boost::mpl::and_< boost::is_same< typename LatticeModel_T::CollisionModel::tag, - collision_model::TRT_tag >, - boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >, - boost::mpl::bool_< LatticeModel_T::compressible >, - boost::is_same< typename LatticeModel_T::ForceModel::tag, - force_model::None_tag > - > >::type > : +class SplitSweep< LatticeModel_T, FlagField_T, typename std::enable_if< std::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::TRT_tag >::value && + std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value && + LatticeModel_T::compressible && + std::is_same< typename LatticeModel_T::ForceModel::tag, force_model::None_tag >::value + >::type > : public FlagFieldSweepBase< LatticeModel_T, FlagField_T > { public: - static_assert( (boost::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::TRT_tag >::value), "Only works with TRT!" ); - static_assert( (boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value), "Only works with D3Q19!" ); + static_assert( (std::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::TRT_tag >::value), "Only works with TRT!" ); + static_assert( (std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value), "Only works with D3Q19!" ); static_assert( LatticeModel_T::compressible, "Only works with compressible models!" ); - static_assert( (boost::is_same< typename LatticeModel_T::ForceModel::tag, force_model::None_tag >::value), "Only works without additional forces!" ); + static_assert( (std::is_same< typename LatticeModel_T::ForceModel::tag, force_model::None_tag >::value), "Only works without additional forces!" ); static_assert( LatticeModel_T::equilibriumAccuracyOrder == 2, "Only works for lattice models that require the equilibrium distribution to be order 2 accurate!" ); typedef typename FlagFieldSweepBase<LatticeModel_T,FlagField_T>::PdfField_T PdfField_T; @@ -1032,12 +1023,11 @@ public: }; template< typename LatticeModel_T, typename FlagField_T > -void SplitSweep< LatticeModel_T, FlagField_T, typename boost::enable_if< boost::mpl::and_< boost::is_same< typename LatticeModel_T::CollisionModel::tag, - collision_model::TRT_tag >, - boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >, - boost::mpl::bool_< LatticeModel_T::compressible >, - boost::is_same< typename LatticeModel_T::ForceModel::tag, - force_model::None_tag > > >::type +void SplitSweep< LatticeModel_T, FlagField_T, typename std::enable_if< std::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::TRT_tag >::value && + std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value && + LatticeModel_T::compressible && + std::is_same< typename LatticeModel_T::ForceModel::tag, force_model::None_tag >::value + >::type >::operator()( IBlock * const block ) { PdfField_T * src( NULL ); @@ -1504,12 +1494,11 @@ void SplitSweep< LatticeModel_T, FlagField_T, typename boost::enable_if< boost:: } template< typename LatticeModel_T, typename FlagField_T > -void SplitSweep< LatticeModel_T, FlagField_T, typename boost::enable_if< boost::mpl::and_< boost::is_same< typename LatticeModel_T::CollisionModel::tag, - collision_model::TRT_tag >, - boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >, - boost::mpl::bool_< LatticeModel_T::compressible >, - boost::is_same< typename LatticeModel_T::ForceModel::tag, - force_model::None_tag > > >::type +void SplitSweep< LatticeModel_T, FlagField_T, typename std::enable_if< std::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::TRT_tag >::value && + std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value && + LatticeModel_T::compressible && + std::is_same< typename LatticeModel_T::ForceModel::tag, force_model::None_tag >::value + >::type >::stream( IBlock * const block, const uint_t numberOfGhostLayersToInclude ) { PdfField_T * src( NULL ); @@ -1522,12 +1511,11 @@ void SplitSweep< LatticeModel_T, FlagField_T, typename boost::enable_if< boost:: } template< typename LatticeModel_T, typename FlagField_T > -void SplitSweep< LatticeModel_T, FlagField_T, typename boost::enable_if< boost::mpl::and_< boost::is_same< typename LatticeModel_T::CollisionModel::tag, - collision_model::TRT_tag >, - boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >, - boost::mpl::bool_< LatticeModel_T::compressible >, - boost::is_same< typename LatticeModel_T::ForceModel::tag, - force_model::None_tag > > >::type +void SplitSweep< LatticeModel_T, FlagField_T, typename std::enable_if< std::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::TRT_tag >::value && + std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value && + LatticeModel_T::compressible && + std::is_same< typename LatticeModel_T::ForceModel::tag, force_model::None_tag >::value + >::type #ifdef NDEBUG >::collide( IBlock * const block, const uint_t /*numberOfGhostLayersToInclude*/ ) #else diff --git a/src/lbm/trt/bluegeneq/SplitPureSweep.impl.h b/src/lbm/trt/bluegeneq/SplitPureSweep.impl.h index ca3821096a692da7bc61322f53e4b68a910e825a..383b697a33d988e11075b86b5289134d6bf5f191 100644 --- a/src/lbm/trt/bluegeneq/SplitPureSweep.impl.h +++ b/src/lbm/trt/bluegeneq/SplitPureSweep.impl.h @@ -30,25 +30,17 @@ #include "lbm/sweeps/Streaming.h" #include "lbm/sweeps/SweepBase.h" -#include <boost/utility/enable_if.hpp> -#include <boost/type_traits.hpp> - #include <builtins.h> +#include <type_traits> // OpenMP #ifdef _OPENMP #include <omp.h> #endif - - namespace walberla { namespace lbm { -using boost::type_traits::ice_and; -using boost::type_traits::ice_not; - - /////////////////////////////////////////////////////// // Available TRT implementations: // @@ -68,21 +60,19 @@ using boost::type_traits::ice_not; /////////////////////////////// template< typename LatticeModel_T > -class SplitPureSweep< LatticeModel_T, typename boost::enable_if_c< ice_and< boost::is_same< typename LatticeModel_T::CollisionModel::tag, - collision_model::TRT_tag >::value, - boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value, - ice_not< LatticeModel_T::compressible >::value, - boost::is_same< typename LatticeModel_T::ForceModel::tag, - force_model::None_tag >::value - >::value >::type > : +class SplitPureSweep< LatticeModel_T, typename std::enable_if< std::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::TRT_tag >::value && + std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value && + ! LatticeModel_T::compressible && + std::is_same< typename LatticeModel_T::ForceModel::tag, force_model::None_tag >::value + >::type > : public SweepBase< LatticeModel_T > { public: - static_assert( (boost::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::TRT_tag >::value), "Only works with TRT!" ); - static_assert( (boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value), "Only works with D3Q19!" ); + static_assert( (std::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::TRT_tag >::value), "Only works with TRT!" ); + static_assert( (std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value), "Only works with D3Q19!" ); static_assert( LatticeModel_T::compressible == false, "Only works with incompressible models!" ); - static_assert( (boost::is_same< typename LatticeModel_T::ForceModel::tag, force_model::None_tag >::value), "Only works without additional forces!" ); + static_assert( (std::is_same< typename LatticeModel_T::ForceModel::tag, force_model::None_tag >::value), "Only works without additional forces!" ); static_assert( LatticeModel_T::equilibriumAccuracyOrder == 2, "Only works for lattice models that require the equilibrium distribution to be order 2 accurate!" ); typedef typename SweepBase<LatticeModel_T>::PdfField_T PdfField_T; @@ -103,12 +93,11 @@ public: }; template< typename LatticeModel_T > -void SplitPureSweep< LatticeModel_T, typename boost::enable_if_c< ice_and< boost::is_same< typename LatticeModel_T::CollisionModel::tag, - collision_model::TRT_tag >::value, - boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value, - ice_not< LatticeModel_T::compressible >::value, - boost::is_same< typename LatticeModel_T::ForceModel::tag, - force_model::None_tag >::value >::value >::type +void SplitPureSweep< LatticeModel_T, typename std::enable_if< std::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::TRT_tag >::value && + std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value && + ! LatticeModel_T::compressible >::value && + std::is_same< typename LatticeModel_T::ForceModel::tag, force_model::None_tag >::value + >::type >::operator()( IBlock * const block ) { PdfField_T * src( NULL ); @@ -620,12 +609,11 @@ void SplitPureSweep< LatticeModel_T, typename boost::enable_if_c< ice_and< boost } template< typename LatticeModel_T > -void SplitPureSweep< LatticeModel_T, typename boost::enable_if_c< ice_and< boost::is_same< typename LatticeModel_T::CollisionModel::tag, - collision_model::TRT_tag >::value, - boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value, - ice_not< LatticeModel_T::compressible >::value, - boost::is_same< typename LatticeModel_T::ForceModel::tag, - force_model::None_tag >::value >::value >::type +void SplitPureSweep< LatticeModel_T, typename std::enable_if< std::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::TRT_tag >::value && + std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value && + ! LatticeModel_T::compressible >::value && + std::is_same< typename LatticeModel_T::ForceModel::tag, force_model::None_tag >::value + >::type >::stream( IBlock * const block, const uint_t numberOfGhostLayersToInclude ) { PdfField_T * src( NULL ); @@ -637,12 +625,11 @@ void SplitPureSweep< LatticeModel_T, typename boost::enable_if_c< ice_and< boost } template< typename LatticeModel_T > -void SplitPureSweep< LatticeModel_T, typename boost::enable_if_c< ice_and< boost::is_same< typename LatticeModel_T::CollisionModel::tag, - collision_model::TRT_tag >::value, - boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value, - ice_not< LatticeModel_T::compressible >::value, - boost::is_same< typename LatticeModel_T::ForceModel::tag, - force_model::None_tag >::value >::value >::type +void SplitPureSweep< LatticeModel_T, typename std::enable_if< std::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::TRT_tag >::value && + std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value && + ! LatticeModel_T::compressible >::value && + std::is_same< typename LatticeModel_T::ForceModel::tag, force_model::None_tag >::value + >::type #ifdef NDEBUG >::collide( IBlock * const block, const uint_t /*numberOfGhostLayersToInclude*/ ) #else @@ -1059,21 +1046,19 @@ void SplitPureSweep< LatticeModel_T, typename boost::enable_if_c< ice_and< boost /////////////////////////////// template< typename LatticeModel_T > -class SplitPureSweep< LatticeModel_T, typename boost::enable_if_c< ice_and< boost::is_same< typename LatticeModel_T::CollisionModel::tag, - collision_model::TRT_tag >::value, - boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value, - LatticeModel_T::compressible, - boost::is_same< typename LatticeModel_T::ForceModel::tag, - force_model::None_tag >::value - >::value >::type > : +class SplitPureSweep< LatticeModel_T, typename std::enable_if< std::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::TRT_tag >::value && + std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value && + LatticeModel_T::compressible && + std::is_same< typename LatticeModel_T::ForceModel::tag, force_model::None_tag >::value + >::type > : public SweepBase< LatticeModel_T > { public: - static_assert( (boost::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::TRT_tag >::value), "Only works with TRT!" ); - static_assert( (boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value), "Only works with D3Q19!" ); + static_assert( (std::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::TRT_tag >::value), "Only works with TRT!" ); + static_assert( (std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value), "Only works with D3Q19!" ); static_assert( LatticeModel_T::compressible, "Only works with compressible models!" ); - static_assert( (boost::is_same< typename LatticeModel_T::ForceModel::tag, force_model::None_tag >::value), "Only works without additional forces!" ); + static_assert( (std::is_same< typename LatticeModel_T::ForceModel::tag, force_model::None_tag >::value), "Only works without additional forces!" ); static_assert( LatticeModel_T::equilibriumAccuracyOrder == 2, "Only works for lattice models that require the equilibrium distribution to be order 2 accurate!" ); typedef typename SweepBase<LatticeModel_T>::PdfField_T PdfField_T; @@ -1094,12 +1079,11 @@ public: }; template< typename LatticeModel_T > -void SplitPureSweep< LatticeModel_T, typename boost::enable_if_c< ice_and< boost::is_same< typename LatticeModel_T::CollisionModel::tag, - collision_model::TRT_tag >::value, - boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value, - LatticeModel_T::compressible, - boost::is_same< typename LatticeModel_T::ForceModel::tag, - force_model::None_tag >::value >::value >::type +void SplitPureSweep< LatticeModel_T, typename std::enable_if< std::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::TRT_tag >::value && + std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value && + LatticeModel_T::compressible, + std::is_same< typename LatticeModel_T::ForceModel::tag, force_model::None_tag >::value + >::type >::operator()( IBlock * const block ) { PdfField_T * src( NULL ); @@ -1634,12 +1618,12 @@ void SplitPureSweep< LatticeModel_T, typename boost::enable_if_c< ice_and< boost } template< typename LatticeModel_T > -void SplitPureSweep< LatticeModel_T, typename boost::enable_if_c< ice_and< boost::is_same< typename LatticeModel_T::CollisionModel::tag, - collision_model::TRT_tag >::value, - boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value, - LatticeModel_T::compressible, - boost::is_same< typename LatticeModel_T::ForceModel::tag, - force_model::None_tag >::value >::value >::type +void SplitPureSweep< LatticeModel_T, typename std::enable_if< std::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::TRT_tag >::value && + std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value && + LatticeModel_T::compressible && + std::is_same< typename LatticeModel_T::ForceModel::tag && + force_model::None_tag + >::type >::stream( IBlock * const block, const uint_t numberOfGhostLayersToInclude ) { PdfField_T * src( NULL ); @@ -1651,12 +1635,11 @@ void SplitPureSweep< LatticeModel_T, typename boost::enable_if_c< ice_and< boost } template< typename LatticeModel_T > -void SplitPureSweep< LatticeModel_T, typename boost::enable_if_c< ice_and< boost::is_same< typename LatticeModel_T::CollisionModel::tag, - collision_model::TRT_tag >::value, - boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value, - LatticeModel_T::compressible, - boost::is_same< typename LatticeModel_T::ForceModel::tag, - force_model::None_tag >::value >::value >::type +void SplitPureSweep< LatticeModel_T, typename std::enable_if< std::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::TRT_tag >::value && + std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value && + LatticeModel_T::compressible && + std::is_same< typename LatticeModel_T::ForceModel::tag, force_model::None_tag >::value + >::type #ifdef NDEBUG >::collide( IBlock * const block, const uint_t /*numberOfGhostLayersToInclude*/ ) #else diff --git a/src/lbm/trt/cell_operations/DefaultCellOperation.impl.h b/src/lbm/trt/cell_operations/DefaultCellOperation.impl.h index f5fa0ca24a7ca655accda4d1d8b5a78ef711fcf3..0950f0cca8bcdf68c1775ee1058719f253b6c3e2 100644 --- a/src/lbm/trt/cell_operations/DefaultCellOperation.impl.h +++ b/src/lbm/trt/cell_operations/DefaultCellOperation.impl.h @@ -25,10 +25,7 @@ #include "lbm/lattice_model/EquilibriumDistribution.h" #include "lbm/lattice_model/LatticeModelBase.h" -#include <boost/mpl/logical.hpp> -#include <boost/mpl/bool.hpp> -#include <boost/type_traits/is_same.hpp> -#include <boost/utility/enable_if.hpp> +#include <type_traits> namespace walberla { @@ -54,18 +51,16 @@ namespace lbm { /////////////////////////////// template< typename LatticeModel_T > -class DefaultCellOperation< LatticeModel_T, typename boost::enable_if< boost::mpl::and_< boost::is_same< typename LatticeModel_T::CollisionModel::tag, - collision_model::TRT_tag >, - boost::mpl::not_< boost::is_same< typename LatticeModel_T::Stencil, - stencil::D3Q19 > >, - boost::is_same< typename LatticeModel_T::ForceModel::tag, - force_model::None_tag > > >::type > +class DefaultCellOperation< LatticeModel_T, typename std::enable_if< std::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::TRT_tag >::value && + ! std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value && + std::is_same< typename LatticeModel_T::ForceModel::tag, force_model::None_tag >::value + >::type > { public: - static_assert( (boost::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::TRT_tag >::value), "Only works with TRT!" ); - static_assert( (boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value == false), "There is a specialization for D3Q19!" ); - static_assert( (boost::is_same< typename LatticeModel_T::ForceModel::tag, force_model::None_tag >::value), "Only works without additional forces!" ); + static_assert( (std::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::TRT_tag >::value), "Only works with TRT!" ); + static_assert( (std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value == false), "There is a specialization for D3Q19!" ); + static_assert( (std::is_same< typename LatticeModel_T::ForceModel::tag, force_model::None_tag >::value), "Only works without additional forces!" ); static_assert( LatticeModel_T::equilibriumAccuracyOrder == 2, "Only works for lattice models that require the equilibrium distribution to be order 2 accurate!" ); typedef PdfField< LatticeModel_T > PdfField_T; @@ -93,12 +88,10 @@ private: }; template< typename LatticeModel_T > -void DefaultCellOperation< LatticeModel_T, typename boost::enable_if< boost::mpl::and_< boost::is_same< typename LatticeModel_T::CollisionModel::tag, - collision_model::TRT_tag >, - boost::mpl::not_< boost::is_same< typename LatticeModel_T::Stencil, - stencil::D3Q19 > >, - boost::is_same< typename LatticeModel_T::ForceModel::tag, - force_model::None_tag > > >::type +void DefaultCellOperation< LatticeModel_T, typename std::enable_if< std::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::TRT_tag >::value && + ! std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value && + std::is_same< typename LatticeModel_T::ForceModel::tag, force_model::None_tag >::value + >::type >::operator()( PdfField_T * src, PdfField_T * dst, cell_idx_t x, cell_idx_t y, cell_idx_t z ) const { real_t pdfs[ Stencil::Size ]; @@ -130,12 +123,10 @@ void DefaultCellOperation< LatticeModel_T, typename boost::enable_if< boost::mpl template< typename LatticeModel_T > template< typename FieldPtrOrIterator > -void DefaultCellOperation< LatticeModel_T, typename boost::enable_if< boost::mpl::and_< boost::is_same< typename LatticeModel_T::CollisionModel::tag, - collision_model::TRT_tag >, - boost::mpl::not_< boost::is_same< typename LatticeModel_T::Stencil, - stencil::D3Q19 > >, - boost::is_same< typename LatticeModel_T::ForceModel::tag, - force_model::None_tag > > >::type +void DefaultCellOperation< LatticeModel_T, typename std::enable_if< std::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::TRT_tag >::value && + ! std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value && + std::is_same< typename LatticeModel_T::ForceModel::tag, force_model::None_tag >::value + >::type >::operator()( FieldPtrOrIterator & src, FieldPtrOrIterator & dst ) const { real_t pdfs[ Stencil::Size ]; @@ -174,19 +165,18 @@ void DefaultCellOperation< LatticeModel_T, typename boost::enable_if< boost::mpl /////////////////////////////// template< typename LatticeModel_T > -class DefaultCellOperation< LatticeModel_T, typename boost::enable_if< boost::mpl::and_< boost::is_same< typename LatticeModel_T::CollisionModel::tag, - collision_model::TRT_tag >, - boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >, - boost::mpl::not_< boost::mpl::bool_< LatticeModel_T::compressible > >, - boost::is_same< typename LatticeModel_T::ForceModel::tag, - force_model::None_tag > > >::type > +class DefaultCellOperation< LatticeModel_T, typename std::enable_if< std::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::TRT_tag >::value && + std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value && + ! LatticeModel_T::compressible && + std::is_same< typename LatticeModel_T::ForceModel::tag, force_model::None_tag >::value + >::type > { public: - static_assert( (boost::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::TRT_tag >::value), "Only works with TRT!" ); - static_assert( (boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value), "Only works with D3Q19!" ); + static_assert( (std::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::TRT_tag >::value), "Only works with TRT!" ); + static_assert( (std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value), "Only works with D3Q19!" ); static_assert( LatticeModel_T::compressible == false, "Only works with incompressible models!" ); - static_assert( (boost::is_same< typename LatticeModel_T::ForceModel::tag, force_model::None_tag >::value), "Only works without additional forces!" ); + static_assert( (std::is_same< typename LatticeModel_T::ForceModel::tag, force_model::None_tag >::value), "Only works without additional forces!" ); static_assert( LatticeModel_T::equilibriumAccuracyOrder == 2, "Only works for lattice models that require the equilibrium distribution to be order 2 accurate!" ); typedef PdfField< LatticeModel_T > PdfField_T; @@ -226,12 +216,11 @@ private: }; template< typename LatticeModel_T > -void DefaultCellOperation< LatticeModel_T, typename boost::enable_if< boost::mpl::and_< boost::is_same< typename LatticeModel_T::CollisionModel::tag, - collision_model::TRT_tag >, - boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >, - boost::mpl::not_< boost::mpl::bool_< LatticeModel_T::compressible > >, - boost::is_same< typename LatticeModel_T::ForceModel::tag, - force_model::None_tag > > >::type +void DefaultCellOperation< LatticeModel_T, typename std::enable_if< std::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::TRT_tag >::value && + std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value && + ! LatticeModel_T::compressible && + std::is_same< typename LatticeModel_T::ForceModel::tag, force_model::None_tag >::value + >::type >::operator()( PdfField_T * src, PdfField_T * dst, cell_idx_t x, cell_idx_t y, cell_idx_t z ) const { using namespace stencil; @@ -324,12 +313,11 @@ void DefaultCellOperation< LatticeModel_T, typename boost::enable_if< boost::mpl template< typename LatticeModel_T > template< typename FieldPtrOrIterator > -void DefaultCellOperation< LatticeModel_T, typename boost::enable_if< boost::mpl::and_< boost::is_same< typename LatticeModel_T::CollisionModel::tag, - collision_model::TRT_tag >, - boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >, - boost::mpl::not_<boost::mpl::bool_< LatticeModel_T::compressible > >, - boost::is_same< typename LatticeModel_T::ForceModel::tag, - force_model::None_tag > > >::type +void DefaultCellOperation< LatticeModel_T, typename std::enable_if< std::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::TRT_tag >::value && + std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value && + ! LatticeModel_T::compressible && + std::is_same< typename LatticeModel_T::ForceModel::tag, force_model::None_tag >::value + >::type >::operator()( FieldPtrOrIterator & src, FieldPtrOrIterator & dst ) const { using namespace stencil; @@ -429,19 +417,18 @@ void DefaultCellOperation< LatticeModel_T, typename boost::enable_if< boost::mpl /////////////////////////////// template< typename LatticeModel_T > -class DefaultCellOperation< LatticeModel_T, typename boost::enable_if< boost::mpl::and_< boost::is_same< typename LatticeModel_T::CollisionModel::tag, - collision_model::TRT_tag >, - boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >, - boost::mpl::bool_< LatticeModel_T::compressible >, - boost::is_same< typename LatticeModel_T::ForceModel::tag, - force_model::None_tag > > >::type > +class DefaultCellOperation< LatticeModel_T, typename std::enable_if< std::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::TRT_tag >::value && + std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value && + LatticeModel_T::compressible && + std::is_same< typename LatticeModel_T::ForceModel::tag, force_model::None_tag >::value + >::type > { public: - static_assert( (boost::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::TRT_tag >::value), "Only works with TRT!" ); - static_assert( (boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value), "Only works with D3Q19!" ); + static_assert( (std::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::TRT_tag >::value), "Only works with TRT!" ); + static_assert( (std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value), "Only works with D3Q19!" ); static_assert( LatticeModel_T::compressible, "Only works with compressible models!" ); - static_assert( (boost::is_same< typename LatticeModel_T::ForceModel::tag, force_model::None_tag >::value), "Only works without additional forces!" ); + static_assert( (std::is_same< typename LatticeModel_T::ForceModel::tag, force_model::None_tag >::value), "Only works without additional forces!" ); static_assert( LatticeModel_T::equilibriumAccuracyOrder == 2, "Only works for lattice models that require the equilibrium distribution to be order 2 accurate!" ); typedef PdfField< LatticeModel_T > PdfField_T; @@ -477,12 +464,11 @@ private: }; template< typename LatticeModel_T > -void DefaultCellOperation< LatticeModel_T, typename boost::enable_if< boost::mpl::and_< boost::is_same< typename LatticeModel_T::CollisionModel::tag, - collision_model::TRT_tag >, - boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >, - boost::mpl::bool_< LatticeModel_T::compressible >, - boost::is_same< typename LatticeModel_T::ForceModel::tag, - force_model::None_tag > > >::type +void DefaultCellOperation< LatticeModel_T, typename std::enable_if< std::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::TRT_tag >::value && + std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value && + LatticeModel_T::compressible && + std::is_same< typename LatticeModel_T::ForceModel::tag, force_model::None_tag >::value + >::type >::operator()( PdfField_T * src, PdfField_T * dst, cell_idx_t x, cell_idx_t y, cell_idx_t z ) const { using namespace stencil; @@ -582,12 +568,11 @@ void DefaultCellOperation< LatticeModel_T, typename boost::enable_if< boost::mpl template< typename LatticeModel_T > template< typename FieldPtrOrIterator > -void DefaultCellOperation< LatticeModel_T, typename boost::enable_if< boost::mpl::and_< boost::is_same< typename LatticeModel_T::CollisionModel::tag, - collision_model::TRT_tag >, - boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >, - boost::mpl::bool_< LatticeModel_T::compressible >, - boost::is_same< typename LatticeModel_T::ForceModel::tag, - force_model::None_tag > > >::type +void DefaultCellOperation< LatticeModel_T, typename std::enable_if< std::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::TRT_tag >::value && + std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value && + LatticeModel_T::compressible && + std::is_same< typename LatticeModel_T::ForceModel::tag, force_model::None_tag >::value + >::type >::operator()( FieldPtrOrIterator & src, FieldPtrOrIterator & dst ) const { operator()( const_cast< PdfField_T * >( static_cast< const PdfField_T * >(src.getField()) ), diff --git a/src/mesh/MeshOperations.h b/src/mesh/MeshOperations.h index 9c5033b28fb0e4f55c5f0563a73015c20caa624d..cd4cf4f3fc0ac94d7f425f44be296438a1b0b897 100644 --- a/src/mesh/MeshOperations.h +++ b/src/mesh/MeshOperations.h @@ -27,7 +27,6 @@ #include "core/math/GenericAABB.h" #include <boost/logic/tribool.hpp> -#include <boost/type_traits/is_same.hpp> #include <set> #include <iterator> diff --git a/src/mesh/python/Exports.impl.h b/src/mesh/python/Exports.impl.h index 5bf6e5b7a7bf9e78deb84d02dfa84be111a2fdcb..7b1fcba05e116a55c4f3b15d66b39d806c315b44 100644 --- a/src/mesh/python/Exports.impl.h +++ b/src/mesh/python/Exports.impl.h @@ -53,11 +53,6 @@ #include "mesh/boundary/BoundarySetup.h" #include "mesh/vtk/VTKMeshWriter.h" -#include <boost/mpl/vector.hpp> -#include <boost/mpl/vector_c.hpp> -#include <boost/mpl/for_each.hpp> - - using namespace boost::python; diff --git a/src/pe/fcd/SimpleFCD.h b/src/pe/fcd/SimpleFCD.h index e61d39eddffbde35603fc4d8e9fb3718c658dccf..a7f08ff4d585be0fd97ee55a4f151ca1178cb82e 100644 --- a/src/pe/fcd/SimpleFCD.h +++ b/src/pe/fcd/SimpleFCD.h @@ -24,6 +24,7 @@ #include "GenericFCD.h" #include <tuple> +#include <type_traits> namespace walberla{ namespace pe{ diff --git a/src/pe/utility/BodyCast.h b/src/pe/utility/BodyCast.h index 2c5456f5440e92f5fbffb88e68d026d9055d2e74..ebd6574b7c0cf3d49d978f73474c38ae3f5dae77 100644 --- a/src/pe/utility/BodyCast.h +++ b/src/pe/utility/BodyCast.h @@ -24,6 +24,7 @@ #include <pe/rigidbody/RigidBody.h> #include <tuple> +#include <type_traits> namespace walberla { namespace pe { diff --git a/src/pe_coupling/momentum_exchange_method/boundary/CurvedQuadratic.h b/src/pe_coupling/momentum_exchange_method/boundary/CurvedQuadratic.h index ea6fe8b665bcc9dfb7aab137774cfee05680a545..3ba15e91923e1a2034d3e21ae8c148aee47e8f64 100644 --- a/src/pe_coupling/momentum_exchange_method/boundary/CurvedQuadratic.h +++ b/src/pe_coupling/momentum_exchange_method/boundary/CurvedQuadratic.h @@ -41,6 +41,7 @@ #include "pe/rigidbody/RigidBody.h" #include "pe/Types.h" +#include <type_traits> #include <vector> @@ -72,7 +73,7 @@ namespace pe_coupling { template< typename LatticeModel_T, typename FlagField_T > class CurvedQuadratic : public Boundary< typename FlagField_T::flag_t > { - static_assert( (boost::is_same< typename LatticeModel_T::CollisionModel::tag, lbm::collision_model::TRT_tag >::value), "Only works with TRT!" ); // to access lambda_d + static_assert( (std::is_same< typename LatticeModel_T::CollisionModel::tag, lbm::collision_model::TRT_tag >::value), "Only works with TRT!" ); // to access lambda_d typedef lbm::PdfField< LatticeModel_T > PDFField_T; typedef typename LatticeModel_T::Stencil Stencil_T; diff --git a/src/pe_coupling/momentum_exchange_method/restoration/Reconstructor.h b/src/pe_coupling/momentum_exchange_method/restoration/Reconstructor.h index b8fb7affbfc2bb720b7eb0930419d221ad5343c2..fdb0804d10e1a40445ae944c48d649b37c203e2d 100644 --- a/src/pe_coupling/momentum_exchange_method/restoration/Reconstructor.h +++ b/src/pe_coupling/momentum_exchange_method/restoration/Reconstructor.h @@ -30,6 +30,8 @@ #include "pe/rigidbody/RigidBody.h" #include "pe/Types.h" +#include <type_traits> + namespace walberla { namespace pe_coupling { @@ -277,7 +279,7 @@ public: ( blockStorage, boundaryHandlingID, pdfFieldID, bodyFieldID, extrapolationDirectionFinder ) ) { if( enforceNoSlipConstraintAfterExtrapolation_ ) { - WALBERLA_CHECK((boost::is_same<typename LatticeModel_T::Stencil, stencil::D3Q19>::value), + WALBERLA_CHECK((std::is_same<typename LatticeModel_T::Stencil, stencil::D3Q19>::value), "Enforcing no-slip constraint after extrapolation currently only works with D3Q19 stencil!"); } } diff --git a/src/postprocessing/FieldToSurfaceMesh.h b/src/postprocessing/FieldToSurfaceMesh.h index a46359063ce0ab58890b3bcf91e404af1a082433..75f2577e2f3ab2294b891a9ed9817620667b35e1 100644 --- a/src/postprocessing/FieldToSurfaceMesh.h +++ b/src/postprocessing/FieldToSurfaceMesh.h @@ -26,8 +26,7 @@ #include "domain_decomposition/StructuredBlockStorage.h" #include "field/FlagField.h" -#include <boost/type_traits/is_same.hpp> -#include <boost/type_traits/is_unsigned.hpp> +#include <type_traits> namespace walberla { namespace postprocessing { @@ -59,7 +58,7 @@ namespace postprocessing { bool calcNormals = false, int targetRank = 0, MPI_Comm comm = MPI_COMM_WORLD ) { - static_assert( boost::is_unsigned<typename Field_T::value_type>::value, "Works only for FlagFields" ); + static_assert( std::is_unsigned<typename Field_T::value_type>::value, "Works only for FlagFields" ); static_assert( Field_T::F_SIZE == 1, "Works only for FlagFields" ); @@ -121,7 +120,7 @@ namespace postprocessing { uint_t fCoord = 0, bool calcNormals = false, int targetRank = 0, MPI_Comm comm = MPI_COMM_WORLD ) { - static_assert( (boost::is_same< typename Field_T::value_type, real_t >::value), "Function works only for fields of real" ); + static_assert( (std::is_same< typename Field_T::value_type, real_t >::value), "Function works only for fields of real" ); auto mesh = make_shared<geometry::TriangleMesh> (); diff --git a/src/postprocessing/MarchingCubes.impl.h b/src/postprocessing/MarchingCubes.impl.h index 6f4e5ae70783c0ad756ad5e7776d43c7419b3abe..6f4538742a7368703e0a186a70df95b344b1c50d 100644 --- a/src/postprocessing/MarchingCubes.impl.h +++ b/src/postprocessing/MarchingCubes.impl.h @@ -28,6 +28,8 @@ #include "core/logging/Logging.h" +#include <type_traits> + namespace walberla { namespace postprocessing { @@ -65,7 +67,7 @@ void generateIsoSurface_internal( const Field_T & f, real_t threshold, uint_t fCoord, const Vector3<real_t> & posOffset, const CellInterval & cellInterval ) { - static_assert( (boost::is_same<typename Field_T::value_type, real_t>::value ), "Currently only real valued fields are supported" ); + static_assert( (std::is_same<typename Field_T::value_type, real_t>::value ), "Currently only real valued fields are supported" ); CellInterval targetInterval = cellInterval; if ( targetInterval.empty() ) diff --git a/src/postprocessing/python/Exports.impl.h b/src/postprocessing/python/Exports.impl.h index d896efdf219ec2730210c5d4808843a3b3da726c..4f67e756e3013d645aed9b456e5d80839c1f4ec6 100644 --- a/src/postprocessing/python/Exports.impl.h +++ b/src/postprocessing/python/Exports.impl.h @@ -32,11 +32,6 @@ #include "postprocessing/FieldToSurfaceMesh.h" -#include <boost/mpl/vector.hpp> -#include <boost/mpl/vector_c.hpp> -#include <boost/mpl/for_each.hpp> - - using namespace boost::python; diff --git a/src/simd/StreamOutput.h b/src/simd/StreamOutput.h index d5d6085f051abd7ebf4dba9d9435f7cd2e686d1b..846f406ba1b301028984f036a49362bfc0b59a5a 100644 --- a/src/simd/StreamOutput.h +++ b/src/simd/StreamOutput.h @@ -22,7 +22,7 @@ #pragma once #include "SIMD.h" -#include <boost/utility/enable_if.hpp> +#include <type_traits> namespace walberla { @@ -31,7 +31,7 @@ namespace simd { // enable output operator only for vector4 types template<typename VEC4> -typename boost::enable_if_c<is_vector4_type<VEC4>::value, std::ostream&>::type +typename std::enable_if<is_vector4_type<VEC4>::value, std::ostream&>::type operator<< ( std::ostream & os, VEC4 v ) { os << "[" << getComponent(v,3) <<", " << getComponent(v,2) <<", " diff --git a/tests/core/CMakeLists.txt b/tests/core/CMakeLists.txt index 0a000974320fd66a380ac5928e7eafac43d0d64a..bfecc04b9d9ed646224e574bff7db7a87a4830fa 100644 --- a/tests/core/CMakeLists.txt +++ b/tests/core/CMakeLists.txt @@ -180,6 +180,9 @@ waLBerla_execute_test( NAME ConcatIterator ) waLBerla_compile_test( FILES DataTypesTest.cpp ) waLBerla_execute_test( NAME DataTypesTest ) +waLBerla_compile_test( FILES FunctionTraitsTest.cpp ) +waLBerla_execute_test( NAME FunctionTraitsTest ) + waLBerla_compile_test( FILES GridGeneratorTest.cpp ) waLBerla_execute_test( NAME GridGeneratorTest ) diff --git a/tests/core/FunctionTraitsTest.cpp b/tests/core/FunctionTraitsTest.cpp new file mode 100644 index 0000000000000000000000000000000000000000..4124fb6bfc00e8e1b140c5d9bd766027c88d6c4a --- /dev/null +++ b/tests/core/FunctionTraitsTest.cpp @@ -0,0 +1,79 @@ +//====================================================================================================================== +// +// This file is part of waLBerla. waLBerla is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// waLBerla is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with waLBerla (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file FunctionTraits.h +//! \author Christoph Schwarzmeier <christoph.schwarzmeier@fau.de> +// +//====================================================================================================================== + +#include "core/debug/TestSubsystem.h" +#include "core/FunctionTraits.h" + +#include <type_traits> + +using namespace walberla; + +// FunctionTraits are used in a similar way in cuda/Kernel.h. As explained below, special attention is required. +template< typename F> +struct SomeClass +{ + template< typename T> + static bool checkParameter1( typename std::enable_if< (FunctionTraits<F>::arity > 1 ), T >::type * = 0) { + + // The keyword "template" before "argument<1>" is crucial when these functions are inside a class. If the + // keyword is dropped, compilers interpret "<1" as an arithmetic expression and therefore throw errors. + typedef typename FunctionTraits<F>::template argument<1>::type argType; + return std::is_same< T, argType >::value; + } + + template< typename T> + static bool checkParameter1( typename std::enable_if< (FunctionTraits<F>::arity <= 1 ), T >::type * = 0) { + return false; + } + +}; + + +int main( int /*argc*/, char** /*argv*/ ) +{ + debug::enterTestMode(); + + // obtain a function pointer's type + typedef typename std::remove_pointer< bool (*)(int, float, double) >::type FuncType; + + // check return type + constexpr auto retTypeEqual = std::is_same< FunctionTraits<FuncType>::return_type, bool>::value; + WALBERLA_CHECK( retTypeEqual ); + + // check arity + constexpr auto argNumber = FunctionTraits<FuncType>::arity; + WALBERLA_CHECK_EQUAL( argNumber, 3 ); + + // check argument types + constexpr auto arg0TypeEqual = std::is_same< FunctionTraits<FuncType>::argument<0>::type, int >::value; + WALBERLA_CHECK ( arg0TypeEqual ); + + constexpr auto arg1TypeEqual = std::is_same< FunctionTraits<FuncType>::argument<1>::type, float >::value; + WALBERLA_CHECK ( arg1TypeEqual ); + + constexpr auto arg2TypeEqual = std::is_same< FunctionTraits<FuncType>::argument<2>::type, double >::value; + WALBERLA_CHECK ( arg2TypeEqual ); + + // check usage inside class + WALBERLA_CHECK( SomeClass<FuncType>::checkParameter1<float>() ); + WALBERLA_CHECK( ! (SomeClass<FuncType>::checkParameter1<double>()) ); + + return EXIT_SUCCESS; +} \ No newline at end of file diff --git a/tests/lbm/SweepEquivalenceTest.cpp b/tests/lbm/SweepEquivalenceTest.cpp index 2c8f0e15a9c9fd018f949c20b6a150e7d565d7a1..e28a00ebbc8295e9716dbea9653141eb0c6f93f4 100644 --- a/tests/lbm/SweepEquivalenceTest.cpp +++ b/tests/lbm/SweepEquivalenceTest.cpp @@ -50,8 +50,7 @@ #include "timeloop/SweepTimeloop.h" -#include <boost/type_traits/is_same.hpp> -#include <boost/utility/enable_if.hpp> +#include <type_traits> //#define TEST_USES_VTK_OUTPUT @@ -186,7 +185,7 @@ template< typename LatticeModel_T, class Enable = void > struct AddTest; template< typename LatticeModel_T > -struct AddTest< LatticeModel_T, typename boost::enable_if_c< boost::is_same< typename LatticeModel_T::CollisionModel::tag, +struct AddTest< LatticeModel_T, typename std::enable_if< std::is_same< typename LatticeModel_T::CollisionModel::tag, lbm::collision_model::SRT_tag >::value >::type > { static void add( shared_ptr< StructuredBlockForest > & blocks, SweepTimeloop & timeloop, std::vector< BlockDataID > & fieldIds, @@ -198,7 +197,7 @@ struct AddTest< LatticeModel_T, typename boost::enable_if_c< boost::is_same< typ }; template< typename LatticeModel_T > -struct AddTest< LatticeModel_T, typename boost::enable_if_c< boost::is_same< typename LatticeModel_T::CollisionModel::tag, +struct AddTest< LatticeModel_T, typename std::enable_if< std::is_same< typename LatticeModel_T::CollisionModel::tag, lbm::collision_model::TRT_tag >::value >::type > { static void add( shared_ptr< StructuredBlockForest > & blocks, SweepTimeloop & timeloop, std::vector< BlockDataID > & fieldIds, @@ -210,7 +209,7 @@ struct AddTest< LatticeModel_T, typename boost::enable_if_c< boost::is_same< typ }; template< typename LatticeModel_T > -struct AddTest< LatticeModel_T, typename boost::enable_if_c< boost::is_same< typename LatticeModel_T::CollisionModel, +struct AddTest< LatticeModel_T, typename std::enable_if< std::is_same< typename LatticeModel_T::CollisionModel, lbm::collision_model::D3Q19MRT >::value >::type > { static void add( shared_ptr< StructuredBlockForest > & blocks, SweepTimeloop & timeloop, std::vector< BlockDataID > & fieldIds, @@ -228,7 +227,7 @@ template< typename LatticeModel_T, class Enable = void > struct AddTRTTest; template< typename LatticeModel_T > -struct AddTRTTest< LatticeModel_T, typename boost::enable_if_c< boost::is_same< typename LatticeModel_T::CollisionModel::tag, +struct AddTRTTest< LatticeModel_T, typename std::enable_if< std::is_same< typename LatticeModel_T::CollisionModel::tag, lbm::collision_model::TRT_tag >::value >::type > { static void add( shared_ptr< StructuredBlockForest > & blocks, SweepTimeloop & timeloop, std::vector< BlockDataID > & fieldIds, @@ -240,7 +239,7 @@ struct AddTRTTest< LatticeModel_T, typename boost::enable_if_c< boost::is_same< }; template< typename LatticeModel_T > -struct AddTRTTest< LatticeModel_T, typename boost::enable_if_c< boost::is_same< typename LatticeModel_T::CollisionModel, +struct AddTRTTest< LatticeModel_T, typename std::enable_if< std::is_same< typename LatticeModel_T::CollisionModel, lbm::collision_model::D3Q19MRT >::value >::type > { static void add( shared_ptr< StructuredBlockForest > & blocks, SweepTimeloop & timeloop, std::vector< BlockDataID > & fieldIds, @@ -289,7 +288,7 @@ void check( const shared_ptr< StructuredBlockForest > & blocks, const BlockDataI samples[2].insert( std::fabs( velocityReference[2] - velocity[2] ) ); samples[3].insert( std::fabs( rhoReference - rho ) ); #else - #ifdef __INTEL_COMPILER // boost::math::float_distance causes a segmentation fault with Intel compiler on our test machine... + #ifdef __INTEL_COMPILER // std::math::float_distance causes a segmentation fault with Intel compiler on our test machine... WALBERLA_CHECK( floatIsEqual( velocityReference[0], velocity[0] ), msg ); WALBERLA_CHECK( floatIsEqual( velocityReference[1], velocity[1] ), msg ); WALBERLA_CHECK( floatIsEqual( velocityReference[2], velocity[2] ), msg ); @@ -304,7 +303,7 @@ void check( const shared_ptr< StructuredBlockForest > & blocks, const BlockDataI } #ifdef DEVEL_OUTPUT - #ifdef __INTEL_COMPILER // boost::math::float_distance causes a segmentation fault with Intel compiler on our test machine... + #ifdef __INTEL_COMPILER // std::math::float_distance causes a segmentation fault with Intel compiler on our test machine... WALBERLA_LOG_DEVEL( "Velocity (x): " << samples[0].format( "[%min, %max], %mean, %med" ) ); WALBERLA_CHECK( floatIsEqual( samples[0].range(), 0.0 ) ); WALBERLA_LOG_DEVEL( "Velocity (y): " << samples[1].format( "[%min, %max], %mean, %med" ) ); diff --git a/tests/lbm/boundary/DiffusionDirichlet.cpp b/tests/lbm/boundary/DiffusionDirichlet.cpp index 9661765230757b846acc2aa41b4e45e9a9ad8514..9e2b0819cfcfb5a188b6cb007a36c9345f015389 100644 --- a/tests/lbm/boundary/DiffusionDirichlet.cpp +++ b/tests/lbm/boundary/DiffusionDirichlet.cpp @@ -80,6 +80,8 @@ #include "vtk/VTKOutput.h" +#include <complex> + namespace walberla {