15#ifndef PECLET_CORE_AMR_BLOCK_OCTREE_VIEW_HPP
16#define PECLET_CORE_AMR_BLOCK_OCTREE_VIEW_HPP
18#ifdef PECLET_CORE_HAVE_MORTON
28template <
int Dim,
unsigned Bits = (Dim == 2 ? 32u : (Dim == 3 ? 21u : 16u))>
59 if (!
probe.try_add(
static_cast<unsigned>(axis), step))
62 if (!
probe.try_sub(
static_cast<unsigned>(axis), 1))
morton::Morton< Dim, Bits > M
typename M::coord_type Coord
typename M::code_type Code
View< T > toDevice(const std::vector< T > &h, const std::string &label)
Upload a host std::vector into a freshly-sized device View (empty vector => empty view).
Kokkos::View< T *, MemSpace > View
1D device array.
std::int64_t Index
Signed index type for grids and particles (supersedes block_decomposer's long int IndxT).
Device mirror of a BlockOctree's leaf arrays + device-callable queries.
void upload(const Host &t)
(Re)upload the host octree's current leaf set to the device.
typename Host::Coord Coord
View< std::uint8_t > levels
Index faceNeighbor(Index i, int axis, int dir) const
Leaf across leaf i's face on axis in direction dir (±1), or -1 if it lies outside the block.
Index locate(Code p) const
Leaf containing Morton code p, or -1. Callable in a device kernel.