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

Static configurations. More...

#include <api.h>

Public Attributes

const char * pot_type
 Type of potential. More...
 
int32_t n_pot
 Approximation order of potential. More...
 
int32_t trajectory_size
 Size of trajectory. More...
 
int32_t int_steps
 Number of integration steps between trajectory points. More...
 
double min_dist
 Minimal allowed distance between missiles and planets. More...
 
const char * composition_scheme
 Composition method of integrator. More...
 
int32_t n_stages
 Number of stages of the composition method. More...
 

Detailed Description

Static configurations.

There are several static configurations that can be set at compile-time. Use grvx_get_config() to get the configuration that was used during compilation. The corresponding compile-time constants that can be passed to CMake are:

Note that none of these settings is necessarily needed to interact with the API, for example, grvx_propagate_missile() returns the number of simulated steps stored in the trajectory sequence upon calling. In fact, it is safer to prefer this value over GrvxConfig::trajectory_size because the former also reflects cases where less values were stored in case of a collision with a planet.

Member Data Documentation

◆ composition_scheme

const char* GrvxConfig::composition_scheme

Composition method of integrator.

The composition method of the integrator encoded as "pXsY" where X is the integration order and Y is the number of stages.

◆ int_steps

int32_t GrvxConfig::int_steps

Number of integration steps between trajectory points.

Number of integration steps between consecutive points of a trajectory. Note that changing this number effectively speeds-up or slows-down the simulated and simulation time.

Possible values: Positive, non-zero integer values.

◆ min_dist

double GrvxConfig::min_dist

Minimal allowed distance between missiles and planets.

If missiles approach planets closer than this minimal distance, propagation is stopped.

Possible values: Positive floating point values.

◆ n_pot

int32_t GrvxConfig::n_pot

Approximation order of potential.

There is no closed-form for \(V_{3\mathrm{D}} = \frac{1}{4\pi} \sum_{j=0}^\infty V^{(j)}_{3\mathrm{D}}\), but the series can be treated as a perturbation expansion with \(V^{(j)}_{3\mathrm{D}} > V^{(j')}_{3\mathrm{D}}\) if \(j < j'\). Empirically, we find that

\[ V_{3\mathrm{D}} \approx \frac{1}{4\pi} \sum_{j=0}^{\texttt{n_pot}-1} V^{(j)}_{3\mathrm{D}} \]

converges fast and yields decent approximations.

For \(V_{2\mathrm{D}}\) a closed-form expression does exist and no approximation is needed.

Possible values: Positive integer values or undefined if GrvxConfig::pot_type is "2D".

◆ n_stages

int32_t GrvxConfig::n_stages

Number of stages of the composition method.

See GrvxConfig.composition_scheme for details.

◆ pot_type

const char* GrvxConfig::pot_type

Type of potential.

Currently, we support two types of potentials, \(V_{2\mathrm{D}}\) and \(V_{3\mathrm{D}}\) and identify them by the strings "2D" and "3D", respectively.

Possible values: "2D" and "3D".

◆ trajectory_size

int32_t GrvxConfig::trajectory_size

Size of trajectory.

Missiles are propagated for multiple time steps. The result is stored in arrays with trajectory_size elements. See Trajectory for more details.

Possible values: Positive, non-zero integer values.


The documentation for this struct was generated from the following file: