Planetary Orbital Evolution due to Tides
Orbital evolution of two objects experiencing tides
CInterface.h
Go to the documentation of this file.
1 
13 #include "../Core/SharedLibraryExportMacros.h"
14 #include "MESAIO.h"
15 
16 extern "C" {
18  LIB_PUBLIC extern const int RADIUS;
19 
22  LIB_PUBLIC extern const int ICONV;
23 
25  LIB_PUBLIC extern const int LUM;
26 
29  LIB_PUBLIC extern const int IRAD;
30 
33  LIB_PUBLIC extern const int MRAD;
34 
37  LIB_PUBLIC extern const int RRAD;
38 
40  LIB_PUBLIC extern const int NUM_QUANTITIES;
41 
43  struct LIB_PUBLIC MESAInterpolator;
44 
47  struct LIB_PUBLIC EvolvingStellarQuantity;
48 
55  const char *mesa_dir,
56 
59  double *smoothing,
60 
63  int *nodes,
64 
68  bool *vs_log_age,
69 
72  bool *log_quantity,
73 
75  unsigned num_threads
76  );
77 
79  LIB_PUBLIC void destroy_interpolator(
82  MESAInterpolator *interpolator
83  );
84 
88  LIB_PUBLIC const EvolvingStellarQuantity* create_quantity(
90  const MESAInterpolator* interpolator,
91 
94  int quantityID,
95 
97  double mass,
98 
100  double feh
101  );
102 
104  LIB_PUBLIC void destroy_quantity(
107  EvolvingStellarQuantity *quantity
108  );
109 
111  LIB_PUBLIC double evaluate_quantity(
114  const EvolvingStellarQuantity* quantity,
115 
117  double age
118  );
119 
121  LIB_PUBLIC void evaluate_quantity_array(
124  const EvolvingStellarQuantity *quantity,
125 
127  double *age,
128 
130  unsigned nvalues,
131 
133  double *result
134  );
135 
137  LIB_PUBLIC void differentiate_quantity(
140  const EvolvingStellarQuantity* quantity,
141 
143  double age,
144 
146  double *result
147  );
148 
156  LIB_PUBLIC void differentiate_quantity_array(
159  const EvolvingStellarQuantity *quantity,
160 
162  double *age,
163 
165  unsigned nvalues,
166 
169  double *result
170  );
171 
173  LIB_PUBLIC double quantity_min_age(
176  const EvolvingStellarQuantity* quantity
177  );
178 
180  LIB_PUBLIC double quantity_max_age(
183  const EvolvingStellarQuantity* quantity
184  );
185 
188  LIB_PUBLIC void quantity_continuous_range(
189  const EvolvingStellarQuantity* quantity,
190  double age,
191  double *range_min,
192  double *range_max
193  );
194 
195 #ifndef NO_SERIALIZE
196  LIB_PUBLIC void save_interpolator(
200  MESAInterpolator *interpolator,
201 
203  const char *filename
204  );
205 
209  const char *filename
210  );
211 #endif
212 
214  LIB_PUBLIC double default_smoothing(
216  int quantityID
217  );
218 
221  LIB_PUBLIC int default_nodes(
223  int quantityID
224  );
225 
228  LIB_PUBLIC bool default_vs_log_age(
230  int quantityID
231  );
232 
235  LIB_PUBLIC bool default_log_quantity(
237  int quantityID
238  );
239 
241  LIB_PUBLIC double metallicity_from_feh(double feh);
242 
244  LIB_PUBLIC double feh_from_metallicity(double metallicity);
245 
247  LIB_PUBLIC double feh_from_z(double z);
248 
250  LIB_PUBLIC double z_from_feh(double feh);
251 
252 } //End extern "C"
253 
LIB_PUBLIC double metallicity_from_feh(double feh)
Alias for StellarEvolution::metallicity_from_feh()
Definition: CInterface.cpp:239
LIB_PUBLIC void destroy_interpolator(MESAInterpolator *interpolator)
Destroy a previously created interpolator.
Definition: CInterface.cpp:46
LIB_PUBLIC const int RADIUS
Identifier for the stellar radius as an interpolation quantity.
struct LIB_PUBLIC EvolvingStellarQuantity
Opaque struct to cast to/from StellarEvolution::EvolvingStellarQuantity pointers. ...
Definition: CInterface.h:47
LIB_PUBLIC MESAInterpolator * load_interpolator(const char *filename)
Load a previously saved interpolator state (faster than creating it).
Definition: CInterface.cpp:198
LIB_PUBLIC const int ICONV
Identifier for the convective zone moment of inertia as an interpolation quantity.
Definition: CInterface.cpp:12
LIB_PUBLIC bool default_vs_log_age(int quantityID)
Return whether by default the given quantity is interpolated vs. log(age).
Definition: CInterface.cpp:223
LIB_PUBLIC double quantity_max_age(const EvolvingStellarQuantity *quantity)
Return the maximum age for which the quantity is defined.
Definition: CInterface.cpp:167
LIB_PUBLIC const int LUM
Identifier for the stellar luminosity as an interpolation quantity.
Definition: CInterface.cpp:13
struct LIB_PUBLIC MESAInterpolator
Opaque struct to cast to/from StellarEvolution::Interpolator pointers.
Definition: CInterface.h:43
LIB_PUBLIC double evaluate_quantity(const EvolvingStellarQuantity *quantity, double age)
Evaluate a stellar quantity at a given age.
Definition: CInterface.cpp:82
LIB_PUBLIC void differentiate_quantity(const EvolvingStellarQuantity *quantity, double age, double *result)
Calculate the zeroth, first and second derivatives of a quantity.
Definition: CInterface.cpp:116
LIB_PUBLIC const EvolvingStellarQuantity * create_quantity(const MESAInterpolator *interpolator, int quantityID, double mass, double feh)
Create a single quantity interpolation for a given star.
Definition: CInterface.cpp:53
LIB_PUBLIC double default_smoothing(int quantityID)
Return the default smoothing argument used for the given quantity.
Definition: CInterface.cpp:207
Defines the classes for generating stellar evolution interpolators from the MESA tracks.
LIB_PUBLIC void differentiate_quantity_array(const EvolvingStellarQuantity *quantity, double *age, unsigned nvalues, double *result)
Calculate the derivatives of a quantity at an array of ages.
Definition: CInterface.cpp:132
LIB_PUBLIC void quantity_continuous_range(const EvolvingStellarQuantity *quantity, double age, double *range_min, double *range_max)
Return the range of ages surrounding a given age over which a quantity is guaranteed continuous...
Definition: CInterface.cpp:175
LIB_PUBLIC double feh_from_metallicity(double metallicity)
Alias for StellarEvolution::feh_from_metallicity()
Definition: CInterface.cpp:244
LIB_PUBLIC const int IRAD
Identifier for the radiative zone moment of inertia as an interpolation quantity. ...
Definition: CInterface.cpp:14
LIB_PUBLIC const int NUM_QUANTITIES
The number of interpolation quantities currentyl supported.
Definition: CInterface.cpp:17
LIB_PUBLIC int default_nodes(int quantityID)
Return the default number of interpolation nodes used for the given quantity.
Definition: CInterface.cpp:215
LIB_PUBLIC void evaluate_quantity_array(const EvolvingStellarQuantity *quantity, double *age, unsigned nvalues, double *result)
Evaluate a stellar quantity at an array of ages.
Definition: CInterface.cpp:93
LIB_PUBLIC bool default_log_quantity(int quantityID)
Return whether by default the log(given quantity) is interpolated vs. the quantity itself...
Definition: CInterface.cpp:231
LIB_PUBLIC double feh_from_z(double z)
Calculate [Fe/H] given Z (metal mass fraction) for a star.
Definition: CInterface.cpp:249
LIB_PUBLIC void save_interpolator(MESAInterpolator *interpolator, const char *filename)
Save the state of an interpolator for faster creation.
Definition: CInterface.cpp:191
LIB_PUBLIC const int MRAD
Identifier for the radiative zone mass of inertia as an interpolation quantity.
Definition: CInterface.cpp:15
LIB_PUBLIC double quantity_min_age(const EvolvingStellarQuantity *quantity)
Return the minimum age for which the quantity is defined.
Definition: CInterface.cpp:159
LIB_PUBLIC MESAInterpolator * create_interpolator(const char *mesa_dir, double *smoothing, int *nodes, bool *vs_log_age, bool *log_quantity, unsigned num_threads)
Create an interpolator from a directory containing MESA tracks.
Definition: CInterface.cpp:19
LIB_PUBLIC const int RRAD
Identifier for the convective-radiative boundary as an interpolation quantity.
Definition: CInterface.cpp:16
LIB_PUBLIC double z_from_feh(double feh)
Calculate Z (metal mass fraction) given [Fe/H] for a star.
Definition: CInterface.cpp:256
LIB_PUBLIC void destroy_quantity(EvolvingStellarQuantity *quantity)
Destroy a previously created evolving stellar quantity.
Definition: CInterface.cpp:75