|
Orrery
A GPU-accelerated N-body gravitational simulator
|
The Barnes-Hut solver described above. More...
#include <orrery/solvers/barnes_hut_solver.hpp>
Public Member Functions | |
| BarnesHutSolver (TreeParameters parameters={}) noexcept | |
| A solver over exact point masses, evaluated on the calling thread. | |
| BarnesHutSolver (TreeParameters parameters, core::Softening softening) noexcept | |
| A solver softening at the given length. | |
| BarnesHutSolver (TreeParameters parameters, core::Softening softening, backend::Executor &executor) noexcept | |
| A softened solver evaluated through executor. | |
| void | evaluate (core::Vec3Span< const core::Real > positions, std::span< const core::Real > masses, core::Vec3Span< core::Real > accelerations) override |
| Write the acceleration at each position into accelerations. | |
| std::string_view | name () const noexcept override |
| The solver's name, for benchmark tables and test messages. | |
| core::Softening | softening () const noexcept override |
| The softening this solver applies. | |
| InteractionCount | interaction_count () const noexcept override |
| The work done since construction or since the last reset. | |
| void | reset_interaction_count () noexcept override |
| Set every counter back to zero. | |
| const TreeParameters & | parameters () const noexcept |
| The parameters in force, which are the ones asked for after correction. | |
| const Octree & | tree () const noexcept |
| The tree the last evaluation built, empty before the first. | |
| const EvaluationTimings & | timings () const noexcept |
| Where the last evaluation's time went. | |
| const backend::Executor * | executor () const noexcept |
| The executor this solver evaluates through, or null if it runs on the calling thread. | |
| void | select_kernel (KernelKind kind) noexcept |
| Ask for a particular kernel for the pairs at the leaves, and settle for the scalar one if this machine cannot run it. | |
| KernelKind | kernel () const noexcept |
| The kernel this solver will use at the leaves. | |
| Public Member Functions inherited from orrery::solvers::ForceSolver | |
| ~ForceSolver () override=default | |
| Public and virtual, the second by inheritance from AccelerationField. | |
Additional Inherited Members | |
| Protected Member Functions inherited from orrery::solvers::ForceSolver | |
| ForceSolver (const ForceSolver &)=default | |
| ForceSolver (ForceSolver &&)=default | |
| ForceSolver & | operator= (const ForceSolver &)=default |
| ForceSolver & | operator= (ForceSolver &&)=default |
| Protected Member Functions inherited from orrery::integrators::AccelerationField | |
| AccelerationField (const AccelerationField &)=default | |
| AccelerationField (AccelerationField &&)=default | |
| AccelerationField & | operator= (const AccelerationField &)=default |
| AccelerationField & | operator= (AccelerationField &&)=default |
The Barnes-Hut solver described above.
|
inlineexplicitnoexcept |
A solver over exact point masses, evaluated on the calling thread.
The parameters are corrected on the way in, so a solver constructed with an opening angle of two reports one and behaves accordingly.
|
inlinenoexcept |
A softened solver evaluated through executor.
The executor is referred to rather than owned and must outlive the solver, for the reason DirectSolver gives: a pool of threads is a machine-wide resource and a solver that owned one could not be created inside a loop.
|
overridevirtual |
Write the acceleration at each position into accelerations.
The three views must describe the same particles in the same order and have the same length, as AccelerationField requires.
Safe to call with no particles.
Implements orrery::integrators::AccelerationField.
|
inlinenodiscardoverridevirtualnoexcept |
The solver's name, for benchmark tables and test messages.
Implements orrery::solvers::ForceSolver.
|
inlinenodiscardoverridevirtualnoexcept |
The softening this solver applies.
Exposed so that a caller measuring energies asks the solver what it softened with rather than carrying a second copy of the value alongside it. Two copies of a number that must agree are how they come to disagree, and a potential energy computed with a different softening from the force kernel turns the project's headline conservation result into a measurement of the mismatch (ADR-0008).
Implements orrery::solvers::ForceSolver.
|
inlinenodiscardoverridevirtualnoexcept |
The work done since construction or since the last reset.
Cheap: solvers accumulate this as they go and this call only reads it.
Implements orrery::solvers::ForceSolver.
|
inlineoverridevirtualnoexcept |
Set every counter back to zero.
A benchmark counts the work of the measured region rather than of the warm-up that preceded it, and the two are otherwise indistinguishable once they have been added together.
Implements orrery::solvers::ForceSolver.
|
inlinenodiscardnoexcept |
The tree the last evaluation built, empty before the first.
Exposed so that a test can assert what the tree is and a benchmark can report its shape beside its timing. A depth or a leaf count is the first thing to look at when a tree costs more than it should, and recovering either from outside would mean building a second tree.
|
inlinenoexcept |
Ask for a particular kernel for the pairs at the leaves, and settle for the scalar one if this machine cannot run it.
The same knob DirectSolver offers and for the same callers: the accuracy test comparing kernels and the benchmark timing them. It matters more here than it looks. A tree solver's leaves are short ranges, so the vector kernel is called with a few dozen sources rather than a few thousand, and how much of Phase 7's speedup survives that is a measurement rather than a deduction.