SEVN
Loading...
Searching...
No Matches
MTstability.h File Reference
#include <string>
#include <map>
#include <utility>
#include <vector>
#include <sevnlog.h>

Go to the source code of this file.

Classes

class  MTstability
 
class  MT_Stable
 
class  MT_UnStable
 
class  MT_Qcrit
 
class  Qcrit_Hurley
 
class  Qcrit_Hurley_Webbink
 
class  Qcrit_Hurley_Webbink_Shao
 
class  Qcrit_COSMIC_Neijssel
 
class  Qcrit_COSMIC_Claeys
 
class  Qcrit_StarTrack
 
class  Qcrit_Radiative_Stable
 
class  Qcrit_HRadiative_Stable
 
class  MT_Zeta
 

Macros

#define set_prop(star, prop, old)   old ? star->getp_0(prop::ID) : star->getp(prop::ID)
 

Macro Definition Documentation

◆ set_prop

#define set_prop (   star,
  prop,
  old 
)    old ? star->getp_0(prop::ID) : star->getp(prop::ID)

The class MTstability is used to estimate the stability of the RLO mass transfer. The idea behind the class is that the instability is "in general" checked through the condition: value > tshold (or < tshold). For example in a classical qcrit implementation, q > qcrit is the condition for unstable mass transfer. The key methods are:

  • bool mt_unstable(Star *donor, Star *accretor, Binstar * binary): This is the method that returns true if the condition of instability is satisfied.
  • bool get(Star *donor, Star *accretor, Binstar * binary): This method returns the value used to check the stability, e.g. for the classical qcrit formalism, get returns q=Mdonor/Maccretor
  • bool get_tshold(Star *donor, Star *accretor, Binstar * binary): this method returns the threshold value used in the comparison, e.g. for the classical qcrit formalism, get_tshold returns qcrit.

NOTICE: WE ASSUME that MTstability and the inherited classes are used during the BInary processes RLO, therefore the stellar properties ARE THE OBTAINED WITH GETP_0 (properties at the previous sse step), while the binary properties are always OBTAINED WITH GETP HOW TO ADD A NEW MTstability IMPLEMENTATION

1- Define the new class, public inherited from MTstability, or another class (e.g. MT_Qcrit) e.g. class Qcrit_Hurley : public MT_Qcrit

2- Implement the constructor e.g. Qcrit_Hurley(bool reg = true){ if (reg){ Register(this, name()); } }

3- Override the method name, it returns the name of this MT_stability option NOTICE this will be the same name used to choice this MT formalism through the parameter rlo_stability. e.g. inline std::string name() override { return "qcrit_hurley"; } this particular MT formalism can be called with -rlo_stability qcrit_hurley.

4- Define a static class member that is an instance of the same class we are defining e.g. static Qcrit_Hurley _qcrit_hurley;

5- Define the method instance that return a new a pointer to a dinamically allocated instance of the class e.g.

Qcrit_Hurley* instance() {
 return (new Qcrit_Hurley(false));

} NOTICE: remember to use false when calling the constructor here

6- If the class is derived directly from MT_stability, you have to define the following public pure virtual classes

  • mt_unstable(Star *donor, Star *accretor, _UNUSED Binstar *binary) const override;
  • double get_tshold(Star *donor, Star *accretor, _UNUSED Binstar *binary) const override;
  • double get(Star *donor, Star *accretor, _UNUSED Binstar *binary) const override; If the class is derived from a subclass of MT_stability check what are the methods to be overrided. e.g. Qcrit_Hurely is derived from MT_Qcrit that already overidde mt_unstable, get and get_tshold, however there are two virtual protected methods:
    • double q(Star *donor, Star *accretor) const;
    • virtual double qcrit(Star *donor, Star *accretor) const = 0; In particular qcrit is a pure virtual method that has to be implemented in the derived classes.

7- Add the static class member in general/static_main.h e.g. Qcrit_Hurley Qcrit_Hurley::_qcrit_hurley;

  • NOTICE: WE ASSUME that MTstability and the inherited classes are used during the BInary processes RLO, therefore the stellar properties ARE THE OBTAINED WITH GETP_0 (properties at the previous sse step), while the binary properties are always OBTAINED WITH GETP