Planetary Orbital Evolution due to Tides
Orbital evolution of two objects experiencing tides
CInterface.h
Go to the documentation of this file.
1 
10 #include "../StellarEvolution/CInterface.h"
11 #include "../Core/SharedLibraryExportMacros.h"
12 #include "EvolvingStar.h"
13 #include "../Evolve/DissipationQuantities.h"
14 
15 
16 extern "C" {
18  LIB_PUBLIC extern const int NO_DERIV;
19 
21  LIB_PUBLIC extern const int AGE_DERIV;
22 
24  LIB_PUBLIC extern const int SPIN_FREQUENCY_DERIV;
25 
27  LIB_PUBLIC extern const int ORBITAL_FREQUENCY_DERIV;
28 
30  struct LIB_PUBLIC EvolvingStar;
31 
33  LIB_PUBLIC EvolvingStar *create_star(
35  double mass,
36 
38  double feh,
39 
41  double wind_strength,
42 
44  double wind_saturation_frequency,
45 
47  double diff_rot_coupling_timescale,
48 
50  const MESAInterpolator *interpolator
51  );
52 
54  LIB_PUBLIC void destroy_star(
57  EvolvingStar *star
58  );
59 
61  LIB_PUBLIC void set_star_dissipation(
63  EvolvingStar *star,
64 
66  unsigned zone_index,
67 
69  unsigned num_tidal_frequency_breaks,
70 
72  unsigned num_spin_frequency_breaks,
73 
75  double *tidal_frequency_breaks,
76 
78  double *spin_frequency_breaks,
79 
81  double *tidal_frequency_powers,
82 
84  double *spin_frequency_powers,
85 
87  double reference_phase_lag,
88 
90  double inertial_mode_enhancement,
91 
93  double inertial_mode_sharpness
94  );
95 
98  LIB_PUBLIC void detect_stellar_wind_saturation(
100  EvolvingStar *star
101  );
102 
107  LIB_PUBLIC void select_interpolation_region(
109  const EvolvingStar *star,
110 
112  double age
113  );
114 
117  LIB_PUBLIC double modified_phase_lag(
119  const EvolvingStar *star,
120 
122  unsigned zone_index,
123 
126  int orbital_frequency_multiplier,
127 
130  int spin_frequency_multiplier,
131 
133  double forcing_frequency,
134 
137  int deriv,
138 
142  double *above_lock_value
143  );
144 
146  LIB_PUBLIC double core_formation_age(
148  const EvolvingStar *star
149  );
150 
152  LIB_PUBLIC double lifetime(
154  const EvolvingStar *star
155  );
156 
158  LIB_PUBLIC double luminosity(
160  EvolvingStar *star,
161 
163  double age
164  );
165 
167  LIB_PUBLIC void luminosity_array(
169  EvolvingStar *star,
170 
172  const double *age,
173 
175  unsigned nvalues,
176 
178  double *result
179  );
180 
182  LIB_PUBLIC double core_inertia(
184  EvolvingStar *star,
185 
187  double age
188  );
189 
192  LIB_PUBLIC double core_inertia_deriv(
194  EvolvingStar *star,
195 
197  double age,
198 
200  int deriv_order
201  );
202 
204  LIB_PUBLIC void core_inertia_array(
206  EvolvingStar *star,
207 
209  const double *age,
210 
212  unsigned nvalues,
213 
215  double *result
216  );
217 
220  LIB_PUBLIC void core_inertia_deriv_array(
222  EvolvingStar *star,
223 
225  const double *age,
226 
228  int deriv_order,
229 
231  unsigned nvalues,
232 
234  double *result
235  );
236 
238  LIB_PUBLIC double envelope_inertia(
240  EvolvingStar *star,
241 
243  double age
244  );
245 
248  LIB_PUBLIC double envelope_inertia_deriv(
250  EvolvingStar *star,
251 
253  double age,
254 
256  int deriv_order
257  );
258 
259 
262  LIB_PUBLIC void envelope_inertia_array(
264  EvolvingStar *star,
265 
267  const double *age,
268 
270  unsigned nvalues,
271 
273  double *result
274  );
275 
278  LIB_PUBLIC void envelope_inertia_deriv_array(
280  EvolvingStar *star,
281 
283  const double *age,
284 
286  int deriv_order,
287 
289  unsigned nvalues,
290 
292  double *result
293  );
294 
295 
297  LIB_PUBLIC double star_radius(
299  EvolvingStar *star,
300 
302  double age
303  );
304 
306  LIB_PUBLIC void star_radius_array(
308  EvolvingStar *star,
309 
311  const double *age,
312 
314  unsigned nvalues,
315 
317  double *result
318  );
319 
321  LIB_PUBLIC double lag_from_lgQ(double lgQ);
322 
323 } //End extern "C"
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...
Definition: CInterface.cpp:254
LIB_PUBLIC const int NO_DERIV
Identifier for not differentiating the phase lag.
LIB_PUBLIC double lag_from_lgQ(double lgQ)
Converts lg(Q) to a tidal phase lag.
Definition: CInterface.cpp:17
Declares the class for stars that user pre-tabulated stellar evolution tracks.
LIB_PUBLIC const int ORBITAL_FREQUENCY_DERIV
Identifier for differentiating the phase lag w.r.t. orbital freuqency.
Definition: CInterface.cpp:15
LIB_PUBLIC double core_formation_age(const EvolvingStar *star)
The age at which the core of a star forms.
Definition: CInterface.cpp:126
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.
Definition: CInterface.cpp:49
struct LIB_PUBLIC MESAInterpolator
Opaque struct to cast to/from StellarEvolution::Interpolator pointers.
Definition: CInterface.h:43
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...
Definition: CInterface.cpp:280
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.
Definition: CInterface.cpp:182
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...
Definition: CInterface.cpp:227
LIB_PUBLIC const int AGE_DERIV
Identifier for differentiating the phase lag w.r.t. age.
Definition: CInterface.cpp:13
LIB_PUBLIC void destroy_star(EvolvingStar *star)
Destroy a previously created star.
Definition: CInterface.cpp:44
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.
Definition: CInterface.cpp:107
LIB_PUBLIC double star_radius(EvolvingStar *star, double age)
The radius of the star at a given age.
Definition: CInterface.cpp:297
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.
Definition: CInterface.cpp:264
LIB_PUBLIC double luminosity(EvolvingStar *star, double age)
The luminosity of a star at a given age.
Definition: CInterface.cpp:140
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.
Definition: CInterface.cpp:150
LIB_PUBLIC void select_interpolation_region(const EvolvingStar *star, double age)
Prepare the zone quantities for interpolation around the given age.
Definition: CInterface.cpp:99
LIB_PUBLIC double core_inertia(EvolvingStar *star, double age)
The moment of inertia of the stellar core at a given age.
Definition: CInterface.cpp:172
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.
Definition: CInterface.cpp:308
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.
Definition: CInterface.cpp:211
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.
Definition: CInterface.cpp:22
LIB_PUBLIC double envelope_inertia(EvolvingStar *star, double age)
The moment of inertia of the stellar envelope at a given age.
Definition: CInterface.cpp:244
LIB_PUBLIC double lifetime(const EvolvingStar *star)
The lifetime of a star (the maximum age at which it can be queried)
Definition: CInterface.cpp:133
LIB_PUBLIC const int SPIN_FREQUENCY_DERIV
Identifier for differentiating the phase lag w.r.t. spin freuqency.
Definition: CInterface.cpp:14
LIB_PUBLIC void detect_stellar_wind_saturation(EvolvingStar *star)
Definition: CInterface.cpp:92
struct LIB_PUBLIC EvolvingStar
Opaque struct to cast to/from Star::InterpolatedEvolutionStar.
Definition: CInterface.h:30