22#include <blockforest/StructuredBlockForest.h>
23#include <core/DataTypes.h>
24#include <core/cell/Cell.h>
25#include <domain_decomposition/IBlock.h>
37template <
typename T>
struct is_real_vector : std::false_type {};
39template <std::
floating_po
int T>
40struct is_real_vector<std::array<T, 3>> : std::true_type {};
42template <std::
floating_po
int T>
45template <std::
floating_po
int T>
46struct is_real_vector<
Utils::Vector<T, 3>> : std::true_type {};
55 return {xyz[0], xyz[1], xyz[2]};
66 unsigned int n_ghost_layers) {
68 for (
auto &
block : cached_blocks) {
70 .getExtended(real_c(n_ghost_layers))
71 .contains(real_c(pos[0]), real_c(pos[1]), real_c(pos[2]))) {
79inline std::optional<BlockAndCell>
83 auto n_ghost_layers = 0u;
84 if (consider_ghost_layers) {
96 blocks->transformGlobalToBlockLocalCell(local_cell, *
block, global_cell);
97 return {{
block, local_cell}};
102 bool consider_ghost_layers) {
105 auto block = blocks->getBlock(real_c(pos[0]), real_c(pos[1]), real_c(pos[2]));
106 if (consider_ghost_layers and !
block) {
120 static_cast<int>(std::round(corner[1])),
121 static_cast<int>(std::round(corner[2]))}};
Class that runs and controls the BlockForest in waLBerla.
auto get_ghost_layers() const
auto const & get_cached_blocks() const
static double * block(double *p, std::size_t index, std::size_t size)
\file PackInfoPdfDoublePrecision.cpp \author pystencils
std::optional< BlockAndCell > get_block_and_cell(::LatticeWalberla const &lattice, Utils::Vector3i const &node, bool consider_ghost_layers)
auto convert_cell_corner_to_coord(real_vector auto const &corner)
Get the block-local coordinates of a block corner.
IBlock * get_block_extended(LatticeWalberla const &lattice, Utils::Vector< T, 3 > const &pos, unsigned int n_ghost_layers)
auto get_min_corner(IBlock const &block)
Get the block-local coordinates of the lower corner of a block.
Cell to_cell(Utils::Vector3i const &xyz)
IBlock * get_block(::LatticeWalberla const &lattice, Utils::Vector3d const &pos, bool consider_ghost_layers)
auto get_max_corner(IBlock const &block)
Get the block-local coordinates of the upper corner of a block.