22#include <blockforest/StructuredBlockForest.h>
23#include <core/DataTypes.h>
24#include <core/cell/Cell.h>
25#include <domain_decomposition/IBlock.h>
29#include "../src/utils/types_conversion.hpp"
40template <
typename T>
struct is_real_vector : std::false_type {};
42template <std::
floating_po
int T>
43struct is_real_vector<
std::array<T, 3>> : std::true_type {};
45template <std::
floating_po
int T>
48template <std::
floating_po
int T>
49struct is_real_vector<
Utils::Vector<T, 3>> : std::true_type {};
56template <
typename T>
struct is_signed_integral_vector : std::false_type {};
58template <std::
signed_
integral T>
59struct is_signed_integral_vector<
std::array<T, 3>> : std::true_type {};
61template <std::
signed_
integral T>
62struct is_signed_integral_vector<
walberla::Vector3<T>> : std::true_type {};
64template <std::
signed_
integral T>
65struct is_signed_integral_vector<
Utils::Vector<T, 3>> : std::true_type {};
67template <>
struct is_signed_integral_vector<
walberla::
Cell> : std::true_type {
68 static_assert(std::integral<walberla::cell_idx_t>
and
69 std::is_signed_v<walberla::cell_idx_t>);
101inline std::optional<BlockAndCell>
143 static_cast<int>(std::round(corner[1])),
144 static_cast<int>(std::round(corner[2]))}};
157[[
nodiscard]]
inline std::optional<walberla::cell::CellInterval>
177[[
nodiscard]]
inline std::optional<walberla::cell::CellInterval>
186 for (
uint_t f = 0
u; f < 3u; ++f) {
193 for (
uint_t f = 0
u; f < 3u; ++f) {
Vector implementation and trait types for boost qvm interoperability.
Class that runs and controls the BlockForest in waLBerla.
Utils::Vector3i get_block_corner(IBlock const &block, bool lower) const
auto get_ghost_layers() const
auto const & get_cached_blocks() const
static DEVICE_QUALIFIER constexpr Vector< T, N > broadcast(typename Base::value_type const &value) noexcept
Create a vector that has all entries set to the same value.
cudaStream_t stream[1]
CUDA streams for parallel computing on CPU and GPU.
static double * block(double *p, std::size_t index, std::size_t size)
int get_linear_index(int a, int b, int c, const Vector3i &adim)
\file PackInfoPdfDoublePrecision.cpp \author pystencils
IBlock * get_block_extended(LatticeWalberla const &lattice, auto const &pos, unsigned int n_ghost_layers)
auto convert_cell_corner_to_coord(real_vector auto const &corner)
Get the block-local coordinates of a block corner.
void copy_block_buffer(CellInterval const &bci, CellInterval const &ci, Utils::Vector3i const &block_offset, Utils::Vector3i const &lower_corner, auto &&kernel)
Synchronize data between a sliced block and a container.
IBlock * get_block(::LatticeWalberla const &lattice, real_vector auto const &pos, bool consider_ghost_layers)
void for_each_block_in_slice(::LatticeWalberla const &lattice, Utils::Vector3i const &lower_corner, Utils::Vector3i const &upper_corner, auto &&visitor)
Iterate over all local blocks that overlap a given 3D slice, invoking a visitor for each such block.
std::optional< BlockAndCell > get_block_and_cell(::LatticeWalberla const &lattice, signed_integral_vector auto const &node, bool consider_ghost_layers)
auto get_min_corner(IBlock const &block)
Get the block-local coordinates of the lower corner of a block.
Cell to_cell(signed_integral_vector auto const &xyz)
std::optional< walberla::cell::CellInterval > get_block_interval(::LatticeWalberla const &lattice, Utils::Vector3i const &lower_corner, Utils::Vector3i const &upper_corner, Utils::Vector3i const &block_offset, IBlock const &block)
Utils::Vector3i to_vector3i(Vector3< int > const &v) noexcept
std::optional< walberla::cell::CellInterval > get_interval(::LatticeWalberla const &lattice, Utils::Vector3i const &lower_corner, Utils::Vector3i const &upper_corner)
auto get_max_corner(IBlock const &block)
Get the block-local coordinates of the upper corner of a block.