Planetary Orbital Evolution due to Tides
Orbital evolution of two objects experiencing tides
YRECIO.h
Go to the documentation of this file.
1 
11 #ifndef __YRECIO_H
12 #define __YRECIO_H
13 
14 #include "../Core/SharedLibraryExportMacros.h"
15 #include "StellarEvolution.h"
16 #include "Common.h"
17 #include "AstronomicalConstants.h"
18 #include "dirent_hacked.h"
19 #include "Error.h"
20 #include <fstream>
21 #include <string>
22 #include <cassert>
23 #include <boost/archive/text_oarchive.hpp>
24 #include <boost/archive/text_iarchive.hpp>
25 #include <boost/serialization/base_object.hpp>
26 
30 class LIB_LOCAL YRECHeader {
31 private:
33  double track_mass;
34 
35  int age_col,
36  radius_col,
37 
40  envelope_mass_col,
41 
43  rad_conv_boundary_col,
44 
46  rad_inertia_col,
47 
49  conv_inertia_col,
50 
52  log_luminosity_col;
53 public:
55  YRECHeader(std::ifstream &track, const std::string &filename);
56 
58  double get_mass() const {return track_mass;}
59 
61  int get_age_col() const {return age_col;}
62 
64  int get_radius_col() const {return radius_col;}
65 
67  int get_log_luminosity_col() const {return log_luminosity_col;}
68 
70  int get_envelope_mass_col() const {return envelope_mass_col;}
71 
73  int get_core_boundary_col() const {return rad_conv_boundary_col;}
74 
76  int get_rad_inertia_col() const {return rad_inertia_col;}
77 
79  int get_conv_inertia_col() const {return conv_inertia_col;}
80 };
81 
85 class LIB_LOCAL EvolutionIterator {
86 public:
90 
92  std::list<double>::iterator mass_iter;
93 
95  std::list< std::valarray<double> >::iterator age_iter,
96 
99 
101  luminosity_iter,
102 
104  rad_mass_iter,
105 
108  core_boundary_iter,
109 
112  conv_inertia_iter,
113 
116  rad_inertia_iter;
117 
120 
122  EvolutionIterator &operator=(const EvolutionIterator &rhs);
123 
125  EvolutionIterator &operator++();
126 
128  EvolutionIterator operator++(int);
129 
133  bool operator==(const EvolutionIterator &rhs);
134 
138  bool operator!=(const EvolutionIterator &rhs) {return !((*this)==rhs);}
139 };
140 
148 class LIB_PUBLIC YRECEvolution : public StellarEvolution {
149 private:
151  std::list<double> mass_list;
152 
153  std::list< std::valarray<double> >
154  ages,
155  radii,
156  luminosities,
157  rad_masses,
158 
160  core_boundaries,
161 
163  conv_inertias,
164 
166  rad_inertias;
167 
169  void read_model_file(const std::string &filename);
170 
173  EvolutionIterator begin();
174 
177  EvolutionIterator end();
178 
180  void move(EvolutionIterator &dest, EvolutionIterator &source);
181 
183  void sort_masses();
184 public:
187 
192  const std::string &model_directory,
193 
195  double smooth_radius=-2.0,
196 
199  double smooth_conv_inertia=0,
200 
203  double smooth_rad_inertia=2.0,
204 
206  double smooth_rad_mass=2.0,
207 
209  double smooth_core_env_boundary=3.5,
210 
216  int radius_nodes=-1000,
217 
224  int conv_inertia_nodes=-1000,
225 
232  int rad_inertia_nodes=-1000,
233 
239  int rad_mass_nodes=-1000,
240 
246  int core_env_boundary_nodes=-5000);
247 };
248 
249 #endif
double get_mass() const
The stellar mass (in ) of the track.
Definition: YRECIO.h:58
Defines various astronomical constants.
double track_mass
The masss of the tracks provided on construction in .
Definition: YRECIO.h:33
int get_age_col() const
The column index within the track that contains the track ages.
Definition: YRECIO.h:61
bool operator!=(const EvolutionIterator &rhs)
Is RHS at a different position than this?
Definition: YRECIO.h:138
std::list< double >::iterator mass_iter
Iterator over the masses of the tracks.
Definition: YRECIO.h:92
std::list< std::valarray< double > > radii
The stellar radii in each track.
Definition: YRECIO.h:154
An iterator over the list of extracted tracks.
Definition: YRECIO.h:85
int get_envelope_mass_col() const
The column index for the envelope mass.
Definition: YRECIO.h:70
YRECEvolution()
Default constructor, use load_state to get a working interpolator.
Definition: YRECIO.h:186
int radius_col
The index of the radius column in the track.
Definition: YRECIO.h:35
Defines the exception hierarchy used by this code.
int get_radius_col() const
The column index within the track that contains the stellar radii.
Definition: YRECIO.h:64
A class which parses the header of a YREC evolution track.
Definition: YRECIO.h:30
EvolutionIterator()
Create an iterator, which must have all its *_iter members set before it can be used.
Definition: YRECIO.h:89
A stellar evolution interpolator based on the YREC tracks.
Definition: YRECIO.h:148
int get_conv_inertia_col() const
The column index for the moment of inertia of the convective envelope.
Definition: YRECIO.h:79
std::list< double > mass_list
The masses of the available tracks.
Definition: YRECIO.h:151
int get_log_luminosity_col() const
The column index within the track that contains the lg(luminosity).
Definition: YRECIO.h:67
int get_rad_inertia_col() const
The column index for the moment of inertia of the radiative core.
Definition: YRECIO.h:76
int get_core_boundary_col() const
The column index for the convective-radiative boundary radius.
Definition: YRECIO.h:73
std::list< std::valarray< double > >::iterator radius_iter
Iterator over the arrays of stellar radii of the tracks.
Definition: YRECIO.h:95