21 #ifndef FUB_AMREX_CUTCELL_INDEX_SPACE_HPP
22 #define FUB_AMREX_CUTCELL_INDEX_SPACE_HPP
30 #include <AMReX_EB2.H>
38 constexpr std::ptrdiff_t
ipow(
int base,
int exponent) {
39 std::ptrdiff_t prod{1};
40 while (exponent > 0) {
47 template <
typename GShop>
48 std::vector<const ::amrex::EB2::IndexSpace*>
49 MakeIndexSpaces(GShop&& shop, const ::amrex::Geometry& coarse_geom,
int n_level,
52 std::vector<const ::amrex::EB2::IndexSpace*> index_spaces(
53 static_cast<std::size_t
>(n_level));
54 ::amrex::Geometry geom = coarse_geom;
55 ::amrex::EB2::Build(shop, geom, 0, 0, ngrow);
56 index_spaces[0] = &::amrex::EB2::IndexSpace::top();
57 for (
int level = 1; level < n_level; ++level) {
58 geom.refine({AMREX_D_DECL(2, 2, 2)});
59 ::amrex::EB2::Build(shop, geom, 1, 2, ngrow);
60 index_spaces[
static_cast<std::size_t
>(level)] =
61 &::amrex::EB2::IndexSpace::top();
66 template <
typename GShop>
67 std::vector<const ::amrex::EB2::IndexSpace*>
68 MakeIndexSpaces(GShop&& shop,
const CartesianGridGeometry& grid_geometry,
#define FUB_ASSERT(x)
Definition: assert.hpp:39
::amrex::Geometry GetCoarseGeometry(const CartesianGridGeometry &grid_geometry)
The fub namespace.
Definition: AnyBoundaryCondition.hpp:31
constexpr std::ptrdiff_t ipow(int base, int exponent)
Definition: algorithm.hpp:39
Definition: AMReX/PatchHierarchy.hpp:54
int max_number_of_levels
Definition: AMReX/PatchHierarchy.hpp:60