SEVN
Loading...
Searching...
No Matches
BTimestep Class Reference

#include <BinaryProperty.h>

Inheritance diagram for BTimestep:
BinaryProperty

Public Types

typedef std::map< std::string, size_t > _PrintMap
 

Public Member Functions

 BTimestep (bool reg=true)
 
BTimestepInstance () override
 
std::string name () override
 
std::string units () override
 
double max_timestep (_UNUSED Binstar *s)
 
bool check_repeat (_UNUSED Binstar *binstar, const double &V0, const double &V, const double &derivative)
 
bool check_repeat_eccentricity (_UNUSED Binstar *binstar, const double &m0, const double &m, const double &derivative)
 
bool check_repeat_DM_RLO (_UNUSED Binstar *binstar)
 
bool check_repeat_OmegaRem_NS (_UNUSED Binstar *binstar)
 
bool check_repeat_stellar_rotation (_UNUSED Binstar *binstar)
 
int evolve (_UNUSED Binstar *binstar) override
 
int getID () const override
 
void resynch (const double &dt, bool set0) override
 
int set_broken (_UNUSED Binstar *binstar) override
 
int special_evolve (_UNUSED Binstar *binstar) override
 
virtual void resynch (_UNUSED const double &dt, _UNUSED bool set0=true)
 
virtual void check_boundaries (_UNUSED double *val, _UNUSED Binstar *binstar)
 
virtual void init (_UNUSED const double par)
 
virtual void init_derived (_UNUSED Binstar *binstar)
 
double get_variation (Binstar *binstar) const
 
virtual double get (_UNUSED const Binstar *b=nullptr)
 
double get_0 (_UNUSED const Binstar *b=nullptr)
 
virtual void restore ()
 

Static Public Attributes

static size_t ID
 
static BTimestep _btimestep
 
static std::vector< BinaryProperty * > all
 
static _PrintMap PrintMap
 

Protected Member Functions

void check_dt_limits (double &dt, Binstar *binstar)
 
double tiny_dt (Binstar *binstar)
 
void Register (BinaryProperty *_p, size_t *id, const std::string &_name)
 
bool isbad (const double &val)
 
virtual void set (const double &a)
 
virtual void set_0 (const double &a)
 

Protected Attributes

std::uniform_real_distribution< double > _uniform_real
 
SevnLogging svlog
 
double V
 
double V0
 

Static Private Attributes

static size_t size = 0
 

Member Typedef Documentation

◆ _PrintMap

typedef std::map<std::string,size_t> BinaryProperty::_PrintMap
inherited

Constructor & Destructor Documentation

◆ BTimestep()

BTimestep::BTimestep ( bool  reg = true)
inline

Member Function Documentation

◆ check_boundaries()

virtual void BinaryProperty::check_boundaries ( _UNUSED double *  val,
_UNUSED Binstar binstar 
)
inlinevirtualinherited

◆ check_dt_limits()

void BTimestep::check_dt_limits ( double &  dt,
Binstar binstar 
)
protected

Check if the proposed dt is larger than max_dt or lower than min_dt. In that cases force dt to be one of the limits.

Parameters
dtreference to the timestep to analyse
spointer to the star

◆ check_repeat()

bool BTimestep::check_repeat ( _UNUSED Binstar binstar,
const double &  V0,
const double &  V,
const double &  derivative 
)
inline

◆ check_repeat_DM_RLO()

bool BTimestep::check_repeat_DM_RLO ( _UNUSED Binstar binstar)
inline

Check if the Mass transfer during the RLO is too much with respect to the maximum variation

Parameters
binstarPointer to the binary system
Returns
true if the system has to repeat the evolution with a new timestep, false otherwise

◆ check_repeat_eccentricity()

bool BTimestep::check_repeat_eccentricity ( _UNUSED Binstar binstar,
const double &  m0,
const double &  m,
const double &  derivative 
)
inline

Special check and repeat for eccentricity. If the new eccentricity is less than 1

Parameters
binstar
V0
V
derivative
Returns

◆ check_repeat_OmegaRem_NS()

bool BTimestep::check_repeat_OmegaRem_NS ( _UNUSED Binstar binstar)

Check if the SpinUp or Spindown of the NS Spin has varied too much with respect to the maximum variation

Parameters
binstarPointer to the binary system
Returns
true if the system has to repeat the evolution with a new timestep, false otherwise

◆ check_repeat_stellar_rotation()

bool BTimestep::check_repeat_stellar_rotation ( _UNUSED Binstar binstar)

Check the variation of stellar rotations due to binary processes

Parameters
binstarPointer to the binary system
Returns
true if the system has to repeat the evolution with a new timestep, false otherwise

◆ evolve()

int BTimestep::evolve ( _UNUSED Binstar binstar)
overridevirtual

Reset repeatstep

CHeck if the Binary evolution trigger a special step in that case call a repeatstep setting a tiny dt

"Normal" check and repeat

check if Semimajor axis has varied a lot, despiting the timestep control

check if Eccentricity has varied a lot, despiting the timestep control

Special check_repeat: Check the amount of mass transferred in the RLO

Special check repeat: stellar rotation

Special check repeat: check the amount of spin changed for mass accreted in NS NOTICE WE DISABLE THIS BY DEFAULT BECAUSE IT CAN SLOW DOWN THE EVOLUTION AND IT IS NOT NEEDED IF WE ARE NOT INTERESTED TO THE NS SPIN

Initialise new_timestep as the maximum possible timestep

Check if force_tiny_dt is active. This is a special condition, it can be triggered when the cumulative binary evolution reduce a to 0 and we want the next step is a step needed only for the CE evolution

Condition from "expected" variation of DA

Condition from DE

GI 19/07/2022, New idea to take into account the variation of stellar rotation in the adaptive time step. Similar to the Eccentricity, we can have very small timesteps when the stellar rotation is close to 0, this a problem especially when we initialise the star with 0 initial spin. In this case, if we do not perform any check a too large timestep in the Main Sequence can bias the binary evolution. Since the angular momentum has a large dynamic range, I chose to use the derived property Spin to check the low velocity regime. Spin is defined as the ratio between the angular velocity and the critical angular velocity, therefore its values are always within 0 and 1. If Spin is less than 0.1, we adapt the timestep to guarantee that the spin is increased at most of 0.01. If Spin>0.1, we use the classic adaptive time step criterium on the property angular momentum.

Reimplemented from BinaryProperty.

◆ get()

virtual double BinaryProperty::get ( _UNUSED const Binstar b = nullptr)
inlinevirtualinherited

Reimplemented in BJIT_Property.

◆ get_0()

double BinaryProperty::get_0 ( _UNUSED const Binstar b = nullptr)
inlineinherited

◆ get_variation()

double BinaryProperty::get_variation ( Binstar binstar) const
inherited

Get the variation expected for a given property just summing all the DVs due to all processes. This is equivalent to evolve, but without checks and without changing V0 and V

Parameters
binstarPointer to the binary from wich to take the processes variations
Returns
The DV for this property considering all the DV from the processes

◆ getID()

int BTimestep::getID ( ) const
inlineoverridevirtual

Reimplemented from BinaryProperty.

◆ init()

virtual void BinaryProperty::init ( _UNUSED const double  par)
inlinevirtualinherited

◆ init_derived()

virtual void BinaryProperty::init_derived ( _UNUSED Binstar binstar)
inlinevirtualinherited

Reimplemented in Derived_Property_Binary.

◆ Instance()

BTimestep * BTimestep::Instance ( )
inlineoverridevirtual

Reimplemented from BinaryProperty.

◆ isbad()

bool BinaryProperty::isbad ( const double &  val)
inlineprotectedinherited

◆ max_timestep()

double BTimestep::max_timestep ( _UNUSED Binstar s)

◆ name()

std::string BTimestep::name ( )
inlineoverridevirtual

Reimplemented from BinaryProperty.

◆ Register()

void BinaryProperty::Register ( BinaryProperty _p,
size_t *  id,
const std::string &  _name 
)
inlineprotectedinherited

◆ restore()

virtual void BinaryProperty::restore ( )
inlinevirtualinherited

Reimplemented in BJIT_Property.

◆ resynch() [1/2]

virtual void BinaryProperty::resynch ( _UNUSED const double &  dt,
_UNUSED bool  set0 = true 
)
inlinevirtualinherited

◆ resynch() [2/2]

void BTimestep::resynch ( const double &  dt,
bool  set0 
)
inlineoverride

◆ set()

virtual void BinaryProperty::set ( const double &  a)
inlineprotectedvirtualinherited

Reimplemented in BJIT_Property.

◆ set_0()

virtual void BinaryProperty::set_0 ( const double &  a)
inlineprotectedvirtualinherited

◆ set_broken()

int BTimestep::set_broken ( _UNUSED Binstar binstar)
inlineoverridevirtual

Reimplemented from BinaryProperty.

◆ special_evolve()

int BTimestep::special_evolve ( _UNUSED Binstar binstar)
inlineoverridevirtual

Reimplemented from BinaryProperty.

◆ tiny_dt()

double BTimestep::tiny_dt ( Binstar binstar)
protected

◆ units()

std::string BTimestep::units ( )
inlineoverridevirtual

Reimplemented from BinaryProperty.

Member Data Documentation

◆ _btimestep

BTimestep BTimestep::_btimestep
static

◆ _uniform_real

std::uniform_real_distribution<double> BinaryProperty::_uniform_real
protectedinherited

◆ all

std::vector< BinaryProperty * > BinaryProperty::all
staticinherited

◆ ID

size_t BTimestep::ID
static

◆ PrintMap

BinaryProperty::_PrintMap BinaryProperty::PrintMap
staticinherited

◆ size

size_t BinaryProperty::size = 0
staticprivateinherited

Instruction for adding new property BPROP 1- Add the size_t BPROP::ID 2- Initialise the static (fake) instance BPROP BPROP::_bprop. NB: take care of the order of initilisation. The properties will be evolved exactly in the same order in which they are initialised here Define: @size: total number of instances of BinaryProperty and derived classes (both fake and real). @all: vector containing all the (pointers) to the BinaryProperty. @PrintMap: map containing the pair (BinaryProperty_name, BinaryProperty_id) for output purpose. Note all and PrintMap are filled during the instantiation of the fake Processes (see below)

◆ svlog

SevnLogging BinaryProperty::svlog
protectedinherited

◆ V

double BinaryProperty::V
protectedinherited

◆ V0

double BinaryProperty::V0
protectedinherited

The documentation for this class was generated from the following files: