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... | |
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:
GRVX_POT_TYPE
: same as GrvxConfig::pot_typeGRVX_N_POT
: same as GrvxConfig::n_potGRVX_TRAJECTORY_SIZE
: same as GrvxConfig::trajectory_sizeGRVX_INT_STEPS
: same as GrvxConfig::int_stepsGRVX_MIN_DIST
: same as GrvxConfig::min_distGRVX_P_MIN
: same as GrvxConfig::p_minGRVX_COMPOSITION_SCHEME
: same as GrvxConfig::composition_schemeNote 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.
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.
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.
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.
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"
.
int32_t GrvxConfig::n_stages |
Number of stages of the composition method.
See GrvxConfig.composition_scheme for details.
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"
.
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.