42 template<u
int32_t T_dim, concepts::Vector T_LowHaloVec, concepts::Vector T_UpHaloVec>
53 T_LowHaloVec
const& lower_halo_sizes,
54 T_UpHaloVec
const& upper_halo_sizes)
64 [[nodiscard]]
static constexpr uint32_t
dim()
75 for(uint32_t i = 0; i < T_dim; ++i)
92 [[nodiscard]]
constexpr bool isEdge()
const
99 [[nodiscard]]
constexpr bool isFace()
const
107 [[nodiscard]]
constexpr bool isCell()
const
130 template<u
int32_t T_dim, concepts::Vector T_LowHaloVec, concepts::Vector T_UpHaloVec>
144 T_LowHaloVec
const& lower_halo_sizes,
145 T_UpHaloVec
const& upper_halo_sizes)
146 : boundaries(boundaries, lower_halo_sizes, upper_halo_sizes)
147 , lowerHaloSizes(lower_halo_sizes)
148 , upperHaloSizes(upper_halo_sizes)
164 uint32_t i = T_dim - 1;
166 while(i !=
static_cast<uint32_t
>(-1))
168 switch(boundaries.data[i])
172 i =
static_cast<uint32_t
>(-1);
177 i =
static_cast<uint32_t
>(-1);
204 [[nodiscard]]
static consteval auto dim()
214 T_LowHaloVec lowerHaloSizes;
215 T_UpHaloVec upperHaloSizes;
235 template<u
int32_t T_dim, concepts::Vector T_LowHaloVec, concepts::Vector T_UpHaloVec>
238 static_assert(T_dim > 0,
"0 Dimension Boundary Direction Container is not defined");
241 : m_lowerHaloSizes(lowerHaloSizes)
242 , m_upperHaloSizes(upperHaloSizes)
262 [[nodiscard]]
static consteval uint32_t
length()
264 return ipow(3u, T_dim);
267 [[nodiscard]]
static consteval auto dim()
273 T_LowHaloVec
const m_lowerHaloSizes;
274 T_UpHaloVec
const m_upperHaloSizes;
277 template<concepts::Vector LowHaloVecType, concepts::Vector UpHaloVecType>
283 template<u
int32_t T_dim>
297 template<u
int32_t T_dim>
310 template<u
int32_t T_dim>
322 template<u
int32_t T_dim>
355 "dimension mismatch");
377 template<u
int32_t T_dim, concepts::Vector T_LowHaloVec, concepts::Vector T_UpHaloVec>
378 requires(T_dim == T_LowHaloVec::dim() && T_dim == T_UpHaloVec::dim())
397 for(uint32_t i = 0; i < bd.dim(); ++i)
426 if(bd.boundaryDimensionality() >= 4)
427 os <<
" (" << bd.boundaryDimensionality() <<
"D volume)";
#define ALPAKA_ASSERT_ACC(...)
ALPAKA_ASSERT_ACC is an assert-like macro.
#define ALPAKA_TYPEOF(...)
Get the type of instance.
Concept checking whether T is a boundary direction.
Interface concept for objects describing api-related multidimensional memory access.
Concept to check if a type is a vector.
Functionality which is usable on the host CPU controller thread.
std::ostream & operator<<(std::ostream &os, concepts::BoundaryDirection auto const &bd)
BoundaryDirectionsContainer(LowHaloVecType const &lowerHalos, UpHaloVecType const &upperHalos) -> BoundaryDirectionsContainer< LowHaloVecType::dim(), LowHaloVecType, UpHaloVecType >
constexpr auto ipow(std::integral auto const base, std::integral auto const exponent)
Helper function calculating the integer power for the given base and exponent.
constexpr bool isBoundaryDirection_v
consteval auto fillCVec()
Create and return a CVector of some length, filled with the given value.
constexpr auto thisApi()
provides the API used during the execution of the current code path
BoundaryType
An enum representing the different types of boundary, with LOWER, MIDDLE, and UPPER being valid state...
consteval auto makeCoreBoundaryDirection()
Construct and return a single BoundaryDirection specifying the middle of a volume with all halo sizes...
constexpr auto makeBoundaryDirIterator()
Construct and return a BoundaryDirectionsContainer.
The iterator type for BoundaryDirectionsContainer.
constexpr auto & operator++()
Vec< BoundaryType, T_dim > T_BoundaryVec
value_type const * const_pointer
std::ptrdiff_t difference_type
constexpr const_reference & operator*() const
BoundaryDirection< T_dim, T_LowHaloVec, T_UpHaloVec > value_type
constexpr auto operator<=>(BoundaryDirectionIter const &) const =default
value_type const & const_reference
constexpr reference & operator*()
constexpr BoundaryDirectionIter(T_BoundaryVec const &boundaries, T_LowHaloVec const &lower_halo_sizes, T_UpHaloVec const &upper_halo_sizes)
static consteval auto dim()
An n-dimensional boundary direction.
constexpr uint32_t boundaryDimensionality() const
The dimensionality of the boundary direction.
T_LowHaloVec lowerHaloSize
constexpr bool isEdge() const
Return true if this boundary direction describes an edge, for example any of the 12 edges of a cube.
constexpr bool isVertex() const
Return true if this boundary direction describes a vertex, for example the corner of a plane.
T_UpHaloVec upperHaloSize
constexpr BoundaryDirection(concepts::Vector auto const &boundaries, T_LowHaloVec const &lower_halo_sizes, T_UpHaloVec const &upper_halo_sizes)
static constexpr uint32_t dim()
The dimensionality of the whole volume that this is a boundary direction for.
constexpr bool isFace() const
Return true if this boundary direction describes a face, for example any of the 6 sides of a cube.
Vec< BoundaryType, T_dim > T_BoundaryVec
constexpr bool isInterior() const
Return true if this boundary direction describes the interior of a volume, like the 2D interior of a ...
constexpr bool isCell() const
Return true if this boundary direction describes a cell, for example the interior of a cube or one of...
constexpr auto operator<=>(BoundaryDirection const &) const =default
A container for boundary directions of an n-dimensional volume.
constexpr BoundaryDirectionIter< T_dim, T_LowHaloVec, T_UpHaloVec > end() const
constexpr BoundaryDirectionsContainer(T_LowHaloVec const &lowerHaloSizes, T_UpHaloVec const &upperHaloSizes)
static consteval uint32_t length()
static consteval auto dim()
constexpr BoundaryDirectionIter< T_dim, T_LowHaloVec, T_UpHaloVec > begin() const