Planetary Orbital Evolution due to Tides
Orbital evolution of two objects experiencing tides
CInterface.cpp File Reference

The definitions of the functions declared in CInterface.h. More...

#include "CInterface.h"
+ Include dependency graph for CInterface.cpp:

Go to the source code of this file.

Functions

void read_eccentricity_expansion_coefficients (const char *filename)
 Read eccentricity expansion coefficients from a file. More...
 
void set_zone_dissipation (BrokenPowerlawPhaseLagZone *zone, unsigned num_tidal_frequency_breaks, unsigned num_spin_frequency_breaks, double *tidal_frequency_breaks, double *spin_frequency_breaks, double *tidal_frequency_powers, double *spin_frequency_powers, double reference_phase_lag, double inertial_mode_enhancement, double inertial_mode_sharpness)
 
DiskBinarySystemcreate_star_planet_system (EvolvingStar *star, CPlanet *planet, double initial_semimajor, double initial_eccentricity, double initial_inclination, double disk_lock_frequency, double disk_dissipation_age, double secondary_formation_age)
 Create a binary system out of a star and a planet. More...
 
DiskBinarySystemcreate_star_star_system (EvolvingStar *primary, EvolvingStar *secondary, double initial_semimajor, double initial_eccentricity, double initial_inclination, double disk_lock_frequency, double disk_dissipation_age, double secondary_formation_age)
 Create a binary system out of two stars. More...
 
void destroy_binary (DiskBinarySystem *system)
 Destroy a previously created binary system. More...
 
void configure_star (EvolvingStar *star, double age, double companion_mass, double semimajor, double eccentricity, const double *spin_angmom, const double *inclination, const double *periapsis, bool locked_surface, bool zero_outer_inclination, bool zero_outer_periapsis)
 Defines the orbit a star is in. More...
 
void configure_planet (CPlanet *planet, double age, double companion_mass, double semimajor, double eccentricity, const double *spin_angmom, const double *inclination, const double *periapsis, bool locked_surface, bool zero_outer_inclination, bool zero_outer_periapsis)
 Defines the orbit a planet is in. More...
 
void configure_system (DiskBinarySystem *system, double age, double semimajor, double eccentricity, const double *spin_angmom, const double *inclination, const double *periapsis, int evolution_mode)
 Sets the current state of a system. More...
 
OrbitSolverevolve_system (DiskBinarySystem *system, double final_age, double max_time_step, double precision, double *required_ages, unsigned num_required_ages, bool print_progress, double max_runtime)
 Calculate the evolution of a previously configured binary system. More...
 
void destroy_solver (OrbitSolver *solver)
 Destroy a solver created by evolve_system. More...
 
unsigned num_evolution_steps (OrbitSolver *solver)
 At how many points was the evolution saved. More...
 
template<typename T >
void list_to_array (const std::list< T > &source, T *destination)
 
void get_star_evolution (const EvolvingStar *star_arg, double *envelope_inclination, double *core_inclination, double *envelope_periapsis, double *core_periapsis, double *envelope_angmom, double *core_angmom, bool *wind_saturation, double *envelope_inclination_rate, double *core_inclination_rate, double *envelope_periapsis_rate, double *core_periapsis_rate, double *envelope_angmom_rate, double *core_angmom_rate)
 Fill the given arrays with the part of the evolution tracked by the star. More...
 
void get_planet_evolution (const CPlanet *planet_arg, double *inclination, double *periapsis, double *angmom, double *inclination_rate, double *periapsis_rate, double *angmom_rate)
 Fill the given array with the part of the evolution tracked by the planet. More...
 
void get_binary_evolution (const DiskBinarySystem *system_arg, double *semimajor, double *eccentricity, double *semimajor_rate, double *eccentricity_rate)
 Fill the given arrays with the part of the evolution (the orbital state) tracked by the binary system. More...
 
void get_solver_evolution (const OrbitSolver *solver_arg, double *age, int *evolution_mode)
 Fill the given arrays with the part of the evolution tracked by the orbit solver. More...
 
void get_star_planet_evolution (const OrbitSolver *solver, const DiskBinarySystem *system, const EvolvingStar *star, const CPlanet *planet, double *age, double *semimajor, double *eccentricity, double *envelope_inclination, double *core_inclination, double *envelope_periapsis, double *core_periapsis, double *envelope_angmom, double *core_angmom, double *planet_inclination, double *planet_periapsis, double *planet_angmom, int *evolution_mode, bool *wind_saturation, double *semimajor_rate, double *eccentricity_rate, double *envelope_inclination_rate, double *core_inclination_rate, double *envelope_periapsis_rate, double *core_periapsis_rate, double *envelope_angmom_rate, double *core_angmom_rate, double *planet_inclination_rate, double *planet_periapsis_rate, double *planet_angmom_rate)
 Fill C-style arrays with the calculated evolution of a star-planet system. More...
 
void get_star_star_evolution (const OrbitSolver *solver, const DiskBinarySystem *system, const EvolvingStar *primary, const EvolvingStar *secondary, double *age, double *semimajor, double *eccentricity, double *primary_envelope_inclination, double *primary_core_inclination, double *primary_envelope_periapsis, double *primary_core_periapsis, double *primary_envelope_angmom, double *primary_core_angmom, double *secondary_envelope_inclination, double *secondary_core_inclination, double *secondary_envelope_periapsis, double *secondary_core_periapsis, double *secondary_envelope_angmom, double *secondary_core_angmom, int *evolution_mode, bool *primary_wind_saturation, bool *secondary_wind_saturation, double *semimajor_rate, double *eccentricity_rate, double *primary_envelope_inclination_rate, double *primary_core_inclination_rate, double *primary_envelope_periapsis_rate, double *primary_core_periapsis_rate, double *primary_envelope_angmom_rate, double *primary_core_angmom_rate, double *secondary_envelope_inclination_rate, double *secondary_core_inclination_rate, double *secondary_envelope_periapsis_rate, double *secondary_core_periapsis_rate, double *secondary_envelope_angmom_rate, double *secondary_core_angmom_rate)
 Fill C-style arrays with the calculated evolution of a binary star system. More...
 
void get_star_final_state (const EvolvingStar *star_arg, double *envelope_inclination, double *core_inclination, double *envelope_periapsis, double *core_periapsis, double *envelope_angmom, double *core_angmom, bool *wind_saturation)
 Fill the given pointers with the state of the given star at the end of the evolution. More...
 
void get_planet_final_state (const CPlanet *planet_arg, double *inclination, double *periapsis, double *angmom)
 Fill the given pointers with the state of the given planet at the end of the evolution. More...
 
void get_binary_final_state (const DiskBinarySystem *system_arg, double *semimajor, double *eccentricity)
 Fill the given pointers with the final orbital state of a previously evolved system. More...
 
void get_solver_final_state (const OrbitSolver *solver_arg, double *age, int *evolution_mode)
 Fill the given pointers with the final state of an orbit solver used to calculate an evolution. More...
 
void get_star_planet_final_state (const OrbitSolver *solver, const DiskBinarySystem *system, const EvolvingStar *star, const CPlanet *planet, double *age, double *semimajor, double *eccentricity, double *envelope_inclination, double *core_inclination, double *envelope_periapsis, double *core_periapsis, double *envelope_angmom, double *core_angmom, double *planet_inclination, double *planet_periapsis, double *planet_angmom, int *evolution_mode, bool *wind_saturation)
 Fill destiantions with the calculated final state of a star-planet system. More...
 
void get_star_star_final_state (const OrbitSolver *solver, const DiskBinarySystem *system, const EvolvingStar *primary, const EvolvingStar *secondary, double *age, double *semimajor, double *eccentricity, double *primary_envelope_inclination, double *primary_core_inclination, double *primary_envelope_periapsis, double *primary_core_periapsis, double *primary_envelope_angmom, double *primary_core_angmom, double *secondary_envelope_inclination, double *secondary_core_inclination, double *secondary_envelope_periapsis, double *secondary_core_periapsis, double *secondary_envelope_angmom, double *secondary_core_angmom, int *evolution_mode, bool *primary_wind_saturation, bool *secondary_wind_saturation)
 Fill destiantions with the calculated final state of a binary star system. More...
 

Variables

const int LOCKED_SURFACE_SPIN_EVOL_MODE = Core::LOCKED_SURFACE_SPIN
 Evolution mode ID for when the surface rotation of one of the bodies is locked to a prescribed value. More...
 
const int BINARY_EVOL_MODE = Core::BINARY
 Evolution mode ID for when the two bodies orbit each other. More...
 
const int SINGLE_EVOL_MODE = Core::SINGLE
 Evolution mode ID for when there is only one body in the system (only its rotation evolves). More...
 
const int TABULATION_EVOL_MODE = Core::TABULATION
 Evolution mode ID used as the mode to transform to from all other modes when storing the computed evolution. More...
 
const double NaN = Core::NaN
 Not a number. More...
 

Detailed Description

The definitions of the functions declared in CInterface.h.

Definition in file CInterface.cpp.

Function Documentation

◆ configure_planet()

void configure_planet ( CPlanet *  planet,
double  age,
double  companion_mass,
double  semimajor,
double  eccentricity,
const double *  spin_angmom,
const double *  inclination,
const double *  periapsis,
bool  locked_surface,
bool  zero_outer_inclination,
bool  zero_outer_periapsis 
)

Defines the orbit a planet is in.

The inclinations and arguments of periapsis must be already set for all zones.

Parameters
planetThe body to configure.
ageThe age to set the body to.
companion_massThe mass of the second body in the system.
semimajorThe semimajor axis of the orbit in \(R_\odot\).
eccentricityThe eccentricity of the orbit
spin_angmomThe spin angular momenta of the non-locked zones of the body (outermost zone to innermost).
inclinationThe inclinations of the zones of the body (same order as spin_angmom). If NULL, all inclinations are assumed zero.
periapsisThe arguments of periapsis of the zones of the bodies (same order as spin_angmom). If NULL, all periapses are assumed zero.
locked_surfaceIf true, the outermost zone's spin is assumed locked to a disk and spin_angmom is assumed to start from the next zone.
zero_outer_inclinationIf true, the outermost zone's inclination is assumed to be zero and the inclination argument is assumed to start from the next zone.
zero_outer_periapsisIf true, the outermost zone's periapsis is assumed to be zero and the inclination argument is assumed to start from the next zone.

Definition at line 148 of file CInterface.cpp.

◆ configure_star()

void configure_star ( EvolvingStar star,
double  age,
double  companion_mass,
double  semimajor,
double  eccentricity,
const double *  spin_angmom,
const double *  inclination,
const double *  periapsis,
bool  locked_surface,
bool  zero_outer_inclination,
bool  zero_outer_periapsis 
)

Defines the orbit a star is in.

The inclinations and arguments of periapsis must be already set for all zones.

Parameters
starThe body to configure.
ageThe age to set the body to.
companion_massThe mass of the second body in the system.
semimajorThe semimajor axis of the orbit in \(R_\odot\).
eccentricityThe eccentricity of the orbit
spin_angmomThe spin angular momenta of the non-locked zones of the body (outermost zone to innermost).
inclinationThe inclinations of the zones of the body (same order as spin_angmom). If NULL, all inclinations are assumed zero.
periapsisThe arguments of periapsis of the zones of the bodies (same order as spin_angmom). If NULL, all periapses are assumed zero.
locked_surfaceIf true, the outermost zone's spin is assumed locked to a disk and spin_angmom is assumed to start from the next zone.
zero_outer_inclinationIf true, the outermost zone's inclination is assumed to be zero and the inclination argument is assumed to start from the next zone.
zero_outer_periapsisIf true, the outermost zone's periapsis is assumed to be zero and the inclination argument is assumed to start from the next zone.

Definition at line 121 of file CInterface.cpp.

◆ configure_system()

void configure_system ( DiskBinarySystem system,
double  age,
double  semimajor,
double  eccentricity,
const double *  spin_angmom,
const double *  inclination,
const double *  periapsis,
int  evolution_mode 
)

Sets the current state of a system.

Parameters
systemThe system to set the state of.
ageThe age to set the system to.
semimajorThe semimajor axis of the orbit.
eccentricityThe eccentricity of the orbit.
spin_angmomThe spin angular momenta of the zones of the bodies (body 1 first, outermost zone to innermost, followed by body 2).
inclinationThe inclinations of the zones of the bodies (same order as spin_angmom). The surface zone inclination must be omitted for single body systems.
periapsisThe arguments of periapsis of the zones of the bodies (same order as spin_angmom, but not including the surface zone of the first body).
evolution_modeThe evolution mode to assume. Must be one of the constants defined.

Definition at line 175 of file CInterface.cpp.

◆ create_star_planet_system()

DiskBinarySystem* create_star_planet_system ( EvolvingStar star,
CPlanet *  planet,
double  initial_semimajor,
double  initial_eccentricity,
double  initial_inclination,
double  disk_lock_frequency,
double  disk_dissipation_age,
double  secondary_formation_age 
)

Create a binary system out of a star and a planet.

Parameters
starThe first body in the system. Assumed to always be there, so for a star-planet system this should be the star.
planetThe second body in the system, initially may not be there and later may be engulfed by the first body.
initial_semimajorThe semimajor axis of the orbit at which the secondary forms in \(R_\odot\).
initial_eccentricityThe eccentricity of the orbit at which the secondary forms.
initial_inclinationInclination between surface zone of primary and initial orbit in radians.
disk_lock_frequencyFrequency of the surface spin of the primary when disk is present in rad/day.
disk_dissipation_ageAge when disk dissipates in Gyrs.
secondary_formation_ageAge when the secondary forms.

