11#ifndef EBGEOMETRY_SFC_HPP
12#define EBGEOMETRY_SFC_HPP
62static constexpr unsigned int ValidBits = 21;
67static constexpr Code ValidSpan = (
static_cast<uint64_t
>(1) << ValidBits) - 1;
80 inline static uint64_t
89 [[nodiscard]]
inline static Index
90 decode(
const uint64_t& a_code)
noexcept;
96 static constexpr uint_fast64_t
Mask_64[6]{
97 0x1fffff, 0x1f00000000ffff, 0x1f0000ff0000ff, 0x100f00f00f00f00f, 0x10c30c30c30c30c3, 0x1249249249249249};
112 [[nodiscard]]
inline static uint64_t
121 [[nodiscard]]
inline static Index
143 [[nodiscard]]
inline static uint64_t
152 [[nodiscard]]
inline static Index
173[[nodiscard]]
inline std::vector<Index>
189template <
class Curve = Morton,
class T>
190[[nodiscard]]
inline std::vector<uint32_t>
197#include "EBGeometry_SFCImplem.hpp"
A fixed-size array that compiles for both host and device.
GPU portability layer: host/device decoration macros and backend detection.
#define EBGEOMETRY_HOST_DEVICE
Mark a function as callable from both host and device code (no-op on host compilers).
Definition EBGeometry_GPU.hpp:80
Declaration of 2D and 3D point/vector classes with templated precision, and free functions on them.
Three-dimensional vector class with arithmetic operators.
Definition EBGeometry_Vec.hpp:258
std::vector< Index > computeBins(const std::vector< Vec3T< T > > &a_points)
Bin a set of points into the space-filling curve's integer grid, normalizing by their own bounding ra...
uint64_t Code
Alias for SFC code.
Definition EBGeometry_SFC.hpp:51
std::vector< uint32_t > order(const std::vector< Vec3T< T > > &a_points)
Return the index permutation that orders a_points along a space-filling curve.
Namespace containing all of EBGeometry's functionality.
Definition EBGeometry_Affine.hpp:26
Fixed-size array with host- and device-callable members.
Definition EBGeometry_Array.hpp:33
Implementation of the 3D Hilbert space-filling curve.
Definition EBGeometry_SFC.hpp:137
static Index decode(const uint64_t &a_code) noexcept
Decode the linear Hilbert distance back into an Index.
static uint64_t encode(const Index &a_point) noexcept
Encode the input point into the linear Hilbert distance.
Implementation of the Morton SFC.
Definition EBGeometry_SFC.hpp:73
static Index decode(const uint64_t &a_code) noexcept
Decode the 64-bit Morton code into an Index.
static constexpr uint_fast64_t Mask_64[6]
Mask for magic-bits encoding of 3D Morton code.
Definition EBGeometry_SFC.hpp:96
static uint64_t encode(const Index &a_point) noexcept
Encode an input point into a Morton index with a 64-bit representation.
Implementation of a nested index SFC.
Definition EBGeometry_SFC.hpp:106
static Index decode(const uint64_t &a_code) noexcept
Decode the 64-bit SFC code into an Index.
static uint64_t encode(const Index &a_point) noexcept
Encode the input point into the SFC code.