libgravix2  0.1.0
A fast simulation of attractive forces acting on point-like particles embedded onto the surface of a sphere.
integrators.h File Reference

Symmetric and symplectic integrator for ODEs. More...

Include dependency graph for integrators.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  GrvxQP
 Phase space representation of state. More...
 

Functions

void grvx_integration_step (struct GrvxQP *qp, struct GrvxQP *e, double h, const struct GrvxPlanets *planets)
 Single integration step. More...
 
unsigned grvx_integration_loop (struct GrvxQP *qp, double h, unsigned n, const struct GrvxPlanets *planets)
 Multiple integration steps. More...
 

Detailed Description

Symmetric and symplectic integrator for ODEs.

Function Documentation

◆ grvx_integration_loop()

unsigned grvx_integration_loop ( struct GrvxQP qp,
double  h,
unsigned  n,
const struct GrvxPlanets planets 
)

Multiple integration steps.

qp is advanced by the integrator for a maximum of n steps. The propagation is stopped prematurely if the distance to a planet becomes too small. (The threshold is controlled via GrvxConfig.min_dist.)

Parameters
qpPhase space.
hStep size passed to grvx_integration_step().
nMaximum number of integration steps.
planetsPlanets handle.
Returns
Number of processed integration steps. (Smaller than n if integration was stopped prematurely.)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ grvx_integration_step()

void grvx_integration_step ( struct GrvxQP qp,
struct GrvxQP e,
double  h,
const struct GrvxPlanets planets 
)

Single integration step.

qp is advanced by the integrator for a single step. Accumulation errors are compensated by tracking them in e. Initialize e with zeros for the first iteration.

Parameters
qpPhase space.
eAccumulation error.
hStep size.
planetsPlanets handle.
Here is the caller graph for this function: