Planetary Orbital Evolution due to Tides
Orbital evolution of two objects experiencing tides
CInterface.h
Go to the documentation of this file.
1 
9 #include "../Core/SharedLibraryExportMacros.h"
10 #include "DiskBinarySystem.h"
11 #include "OrbitSolver.h"
12 #include "../Star/CInterface.h"
13 #include "../Planet/CInterface.h"
14 
15 extern "C" {
18  LIB_PUBLIC extern const int LOCKED_SURFACE_SPIN_EVOL_MODE;
19 
21  LIB_PUBLIC extern const int BINARY_EVOL_MODE;
22 
25  LIB_PUBLIC extern const int SINGLE_EVOL_MODE;
26 
29  LIB_PUBLIC extern const int TABULATION_EVOL_MODE;
30 
32  LIB_PUBLIC extern const double NaN;
33 
35  struct LIB_PUBLIC DiskBinarySystem;
36 
38  struct LIB_PUBLIC OrbitSolver;
39 
41  struct LIB_PUBLIC BrokenPowerlawPhaseLagZone;
42 
45  const char *filename
46  );
47 
48  LIB_PUBLIC void set_zone_dissipation(
51 
53  unsigned num_tidal_frequency_breaks,
54 
56  unsigned num_spin_frequency_breaks,
57 
60  double *tidal_frequency_breaks,
61 
64  double *spin_frequency_breaks,
65 
70  double *tidal_frequency_powers,
71 
76  double *spin_frequency_powers,
77 
80  double reference_phase_lag,
81 
85  double inertial_mode_enhancement,
86 
89  double inertial_mode_sharpness
90  );
91 
96  EvolvingStar *star,
97 
100  CPlanet *planet,
101 
104  double initial_semimajor,
105 
107  double initial_eccentricity,
108 
111  double initial_inclination,
112 
115  double disk_lock_frequency,
116 
118  double disk_dissipation_age,
119 
121  double secondary_formation_age
122  );
123 
128  EvolvingStar *primary,
129 
132  EvolvingStar *secondary,
133 
136  double initial_semimajor,
137 
139  double initial_eccentricity,
140 
143  double initial_inclination,
144 
147  double disk_lock_frequency,
148 
150  double disk_dissipation_age,
151 
153  double secondary_formation_age
154  );
155 
157  LIB_PUBLIC void destroy_binary(
159  DiskBinarySystem *system
160  );
161 
166  LIB_PUBLIC void configure_planet(
168  CPlanet *planet,
169 
171  double age,
172 
174  double companion_mass,
175 
177  double semimajor,
178 
180  double eccentricity,
181 
184  const double *spin_angmom,
185 
188  const double *inclination,
189 
193  const double *periapsis,
194 
197  bool locked_surface,
198 
202  bool zero_outer_inclination,
203 
207  bool zero_outer_periapsis
208  );
209 
214  LIB_PUBLIC void configure_star(
216  EvolvingStar *star,
217 
219  double age,
220 
222  double companion_mass,
223 
225  double semimajor,
226 
228  double eccentricity,
229 
232  const double *spin_angmom,
233 
236  const double *inclination,
237 
241  const double *periapsis,
242 
245  bool locked_surface,
246 
250  bool zero_outer_inclination,
251 
255  bool zero_outer_periapsis
256  );
257 
259  LIB_PUBLIC void configure_system(
261  DiskBinarySystem *system,
262 
264  double age,
265 
267  double semimajor,
268 
270  double eccentricity,
271 
274  const double *spin_angmom,
275 
279  const double *inclination,
280 
284  const double *periapsis,
285 
288  int evolution_mode
289  );
290 
292  LIB_PUBLIC OrbitSolver *evolve_system(
294  DiskBinarySystem *system,
295 
298  double final_age,
299 
301  double max_time_step,
302 
304  double precision,
305 
307  double *required_ages,
308 
310  unsigned num_required_ages,
311 
313  bool print_progress,
314 
317  //values results in infinite timeout.
318  double max_runtime
319  );
320 
322  LIB_PUBLIC void destroy_solver(
324  OrbitSolver *solver
325  );
326 
328  LIB_PUBLIC unsigned num_evolution_steps(
330  OrbitSolver *solver
331  );
332 
338  LIB_PUBLIC void get_star_planet_evolution(
340  const OrbitSolver *solver,
341 
343  const DiskBinarySystem *system,
344 
346  const EvolvingStar *star,
347 
349  const CPlanet *planet,
350 
353  double *age,
354 
357  double *semimajor,
358 
361  double *eccentricity,
362 
365  double *envelope_inclination,
366 
369  double *core_inclination,
370 
373  double *envelope_periapsis,
374 
377  double *core_periapsis,
378 
381  double *envelope_angmom,
382 
385  double *core_angmom,
386 
390  double *planet_inclination,
391 
394  double *planet_periapsis,
395 
398  double *planet_angmom,
399 
401  int *evolution_mode,
402 
406  bool *wind_saturation,
407 
410  double *semimajor_rate,
411 
414  double *eccentricity_rate,
415 
418  double *envelope_inclination_rate,
419 
422  double *core_inclination_rate,
423 
426  double *envelope_periapsis_rate,
427 
430  double *core_periapsis_rate,
431 
434  double *envelope_angmom_rate,
435 
438  double *core_angmom_rate,
439 
443  double *planet_inclination_rate,
444 
448  double *planet_periapsis_rate,
449 
452  double *planet_angmom_rate
453  );
454 
460  LIB_PUBLIC void get_star_star_evolution(
462  const OrbitSolver *solver,
463 
465  const DiskBinarySystem *system,
466 
468  const EvolvingStar *primary,
469 
471  const EvolvingStar *secondary,
472 
475  double *age,
476 
479  double *semimajor,
480 
483  double *eccentricity,
484 
487  double *primary_envelope_inclination,
488 
491  double *primary_core_inclination,
492 
495  double *primary_envelope_periapsis,
496 
499  double *primary_core_periapsis,
500 
503  double *primary_envelope_angmom,
504 
507  double *primary_core_angmom,
508 
511  double *secondary_envelope_inclination,
512 
515  double *secondary_core_inclination,
516 
519  double *secondary_envelope_periapsis,
520 
523  double *secondary_core_periapsis,
524 
527  double *secondary_envelope_angmom,
528 
531  double *secondary_core_angmom,
532 
534  int *evolution_mode,
535 
539  bool *primary_wind_saturation,
540 
544  bool *secondary_wind_saturation,
545 
548  double *semimajor_rate,
549 
552  double *eccentricity_rate,
553 
556  double *primary_envelope_inclination_rate,
557 
560  double *primary_core_inclination_rate,
561 
564  double *primary_envelope_periapsis_rate,
565 
568  double *primary_core_periapsis_rate,
569 
572  double *primary_envelope_angmom_rate,
573 
576  double *primary_core_angmom_rate,
577 
580  double *secondary_envelope_inclination_rate,
581 
584  double *secondary_core_inclination_rate,
585 
588  double *secondary_envelope_periapsis_rate,
589 
592  double *secondary_core_periapsis_rate,
593 
596  double *secondary_envelope_angmom_rate,
597 
600  double *secondary_core_angmom_rate
601  );
602 
608  LIB_PUBLIC void get_star_planet_final_state(
610  const OrbitSolver *solver,
611 
613  const DiskBinarySystem *system,
614 
616  const EvolvingStar *star,
617 
619  const CPlanet *planet,
620 
623  double *age,
624 
627  double *semimajor,
628 
631  double *eccentricity,
632 
635  double *envelope_inclination,
636 
639  double *core_inclination,
640 
643  double *envelope_periapsis,
644 
647  double *core_periapsis,
648 
651  double *envelope_angmom,
652 
655  double *core_angmom,
656 
660  double *planet_inclination,
661 
664  double *planet_periapsis,
665 
668  double *planet_angmom,
669 
671  int *evolution_mode,
672 
676  bool *wind_saturation
677  );
678 
684  LIB_PUBLIC void get_star_star_final_state(
686  const OrbitSolver *solver,
687 
689  const DiskBinarySystem *system,
690 
692  const EvolvingStar *primary,
693 
695  const EvolvingStar *secondary,
696 
699  double *age,
700 
703  double *semimajor,
704 
707  double *eccentricity,
708 
711  double *primary_envelope_inclination,
712 
715  double *primary_core_inclination,
716 
719  double *primary_envelope_periapsis,
720 
723  double *primary_core_periapsis,
724 
727  double *primary_envelope_angmom,
728 
731  double *primary_core_angmom,
732 
735  double *secondary_envelope_inclination,
736 
739  double *secondary_core_inclination,
740 
743  double *secondary_envelope_periapsis,
744 
747  double *secondary_core_periapsis,
748 
751  double *secondary_envelope_angmom,
752 
755  double *secondary_core_angmom,
756 
758  int *evolution_mode,
759 
763  bool *primary_wind_saturation,
764 
768  bool *secondary_wind_saturation
769  );
770 
771 }//End Extern "C"
LIB_PUBLIC const double NaN
Not a number.
Definition: Common.h:33
LIB_PUBLIC 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)
Definition: CInterface.cpp:22
LIB_PUBLIC void configure_system(DiskBinarySystem *system, double age, double semimajor, double eccentricity, const double *spin_angmom, const double *inclination, const double *periapsis, int evolution_mode)
Sets the current state of a system.
Definition: CInterface.cpp:175
LIB_PUBLIC OrbitSolver * evolve_system(DiskBinarySystem *system, double final_age, double max_time_step, double precision, double *required_ages, unsigned num_required_ages, bool print_progress, double max_runtime)
Calculate the evolution of a previously configured binary system.
Definition: CInterface.cpp:197
LIB_PUBLIC void configure_planet(CPlanet *planet, double age, double companion_mass, double semimajor, double eccentricity, const double *spin_angmom, const double *inclination, const double *periapsis, bool locked_surface, bool zero_outer_inclination, bool zero_outer_periapsis)
Defines the orbit a planet is in.
Definition: CInterface.cpp:148
struct LIB_PUBLIC BrokenPowerlawPhaseLagZone
Opaque struct to cant to/from Evolve::BrokenPowerlawPhasLagZone.
Definition: CInterface.h:41
struct LIB_PUBLIC OrbitSolver
Opaque struct to cast to/from Evolve::OrbitSolver.
Definition: CInterface.h:38
LIB_PUBLIC void get_star_star_evolution(const OrbitSolver *solver, const DiskBinarySystem *system, const EvolvingStar *primary, const EvolvingStar *secondary, double *age, double *semimajor, double *eccentricity, double *primary_envelope_inclination, double *primary_core_inclination, double *primary_envelope_periapsis, double *primary_core_periapsis, double *primary_envelope_angmom, double *primary_core_angmom, double *secondary_envelope_inclination, double *secondary_core_inclination, double *secondary_envelope_periapsis, double *secondary_core_periapsis, double *secondary_envelope_angmom, double *secondary_core_angmom, int *evolution_mode, bool *primary_wind_saturation, bool *secondary_wind_saturation, double *semimajor_rate, double *eccentricity_rate, double *primary_envelope_inclination_rate, double *primary_core_inclination_rate, double *primary_envelope_periapsis_rate, double *primary_core_periapsis_rate, double *primary_envelope_angmom_rate, double *primary_core_angmom_rate, double *secondary_envelope_inclination_rate, double *secondary_core_inclination_rate, double *secondary_envelope_periapsis_rate, double *secondary_core_periapsis_rate, double *secondary_envelope_angmom_rate, double *secondary_core_angmom_rate)
Fill C-style arrays with the calculated evolution of a binary star system.
Definition: CInterface.cpp:454
LIB_PUBLIC void destroy_solver(OrbitSolver *solver)
Destroy a solver created by evolve_system.
Definition: CInterface.cpp:229
LIB_PUBLIC const int BINARY_EVOL_MODE
Evolution mode ID for when the two bodies orbit each other.
Definition: CInterface.cpp:12
Defines the OrbitSolver class, the various stopping conditions and a number of other classes used whi...
struct LIB_PUBLIC DiskBinarySystem
Opaque struct to cast to/from Evolve::DiskBinarySystem.
Definition: CInterface.h:35
LIB_PUBLIC void get_star_planet_evolution(const OrbitSolver *solver, const DiskBinarySystem *system, const EvolvingStar *star, const CPlanet *planet, double *age, double *semimajor, double *eccentricity, double *envelope_inclination, double *core_inclination, double *envelope_periapsis, double *core_periapsis, double *envelope_angmom, double *core_angmom, double *planet_inclination, double *planet_periapsis, double *planet_angmom, int *evolution_mode, bool *wind_saturation, double *semimajor_rate, double *eccentricity_rate, double *envelope_inclination_rate, double *core_inclination_rate, double *envelope_periapsis_rate, double *core_periapsis_rate, double *envelope_angmom_rate, double *core_angmom_rate, double *planet_inclination_rate, double *planet_periapsis_rate, double *planet_angmom_rate)
Fill C-style arrays with the calculated evolution of a star-planet system.
Definition: CInterface.cpp:391
LIB_PUBLIC void destroy_binary(DiskBinarySystem *system)
Destroy a previously created binary system.
Definition: CInterface.cpp:116
LIB_PUBLIC const int LOCKED_SURFACE_SPIN_EVOL_MODE
Evolution mode ID for when the surface rotation of one of the bodies is locked to a prescribed value...
Definition: CInterface.cpp:11
LIB_PUBLIC DiskBinarySystem * create_star_star_system(EvolvingStar *primary, EvolvingStar *secondary, double initial_semimajor, double initial_eccentricity, double initial_inclination, double disk_lock_frequency, double disk_dissipation_age, double secondary_formation_age)
Create a binary system out of two stars.
Definition: CInterface.cpp:92
LIB_PUBLIC unsigned num_evolution_steps(OrbitSolver *solver)
At how many points was the evolution saved.
Definition: CInterface.cpp:234
LIB_PUBLIC void read_eccentricity_expansion_coefficients(const char *filename)
Read eccentricity expansion coefficients from a file.
Definition: CInterface.cpp:17
LIB_PUBLIC const int TABULATION_EVOL_MODE
Evolution mode ID used as the mode to transform to from all other modes when storing the computed evo...
Definition: CInterface.cpp:14
LIB_PUBLIC const int SINGLE_EVOL_MODE
Evolution mode ID for when there is only one body in the system (only its rotation evolves)...
Definition: CInterface.cpp:13
Declares a class of binary systems which start with a disk-locked star which is then released and at ...
LIB_PUBLIC void get_star_star_final_state(const OrbitSolver *solver, const DiskBinarySystem *system, const EvolvingStar *primary, const EvolvingStar *secondary, double *age, double *semimajor, double *eccentricity, double *primary_envelope_inclination, double *primary_core_inclination, double *primary_envelope_periapsis, double *primary_core_periapsis, double *primary_envelope_angmom, double *primary_core_angmom, double *secondary_envelope_inclination, double *secondary_core_inclination, double *secondary_envelope_periapsis, double *secondary_core_periapsis, double *secondary_envelope_angmom, double *secondary_core_angmom, int *evolution_mode, bool *primary_wind_saturation, bool *secondary_wind_saturation)
Fill destiantions with the calculated final state of a binary star system.
Definition: CInterface.cpp:675
LIB_PUBLIC DiskBinarySystem * create_star_planet_system(EvolvingStar *star, CPlanet *planet, double initial_semimajor, double initial_eccentricity, double initial_inclination, double disk_lock_frequency, double disk_dissipation_age, double secondary_formation_age)
Create a binary system out of a star and a planet.
Definition: CInterface.cpp:68
LIB_PUBLIC void get_star_planet_final_state(const OrbitSolver *solver, const DiskBinarySystem *system, const EvolvingStar *star, const CPlanet *planet, double *age, double *semimajor, double *eccentricity, double *envelope_inclination, double *core_inclination, double *envelope_periapsis, double *core_periapsis, double *envelope_angmom, double *core_angmom, double *planet_inclination, double *planet_periapsis, double *planet_angmom, int *evolution_mode, bool *wind_saturation)
Fill destiantions with the calculated final state of a star-planet system.
Definition: CInterface.cpp:637
LIB_PUBLIC void configure_star(EvolvingStar *star, double age, double companion_mass, double semimajor, double eccentricity, const double *spin_angmom, const double *inclination, const double *periapsis, bool locked_surface, bool zero_outer_inclination, bool zero_outer_periapsis)
Defines the orbit a star is in.
Definition: CInterface.cpp:121
struct LIB_PUBLIC EvolvingStar
Opaque struct to cast to/from Star::InterpolatedEvolutionStar.
Definition: CInterface.h:30