8 #define BUILDING_LIBRARY 10 #include "../Evolve/CInterface.h" 19 return 15.0 / (16.0 * M_PI * std::pow(10.0, lgQ));
25 double wind_saturation_frequency,
26 double diff_rot_coupling_timescale,
34 wind_saturation_frequency,
35 diff_rot_coupling_timescale,
36 *reinterpret_cast<const StellarEvolution::MESA::Interpolator*>(
51 unsigned num_tidal_frequency_breaks,
52 unsigned num_spin_frequency_breaks,
53 double *tidal_frequency_breaks,
54 double *spin_frequency_breaks,
55 double *tidal_frequency_powers,
56 double *spin_frequency_powers,
57 double reference_phase_lag,
58 double inertial_mode_enhancement,
59 double inertial_mode_sharpness)
64 if(zone_index == 0) zone = &(real_star->
envelope());
65 else zone = &(real_star->
core());
68 std::cerr <<
"Setting zone " 70 <<
" dissipation with " 71 << num_tidal_frequency_breaks
73 << num_spin_frequency_breaks
74 <<
" spin frequency breaks." 79 reinterpret_cast<BrokenPowerlawPhaseLagZone*>(zone),
80 num_tidal_frequency_breaks,
81 num_spin_frequency_breaks,
82 tidal_frequency_breaks,
83 spin_frequency_breaks,
84 tidal_frequency_powers,
85 spin_frequency_powers,
87 inertial_mode_enhancement,
88 inertial_mode_sharpness
96 )->detect_saturation();
109 int orbital_frequency_multiplier,
110 int spin_frequency_multiplier,
111 double forcing_frequency,
113 double *above_lock_value)
117 )->zone(zone_index).modified_phase_lag(
118 orbital_frequency_multiplier,
119 spin_frequency_multiplier,
121 static_cast<Evolve::Dissipation::QuantityEntry>(entry),
130 )->core().formation_age();
159 for(
unsigned i = 0; i < nvalues; ++i) {
198 for(
unsigned i = 0; i < nvalues; ++i) {
217 reinterpret_cast<Star::InterpolatedEvolutionStar*>(
234 reinterpret_cast<Star::InterpolatedEvolutionStar*>(
270 reinterpret_cast<Star::InterpolatedEvolutionStar*>(
287 reinterpret_cast<Star::InterpolatedEvolutionStar*>(
317 for(
unsigned i = 0; i < nvalues; ++i) {
double outer_radius(double age, int deriv_order=0) const
See DissipatingZone::outer_radius(double, int).
void star_radius_array(EvolvingStar *star, const double *age, unsigned nvalues, double *result)
The radius of the star at an array of ages.
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...
double core_formation_age(const EvolvingStar *star)
The age at which the core of a star forms.
SPIN_FREQUENCY
The derivative w.r.t. the spin frequency of a dissipating zone.
Declare C-style functions for accessing the functionality of the Evolve library.
const int SPIN_FREQUENCY_DERIV
Identifier for differentiating the phase lag w.r.t. spin freuqency.
double lifetime(const EvolvingStar *star)
The lifetime of a star (the maximum age at which it can be queried)
const int AGE_DERIV
Identifier for differentiating the phase lag w.r.t. age.
Base class for zones of low mass evolving stars.
double core_inertia(EvolvingStar *star, double age)
The moment of inertia of the stellar core at a given age.
struct LIB_PUBLIC MESAInterpolator
Opaque struct to cast to/from StellarEvolution::Interpolator pointers.
Radiative core for low mass evolving stars.
const EvolvingStellarCore & core() const
The core of the star.
virtual void select_interpolation_region(double age) const
Prepare the zone quantities for interpolation around the given age.
void destroy_star(EvolvingStar *star)
Destroy a previously created star.
void luminosity_array(EvolvingStar *star, const double *age, unsigned nvalues, double *result)
The luminosity of a star at a given array of ages.
virtual double moment_of_inertia(int deriv_order=0) const =0
Moment of inertia of the zone or its age derivative at the age of last configure() call...
double lag_from_lgQ(double lgQ)
Converts lg(Q) to a tidal phase lag.
double luminosity(EvolvingStar *star, double age)
The luminosity of a star at a given age.
void detect_stellar_wind_saturation(EvolvingStar *star)
double moment_of_inertia(double age, int deriv_order=0) const
See DissipatingZone::moment_of_inertia(double, int)
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...
void reached_critical_age(double age)
Change the body as necessary at the given age.
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.
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...
void select_interpolation_region(const EvolvingStar *star, double age)
Prepare the zone quantities for interpolation around the given age.
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.
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.
Surface convective zone for low mass evolving stars or the entire star for high mass stars...
double envelope_inertia(EvolvingStar *star, double age)
The moment of inertia of the stellar envelope at a given age.
const EvolvingStellarEnvelope & envelope() const
The envelope of the star - inmodifiable.
double moment_of_inertia(int deriv_order=0) const
See DissipatingZone::moment_of_inertia(int).
AGE
The derivative w.r.t. age, excluding the dependence through the body's radius and the moments of iner...
const int NO_DERIV
Identifier for not differentiating the phase lag.
A DissipatingZone where the phase lag is described by a broken powerlaw.
const int ORBITAL_FREQUENCY_DERIV
Identifier for differentiating the phase lag w.r.t. orbital freuqency.
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.
ORBITAL_FREQUENCY
The derivative w.r.t. the orbital frequency.
virtual void reached_critical_age(double age)
Change the star as necessary at the given age.
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.
double luminosity(double age) const
The luminosity of the star at the given age.
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)
double star_radius(EvolvingStar *star, double age)
The radius of the star at a given age.
virtual void select_interpolation_region(double age) const
Prepare the stellar quantities for interpolation around the given age.
virtual double outer_radius(int deriv_order=0) const =0
Outer radius of the zone or its derivative (per last.
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.
struct LIB_PUBLIC EvolvingStar
Opaque struct to cast to/from Star::InterpolatedEvolutionStar.