Orrery
A GPU-accelerated N-body gravitational simulator
Loading...
Searching...
No Matches
orrery::solvers::MortonOrdering Class Reference

The particles of a configuration, in the order the tree wants them. More...

#include <orrery/solvers/morton.hpp>

Public Member Functions

void build (core::Vec3Span< const core::Real > positions, backend::Executor *executor)
 Compute and sort the codes of positions.
std::span< const MortonKeykeys () const noexcept
 The keys, ascending. Empty until build has been called.
const BoundingCubecube () const noexcept
 The cube the codes were computed in.

Detailed Description

The particles of a configuration, in the order the tree wants them.

Holds the sorted keys and the scratch space the sort needs, so that a solver evaluating millions of times allocates on the first evaluation and on none of the rest.

Member Function Documentation

◆ build()

void orrery::solvers::MortonOrdering::build ( core::Vec3Span< const core::Real > positions,
backend::Executor * executor )

Compute and sort the codes of positions.

Runs the sort through executor where one is given, and on the calling thread otherwise. The result does not depend on which: the ordering is total, so every path produces the same permutation.

Safe to call with no particles.


The documentation for this class was generated from the following file: