![]() |
SEVN
|
#include <binstar.h>
Public Member Functions | |
| Binstar () | |
| Binstar (IO *_io, std::vector< std::string > ¶ms, size_t &_ID, unsigned long _rseed=0) | |
| double | getp (const size_t &id) const |
| METHODS///. More... | |
| double | getp_0 (const size_t &id) const |
| std::string | get_name () const |
| size_t | get_ID () const |
| Star * | getstar (const size_t &id) |
| Process * | getprocess (const size_t &id) |
| const std::vector< Process * > & | getprocesses () const |
| const std::vector< double > & | getstate () |
| double | get_last_Timestep () const |
| unsigned int | get_id_more_evolved_star () const |
| Star * | get_more_evolved_star () |
| double | Radx (size_t starID) |
| double | get_svpar_num (std::string name) |
| Get the value of the parameters store in the svpar class in io. More... | |
| std::string | get_svpar_str (std::string name) |
| bool | get_svpar_bool (std::string name) |
| unsigned long | get_rseed () |
| virtual void | evolve () |
| void | recordstate_w_timeupdate () |
| void | recordstate () |
| void | recordstate_binary () |
| void | set_broken () |
| void | set_empty () |
| void | set_onesurvived () |
| bool | breaktrigger () const |
| bool | is_process_ongoing (const size_t &id) const |
| bool | processes_alarm (const size_t &id) const |
| Handle processes alarms. More... | |
| bool | process_alarm_any () const |
| void | reset_all_processes_alarms () |
| void | reset_events () |
| Handle events. More... | |
| double | get_event_from_processes () |
| bool | isoutputtime () |
| Outputs. More... | |
| bool | printall () |
| bool | notprint () |
| void | print () |
| void | print_failed (bool include_in_output=false) |
| void | print_to_log (std::string &message) |
| void | init (const std::vector< std::string > ¶ms) |
| std::vector< double > | get_zams () |
| std::vector< double > | get_Z () |
| void | set_tf (const double a, const char *file, const int line) |
| void | set_dtout (const double a, const char *file, const int line) |
| void | evolution_step_done () |
| void | evolution_guard (const char *file_input=nullptr, int line_input=-1) |
| double | get_tf () const |
| double | get_dtout () |
| std::string | get_id_name () const |
| utilities::sn_explosion | check_accretion_on_compact (size_t donorID, size_t accretorID, double DMaccreted) |
| void | check_accretion_on_compact () |
| bool | check_and_set_broken () |
| void | check_and_set_bavera_xspin () |
| void | check_if_applied_bavera_xspin () |
| double | SetXspinBavera (const double, const double) const |
| ~Binstar () | |
| DENSTRUCTORS. More... | |
Public Attributes | |
| bool | broken |
| MEMBERS///. More... | |
| bool | onesurvived |
| bool | empty |
| bool | break_at_remnant |
| bool | break_at_broken |
| bool | repeatstep |
| bool | mix |
| bool | comenv |
| bool | is_swallowed [2] |
| double | last_Timestep |
| bool | print_all_steps |
| bool | print_per_phase |
| bool | print_only_end |
| bool | print_events |
| bool | print_rlo |
| bool | disable_e_check |
| bool | disable_a_check |
| bool | disable_DM_check |
| bool | disable_OmegaRem_NS_check |
| bool | disable_stellar_rotation_check |
| bool | force_tiny_dt |
| double | CE_E_tomatch = utilities::NULL_DOUBLE |
| bool | evolution_step_completed |
Protected Member Functions | |
| void | synchronise_dt_star () |
| void | check_and_sync_sse () |
| void | check_and_sync_bse () |
| void | check_nakedHe_or_nakedCO_after_binary_evolution () |
| CHECKS AND CORRECT. More... | |
| void | check_AngMomSpin_after_binary_evolution () |
| void | limit_and_correct_mass_transfer_for_donor_from_binary (Star *donor, Star *accretor, std::size_t mass_limiting_property_id) |
| bool | check_and_set_QHE (Star *accretor) |
| void | update_derived_properties_star (Star *s) |
| void | reset_evolution_flags () |
| RESET. More... | |
Protected Attributes | |
| double | tf |
| MEMBERS///. More... | |
| double | dtout |
| std::vector< double > | state |
| std::vector< double > | combinedstate |
| std::vector< std::vector< double > > | allstates |
| SevnLogging | svlog |
Private Member Functions | |
| utilities::bse_evolution | evolve_binary () |
| METHODS///. More... | |
| void | resynch (const double &dt) |
| void | default_destructor () |
| void | call_stars_constructor (std::vector< std::string > ¶ms_star1, std::vector< std::string > ¶ms_star2) |
| void | init_stars (const std::vector< std::string > ¶ms) |
| void | init_stars_legacy (const std::vector< std::string > ¶ms) |
| void | set_initial_semimajor (double a_ini) |
| void | set_initial_semimajor (std::string a_ini) |
| void | set_initial_eccentricity (double ecc_ini) |
| void | set_initial_eccentricity (std::string ecc_ini) |
| void | init_binary_properties (const std::vector< std::string > ¶ms) |
| void | init_other_params () |
| void | set_break_at_broken (std::string &tf) |
| void | set_rseed (const unsigned long a, const char *file, const int line) |
| void | check_init_param (const std::vector< std::string > ¶ms) |
Private Attributes | |
| vector< Process * > | process |
| MEMBERS///. More... | |
| vector< BinaryProperty * > | property |
| Star * | star [2] ={nullptr, nullptr} |
| IO * | io |
| size_t | ID |
| std::vector< std::string > | init_params |
| std::string | name |
| unsigned long | rseed |
|
inline |
CONSTRUCTORS/// Constructors for fake objects
|
inline |
Print options
| Binstar::~Binstar | ( | ) |
DENSTRUCTORS.
|
inline |
|
private |
Call the constructor of the two stars with parameters params_star1 and params_star2. The parameters are Mass, Z, Spin, sn_type, t initial, t final, dt print output.
| params_star1 | Mass, Z, Spin, sn_type, t initial, t final, dt print output of the first star. |
| params_star2 | Mass, Z, Spin, sn_type, t initial, t final, dt print output of the second star |
|
inline |
Call check_accretion_on_compact(size_t donorID, size_t accretorID, double DMaccreted) checking both stars and taking DMaccreted from the processes
Estimate the DM from the processes
| utilities::sn_explosion Binstar::check_accretion_on_compact | ( | size_t | donorID, |
| size_t | accretorID, | ||
| double | DMaccreted | ||
| ) |
Check the outcome of the accretion on a compact object
| donorID | Id of the donor star |
| accretorID | ID of the accretor star |
| DMaccreted | DM accreted on the acrretor |
trigger Type 1a SN explosion
trigger Type 1a SN explosion
| void Binstar::check_and_set_bavera_xspin | ( | ) |
|
inline |
Check if the binary system is broken or onesurvived is true or empty. In that case apply set_broken to the properties
|
protected |
Check if the condition for Quasi Homogeneous Evolution is triggered after RLO mass transfer. This function follows the recipe in Sec. 2.2 of Eldridge&Stanway11 (https://arxiv.org/abs/1109.0288). If the condition are met, the star is flagged as QHE (ami_following_QHE is set to true) Notice this check function has to be used at the end of the binary evolution so that we are sure the evolution is completed and no repetitions can be called.
| accretor | Pointer to a star that is assumed the accretor in the RLO mass transfer (the fucntion checks if the star is really the accretor or if the RLO is happening using the property dMcumul_RLO). |
Check the preliminary condition for QHE:
Very first check
Second preliminary check
Third Check, is RLO happening and is the Star the accretor?
Prelimary Checks passed, now do the main check based on Eldridge&Stanway11
If trigger is true, set the QHE
|
protected |
Check if the last single stellar evolution step has been made with the same timestep. If not evolve again the star with the smallest timestep used in the last evolutions (T0)..
Safety check on timesteps: the new proposed timestep should be smaller than the stellar one.
We have to evolve again the stars and the binary Re-evolve the stars with the new timestep propsed by the last call of BTimestep.evolve
Restore binary properties and revolve (processes are restored in evolve_binary)
|
protected |
Check if the last single stellar evolution step has been made with the same timestep. If not evolve again the star with the smallest timestep used in the last evolutions (T0)..
Re-evolve the star that did the longest timestep
Now update the BinaryTimestep to be equal to the actual stellar evolution timestep
|
protected |
Check if after the binary evolution the angular momentum, of the two stars is larger than the critical angular momentum Lcrit=IOmega_crit. In case set L=Lcrit. If L has been updated, call also update_derived_properties_star to update derived properties that can depend on L
| void Binstar::check_if_applied_bavera_xspin | ( | ) |
|
inlineprivate |
Check if params in input has the expected number of parameters as defined in INPUTMAPBIN and INPUTMAPBIN_PARAM (lookup_and_phases.cpp)
| params | params to pass to the init function. |
|
protected |
CHECKS AND CORRECT.
Check if after the evolution the Mass transfer (mainly Roche Lobe) causes the total Mass to be lower than the core Mass, considering both the He and CO Mass. If the Roche Lobe radius does not include the Core (He or CO) we force the star to lose only the envelope creating a Naked He star, the radius, the accreted and donated mass from the binary evolution are corrected accordingly. If the Roche Lobe radius is inside the He and/or CO core, the stars is allowed to transfer mass from the core and the MCO and/or MHE is updated to be equal to Mtot. If Mtot<MCO and RCO<RL<RHE a nakedCO star is created and the star is forced to lose at most the envelope and He layer from the core.
If M<MHE or M<MCO check for naked Helium, naked CO stars
Notice, we can enter here both because the total Mass is lower than the MHE Mass or because the difference is within the tshol.
Notice, we can enter here both because the total Mass is lower than the MCO Mass or because the difference is within the tshol.
|
private |
Method to clean the heap from all the heap allocated members of this class
Here we have to delete all the pointer to stuff allocated on the heap
|
inline |
|
inline |
|
inlinevirtual |
Check for new_tracks for stars and check mass_limits
|
private |
METHODS///.
1-Reset some flags
2-Special evolve
3-Check if the bynary still esist
4-Check if some stellar process has destroied the systems
5-Reset variations due to processes (all to zero... VB and VS)
6-Outside the parallel update, we have here a sequential update due to the special evolve function of the processes
8-Main evolve
8a-reset special flags (mix, comenv, is_swallowed)
8b-Evolve all the Processes
8c-Check if a special state has been flagged or is the system ahs been broken
8d-Update the Single stellar properties due to the processes. This is a parallel update
8e-Check if the binary evolution creates a nakedHe or nakedCO star WARNING: This function needs to be exactly there, after the update of the single star properties and before the update of the binary property
8f-Check outcome of accretion on compact objects
8h-Update derived properties (basic properties could have been changes during binary processes)
8h-Check AngMomSpin (reduce it if it has reached the maximum spin)
9-If system is not broken update the binary properties
9b-Check if the Eccentricity is larger than 1
|
inline |
|
inline |
Check if one of the process is signaling an event. Notice that the function use a priority schema to decide which one of the events will be returned. The priority is given by the position of the event in Lookup::EventList, higher is the value higher is the priority The order of the checked process follows the process initialisation in static_main.h
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Get the value of the parameters store in the svpar class in io.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
METHODS///.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
| void Binstar::init | ( | const std::vector< std::string > & | params | ) |
Initialise the two stars in the binary and the other binary properties. This functiom assume thta the Star constructor is called in the standard way from a init param vector with: Mass, Z, Spin, sn_type, t initial, t final, dt print output.
| params | A vector of string with the following orderd parameters: Mass1, Z1, Spin1, t_1 initial, Mass2, Z2, Spin2, t_2 initial, sn_type, t final, dt_out, bin_separation, bin_eccentricity |
|
inlineprivate |
Initialise the binary parameters.
| params | A vector of string with the following ordered parameters: if binput_mode is legacy: Mass1, Mass2, Z1, Z2, Spin1, Spin2, bin_separation, bin_eccentricity, t_final, t_ini, tstep sn_type1, sn_type2, dt_out if binput_mode is new: Mass1, Z1, Spin1, sn_type1, t_1 initial, Mass2, Z2, Spin2, sn_type2, t_2 initial, bin_separation, bin_eccentricity, t_final, dt_out |
|
private |
In this function we set the parameters that are already set in each star when we call init_stars or init_stars_legacy. These parameters are: break_at_broken, break_at_remnant, print_all_steps and print_per_phase, tf, dtout. The function just check that the two stars store the same value for the parameters to set. It this is not true it throws a critical error.
|
private |
Transform the parameter in input it the stardard form needed from the Star constructor and then call the stars constructor NB: This is the version that I like more, but it is different with respect the old SEVN V1 formalism (implemented in init_star_legacy) The constructor is called in the standard way from a init param vector with: Mass, Z, Spin, sn_type, t initial, t final, dt print output.
| params | A vector of string with the following orderd parameters: Mass1, Z1, Spin1, sn_type1, t_1 initial, Mass2, Z2, Spin2, sn_type2, t_2 initial, bin_separation, bin_eccentricity, t_final, dt_out |
|
private |
Transform the parameter in input in the standard format needed from the Star constructor and then call the stars constructor. The input format is in the old SEVN1 style. The constructor is called in the standard way from a init param vector with: Mass, Z, Spin, sn_type, t initial, t final, dt print output.
| params | A vector of string with the following orderd parameters: Mass1, Mass2, Z1, Z2, Spin1, Spin2, bin_separation, bin_eccentricity, t_final, t_ini, tstep, sn_type1, sn_type2, dt_out NB: tstep not used at the moment |
|
inline |
Check if a given process is actually ongoing
| id | Id of the process to check |
| bool Binstar::isoutputtime | ( | ) |
Outputs.
Check if time to store the outputs
|
protected |
Function that limit the mass transfer to a given mass value. For example we can limit the mass transfer to the core mass, in that case the maximum amount of mass we can trasnfer is the Envelope mass. We can also limit the mass transfer to the CO core mass. If the amount of mass transfered is larger, the function estimate the correction to exactly loss the right amount of mass and update the properties. The accreted mass is corrected accordingly. Notice to work this function assume that Total Mass < mass_limiting_property_id
| donor | Pointer to the Star where we want to limit the mass transfer |
| accretor | Pointer to the Star that can accrete the mass lost from the donor |
| mass_limiting_property_id | ID of the mass limiting property (usually MHE or MCO). |
Notice:
Estimate the DM from the processes
Estimate the actual fraction of mass accred on the accretor (considering all the processes)
Estimate the correcting term
Notice
Correct mass
Correct orbital properties
|
inline |
|
inline |
Print the current binary properties. It is supposed that the evolution of this binary is not stopped by an error, therefore the summary is printed in the evolved files It uses the method print_evolved_summary and print_formatted_output of the class IO.h
|
inline |
Print the current binary properties. It is supposed that the evolution of this binary is stopped by an error, therefore the summary is printed in the failed files It uses the method print_failed_summary and print_formatted_output of the class IO.h Print the current binary properties. It is supposed that the evolution of this binary is stopped by an error, therefore the summary is printed in the failed files It uses the method print_failed_summary and print_formatted_output of the class IO.h
| include_in_output | If true flush allstates to the output even if the evolution failed |
|
inline |
Print a message to the log file. It is a wrapper of the method log_put of the class IO
| message |
|
inline |
| bool Binstar::process_alarm_any | ( | ) | const |
Check all the processes alarm
|
inline |
Handle processes alarms.
Check if the specific process is signaling an special_evolution_alarm
| id | Id of the process to check |
| double Binstar::Radx | ( | size_t | starID | ) |
Estimate the effective radius during a RLO, i.e. Max(Rc,RL) for a given star.
| starID | Id of the star (0 or 1) |
|
inline |
|
inline |
|
inline |
Check that the evolution has been done
|
inline |
Switch off all the processes alarms
|
inline |
Handle events.
Reset all the events, i.e. set to -1 the event member of all the processes
|
inlineprotected |
RESET.
Reset (put to false) the flag about special evolution: mix, comenv, is_swallowed.
|
inlineprivate |
|
inlineprivate |
Set time when the tf in input is equal to broken
| tf |
|
inline |
|
inline |
Set the dtout time.
| a | value to set |
| file | |
| line |
|
inline |
|
inlineprivate |
Initialise the Eccentricity checking the value
| ecc_ini | Initial value of the eccentricity, it should be lower than 1 and no lower than 0 |
|
inlineprivate |
Initialise the Eccentricity checking the value
| ecc_ini | string with the initial eccentricity, if the string cannot be transformed to a number the function throw an io error. The initial value of the eccentricity has to be lower than 1 and no lower than 0 |
|
inlineprivate |
|
inlineprivate |
Initialise the Semimajor checking the value
| a_ini | string with the initial semimajor axis, if the string cannot be transformed to a number the function throw an io error. a_ini has to be larger than 0 or the functions throw a critical error |
|
inline |
|
inlineprivate |
|
inline |
Set the final time of the simulation
| a | value to set |
| file | |
| line |
| double Binstar::SetXspinBavera | ( | const double | , |
| const double | |||
| ) | const |
|
protected |
METHODS/// SYNCS Set the time step of the next evolution of the two stars to the minimum values between the current timestep (Timestep::V).
|
protected |
Call the evolve of the derived properties of a given star. The derived properties are properties that depends on other propertis, therefore when the binary evolution chanfe some of the fundamental properties we can call this function to properly set all the other derived properties.
| s | Pointer to the star |
|
protected |
2D Vector storing all the combinedstates. Each time Binstar::record is called combinedstate is pushed to allstates
| bool Binstar::break_at_broken |
if true stop the evolution when the binary breaks
| bool Binstar::break_at_remnant |
if true stop the evolution when both stars are remnant
| bool Binstar::broken |
MEMBERS///.
If true the binary is broken
| double Binstar::CE_E_tomatch = utilities::NULL_DOUBLE |
Envelope binding energy of the system after coalesce during a CE
|
protected |
Vector containing the properties of the stars (see Star::state) and the properties of the binary (see above)
| bool Binstar::comenv |
If true the binary is doing a ce
| bool Binstar::disable_a_check |
If true, the a_check in adpative timestep is disabled
| bool Binstar::disable_DM_check |
If true, the DM_check (from binary evolution) in adpative timestep is disabled
| bool Binstar::disable_e_check |
If true, the e_check in adpative timestep is disabled
| bool Binstar::disable_OmegaRem_NS_check |
If true, the OmegaRem_NS_check (from binary evolution) in adpative timestep is disabled
| bool Binstar::disable_stellar_rotation_check |
If true, the OmegaSpin (from binary evolution) in adpative timestep is disabled
|
protected |
Time interval for the output
| bool Binstar::empty |
| bool Binstar::evolution_step_completed |
| bool Binstar::force_tiny_dt |
If true, it forces the next Binary time step to be equal to utilities::TINY
|
private |
ID of the binary (it depends on the position of this system in the list of binary
|
private |
vector of string loaded from the list of binary
| bool Binstar::is_swallowed[2] |
Array of bool corresponding to the ID of stars in binary. If true, the star has been swallowed
| double Binstar::last_Timestep |
it stores the last value of the Timestep used in the evolution
| bool Binstar::mix |
If true the binary is mixing
|
private |
Random name of the binary
| bool Binstar::onesurvived |
true if just one star survived else either both stars are present or no stars are present
| bool Binstar::print_all_steps |
Print options If true print in output all the steps.
| bool Binstar::print_events |
If true print all the events
| bool Binstar::print_only_end |
If true do not print intermediate steps
| bool Binstar::print_per_phase |
If true print in output in each phase change
| bool Binstar::print_rlo |
If true print all the steps during a rlo
|
private |
MEMBERS///.
List with all the pointers to the processes initialised in static_main.h
|
private |
List with all the pointers to the binary properties initialised in static_main.h
| bool Binstar::repeatstep |
Control if it is needed to repeat a step of the binary evolution. It is mostly used in BTimestep::evolve
|
private |
Random seed
|
private |
Pointers to the stars in the binary system, initiliased to nullptr
|
protected |
Vector containing the properties of the binary (the one stored in IO::printcolumns_binary). It is filled with value in Binstar::record
|
protected |
log object to handle output messages
|
protected |
MEMBERS///.
End time of the simulation