104namespace orrery::solvers {
144 [[nodiscard]] std::string_view
name() const noexcept
override {
return "direct"; }
201 KernelKind kernel_{fastest_available_kernel()};
203 InteractionCount count_;
Something that can run a loop body over a range, possibly in parallel.
Definition executor.hpp:52
The softening length of the Plummer kernel above.
Definition softening.hpp:49
core::Softening softening() const noexcept override
The softening this solver applies.
Definition direct_solver.hpp:146
DirectSolver(core::Softening softening) noexcept
A solver softening at the given length.
Definition direct_solver.hpp:116
void select_kernel(KernelKind kind) noexcept
Ask for a particular kernel, and settle for the scalar one if this machine cannot run it.
Definition direct_solver.hpp:174
DirectSolver(backend::Executor &executor) noexcept
A solver over exact point masses, evaluated through executor.
Definition direct_solver.hpp:119
KernelKind kernel() const noexcept
The kernel this solver will actually use.
Definition direct_solver.hpp:179
InteractionCount interaction_count() const noexcept override
The work done since construction or since the last reset.
Definition direct_solver.hpp:148
void reset_interaction_count() noexcept override
Set every counter back to zero.
Definition direct_solver.hpp:150
DirectSolver(core::Softening softening, backend::Executor &executor) noexcept
A softened solver evaluated through executor.
Definition direct_solver.hpp:128
const backend::Executor * executor() const noexcept
The executor this solver evaluates through, or null if it runs on the calling thread.
Definition direct_solver.hpp:158
std::string_view name() const noexcept override
The solver's name, for benchmark tables and test messages.
Definition direct_solver.hpp:144
DirectSolver()=default
A solver over exact point masses, evaluated on the calling thread.
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.
The innermost loop of the direct solver, in more than one instruction set.
KernelKind
Which implementation of the summation to use.
Definition direct_kernel.hpp:85
@ kScalar
One pair at a time, in index order.
Definition direct_kernel.hpp:91
bool kernel_available(KernelKind kind) noexcept
Whether this build, on this machine, can run kind.
How a kernel asks for a loop to be run in parallel.
What every gravitational force solver in this project provides.
The unit in which the cost of a force evaluation is reported.
Plummer softening, defined once for everything that needs it.
A view of three component arrays of equal length.
Definition vec3_span.hpp:33
What a solver has done since the count was last reset.
Definition interaction_count.hpp:37
The scalar and index types that every layer of the project agrees on.
Three parallel component arrays, viewed as one sequence of 3-vectors.