Definition at line 68 of file CInterface.cpp.

◆ create_star_star_system()

DiskBinarySystem* create_star_star_system ( EvolvingStar primary,
EvolvingStar secondary,
double  initial_semimajor,
double  initial_eccentricity,
double  initial_inclination,
double  disk_lock_frequency,
double  disk_dissipation_age,
double  secondary_formation_age 
)

Create a binary system out of two stars.

Parameters
primaryThe first body in the system. Assumed to always be there, so for a star-planet system this should be the star.
secondaryThe second body in the system, initially may not be there and later may be engulfed by the first body.
initial_semimajorThe semimajor axis of the orbit at which the secondary forms in \(R_\odot\).
initial_eccentricityThe eccentricity of the orbit at which the secondary forms.
initial_inclinationInclination between surface zone of primary and initial orbit in radians.
disk_lock_frequencyFrequency of the surface spin of the primary when disk is present in rad/day.
disk_dissipation_ageAge when disk dissipates in Gyrs.
secondary_formation_ageAge when the secondary forms.

Definition at line 92 of file CInterface.cpp.

◆ destroy_binary()

void destroy_binary ( DiskBinarySystem system)

Destroy a previously created binary system.

Parameters
systemThe system to destroy.

Definition at line 116 of file CInterface.cpp.

◆ destroy_solver()

void destroy_solver ( OrbitSolver solver)

Destroy a solver created by evolve_system.

Parameters
solverThe solver to destroy.

Definition at line 229 of file CInterface.cpp.

◆ evolve_system()

OrbitSolver* evolve_system ( DiskBinarySystem system,
double  final_age,
double  max_time_step,
double  precision,
double *  required_ages,
unsigned  num_required_ages,
bool  print_progress,
double  max_runtime 
)

Calculate the evolution of a previously configured binary system.

Parameters
systemThe system to evolve.
final_ageThe age at which to stop the evolution in Gyrs. The starting age must be already set for the system.
max_time_stepThe maximum size of the time step allowed in Gyrs.
precisionThe precision to require of the solution.
required_agesAges at which the evolution must stop precisely.
num_required_agesThe number of required ages.
print_progressSee print_progress argument to Evolve::OrbitSolver::OrbitSolver()
max_runtimeThe maximum time in seconds the evolutions is allowed to run. Partially calculated evolution can be queried. Any non-positive

Definition at line 197 of file CInterface.cpp.

◆ get_binary_evolution()

void get_binary_evolution ( const DiskBinarySystem system_arg,
double *  semimajor,
double *  eccentricity,
double *  semimajor_rate,
double *  eccentricity_rate 
)

Fill the given arrays with the part of the evolution (the orbital state) tracked by the binary system.

Definition at line 358 of file CInterface.cpp.

◆ get_binary_final_state()

void get_binary_final_state ( const DiskBinarySystem system_arg,
double *  semimajor,
double *  eccentricity 
)

Fill the given pointers with the final orbital state of a previously evolved system.

Definition at line 607 of file CInterface.cpp.

◆ get_planet_evolution()

void get_planet_evolution ( const CPlanet *  planet_arg,
double *  inclination,
double *  periapsis,
double *  angmom,
double *  inclination_rate,
double *  periapsis_rate,
double *  angmom_rate 
)

Fill the given array with the part of the evolution tracked by the planet.

Definition at line 317 of file CInterface.cpp.

◆ get_planet_final_state()

void get_planet_final_state ( const CPlanet *  planet_arg,
double *  inclination,
double *  periapsis,
double *  angmom 
)

Fill the given pointers with the state of the given planet at the end of the evolution.

Definition at line 580 of file CInterface.cpp.

◆ get_solver_evolution()

void get_solver_evolution ( const OrbitSolver solver_arg,
double *  age,
int *  evolution_mode 
)

Fill the given arrays with the part of the evolution tracked by the orbit solver.

Definition at line 376 of file CInterface.cpp.

◆ get_solver_final_state()

void get_solver_final_state ( const OrbitSolver solver_arg,
double *  age,
int *  evolution_mode 
)

Fill the given pointers with the final state of an orbit solver used to calculate an evolution.

Definition at line 623 of file CInterface.cpp.

◆ get_star_evolution()

void get_star_evolution ( const EvolvingStar star_arg,
double *  envelope_inclination,
double *  core_inclination,
double *  envelope_periapsis,
double *  core_periapsis,
double *  envelope_angmom,
double *  core_angmom,
bool *  wind_saturation,
double *  envelope_inclination_rate,
double *  core_inclination_rate,
double *  envelope_periapsis_rate,
double *  core_periapsis_rate,
double *  envelope_angmom_rate,
double *  core_angmom_rate 
)

