Orrery
A GPU-accelerated N-body gravitational simulator
Loading...
Searching...
No Matches
acceleration_field.hpp File Reference

What an integrator is allowed to know about gravity. More...

#include <span>
#include "orrery/core/types.hpp"
#include "orrery/core/vec3_span.hpp"

Go to the source code of this file.

Classes

class  orrery::integrators::AccelerationField
 The acceleration produced by a set of masses at a set of positions. More...

Detailed Description

What an integrator is allowed to know about gravity.

An integrator advances a state under an acceleration that depends on position. It does not care whether that acceleration comes from direct summation, from a tree walk, from the GPU, or from an analytic test field, and it must not, because the solvers layer sits above this one and a header here may not reach up into it. This interface is the whole of the contract between the two, and the solvers of Phase 5 and Phase 8 implement it.

The signature takes spans rather than a ParticleData for one reason, and it is the reason a non-symplectic method exists in this project at all: RK4 evaluates the acceleration at stage positions that are not the state of any particle. Handing the evaluator a particle store would force those stage positions to be written into one first, which means either a second store held for the purpose or a temporary swap of the real one. Spans let the caller point the evaluator at whatever positions it currently holds.

ADR-0012 records the alternatives, the function-template form among them.