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 "../Evolve/CInterface.h"
+ Include dependency graph for CInterface.cpp:

Go to the source code of this file.

Functions

double lag_from_lgQ (double lgQ)
 Converts lg(Q) to a tidal phase lag. More...
 
EvolvingStarcreate_star (double mass, double feh, double wind_strength, double wind_saturation_frequency, double diff_rot_coupling_timescale, const MESAInterpolator *interpolator)
 Create a star to participate in the orbital evolution calculation. More...
 
void destroy_star (EvolvingStar *star)
 Destroy a previously created star. More...
 
void set_star_dissipation (EvolvingStar *star, unsigned zone_index, 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)
 Set the dissipative properties of one of the zones of a star. More...
 
void detect_stellar_wind_saturation (EvolvingStar *star)
 
void select_interpolation_region (const EvolvingStar *star, double age)
 Prepare the zone quantities for interpolation around the given age. More...
 
double modified_phase_lag (const EvolvingStar *star, unsigned zone_index, int orbital_frequency_multiplier, int spin_frequency_multiplier, double forcing_frequency, int entry, double *above_lock_value)
 See Evolve::BrokenPowerlawPhaseLagZone::modified_phase_lag for details. More...
 
double core_formation_age (const EvolvingStar *star)
 The age at which the core of a star forms. More...
 
double lifetime (const EvolvingStar *star)
 The lifetime of a star (the maximum age at which it can be queried) More...
 
double luminosity (EvolvingStar *star, double age)
 The luminosity of a star at a given age. More...
 
void luminosity_array (EvolvingStar *star, const double *age, unsigned nvalues, double *result)
 The luminosity of a star at a given array of ages. More...
 
double core_inertia (EvolvingStar *star, double age)
 The moment of inertia of the stellar core at a given age. More...
 
double core_inertia_deriv (EvolvingStar *star, double age, int deriv_order)
 One of the derivatives of the moment of inertia of the stellar core at a given age. More...
 
void zone_inertia_array (Star::EvolvingStellarZone &zone, const double *age, int deriv_order, unsigned nvalues, double *result)
 
void core_inertia_array (EvolvingStar *star, const double *age, unsigned nvalues, double *result)
 The moment of inertia of the stellar core at a given array of ages. More...
 
void core_inertia_deriv_array (EvolvingStar *star, const double *age, int deriv_order, unsigned nvalues, double *result)
 One of the derivatives of the moment of inertia of the stellar core at a given array of ages. More...
 
double envelope_inertia (EvolvingStar *star, double age)
 The moment of inertia of the stellar envelope at a given age. More...
 
double envelope_inertia_deriv (EvolvingStar *star, double age, int deriv_order)
 One of the derivatives of the moment of inertia of the stellar envelope at a given age. More...
 
void envelope_inertia_array (EvolvingStar *star, const double *age, unsigned nvalues, double *result)
 The moment of inertia of the stellar envelope at a given array of ages. More...
 
void envelope_inertia_deriv_array (EvolvingStar *star, const double *age, int deriv_order, unsigned nvalues, double *result)
 One of the derivatives of the moment of inertia of the stellar envelope at a given array of ages. More...
 
double star_radius (EvolvingStar *star, double age)
 The radius of the star at a given age. More...
 
void star_radius_array (EvolvingStar *star, const double *age, unsigned nvalues, double *result)
 The radius of the star at an array of ages. More...
 

Variables

const int NO_DERIV = Evolve::Dissipation::NO_DERIV
 Identifier for not differentiating the phase lag. More...
 
const int AGE_DERIV = Evolve::Dissipation::AGE
 Identifier for differentiating the phase lag w.r.t. age. More...
 
const int SPIN_FREQUENCY_DERIV = Evolve::Dissipation::SPIN_FREQUENCY
 Identifier for differentiating the phase lag w.r.t. spin freuqency. More...
 
const int ORBITAL_FREQUENCY_DERIV = Evolve::Dissipation::ORBITAL_FREQUENCY
 Identifier for differentiating the phase lag w.r.t. orbital freuqency. More...
 

Detailed Description

The definitions of the functions declared in CInterface.h.

Definition in file CInterface.cpp.

Function Documentation

◆ core_formation_age()

double core_formation_age ( const EvolvingStar star)

The age at which the core of a star forms.

Parameters
starThe star for which to return the core formation age.

Definition at line 126 of file CInterface.cpp.

◆ core_inertia()

double core_inertia ( EvolvingStar star,
double  age 
)

The moment of inertia of the stellar core at a given age.

Parameters
starThe star whose luminosity to return.
ageThe age at which to return the luminosity.

Definition at line 172 of file CInterface.cpp.

◆ core_inertia_array()

void core_inertia_array ( EvolvingStar star,
const double *  age,
unsigned  nvalues,
double *  result 
)

The moment of inertia of the stellar core at a given array of ages.

Parameters
starThe star whose luminosity to return.
ageThe ages at which to return the moment of inertia.
nvaluesThe number of ages at which evaluation is required.
resultA pre-allocated memory (size: nvalues) where to place the result.

Definition at line 211 of file CInterface.cpp.

◆ core_inertia_deriv()

double core_inertia_deriv ( EvolvingStar star,
double  age,
int  deriv_order 
)

One of the derivatives of the moment of inertia of the stellar core at a given age.

Parameters
starThe star whose luminosity to return.
ageThe age at which to return the luminosity.
deriv_orderThe order of the derivative to return (0, 1, or 2).

Definition at line 182 of file CInterface.cpp.

◆ core_inertia_deriv_array()

void core_inertia_deriv_array ( EvolvingStar star,
const double *  age,
int  deriv_order,
unsigned  nvalues,
double *  result 
)

One of the derivatives of the moment of inertia of the stellar core at a given array of ages.

Parameters
starThe star whose luminosity to return.
ageThe ages at which to return the moment of inertia.
deriv_orderThe orde of the derivate to return (0, 1, or 2).
nvaluesThe number of ages at which evaluation is required.
resultA pre-allocated memory (size: nvalues) where to place the result.

Definition at line 227 of file CInterface.cpp.

◆ create_star()

EvolvingStar* create_star ( double  mass,
double  feh,
double  wind_strength,
double  wind_saturation_frequency,
double  diff_rot_coupling_timescale,
const MESAInterpolator interpolator 
)

Create a star to participate in the orbital evolution calculation.

Parameters
massMass of the star
fehThe [Fe/H] of the star
wind_strengthThe strength of the wind.
wind_saturation_frequencyThe frequency at which the wind loss saturates in rad/day.
diff_rot_coupling_timescaleThe timescale for differential rotation coupling.
interpolatorA StellarEvolution interpolator.

Definition at line 22 of file CInterface.cpp.

◆ destroy_star()

void destroy_star ( EvolvingStar star)

Destroy a previously created star.

Parameters
starThe star to destroy. Must have previously been created using create_star.

Definition at line 44 of file CInterface.cpp.

◆ detect_stellar_wind_saturation()

void detect_stellar_wind_saturation ( EvolvingStar star)

Tell the star to detect its wind saturation state per its current configuration.

Parameters
starThe star to detect the saturation state of.

Definition at line 92 of file CInterface.cpp.

◆ envelope_inertia()

double envelope_inertia ( EvolvingStar star,
double  age 
)

The moment of inertia of the stellar envelope at a given age.

Parameters
starThe star whose luminosity to return.
ageThe age at which to return the luminosity.

Definition at line 244 of file CInterface.cpp.

◆ envelope_inertia_array()

void envelope_inertia_array ( EvolvingStar star,
const double *  age,
unsigned  nvalues,
double *  result 
)

The moment of inertia of the stellar envelope at a given array of ages.

Parameters
starThe star whose luminosity to return.
ageThe age at which to return the luminosity.
nvaluesThe number of ages at which evaluation is required.
resultA pre-allocated memory (size: nvalues) where to place the result.

Definition at line 264 of file CInterface.cpp.

◆ envelope_inertia_deriv()

double envelope_inertia_deriv ( EvolvingStar star,
double  age,
int  deriv_order 
)

One of the derivatives of the moment of inertia of the stellar envelope at a given age.

Parameters
starThe star whose luminosity to return.
ageThe age at which to return the luminosity.
deriv_orderThe order of the derivative to return (0, 1, or 2).

Definition at line 254 of file CInterface.cpp.

◆ envelope_inertia_deriv_array()

void envelope_inertia_deriv_array ( EvolvingStar star,
const double *  age,
int  deriv_order,
unsigned  nvalues,
double *  result 
)

One of the derivatives of the moment of inertia of the stellar envelope at a given array of ages.

Parameters
starThe star whose luminosity to return.
ageThe ages at which to return the moment of inertia.
deriv_orderThe orde of the derivate to return (0, 1, or 2).
nvaluesThe number of ages at which evaluation is required.
resultA pre-allocated memory (size: nvalues) where to place the result.

Definition at line 280 of file CInterface.cpp.

◆ lag_from_lgQ()

double lag_from_lgQ ( double  lgQ)

Converts lg(Q) to a tidal phase lag.

Definition at line 17 of file CInterface.cpp.

◆ lifetime()

double lifetime ( const EvolvingStar star)

The lifetime of a star (the maximum age at which it can be queried)

Parameters
starThe star whose lifetime to return.

Definition at line 133 of file CInterface.cpp.

◆ luminosity()

double luminosity ( EvolvingStar star,
double  age 
)

The luminosity of a star at a given age.

Parameters
starThe star whose luminosity to return.
ageThe age at which to return the luminosity.

Definition at line 140 of file CInterface.cpp.

◆ luminosity_array()

void luminosity_array ( EvolvingStar star,
const double *  age,
unsigned  nvalues,
double *  result 
)

The luminosity of a star at a given array of ages.

Parameters
starThe star whose luminosity to return.
ageThe ages at which to return the luminosity.
nvaluesThe number of ages at which evaluation is required.
resultA pre-allocated memory (size: nvalues) where to place the result.

Definition at line 150 of file CInterface.cpp.

◆ modified_phase_lag()

double modified_phase_lag ( const EvolvingStar star,
unsigned  zone_index,
int  orbital_frequency_multiplier,
int  spin_frequency_multiplier,
double  forcing_frequency,
int  entry,
double *  above_lock_value 
)

See Evolve::BrokenPowerlawPhaseLagZone::modified_phase_lag for details.

Parameters
starThe star to get the modified phase lag for.
zone_indexThe index of the zone whose modified phase lag to return.
orbital_frequency_multiplierThe multiplier of the orbital frequency in the expression for the forcing frequency.
spin_frequency_multiplierThe multiplier of the spin frequency in the expression for the forcing frequency.
forcing_frequencyThe current forcing frequency in rad/day.
entryThe return value should be either the phase lag itself (NO_DERIV) or its derivative w.r.t. the specified quantity.
above_lock_valueIf the lag of a locked term is calculated this should be set to the lag assuming the spin frequency is just above the lock. Otherwise, leave untouched.

Definition at line 107 of file CInterface.cpp.

◆ select_interpolation_region()

void select_interpolation_region ( const EvolvingStar star,
double  age 
)

Prepare the zone quantities for interpolation around the given age.

See EvolvingStar::select_interpolation_region() for details.

Parameters
starThe star to select the interpolation region for.
ageThe age around which interpolation should work.

Definition at line 99 of file CInterface.cpp.

◆ set_star_dissipation()

void set_star_dissipation ( EvolvingStar star,
unsigned  zone_index,
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 
)

Set the dissipative properties of one of the zones of a star.

Parameters
starThe star to set the dissipation for.
zone_indexWhich zone to set the dissiaption for (0 - envelope, 1 - core).
num_tidal_frequency_breaksSee same name argument to set_zone_dissipation()
num_spin_frequency_breaksSee same name argument to set_zone_dissipation()
tidal_frequency_breaksSee same name argument to set_zone_dissipation()
spin_frequency_breaksSee same name argument to set_zone_dissipation()
tidal_frequency_powersSee same name argument to set_zone_dissipation()
spin_frequency_powersSee same name argument to set_zone_dissipation()
reference_phase_lagSee same name argument to set_zone_dissipation()
inertial_mode_enhancementSee same name argument to set_zone_dissipation()
inertial_mode_sharpnessSee same name argument to set_zone_dissipation()

Definition at line 49 of file CInterface.cpp.

◆ star_radius()

double star_radius ( EvolvingStar star,
double  age 
)

The radius of the star at a given age.

Parameters
starThe star whose radius to return.
ageThe age at which to return the stellar radius.

Definition at line 297 of file CInterface.cpp.

◆ star_radius_array()

void star_radius_array ( EvolvingStar star,
const double *  age,
unsigned  nvalues,
double *  result 
)

The radius of the star at an array of ages.

Parameters
starThe star whose radius to return.
ageThe ages at which to return the stellar radius.
nvaluesThe number of ages at which evaluation is required.
resultA pre-allocated memory (size: nvalues) where to place the result.

Definition at line 308 of file CInterface.cpp.

Variable Documentation

◆ AGE_DERIV

const int AGE_DERIV = Evolve::Dissipation::AGE

Identifier for differentiating the phase lag w.r.t. age.

Definition at line 13 of file CInterface.cpp.

◆ NO_DERIV

const int NO_DERIV = Evolve::Dissipation::NO_DERIV

Identifier for not differentiating the phase lag.

Identifier for not differentiating the phase lag.

Definition at line 12 of file CInterface.cpp.

◆ ORBITAL_FREQUENCY_DERIV

const int ORBITAL_FREQUENCY_DERIV = Evolve::Dissipation::ORBITAL_FREQUENCY

Identifier for differentiating the phase lag w.r.t. orbital freuqency.

Definition at line 15 of file CInterface.cpp.

◆ SPIN_FREQUENCY_DERIV

const int SPIN_FREQUENCY_DERIV = Evolve::Dissipation::SPIN_FREQUENCY

Identifier for differentiating the phase lag w.r.t. spin freuqency.

Definition at line 14 of file CInterface.cpp.