11#ifndef PECLET_CORE_AMR_REFINE_HPP
12#define PECLET_CORE_AMR_REFINE_HPP
14#ifdef PECLET_CORE_HAVE_MORTON
34template <
int Dim,
unsigned Bits,
class SdfFn>
42 for (
Index i = 0;
i <
t.numLeaves(); ++
i) {
43 const unsigned L =
t.level(
i);
57 [&](Code
c,
unsigned) {
return std::binary_search(
toRefine.begin(),
toRefine.end(),
c); });
Per-block adaptive octree over block-local Morton codes.
typename M::code_type Code
std::vector< std::array< double, Dim > > transferFieldGradients(const BlockOctree< Dim, Bits > &oldT, const std::vector< double > &oldF)
Per-old-leaf minmod prolongation gradients (per fine-coordinate unit) — transferField's stencil,...
Index refineToSdf(BlockOctree< Dim, Bits > &t, const AmrGeometry< Dim > &geo, SdfFn &&sdf, unsigned targetLevel, Real band=1.0, bool balance=true)
Refine leaves near an SDF interface down to targetLevel.
std::array< Real, Dim > Vec
Multi-dimensional real vector.
double Real
Default host floating type. Device kernels may use float; conversions happen at the boundary.
std::int64_t Index
Signed index type for grids and particles (supersedes block_decomposer's long int IndxT).
World-space placement of a block-local octree: fine coordinate (0,..,0) sits at origin,...