12 #include "../Core/SharedLibraryExportMacros.h" 14 #include "../IO/IOUtil.h" 15 #include "../Core/Common.h" 16 #include "../Core/AstronomicalConstants.h" 17 #include "../Core/Error.h" 18 #include "dirent_hacked.h" 25 #include <boost/archive/text_oarchive.hpp> 26 #include <boost/archive/text_iarchive.hpp> 27 #include <boost/serialization/base_object.hpp> 116 void read_column_numbers(std::istream &track,
117 const std::string &filename,
unsigned &line_number);
120 void set_column_names();
123 Header(std::ifstream &track,
const std::string &filename);
127 {
return __column_numbers[quantity];}
131 {
return __column_numbers;}
152 std::list< std::valarray<double> >::iterator
age_iter;
155 std::vector< std::list< std::valarray<double> >::iterator >
160 mass_iter(orig.mass_iter),
161 feh_iter(orig.feh_iter),
162 age_iter(orig.age_iter),
163 quantity_iter(orig.quantity_iter)
186 {
return !((*this) == rhs);}
241 std::vector< std::list< std::valarray<double> > >
252 bool parse_model_file_name(
const std::string &filename);
255 void sort_last_track_by_age();
258 void read_model_file(
const std::string &filename);
261 void log_current_age_ranges()
const;
267 void get_mass_feh_grid(
270 std::valarray<double> &masses,
274 std::valarray<double> &feh
299 const std::string &model_directory,
302 unsigned num_threads,
308 const std::vector<double> &smoothing = __default_smoothing,
316 const std::vector<int> &nodes = __default_nodes,
320 const std::vector<bool> &vs_log_age = __default_vs_log_age,
324 const std::vector<bool> &log_quantity =__default_log_quantity
332 {
return __default_smoothing[quantity];}
336 {
return __default_smoothing;}
343 {
return __default_nodes[quantity];}
347 {
return __default_nodes;}
354 {
return __default_vs_log_age[quantity];}
358 {
return __default_vs_log_age;}
365 {
return __default_log_quantity[quantity];}
370 {
return __default_log_quantity;}
The total number of interesting columns.
static bool default_vs_log_age(StellarEvolution::QuantityID quantity)
By default is the given quantity interpolated vs log(age)?
double metallicity_from_feh(double feh)
Return the metallicity interpolation parameter corresponding to the given [Fe/H] value.
const double Yprotosun
The Helium fraction with which the Sun formed.
std::list< std::valarray< double > >::iterator age_iter
Iterator over the array of ages of the tracks.
static const std::vector< bool > & default_vs_log_age()
Return the default vs_log_age argument to pass to constructor.
Mass of the radiative core in .
static const std::vector< bool > __default_log_quantity
The default selection of interpolation function (quantity vs log(quantity) for each quantity...
std::ostream & operator<<(std::ostream &os, StellarEvolution::MESA::Column col)
Civilized output of mesa column names.
const double Yprimordial
The primordial Helium fraction of the universe.
Log10 of the luminosity of the star in .
const double Zprotosun
The metal fraction with which the Sun formed.
Log10 of the radius of the star in .
static const std::vector< bool > & default_log_quantity()
Return the default log_quantity argument to pass to constructor.
static const std::vector< bool > __default_vs_log_age
The default selection of interpolation argument (age vs log(age) for each quantity. See StellarEvolution::Interpolator::create_from.
const double Xprotosun
The hydrogen fraction with which the Sun formed.
The total mass of the star in .
static const std::vector< double > & default_smoothing()
Return the default smoothing argument to pass to constructor.
EvolutionIterator()
Create an iterator, which must have all its *_iter members set before it can be used.
A class that interpolates among stellar evolution tracks.
Column
Names for the interesting columns in a MESA track.
std::list< double > __feh_list
The [Fe/H] values of the available tracks in the order read.
std::list< double > __mass_list
The masses of the available tracks in the order read.
A stellar evolution interpolator based on the MESA tracks.
std::list< std::valarray< double > > __track_ages
The ages at which each track is tabulated.
EvolutionIterator operator++(int)
Advance all iterators to the next track.
Moment of inertia of the convective envelope in .
static double default_smoothing(StellarEvolution::QuantityID quantity)
The default smoothing argument used for a given quantity.
The luminosity of the star in .
double feh_from_metallicity(double metallicity)
Return the [Fe/H] value corresponding to the given metallicity.
static const std::vector< int > & default_nodes()
Return the default nodes argument to pass to constructor.
std::list< double >::iterator feh_iter
Iterator over the masses of the tracks.
EvolutionIterator(const EvolutionIterator &orig)
Copy orig to *this.
std::vector< std::list< std::valarray< double > > > __track_quantities
A structure holding all interesting quantities from the MESA tracks except age.
static const std::vector< QuantityID > __column_to_quantity
The value at the indexed from Column is the StellarEvolution::QuantityID to which this column is conv...
const int NUM_QUANTITIES
The number of interpolation quantities currentyl supported.
An iterator over the list of extracted tracks.
Radius of the radiative core in .
The radius of the star in .
std::list< double >::iterator mass_iter
Iterator over the masses of the tracks.
QuantityID
Defines the quantities tracked by stellar evolution and their order.
bool operator==(const EvolutionIterator &rhs)
Is RHS at the same position as this?
std::vector< std::list< std::valarray< double > >::iterator > quantity_iter
Iterators over the arrays of the track quantities.
static int default_nodes(StellarEvolution::QuantityID quantity)
The default interpolation nodes used for a given quantity.
Moment of inertia of the radiative core in .
bool operator!=(const EvolutionIterator &rhs)
Is RHS at a different position than this?
static const std::vector< int > __default_nodes
The default number of node to use for each quantity. See StellarEvolution::Interpolator::create_from...
static const std::vector< double > __default_smoothing
The default amount of smoothing to use for each quantity. See StellarEvolution::Interpolator::create_...
static bool default_log_quantity(StellarEvolution::QuantityID quantity)
By default is the log(given quantity) interpolated?
Defines the StellarEvolution class needed for interpolating among stellar evolution tracks...