Integrator Structures

group IntegratorStructs

Structures for the various integrators.

struct reb_simulation_integrator_ias15
#include <rebound.h>

This structure contains variables and pointer used by the IAS15 integrator.

Public Members

double epsilon

This parameter controls the accuracy of the integrator.

Set to 0 to make IAS15 a non-adaptive integrator. The default value is: 1e-9.

double min_dt

The minimum allowed timestep.

The default value is 0 (no minimal timestep). Set a finite value to this variable if the IAS15 integrator has problems and the timestep becomes excessively small.

unsigned int epsilon_global

Flag that determines how relative acceleration error is estimated.

If set to 1, estimate the fractional error by max(acceleration_error)/max(acceleration), where max is take over all particles. If set to 0, estimate the fractional error by max(acceleration_error/acceleration).

struct reb_simulation_integrator_hermes
#include <rebound.h>

This structure contains variables and pointer used by the HERMES integrator.

Public Members

struct reb_simulation *mini

Mini simulation integrated using IAS15. See Silburt et al 2016.

struct reb_simulation *global

Global simulation integrated using WHFast. Only set in mini simulation. See Silburt et al 2016).

double hill_switch_factor

Criteria for switching between IAS15 and WHFast in terms of Hill radii (default: 3.).

double solar_switch_factor

Criteria for switching between IAS15 and WHfast in terms of the central star’s physical radius (default: 15.).

int adaptive_hill_switch_factor

Flag (default: 1) for automatically calculating the appropriate HSF value each iteration.

int mini_active

Flag that is set to 1 by HERMES if the mini simulation is active in this timestep.

struct reb_simulation_integrator_sei
#include <rebound.h>

This structure contains variables used by the SEI integrator.

This is where the user sets the orbital frequency OMEGA for shearing sheet simulations.

Public Members

double OMEGA

Epicyclic/orbital frequency.

double OMEGAZ

Epicyclic frequency in vertical direction.

struct reb_simulation_integrator_whfast
#include <rebound.h>

This structure contains variables used by the WHFast integrator.

Public Members

unsigned int corrector

This variable turns on/off different symplectic correctors for WHFast. See Rein & Tamayo 2015 and Wisdom 2006 for a discussion.

  • 0 (default): turns off all correctors
  • 3: uses third order (two-stage) corrector
  • 5: uses fifth order (four-stage) corrector
  • 7: uses seventh order (six-stage) corrector
  • 11: uses eleventh order (ten-stage) corrector

unsigned int recalculate_jacobi_this_timestep

Setting this flag to one will recalculate Jacobi coordinates from the particle structure in the next timestep.

After the timestep, the flag gets set back to 0. If you want to change particles after every timestep, you also need to set this flag to 1 before every timestep. Default is 0.

unsigned int safe_mode

If this flag is set (the default), whfast will recalculate jacobi coordinates and synchronize every timestep, to avoid problems with outputs or particle modifications between timesteps.

Setting it to 0 will result in a speedup, but care must be taken to synchronize and recalculate jacobi coordinates when needed. See AdvWHFast.ipynb in the python_tutorials folder (navigate to it on github if you don’t have ipython notebook installed). The explanation is general, and the python and C flags have the same names.

struct reb_particle* restrict reb_simulation_integrator_whfast::p_j

Jacobi coordinates.

This array contains the Jacobi coordinates of all particles. It is automatically filled and updated by WHfast. Access this array with caution.

unsigned int keep_unsynchronized

Generate inertial coordinates at the end of the integration, but do not change the Jacobi coordinates.

Danger zone! Only use this flag if you are absolutely sure what you are doing. This is intended for simulation which have to be reproducible on a bit by bit basis.

struct reb_simulation_integrator_whfasthelio

Public Members

unsigned int corrector

This variable turns on/off different symplectic correctors for WHFastHelio. Same as for WHFast.

  • 0 (default): turns off all correctors
  • 3: uses third order (two-stage) corrector
  • 5: uses fifth order (four-stage) corrector
  • 7: uses seventh order (six-stage) corrector
  • 11: uses eleventh order (ten-stage) corrector

unsigned int recalculate_heliocentric_this_timestep

Setting this flag to one will recalculate heliocentric coordinates from the particle structure in the next timestep.

After the timestep, the flag gets set back to 0. If you want to change particles after every timestep, you also need to set this flag to 1 before every timestep. Default is 0.

unsigned int safe_mode

If this flag is set (the default), WHFastHelio will recalculate heliocentric coordinates and synchronize every timestep, to avoid problems with outputs or particle modifications between timesteps.

Setting it to 0 will result in a speedup, but care must be taken to synchronize and recalculate heliocentric coordinates when needed.

struct reb_particle* restrict reb_simulation_integrator_whfasthelio::p_h

Heliocentric coordinates.

This array contains the heliocentric coordinates of all particles. It is automatically filled and updated by WHfastDemocratic. Access this array with caution.

unsigned int keep_unsynchronized

Generate inertial coordinates at the end of the integration, but do not change the Heliocentric coordinates.

Danger zone! Only use this flag if you are absolutely sure what you are doing. This is intended for simulation which have to be reproducible on a bit by bit basis.