Declare C-style functions for accessing the functionality of the Star library. More...
#include "../StellarEvolution/CInterface.h"
#include "../Core/SharedLibraryExportMacros.h"
#include "EvolvingStar.h"
#include "../Evolve/DissipationQuantities.h"
Go to the source code of this file.
Functions | |
LIB_PUBLIC 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. More... | |
LIB_PUBLIC void | destroy_star (EvolvingStar *star) |
Destroy a previously created star. More... | |
LIB_PUBLIC 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... | |
LIB_PUBLIC void | detect_stellar_wind_saturation (EvolvingStar *star) |
LIB_PUBLIC void | select_interpolation_region (const EvolvingStar *star, double age) |
Prepare the zone quantities for interpolation around the given age. More... | |
LIB_PUBLIC double | modified_phase_lag (const EvolvingStar *star, unsigned zone_index, int orbital_frequency_multiplier, int spin_frequency_multiplier, double forcing_frequency, int deriv, double *above_lock_value) |
See Evolve::BrokenPowerlawPhaseLagZone::modified_phase_lag for details. More... | |
LIB_PUBLIC double | core_formation_age (const EvolvingStar *star) |
The age at which the core of a star forms. More... | |
LIB_PUBLIC double | lifetime (const EvolvingStar *star) |
The lifetime of a star (the maximum age at which it can be queried) More... | |
LIB_PUBLIC double | luminosity (EvolvingStar *star, double age) |
The luminosity of a star at a given age. More... | |
LIB_PUBLIC void | luminosity_array (EvolvingStar *star, const double *age, unsigned nvalues, double *result) |
The luminosity of a star at a given array of ages. More... | |
LIB_PUBLIC double | core_inertia (EvolvingStar *star, double age) |
The moment of inertia of the stellar core at a given age. More... | |
LIB_PUBLIC 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... | |
LIB_PUBLIC 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... | |
LIB_PUBLIC 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... | |
LIB_PUBLIC double | envelope_inertia (EvolvingStar *star, double age) |
The moment of inertia of the stellar envelope at a given age. More... | |
LIB_PUBLIC 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... | |
LIB_PUBLIC 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... | |
LIB_PUBLIC 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... | |
LIB_PUBLIC double | star_radius (EvolvingStar *star, double age) |
The radius of the star at a given age. More... | |
LIB_PUBLIC void | star_radius_array (EvolvingStar *star, const double *age, unsigned nvalues, double *result) |
The radius of the star at an array of ages. More... | |
LIB_PUBLIC double | lag_from_lgQ (double lgQ) |
Converts lg(Q) to a tidal phase lag. More... | |
Variables | |
LIB_PUBLIC const int | NO_DERIV |
Identifier for not differentiating the phase lag. More... | |
LIB_PUBLIC const int | AGE_DERIV |
Identifier for differentiating the phase lag w.r.t. age. More... | |
LIB_PUBLIC const int | SPIN_FREQUENCY_DERIV |
Identifier for differentiating the phase lag w.r.t. spin freuqency. More... | |
LIB_PUBLIC const int | ORBITAL_FREQUENCY_DERIV |
Identifier for differentiating the phase lag w.r.t. orbital freuqency. More... | |
struct LIB_PUBLIC | EvolvingStar |
Opaque struct to cast to/from Star::InterpolatedEvolutionStar. More... | |
Declare C-style functions for accessing the functionality of the Star library.
Definition in file CInterface.h.
LIB_PUBLIC double core_formation_age | ( | const EvolvingStar * | star | ) |
The age at which the core of a star forms.
star | The star for which to return the core formation age. |
Definition at line 126 of file CInterface.cpp.
LIB_PUBLIC double core_inertia | ( | EvolvingStar * | star, |
double | age | ||
) |
The moment of inertia of the stellar core at a given age.
star | The star whose luminosity to return. |
age | The age at which to return the luminosity. |
Definition at line 172 of file CInterface.cpp.
LIB_PUBLIC 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.
star | The star whose luminosity to return. |
age | The ages at which to return the moment of inertia. |
nvalues | The number of ages at which evaluation is required. |
result | A pre-allocated memory (size: nvalues) where to place the result. |
Definition at line 211 of file CInterface.cpp.
LIB_PUBLIC 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.
star | The star whose luminosity to return. |
age | The age at which to return the luminosity. |
deriv_order | The order of the derivative to return (0, 1, or 2). |
Definition at line 182 of file CInterface.cpp.
LIB_PUBLIC 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.
star | The star whose luminosity to return. |
age | The ages at which to return the moment of inertia. |
deriv_order | The orde of the derivate to return (0, 1, or 2). |
nvalues | The number of ages at which evaluation is required. |
result | A pre-allocated memory (size: nvalues) where to place the result. |
Definition at line 227 of file CInterface.cpp.
LIB_PUBLIC 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.
mass | Mass of the star |
feh | The [Fe/H] of the star |
wind_strength | The strength of the wind. |
wind_saturation_frequency | The frequency at which the wind loss saturates in rad/day. |
diff_rot_coupling_timescale | The timescale for differential rotation coupling. |
interpolator | A StellarEvolution interpolator. |
Definition at line 22 of file CInterface.cpp.
LIB_PUBLIC void destroy_star | ( | EvolvingStar * | star | ) |
Destroy a previously created star.
star | The star to destroy. Must have previously been created using create_star. |
Definition at line 44 of file CInterface.cpp.
LIB_PUBLIC void detect_stellar_wind_saturation | ( | EvolvingStar * | star | ) |
Tell the star to detect its wind saturation state per its current configuration.
star | The star to detect the saturation state of. |
Definition at line 92 of file CInterface.cpp.
LIB_PUBLIC double envelope_inertia | ( | EvolvingStar * | star, |
double | age | ||
) |
The moment of inertia of the stellar envelope at a given age.
star | The star whose luminosity to return. |
age | The age at which to return the luminosity. |
Definition at line 244 of file CInterface.cpp.
LIB_PUBLIC 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.
star | The star whose luminosity to return. |
age | The age at which to return the luminosity. |
nvalues | The number of ages at which evaluation is required. |
result | A pre-allocated memory (size: nvalues) where to place the result. |
Definition at line 264 of file CInterface.cpp.
LIB_PUBLIC 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.
star | The star whose luminosity to return. |
age | The age at which to return the luminosity. |
deriv_order | The order of the derivative to return (0, 1, or 2). |
Definition at line 254 of file CInterface.cpp.
LIB_PUBLIC 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.
star | The star whose luminosity to return. |
age | The ages at which to return the moment of inertia. |
deriv_order | The orde of the derivate to return (0, 1, or 2). |
nvalues | The number of ages at which evaluation is required. |
result | A pre-allocated memory (size: nvalues) where to place the result. |
Definition at line 280 of file CInterface.cpp.
LIB_PUBLIC double lag_from_lgQ | ( | double | lgQ | ) |
Converts lg(Q) to a tidal phase lag.
Definition at line 17 of file CInterface.cpp.
LIB_PUBLIC double lifetime | ( | const EvolvingStar * | star | ) |
The lifetime of a star (the maximum age at which it can be queried)
star | The star whose lifetime to return. |
Definition at line 133 of file CInterface.cpp.
LIB_PUBLIC double luminosity | ( | EvolvingStar * | star, |
double | age | ||
) |
The luminosity of a star at a given age.
star | The star whose luminosity to return. |
age | The age at which to return the luminosity. |
Definition at line 140 of file CInterface.cpp.
LIB_PUBLIC void luminosity_array | ( | EvolvingStar * | star, |
const double * | age, | ||
unsigned | nvalues, | ||
double * | result | ||
) |
The luminosity of a star at a given array of ages.
star | The star whose luminosity to return. |
age | The ages at which to return the luminosity. |
nvalues | The number of ages at which evaluation is required. |
result | A pre-allocated memory (size: nvalues) where to place the result. |
Definition at line 150 of file CInterface.cpp.
LIB_PUBLIC double modified_phase_lag | ( | const EvolvingStar * | star, |
unsigned | zone_index, | ||
int | orbital_frequency_multiplier, | ||
int | spin_frequency_multiplier, | ||
double | forcing_frequency, | ||
int | deriv, | ||
double * | above_lock_value | ||
) |
See Evolve::BrokenPowerlawPhaseLagZone::modified_phase_lag for details.
star | The star to get the modified phase lag for. |
zone_index | The index of the zone whose modified phase lag to return. |
orbital_frequency_multiplier | The multiplier of the orbital frequency in the expression for the forcing frequency. |
spin_frequency_multiplier | The multiplier of the spin frequency in the expression for the forcing frequency. |
forcing_frequency | The current forcing frequency in rad/day. |
deriv | The return value should be either the phase lag itself (NO_DERIV) or its derivative w.r.t. the specified quantity. |
above_lock_value | If 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.
LIB_PUBLIC 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.
star | The star to select the interpolation region for. |
age | The age around which interpolation should work. |
Definition at line 99 of file CInterface.cpp.
LIB_PUBLIC 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.
star | The star to set the dissipation for. |
zone_index | Which zone to set the dissiaption for (0 - envelope, 1 - core). |
num_tidal_frequency_breaks | See same name argument to set_zone_dissipation() |
num_spin_frequency_breaks | See same name argument to set_zone_dissipation() |
tidal_frequency_breaks | See same name argument to set_zone_dissipation() |
spin_frequency_breaks | See same name argument to set_zone_dissipation() |
tidal_frequency_powers | See same name argument to set_zone_dissipation() |
spin_frequency_powers | See same name argument to set_zone_dissipation() |
reference_phase_lag | See same name argument to set_zone_dissipation() |
inertial_mode_enhancement | See same name argument to set_zone_dissipation() |
inertial_mode_sharpness | See same name argument to set_zone_dissipation() |
Definition at line 49 of file CInterface.cpp.
LIB_PUBLIC double star_radius | ( | EvolvingStar * | star, |
double | age | ||
) |
The radius of the star at a given age.
star | The star whose radius to return. |
age | The age at which to return the stellar radius. |
Definition at line 297 of file CInterface.cpp.
LIB_PUBLIC void star_radius_array | ( | EvolvingStar * | star, |
const double * | age, | ||
unsigned | nvalues, | ||
double * | result | ||
) |
The radius of the star at an array of ages.
star | The star whose radius to return. |
age | The ages at which to return the stellar radius. |
nvalues | The number of ages at which evaluation is required. |
result | A pre-allocated memory (size: nvalues) where to place the result. |
Definition at line 308 of file CInterface.cpp.
LIB_PUBLIC const int AGE_DERIV |
Identifier for differentiating the phase lag w.r.t. age.
Definition at line 13 of file CInterface.cpp.
struct LIB_PUBLIC EvolvingStar |
Opaque struct to cast to/from Star::InterpolatedEvolutionStar.
Definition at line 30 of file CInterface.h.
LIB_PUBLIC const int NO_DERIV |
Identifier for not differentiating the phase lag.
Identifier for not differentiating the phase lag.
Definition at line 63 of file DissipationQuantities.h.
LIB_PUBLIC const int ORBITAL_FREQUENCY_DERIV |
Identifier for differentiating the phase lag w.r.t. orbital freuqency.
Definition at line 15 of file CInterface.cpp.
LIB_PUBLIC const int SPIN_FREQUENCY_DERIV |
Identifier for differentiating the phase lag w.r.t. spin freuqency.
Definition at line 14 of file CInterface.cpp.