62namespace orrery::solvers {
76inline constexpr std::uint32_t
kMortonGridSize = std::uint32_t{1} << kMortonBitsPerAxis;
93 [[nodiscard]]
core::Vec3 centre() const noexcept {
194 [[nodiscard]] std::span<const MortonKey>
keys() const noexcept {
return keys_; }
207 std::vector<MortonKey> keys_;
208 std::vector<MortonKey> scratch_;
Something that can run a loop body over a range, possibly in parallel.
Definition executor.hpp:52
The particles of a configuration, in the order the tree wants them.
Definition morton.hpp:182
void build(core::Vec3Span< const core::Real > positions, backend::Executor *executor)
Compute and sort the codes of positions.
std::span< const MortonKey > keys() const noexcept
The keys, ascending. Empty until build has been called.
Definition morton.hpp:194
const BoundingCube & cube() const noexcept
The cube the codes were computed in.
Definition morton.hpp:197
How a kernel asks for a loop to be run in parallel.
std::uint64_t MortonCode
A position on the space-filling curve.
Definition morton.hpp:70
constexpr std::uint32_t kMortonGridSize
The number of grid cells along one side of the bounding cube.
Definition morton.hpp:76
MortonCode morton_code(std::uint32_t x, std::uint32_t y, std::uint32_t z) noexcept
The code of a point at integer grid coordinates.
MortonCode spread_bits(std::uint32_t value) noexcept
Spread the low 21 bits of value out to every third bit.
constexpr unsigned kMortonBitsPerAxis
Bits of code per axis, and so the number of levels of subdivision available.
Definition morton.hpp:73
unsigned morton_octant(MortonCode code, unsigned level) noexcept
The octant, 0 to 7, that code occupies at level.
BoundingCube bounding_cube(core::Vec3Span< const core::Real > positions) noexcept
The smallest cube containing every position, centred on their bounding box.
A view of three component arrays of equal length.
Definition vec3_span.hpp:33
A vector in three-dimensional Euclidean space.
Definition vec3.hpp:26
The cube that encloses a configuration.
Definition morton.hpp:85
core::Real size
The length of one side.
Definition morton.hpp:91
core::Vec3 origin
The corner with the lowest coordinate on every axis.
Definition morton.hpp:87
One particle's place on the curve.
Definition morton.hpp:155
friend constexpr auto operator<=>(const MortonKey &, const MortonKey &) noexcept=default
Ordered by code, and by index where two codes are equal.
The scalar and index types that every layer of the project agrees on.
std::size_t Index
The type of a particle index and of any count of particles.
Definition types.hpp:45
A three-component vector for interfaces, not for storage.
Three parallel component arrays, viewed as one sequence of 3-vectors.