Fill the given arrays with the part of the evolution tracked by the star.

Definition at line 249 of file CInterface.cpp.

◆ get_star_final_state()

void get_star_final_state ( const EvolvingStar star_arg,
double *  envelope_inclination,
double *  core_inclination,
double *  envelope_periapsis,
double *  core_periapsis,
double *  envelope_angmom,
double *  core_angmom,
bool *  wind_saturation 
)

Fill the given pointers with the state of the given star at the end of the evolution.

Definition at line 532 of file CInterface.cpp.

◆ get_star_planet_evolution()

void get_star_planet_evolution ( const OrbitSolver solver,
const DiskBinarySystem system,
const EvolvingStar star,
const CPlanet *  planet,
double *  age,
double *  semimajor,
double *  eccentricity,
double *  envelope_inclination,
double *  core_inclination,
double *  envelope_periapsis,
double *  core_periapsis,
double *  envelope_angmom,
double *  core_angmom,
double *  planet_inclination,
double *  planet_periapsis,
double *  planet_angmom,
int *  evolution_mode,
bool *  wind_saturation,
double *  semimajor_rate,
double *  eccentricity_rate,
double *  envelope_inclination_rate,
double *  core_inclination_rate,
double *  envelope_periapsis_rate,
double *  core_periapsis_rate,
double *  envelope_angmom_rate,
double *  core_angmom_rate,
double *  planet_inclination_rate,
double *  planet_periapsis_rate,
double *  planet_angmom_rate 
)

Fill C-style arrays with the calculated evolution of a star-planet system.

All return arrays must either be allocated to the correct size or be NULL. In the latter case, the corresponding quantity is not returned.

Parameters
solverThe solver which was used to calculate the orbital evolution.
systemThe system which was evolved.
starThe star which was evolved.
planetThe planet which was evolved,
ageAn array to fill with the ages at which the evolution was calculated.
semimajorAn array to fill with the semimajor axis at the saved evolution steps.
eccentricityAn array to fill with the orbital eccentricity at the saved evolution steps.
envelope_inclinationAn array to fill with the angle between the stellar convective envelope and the orbital angular momenta.
core_inclinationAn array to fill with the angle between the stellar radiative core and the orbital angular momenta.
envelope_periapsisAn array to fill with the periapsis of the orbit in the equatorial plane of the stellar convective envelope.
core_periapsisAn array to fill with the periapsis of the orbit in the equatorial plane of the stellar radiative core.
envelope_angmomAn array to fill with the angular momentum of the stellar convective envelope.
core_angmomAn array to fill with the angular momentum of the stellar radiative core.
planet_inclinationAn array to fill wit the angle between the planet's and the orbital angular momentum (pass NULL if the planet is not dissipative).
planet_periapsisAn array to fill wit the periapsis of the orbit in the equatorial plane of the planet (pass NULL if the planet is not dissipative).
planet_angmomAn array to fill wit the angular momentum of the planet (pass NULL if the planet is not dissipative).
evolution_modeAn array to fill with the evolution mode of the system.
wind_saturationAn array to fill with a flag indicating whether the angular momentum loss due to stellar wind is in the satured state (true) or not (false).
semimajor_rateAn array to fill with the rate at which the semimajor axis changes at the saved evolution steps.
eccentricity_rateAn array to fill with the rate the orbital eccentricity changes at the saved evolution steps.
envelope_inclination_rateAn array to fill with the rate at which the angle between the stellar convective envelope and the orbital angular momenta changes.
core_inclination_rateAn array to fill with the rate of change of the angle between the stellar radiative core and the orbital angular momenta.
envelope_periapsis_rateAn array to fill with the rate of change of the periapsis of the orbit in the equatorial plane of the stellar convective envelope.
core_periapsis_rateAn array to fill with the rate of change of the periapsis of the orbit in the equatorial plane of the stellar radiative core.
envelope_angmom_rateAn array to fill with the rate of change of the angular momentum of the stellar convective envelope.
core_angmom_rateAn array to fill with the rate of change of the angular momentum of the stellar radiative core.
planet_inclination_rateAn array to fill wit the rate of change of the angle between the planet's and the orbital angular momentum (pass NULL if the planet is not dissipative).
planet_periapsis_rateAn array to fill with the rate of change of the periapsis of the orbit in the equatorial plane of the planet (pass NULL if the planet is not dissipative).
planet_angmom_rateAn array to fill with the range of change of the angular momentum of the planet (pass NULL if the planet is not dissipative).

Definition at line 391 of file CInterface.cpp.

◆ get_star_planet_final_state()

void get_star_planet_final_state ( const OrbitSolver solver,
const DiskBinarySystem system,
const EvolvingStar star,
const CPlanet *  planet,
double *  age,
double *  semimajor,
double *  eccentricity,
double *  envelope_inclination,
double *  core_inclination,
double *  envelope_periapsis,
double *  core_periapsis,
double *  envelope_angmom,
double *  core_angmom,
double *  planet_inclination,
double *  planet_periapsis,
double *  planet_angmom,
int *  evolution_mode,
bool *  wind_saturation 
)

Fill destiantions with the calculated final state of a star-planet system.

All return variables must either be allocated or be NULL. In the latter case, the corresponding quantity is not returned.

Parameters
solverThe solver which was used to calculate the orbital evolution.
systemThe system which was evolved.
starThe star which was evolved.
planetThe planet which was evolved.
ageAn array to fill with the ages at which the evolution was calculated.
semimajorAn array to fill with the semimajor axis at the saved evolution steps.
eccentricityAn array to fill with the orbital eccentricity at the saved evolution steps.
envelope_inclinationTo overwrite with the angle between the stellar convective envelope and the orbital angular momenta.
core_inclinationTo overwrite with the angle between the stellar radiative core and the orbital angular momenta.
envelope_periapsisTo overwrite with the periapsis of the orbit in the equatorial plane of the stellar convective envelope.
core_periapsisTo overwrite with the periapsis of the orbit in the equatorial plane of the stellar radiative core.
envelope_angmomTo overwrite with the angular momentum of the stellar convective envelope.
core_angmomTo overwrite with the angular momentum of the stellar radiative core.
planet_inclinationTo overwrite with the angle between the planet's and the orbital angular momentum (pass NULL if the planet is not dissipative).
planet_periapsisTo overwrite with the periapsis of the orbit in the equatorial plane of the planet (pass NULL if the planet is not dissipative).
planet_angmomTo overwrite with the angular momentum of the planet (pass NULL if the planet is not dissipative).
evolution_modeAn array to fill with the evolution mode of the system.
wind_saturationAn array to fill with a flag indicating whether the angular momentum loss due to stellar wind is in the satured state (true) or not (false).

Definition at line 637 of file CInterface.cpp.

◆ get_star_star_evolution()

void get_star_star_evolution ( const OrbitSolver solver,
const DiskBinarySystem system,
const EvolvingStar primary,
const EvolvingStar secondary,
double *  age,
double *  semimajor,
double *  eccentricity,
double *  primary_envelope_inclination,
double *  primary_core_inclination,
double *  primary_envelope_periapsis,
double *  primary_core_periapsis,
double *  primary_envelope_angmom,
double *  primary_core_angmom,
double *  secondary_envelope_inclination,
double *  secondary_core_inclination,
double *  secondary_envelope_periapsis,
double *  secondary_core_periapsis,
double *  secondary_envelope_angmom,
double *  secondary_core_angmom,
int *  evolution_mode,
bool *  primary_wind_saturation,
bool *  secondary_wind_saturation,
double *  semimajor_rate,
double *  eccentricity_rate,
double *  primary_envelope_inclination_rate,
double *  primary_core_inclination_rate,
double *  primary_envelope_periapsis_rate,
double *  primary_core_periapsis_rate,
double *  primary_envelope_angmom_rate,
double *  primary_core_angmom_rate,
double *  secondary_envelope_inclination_rate,
double *  secondary_core_inclination_rate,
double *  secondary_envelope_periapsis_rate,
double *  secondary_core_periapsis_rate,
double *  secondary_envelope_angmom_rate,
double *  secondary_core_angmom_rate 
)

Fill C-style arrays with the calculated evolution of a binary star system.

All return arrays must either be allocated to the correct size or be NULL. In the latter case, the corresponding quantity is not returned.

Parameters
solverThe solver which was used to calculate the orbital evolution.
systemThe system which was evolved.
primaryThe primary star which was evolved.
secondaryThe secondary star which was evolved.
ageAn array to fill with the ages at which the evolution was calculated.
semimajorAn array to fill with the semimajor axis at the saved evolution steps.
eccentricityAn array to fill with the orbital eccentricity at the saved evolution steps.
primary_envelope_inclinationAn array to fill with the angle between the stellar convective envelope and the orbital angular momenta.
primary_core_inclinationAn array to fill with the angle between the stellar radiative core and the orbital angular momenta.
primary_envelope_periapsisAn array to fill with the periapsis of the orbit in the equatorial plane of the stellar convective envelope.
primary_core_periapsisAn array to fill with the periapsis of the orbit in the equatorial plane of the stellar radiative core.
primary_envelope_angmomAn array to fill with the angular momentum of the stellar convective envelope.
primary_core_angmomAn array to fill with the angular momentum of the stellar radiative core.
secondary_envelope_inclinationAn array to fill with the angle between the stellar convective envelope and the orbital angular momenta.
secondary_core_inclinationAn array to fill with the angle between the stellar radiative core and the orbital angular momenta.
secondary_envelope_periapsisAn array to fill with the periapsis of the orbit in the equatorial plane of the stellar convective envelope.
secondary_core_periapsisAn array to fill with the periapsis of the orbit in the equatorial plane of the stellar radiative core.
secondary_envelope_angmomAn array to fill with the angular momentum of the stellar convective envelope.
secondary_core_angmomAn array to fill with the angular momentum of the stellar radiative core.
evolution_modeAn array to fill with the evolution mode of the system.
primary_wind_saturationAn array to fill with a flag indicating whether the angular momentum loss due to stellar wind is in the satured state (true) or not (false).
secondary_wind_saturationAn array to fill with a flag indicating whether the angular momentum loss due to stellar wind is in the satured state (true) or not (false).
semimajor_rateAn array to fill with the rate of change of the semimajor axis at the saved evolution steps.
eccentricity_rateAn array to fill with the rate of change of the orbital eccentricity at the saved evolution steps.
primary_envelope_inclination_rateAn array to fill with the rate of change of the angle between the stellar convective envelope and the orbital angular momenta.
primary_core_inclination_rateAn array to fill with the rate of change of the angle between the stellar radiative core and the orbital angular momenta.
primary_envelope_periapsis_rateAn array to fill with the rate of change of the periapsis of the orbit in the equatorial plane of the stellar convective envelope.
primary_core_periapsis_rateAn array to fill with the rate of change of the periapsis of the orbit in the equatorial plane of the stellar radiative core.
primary_envelope_angmom_rateAn array to fill with the rate of change of the angular momentum of the stellar convective envelope.
primary_core_angmom_rateAn array to fill with the rate of change of the angular momentum of the stellar radiative core.
secondary_envelope_inclination_rateAn array to fill with the rate of change of the angle between the stellar convective envelope and the orbital angular momenta.
secondary_core_inclination_rateAn array to fill with the rate of change of the angle between the stellar radiative core and the orbital angular momenta.
secondary_envelope_periapsis_rateAn array to fill with the rate of change of the periapsis of the orbit in the equatorial plane of the stellar convective envelope.
secondary_core_periapsis_rateAn array to fill with the rate of change of the periapsis of the orbit in the equatorial plane of the stellar radiative core.
secondary_envelope_angmom_rateAn array to fill with the rate of change of the angular momentum of the stellar convective envelope.
secondary_core_angmom_rateAn array to fill with the rate of change of the angular momentum of the stellar radiative core.

Definition at line 454 of file CInterface.cpp.

◆ get_star_star_final_state()

void get_star_star_final_state ( const OrbitSolver solver,
const DiskBinarySystem system,
const EvolvingStar primary,
const EvolvingStar secondary,
double *  age,
double *  semimajor,
double *  eccentricity,
double *  primary_envelope_inclination,
double *  primary_core_inclination,
double *  primary_envelope_periapsis,
double *  primary_core_periapsis,
double *  primary_envelope_angmom,
double *  primary_core_angmom,
double *  secondary_envelope_inclination,
double *  secondary_core_inclination,
double *  secondary_envelope_periapsis,
double *  secondary_core_periapsis,
double *  secondary_envelope_angmom,
double *  secondary_core_angmom,
int *  evolution_mode,
bool *  primary_wind_saturation,
bool *  secondary_wind_saturation 
)

Fill destiantions with the calculated final state of a binary star system.

All return variables must either be allocated or be NULL. In the latter case, the corresponding quantity is not returned.

Parameters
solverThe solver which was used to calculate the orbital evolution.
systemThe system which was evolved.
primaryThe primary star in the system.
secondaryThe secondary star in the system.
ageAn array to fill with the ages at which the evolution was calculated.
semimajorAn array to fill with the semimajor axis at the saved evolution steps.
eccentricityAn array to fill with the orbital eccentricity at the saved evolution steps.
primary_envelope_inclinationAn array to fill with the angle between the stellar convective envelope and the orbital angular momenta.
primary_core_inclinationAn array to fill with the angle between the stellar radiative core and the orbital angular momenta.
primary_envelope_periapsisAn array to fill with the periapsis of the orbit in the equatorial plane of the stellar convective envelope.
primary_core_periapsisAn array to fill with the periapsis of the orbit in the equatorial plane of the stellar radiative core.
primary_envelope_angmomAn array to fill with the angular momentum of the stellar convective envelope.
primary_core_angmomAn array to fill with the angular momentum of the stellar radiative core.
secondary_envelope_inclinationAn array to fill with the angle between the stellar convective envelope and the orbital angular momenta.
secondary_core_inclinationAn array to fill with the angle between the stellar radiative core and the orbital angular momenta.
secondary_envelope_periapsisAn array to fill with the periapsis of the orbit in the equatorial plane of the stellar convective envelope.
secondary_core_periapsisAn array to fill with the periapsis of the orbit in the equatorial plane of the stellar radiative core.
secondary_envelope_angmomAn array to fill with the angular momentum of the stellar convective envelope.
secondary_core_angmomAn array to fill with the angular momentum of the stellar radiative core.
evolution_modeAn array to fill with the evolution mode of the system.
primary_wind_saturationAn array to fill with a flag indicating whether the angular momentum loss due to stellar wind is in the satured state (true) or not (false).
secondary_wind_saturationAn array to fill with a flag indicating whether the angular momentum loss due to stellar wind is in the satured state (true) or not (false).

Definition at line 675 of file CInterface.cpp.

◆ num_evolution_steps()

unsigned num_evolution_steps ( OrbitSolver solver)

At how many points was the evolution saved.

Parameters
solverThe solver used to follow the evolution.

Definition at line 234 of file CInterface.cpp.

◆ read_eccentricity_expansion_coefficients()

void read_eccentricity_expansion_coefficients ( const char *  filename)

Read eccentricity expansion coefficients from a file.

Definition at line 17 of file CInterface.cpp.

◆ set_zone_dissipation()

void set_zone_dissipation ( BrokenPowerlawPhaseLagZone zone,
unsigned  num_tidal_frequency_breaks,
unsigned  num_spin_frequency_breaks,
double *  tidal_frequency_breaks,
double *  spin_frequency_breaks,
double *  tidal_frequency_powers,
double *  spin_frequency_powers,
double  reference_phase_lag,
double  inertial_mode_enhancement,
double  inertial_mode_sharpness 
)
Parameters
zoneThe zone to set the dissipation of.
num_tidal_frequency_breaksThe number of breaks in the tidal frequency dependence.
num_spin_frequency_breaksThe number of breaks in the spin frequency dependence.
tidal_frequency_breaksThe locations of the breaks in tidal frequency in rad/day. Entries should be sorted.
spin_frequency_breaksThe locations of the breaks in spin frequency in rad/day. Entries should be sorted.
tidal_frequency_powersThe powerlaw indices for the tidal frequency dependence. Should be indexed in the same order as tidal_frequency_breaks, but must contain an additional starting entry for the powerlaw index before the first break.
spin_frequency_powersThe powerlaw indices for the spin frequency dependence. Should be indexed in the same order as spin_frequency_breaks, but must contain an additional starting entry for the powerlaw index before the first break.
reference_phase_lagThe phase lag at the first tidal and first spin frequency break. The rest are calculated by imposing continuity.
inertial_mode_enhancementFactor by which the dissipation in the inertial mode range is enhanced relative to what is defined by all other parameters. Must be greater than 1.
inertial_mode_sharpnessParameter controlling how sharp the transition between inertial mode non-enhanced and inertial mode enhanced dissipation is.

Definition at line 22 of file CInterface.cpp.

Variable Documentation

◆ BINARY_EVOL_MODE

const int BINARY_EVOL_MODE = Core::BINARY

Evolution mode ID for when the two bodies orbit each other.

Definition at line 12 of file CInterface.cpp.

◆ LOCKED_SURFACE_SPIN_EVOL_MODE

const int LOCKED_SURFACE_SPIN_EVOL_MODE = Core::LOCKED_SURFACE_SPIN

Evolution mode ID for when the surface rotation of one of the bodies is locked to a prescribed value.

Definition at line 11 of file CInterface.cpp.

◆ NaN

const double NaN = Core::NaN

Not a number.

Definition at line 15 of file CInterface.cpp.

◆ SINGLE_EVOL_MODE

const int SINGLE_EVOL_MODE = Core::SINGLE

Evolution mode ID for when there is only one body in the system (only its rotation evolves).

Definition at line 13 of file CInterface.cpp.

◆ TABULATION_EVOL_MODE

const int TABULATION_EVOL_MODE = Core::TABULATION

Evolution mode ID used as the mode to transform to from all other modes when storing the computed evolution.

Definition at line 14 of file CInterface.cpp.