![]() |
SEVN
|
Classes | |
| class | ListGenerator |
| Class to handle the generation of a list of values. More... | |
| struct | MassContainer |
Typedefs | |
| typedef unsigned int | evolution |
| typedef unsigned int | jump_convergence |
| typedef unsigned int | sn_explosion |
| typedef unsigned int | rlo |
| typedef bool | bse_evolution |
Functions | |
| double | maxwellian_cdf (double x, double sigma) |
| double | maxwellian_pdf (double x, double sigma) |
| double | R_Schwarzschild (double Mass) |
| template<typename T > | |
| const std::string | n2s (T val, const char *file_input, const int line_input, const unsigned int precision=6) |
| double | roche_lobe_Eg (double Mass_primary, double Mass_secondary, double a) |
| double | R_Alfven (Star *s, double dMdt, bool get0=false) |
| double | Hfrac (Star *s) |
| double | dMdt_Eddington_accretion (Star *donor, Star *accretor, double eddfact=1.0) |
| static double | omega_crit (double Mass, double Rpolar) |
| void | hardwait () |
| template<typename T , typename... Tail> | |
| void | hardwait (T head, Tail... tail) |
| void | wait () |
| template<typename T , typename... Tail> | |
| void | wait (_UNUSED T head, _UNUSED Tail... tail) |
| std::string | get_name (Star *s) |
| long | get_ID (Star *s) |
| std::string | get_name (Binstar *b) |
| long | get_ID (Binstar *b) |
| double | get_current_time (Star *s) |
| double | get_current_time (Binstar *b) |
| template<typename T > | |
| void | _log_print_core (std::stringstream &ss, T t) |
| template<typename T , typename... ListP> | |
| void | _log_print_core (std::stringstream &ss, T t, ListP... args) |
| template<class System , typename... ListP> | |
| std::string | common_log_print (const std::string &label, System *system, ListP... args) |
| template<class System , typename... ListP> | |
| std::string | common_log_print (const std::string &label, System *system) |
| template<typename... ListP> | |
| std::string | log_print (const std::string &label, Star *star, ListP... args) |
| template<typename... ListP> | |
| std::string | log_print (const std::string &label, Binstar *binstar, ListP... args) |
| std::string | log_star_info (Star *s, bool oldstep=false) |
| unsigned long | gen_rseed () |
| unsigned long | gen_rseed (std::random_device &rd) |
| const std::string | random_keygen (std::mt19937_64 *mtrand) |
| std::vector< std::string > | split (const std::string &s, char delimiter) |
| template<class T > | |
| bool | isifstream () |
| template<> | |
| bool | isifstream< std::ifstream > () |
| template<typename T > | |
| size_t | binary_search (T *array, const size_t left, const size_t right, const T value) |
| template<typename T > | |
| bool | string_is_number (std::string str) |
| double | kepler (const double &ecc, const double &m, const double tol=1e-6, const int maxit=50) |
| template<typename T > | |
| const T | s2n (std::string &str, const char *file_input, const int line_input) |
| template<typename T > | |
| void | _openfile (T &in, const std::string f, const char *file_input, const int line_input) |
| bool | wayToSort (int i, int j) |
| template<typename T > | |
| T | dirname2n (std::string str, const char *file_input, const int line_input) |
| template<typename T > | |
| void | print_vector (const std::vector< T > &v) |
| std::string | gen_filename (const std::string &_folder, const std::string &_fname, bool print_threads=true) |
| std::string | get_absolute_SEVN_path () |
| int | find_line (const double &x1, const double &x2, const double &y1, const double &y2, double &slope, double &intercept) |
| template<typename T > | |
| double | rel_difference (T val1, T val2) |
| void | swap_stars (Star *&s1, Star *&s2) |
| std::string | trim (const std::string &s) |
| template<typename T , typename Iter > | |
| bool | isinlist (T element, Iter it, Iter end) |
| std::string | make_pfile_str (const double plife, const size_t Phase, const unsigned int min_precision=6) |
| template<typename T > | |
| T | interpolate_1D (T xp, std::vector< T > &x_interp, std::vector< T > &y_interp, bool equispaced_interval=false, bool ext_raise=false) |
| std::string | get_subpath (std::string path, std::string split_string, bool include_split_string=true) |
| template<typename T > | |
| void | transpose (std::vector< std::vector< T > > &MatrixT, std::vector< std::vector< T > > &Matrix) |
| template<typename T > | |
| int | findInVector (const std::vector< T > &vecOfElements, const T &element) |
| template<typename Key , typename Value > | |
| std::map< Value, Key > | flip_map (const std::map< Key, Value > &original_map) |
| bool | areEqual (double x, double y) |
| double | smallestSignificativeStep (double x) |
| template<typename T , typename... Args> | |
| std::unique_ptr< T > | make_unique (Args &&... args) |
Variables | |
| std::mt19937_64 | mtrand |
| const std::string | SEVN_NAME = "SEVN" |
| constexpr double | G = 3.925125598496094e8 |
| Fundamental quantitis. More... | |
| constexpr double | yr_cgs = 3.1557600e7 |
| constexpr double | parsec_cgs = 3.085677581491367e+18 |
| constexpr double | Rsun_cgs = 6.95700e10 |
| constexpr double | Msun_cgs = 1.988409870698051e+33 |
| constexpr double | G_cgs = G*Rsun_cgs*Rsun_cgs*Rsun_cgs/(Msun_cgs*yr_cgs*yr_cgs) |
| constexpr double | Sigma_StefBoltz = 7.1694165533435e-17 |
| constexpr double | Myr_to_yr = 1.0e6 |
| constexpr double | yr_to_Myr = 1.0e-6 |
| constexpr double | AU_to_RSun = 215.03215567054764 |
| constexpr double | kms_to_RSunyr = 45.360931435963785 |
| constexpr double | LSun_to_Solar = 12.500687924182579 |
| constexpr double | c = 1.3598865132357053e7 |
| constexpr double | km_to_RSun = 1.4374011786689665e-06 |
| constexpr double | parsec_to_Rsun = parsec_cgs/Rsun_cgs |
| constexpr double | g_to_MSun = 5.029144215870041e-34 |
| constexpr double | G_over_c2 = G / (c*c) |
| constexpr double | G3_over_c5 = (G*G*G)/(c*c*c*c*c) |
| constexpr double | tH = 13.7*1e3 |
| constexpr double | Mchandra = 1.41 |
| const std::string | PLACEHOLDER ="xxx" |
| constexpr double | NULL_DOUBLE = -9e30 |
| constexpr int | NULL_INT = -999999999 |
| constexpr size_t | NULL_SINT = 999999999 |
| const std::string | NULL_STR = "FORZAROMA" |
| constexpr double | DIFF_TOLL = 1e-10 |
| constexpr double | LARGE = 1e30 |
| constexpr double | TINY = 1e-15 |
| constexpr double | DOUBLE_EPS = std::numeric_limits<double>::epsilon() |
| constexpr int | SINGLE_STEP_EVOLUTION =0 |
| constexpr int | REPEATED_EVOLUTION =1 |
| constexpr int | JUMP_CONVERGE =0 |
| constexpr int | JUMP =1 |
| constexpr int | NO_JUMP =2 |
| constexpr int | SNIA_EXPLODE =1 |
| constexpr int | SNII_EXPLODE =2 |
| constexpr int | SN_NOT_EXPLODE =0 |
| constexpr int | RLO_FALSE =0 |
| constexpr int | RLO_TRUE =1 |
| constexpr int | BIN_EV_DONE = 1 |
| constexpr int | BIN_EV_NOT_DONE = 0 |
| constexpr int | BIN_EV_SETBROKEN = 2 |
| typedef bool utilities::bse_evolution |
| typedef unsigned int utilities::evolution |
| typedef unsigned int utilities::jump_convergence |
| typedef unsigned int utilities::rlo |
| typedef unsigned int utilities::sn_explosion |
| void utilities::_log_print_core | ( | std::stringstream & | ss, |
| T | t | ||
| ) |
| void utilities::_log_print_core | ( | std::stringstream & | ss, |
| T | t, | ||
| ListP... | args | ||
| ) |
| void utilities::_openfile | ( | T & | in, |
| const std::string | f, | ||
| const char * | file_input, | ||
| const int | line_input | ||
| ) |
| bool utilities::areEqual | ( | double | x, |
| double | y | ||
| ) |
Check if two values can be considered equal within the machine precision tolerance. This can be used as a robust alternative to the operator == for doubles Absolute tolerance works well for values<1, relative tolerance for larger values
| x | First value to compare |
| y | Second value to compare |
| size_t utilities::binary_search | ( | T * | array, |
| const size_t | left, | ||
| const size_t | right, | ||
| const T | value | ||
| ) |
| std::string utilities::common_log_print | ( | const std::string & | label, |
| System * | system | ||
| ) |
| std::string utilities::common_log_print | ( | const std::string & | label, |
| System * | system, | ||
| ListP... | args | ||
| ) |
| T utilities::dirname2n | ( | std::string | str, |
| const char * | file_input, | ||
| const int | line_input | ||
| ) |
Estimate the maximal accretion rate on an object due to the Eddington limit. It is estimated using Eq. 67 in Hurley+02. In addition it is multiplied by the factor eddfact (>0, default=1) to allow super-eddingont accretion NOTICE the return will be in units of Myr / YR, while SEVN usually assumes Myr as scale, be careful of conversion.
| donor | Pointer to the star that is donating mass |
| accretor | Pointer to the star that is accreting mass |
| eddfact | Multiplicative factor to allow supereddington accretions |
|
inline |
Find the slope and the intercept of the line passing through (x1,y1), (x2,y2)
| x1 | x-value of the first point |
| x2 | x-value of the second point |
| y1 | y-value of the first point |
| y2 | y-value of the second point |
| slope | this value stores the estimated slope |
| intercept | this value store the estimated intercept |
| int utilities::findInVector | ( | const std::vector< T > & | vecOfElements, |
| const T & | element | ||
| ) |
Generic function to find an element in vector and also its position.
| T |
| vecOfElements | Vector to look for the element |
| element | element to find in the vector |
| std::map< Value, Key > utilities::flip_map | ( | const std::map< Key, Value > & | original_map | ) |
|
inline |
Functions to generate a complete filename path containing also the directory
| _folder | A string containing the folder path |
| _fname | Complete filename including also the .extension if any (_fname=_fname_root . _fname_extension) |
| print_threads | If true the number of threads will be added to the filename |
| unsigned long utilities::gen_rseed | ( | ) |
| unsigned long utilities::gen_rseed | ( | std::random_device & | rd | ) |
|
inline |
Get the absolute path of this SEVN folder
| double utilities::get_current_time | ( | Binstar * | b | ) |
| double utilities::get_current_time | ( | Star * | s | ) |
| long utilities::get_ID | ( | Binstar * | b | ) |
| long utilities::get_ID | ( | Star * | s | ) |
| std::string utilities::get_name | ( | Binstar * | b | ) |
| std::string utilities::get_name | ( | Star * | s | ) |
|
inline |
Get a portion of path name till the given split_string. The split_string is include.
| path | Complete path |
| split_string | string patter where to cut the complete path |
|
inline |
Like wait but it works also outside debug mode
| void utilities::hardwait | ( | T | head, |
| Tail... | tail | ||
| ) |
Like wait but it works also outside debug mode
| double utilities::Hfrac | ( | Star * | s | ) |
Estimate the Hydrogen mass fraction of the star. It is the one used in BSE/MOBSE
| s | Pointer to the star |
| T utilities::interpolate_1D | ( | T | xp, |
| std::vector< T > & | x_interp, | ||
| std::vector< T > & | y_interp, | ||
| bool | equispaced_interval = false, |
||
| bool | ext_raise = false |
||
| ) |
Estimate the y value using 1D linear interpolation
| T | type of the of interpolated value |
| xp | |
| x_interp | 1D vector containing the x-value of the interpolating tables (in ascending order) |
| y_interp | 1D vector containing the y-value of the interpolating tables |
| equispaced_interval | if true the value in x_interp are equi-spaced |
| ext_raise | if true and xp is out of boundary raise an error otherwise return the extrema of yinterp |
|
inline |
|
inline |
| bool utilities::isinlist | ( | T | element, |
| Iter | it, | ||
| Iter | end | ||
| ) |
Template function to check if a given element is inside a container.
| T | typename of the element to be checked |
| Iter | typename of the iterator |
| element | element to be checked |
| it | iterator to the begin of the container |
| end | iteratore to the end of the container |
|
inline |
Solve the Kepler equation to found the Eccentric anomaly starting from eccentricy and Mean anomaly. We use the generalized Newton Raphson’s method (Eq. 2.6, Nazeer 2016). If in some step we have numerical problem with the second derivative, we revert to a simple NR method for that step
| ecc | Eccentricity |
| m | Mean anomaly |
| tol | tollerance |
| maxit | maximum number of iteration |
| std::string utilities::log_print | ( | const std::string & | label, |
| Binstar * | binstar, | ||
| ListP... | args | ||
| ) |
| std::string utilities::log_print | ( | const std::string & | label, |
| Star * | star, | ||
| ListP... | args | ||
| ) |
| std::string utilities::log_star_info | ( | Star * | s, |
| bool | oldstep = false |
||
| ) |
Utility to write Star info in a log format
| s | Pointer to star |
| oldstep | if true get the property of the last step |
|
inline |
|
inline |
Define make_unique for pre-C++14. Notice this is the the same of the implementation of C++14 standard for single object, in the std there is also another implementation for arrays.
| T | Type of the unique ptr |
| Args |
| args | arg to initialise the object pointed by the unique ptr |
| double utilities::maxwellian_cdf | ( | double | x, |
| double | sigma | ||
| ) |
| double utilities::maxwellian_pdf | ( | double | x, |
| double | sigma | ||
| ) |
| const std::string utilities::n2s | ( | T | val, |
| const char * | file_input, | ||
| const int | line_input, | ||
| const unsigned int | precision = 6 |
||
| ) |
| T | template type. It should be able to accept anything that can be << to a stream obejct. |
| val | value of type T to be converted to a string |
| file_input | it should be set to __FILE__
|
| line_input | it should be set to __LINE__
|
| precision | set precision for the scientific format output of numbers |
val converted to a string. If val is a number the string is the scientific format with precision equal to precision.
|
inlinestatic |
Critical angular velocity
| Mass | mass in Msun |
| Rpolar | polar radius in Rsun |
| void utilities::print_vector | ( | const std::vector< T > & | v | ) |
Functions to print all the elements of a vector in a Python numpy style (GI)
| double utilities::R_Alfven | ( | Star * | s, |
| double | dMdt, | ||
| bool | get0 = false |
||
| ) |
Estimate the Alfven radius
| s | Pointer to the star for which we want to calculate the Alfven radius |
| dMdt | Accreated mass rate in Msun/yr |
| get0 | AIf true use the stellar propertie at the beginning of the timestep |
|
inline |
|
inline |
| double utilities::rel_difference | ( | T | val1, |
| T | val2 | ||
| ) |
| double utilities::roche_lobe_Eg | ( | double | Mass_primary, |
| double | Mass_secondary, | ||
| double | a | ||
| ) |
| const T utilities::s2n | ( | std::string & | str, |
| const char * | file_input, | ||
| const int | line_input | ||
| ) |
| double utilities::smallestSignificativeStep | ( | double | x | ) |
Estimate the smallest possible step given X so that X+step>X
| x | number |
| std::vector< std::string > utilities::split | ( | const std::string & | s, |
| char | delimiter | ||
| ) |
| bool utilities::string_is_number | ( | std::string | str | ) |
| void utilities::transpose | ( | std::vector< std::vector< T > > & | MatrixT, |
| std::vector< std::vector< T > > & | Matrix | ||
| ) |
Transpose a matrix
| T |
| MatrixT | Transposed Matrix |
| Matrix | Matrix to be transposed |
|
inline |
Trim a string from all whitespaces
| s |
|
inline |
Base class for the variadic function wait.
| _message |
| void utilities::wait | ( | _UNUSED T | head, |
| _UNUSED Tail... | tail | ||
| ) |
Variadic function. It prints a message in std::cout (from an argument pack) and wait of a cin input from the user.
| T | template param of the value to be written |
| Tail | template params of the pack of parameters to iterate over |
| head | value to be written |
| tail | rest of the packs |
|
inline |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
Fundamental quantitis.
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
extern |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
| const std::string utilities::NULL_STR = "FORZAROMA" |
|
constexpr |
|
constexpr |
| const std::string utilities::PLACEHOLDER ="xxx" |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
| const std::string utilities::SEVN_NAME = "SEVN" |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |