|
Orrery
A GPU-accelerated N-body gravitational simulator
|
The classical fourth-order Runge-Kutta method. More...
#include <orrery/integrators/runge_kutta4.hpp>
Public Member Functions | |
| void | step (core::ParticleData &data, core::Real timestep, AccelerationField &field) override |
| Advance the configuration by one step of timestep. | |
| std::string_view | name () const noexcept override |
| The method's name, for diagnostics output and test messages. | |
| int | order () const noexcept override |
| The order of the method: the power of the timestep that the error after a fixed interval of simulated time falls with. | |
| bool | is_symplectic () const noexcept override |
| Whether the method preserves the phase-space volume of the flow. | |
| core::Index | force_evaluations_per_step () const noexcept override |
| Four, and the first of them is free. | |
Additional Inherited Members | |
| Protected Member Functions inherited from orrery::integrators::Integrator | |
| Integrator (const Integrator &)=default | |
| Integrator (Integrator &&)=default | |
| Integrator & | operator= (const Integrator &)=default |
| Integrator & | operator= (Integrator &&)=default |
The classical fourth-order Runge-Kutta method.
Holds four scratch arrays of the same length as the configuration. They are members rather than locals so that a step of a million particles does not allocate and free 96 MB every time it is called; the first step of a run sizes them and every step after finds them the right length already.
|
overridevirtual |
Advance the configuration by one step of timestep.
Requires the invariant above and restores it. A negative timestep is meaningful and is not an error: the symmetric methods here are exactly time-reversible, and stepping backwards is how a test asserts it.
Implements orrery::integrators::Integrator.
|
inlinenodiscardoverridevirtualnoexcept |
The method's name, for diagnostics output and test messages.
Implements orrery::integrators::Integrator.
|
inlinenodiscardoverridevirtualnoexcept |
The order of the method: the power of the timestep that the error after a fixed interval of simulated time falls with.
Implements orrery::integrators::Integrator.
|
inlinenodiscardoverridevirtualnoexcept |
Whether the method preserves the phase-space volume of the flow.
The property that decides whether the energy error stays inside a bounded envelope for ever or grows without limit, which for a simulation run over millions of steps matters more than the order does. ADR-0011 sets out the argument and the validation suite demonstrates it.
Implements orrery::integrators::Integrator.
|
inlinenodiscardoverridevirtualnoexcept |
Four, and the first of them is free.
The first stage needs the acceleration at the starting positions, which the invariant in integrator.hpp says is already there. The fourth evaluation is the one that restores that invariant at the new positions, so it is not spent twice either. The classical count and the count this implementation pays are the same number.
Implements orrery::integrators::Integrator.