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

What every gravitational force solver in this project provides. More...

Go to the source code of this file.

Classes

class  orrery::solvers::ForceSolver
 A method for computing the gravitational acceleration of a set of particles. More...

Detailed Description

What every gravitational force solver in this project provides.

An integrator asks one question of gravity, and AccelerationField in the layer below is exactly that question: given these masses at these positions, what is the acceleration of each. Nothing an integrator does depends on how the answer was reached, which is why that interface is deliberately as narrow as it is.

This interface is the same question asked by everything else. A benchmark needs to know which solver it is timing and how much work that solver did. A validation test comparing an approximation against direct summation needs both to be softening the same way, or the difference it measures is the softening rather than the approximation. A diagnostic needs the softening the kernel used, for the reason ADR-0008 gives. None of that belongs on the interface the integrators see, and all of it is common to every solver that will ever be written here, so it lives one layer up. ADR-0014 records the alternatives.

A solver is an acceleration field, so it can be handed to an integrator directly. The relationship is inheritance rather than a wrapper because it is a true is-a: computing accelerations is not something a solver does as well as its real job, it is the job.