PeTar
N-body code for collisional gravitational systems
|
SSE/BSE interface manager. More...
#include <bse_interface.h>
Public Member Functions | |
BSEManager () | |
More... | |
bool | checkParams () |
void | dumpRandConstant (const char *_fname) |
dump rand constant to file More... | |
void | readRandConstant (const char *_fname) |
read BSE rand constant from file More... | |
bool | isMassTransfer (const int _binary_type) |
bool | isMerger (const int _binary_type) |
notice kick priority is higher than others More... | |
bool | isDisrupt (const int _binary_type) |
void | initial (const IOParamsBSE &_input, const bool _print_flag=false) |
initial SSE/BSE based code global parameters More... | |
double | getMass (StarParameter &_star) |
get current mass in NB unit More... | |
double | getMassLoss (StarParameterOut &_out) |
get mass loss in NB unit More... | |
double | getMergerRadius (StarParameter &_star) |
get merger radius in NB unit More... | |
double | getStellarRadius (StarParameter &_star) |
get stellar radius in NB unit More... | |
double | getSpeedOfLight () const |
get speed of light in NB unit More... | |
double | getTime (StarParameter &_star) |
get evolved Time in NB unit More... | |
double | getDTMiss (StarParameterOut &_out) |
get the difference of required finishing time and actually evolved time in NB unit More... | |
void | printTypeChange (std::ostream &_fout, StarParameter &_star, StarParameterOut &_out, const int _width=4) |
print type change More... | |
void | printBinaryEvent (std::ostream &_fout, const BinaryEvent &_bin_event) |
print binary event More... | |
void | printBinaryEventOne (std::ostream &_fout, const BinaryEvent &_bin_event, const int k) |
print binary event one More... | |
void | printBinaryEventColumnOne (std::ostream &_fout, const BinaryEvent &_bin_event, const int k, const int _width=20, const bool print_type_name=true) |
print binary event one in column More... | |
double | getVelocityChange (double *dv, StarParameterOut &_out) |
get velocity change in NB unit More... | |
int | evolveStar (StarParameter &_star, StarParameterOut &_out, const double _dt, bool _unit_in_myr=false) |
call SSE evolv1 for single star More... | |
int | evolveBinary (StarParameter &_star1, StarParameter &_star2, StarParameterOut &_out1, StarParameterOut &_out2, double &_semi, double &_period, double &_ecc, BinaryEvent &_bse_event, const int &_binary_init_type, const double _dt_nb) |
call evolv2 for a binary More... | |
bool | isRocheFill (StarParameter &_star1, StarParameter &_star2, double &_semi, double &_ecc) |
check Roche fill condition More... | |
void | merge (StarParameter &_star1, StarParameter &_star2, StarParameterOut &_out1, StarParameterOut &_out2, double &_semi, double &_ecc) |
merge two star using mix function, star 2 will becomes zero mass More... | |
double | getTimeStepStar (StarParameter &_star) |
get next time step to check in Myr More... | |
double | getTimeStepBinary (StarParameter &_star1, StarParameter &_star2, double &_semi, double &_ecc, int &_binary_type) |
call BSE evolv2 for a binary More... | |
bool | isCallBSENeeded (StarParameter &_star1, StarParameter &_star2, double &_semi, double &_ecc, double &_dt) |
a simple check to determine whether call BSE is necessary by given a reference of time step More... | |
Static Public Member Functions | |
static void | printReference (std::ostream &fout, const int offset=4) |
print reference to cite More... | |
static std::string | getSSEOutputFilenameSuffix () |
static std::string | getBSEOutputFilenameSuffix () |
static std::string | getSSEName () |
static std::string | getBSEName () |
Public Attributes | |
double | z |
double | zpars [20] |
double | tscale |
More... | |
double | rscale |
More... | |
double | mscale |
More... | |
double | vscale |
More... | |
const double | year_to_day |
More... | |
const char * | single_type [16] |
More... | |
const char * | binary_type [14] |
More... | |
SSE/BSE interface manager.
The class provides the interface to call single and binary stellar evolution (evolveStar and evolveBinary); and also the time step estimators (getTimeStepStar, getTimeStepBinary).
|
inline |
name of binary type return from BSE evolv2, notice if it is -1, it indicate the end of record
|
inline |
|
inline |
dump rand constant to file
|
inline |
call evolv2 for a binary
[in,out] | _star1 | star parameter of first |
[in,out] | _star2 | star parameter of second |
[out] | _out1 | output parameter of first from evolv2 |
[out] | _out2 | output parameter of second from evolv2 |
[out] | _bse_event | binary event record (bpp array) |
[in] | _semi | semi-major axis, only used to record initial semi [IN unit] |
[in,out] | _period | period of binary in NB unit [IN unit] |
[in,out] | _ecc | eccentricity of binary |
[in] | _binary_init_type | initial type of binary |
[in] | _dt_nb | physical time step to evolve [In unit] |
|
inline |
call SSE evolv1 for single star
[in,out] | _star | star parameter |
[out] | _out | output parameter from evolv1 |
[in] | _dt | time step to evolve |
[in] | _unit_in_myr | if true, _dt is in Myr; else, _dt*tscale is used (default false) |
|
inlinestatic |
|
inlinestatic |
|
inline |
get the difference of required finishing time and actually evolved time in NB unit
|
inline |
get current mass in NB unit
|
inline |
get mass loss in NB unit
|
inline |
get merger radius in NB unit
|
inline |
get speed of light in NB unit
IAU 2009: c = 299 792 458 m/s
|
inlinestatic |
|
inlinestatic |
|
inline |
get stellar radius in NB unit
|
inline |
get evolved Time in NB unit
|
inline |
call BSE evolv2 for a binary
[in] | _star1 | star parameter of first |
[in] | _star2 | star parameter of second |
[in] | _semi | semi-major axis, [IN unit] |
[in] | _ecc | eccentricity of binary, used for BSE |
[in] | _binary_type | binary type |
|
inline |
get next time step to check in Myr
[in] | _star | star parameter |
|
inline |
get velocity change in NB unit
[in] | _dv | 3-D array to record velocity change |
|
inline |
initial SSE/BSE based code global parameters
|
inline |
a simple check to determine whether call BSE is necessary by given a reference of time step
For the given time step, if the general relativity effect is important or Roche overflow may happen, return True When calling BSE is necessary within the given time step, return true. If KW type <10, check whether peri-center distance < 100*stellar radii (sum); If KW type >10, check GR effect timescale.
[in] | _star1 | star parameter of first |
[in] | _star2 | star parameter of second |
[in] | _semi | semi-major axis, [IN unit] |
[in] | _ecc | eccentricity of binary, used for BSE |
[in] | _dt | the time step [In unit] |
|
inline |
|
inline |
|
inline |
notice kick priority is higher than others
|
inline |
check Roche fill condition
|
inline |
merge two star using mix function, star 2 will becomes zero mass
[in,out] | _star1 | star parameter of first |
[in,out] | _star2 | star parameter of second |
[out] | _out1 | output parameter of first from evolv2 |
[out] | _out2 | output parameter of second from evolv2 |
[in] | _semi | semi-major axis, only used to record initial semi [IN unit] |
[in] | _ecc | eccentricity of hyperbolic orbit, used for BSE TODO: we must to consider the donor! |
|
inline |
print binary event
|
inline |
print binary event one in column
|
inline |
print binary event one
|
inlinestatic |
print reference to cite
|
inline |
print type change
|
inline |
read BSE rand constant from file
const char* BSEManager::binary_type[14] |
name of single type from SSE
double BSEManager::mscale |
radius scaling factor from NB to Rsun
double BSEManager::rscale |
time scaling factor from NB to Myr (t[Myr]=t[NB]*tscale)
const char* BSEManager::single_type[16] |
year to day
double BSEManager::tscale |
metallicity parameters
double BSEManager::vscale |
mass scaling factor from NB to Msun
const double BSEManager::year_to_day |
velocity scaling factor from NB to km/s
double BSEManager::z |
double BSEManager::zpars[20] |