PeTar
N-body code for collisional gravitational systems
StarParameter Struct Reference

SSE/BSE based code star parameter for saving. More...

#include <bse_interface.h>

Public Member Functions

void initial (double _mass, int _kw=1, double _ospin=0.0, double _epoch=0.0)
 

Landmark luminosities

More...
 
void writeAscii (FILE *fp) const
 write class data with ASCII format More...
 
void readAscii (FILE *fp)
 read class data with ASCII format More...
 
void print (std::ostream &fout) const
 for print in one line More...
 
void printColumn (std::ostream &_fout, const int _width=20) const
 print data of class members using column style More...
 

Static Public Member Functions

static void printColumnTitle (std::ostream &_fout, const int _width=20)
 print titles of class members using column style More...
 
static int printTitleWithMeaning (std::ostream &_fout, const int _counter=0, const int _offset=0)
 print column title with meaning (each line for one column) More...
 

Public Attributes

long long int kw
 
double m0
 

stellar type

More...
 
double mt
 

Initial stellar mass in solar units

More...
 
double r
 

Current mass in solar units (used for R)

More...
 
double mc
 

Stellar radius in solar units

More...
 
double rc
 

core mass in solar units

More...
 
double ospin
 

core radius in solar units (output)

More...
 
double epoch
 

spin of star

More...
 
double tphys
 

starting time of one evolution phase, age = tphys - epoch

More...
 
double lum
 

physical evolve time in Myr

More...
 

Detailed Description

SSE/BSE based code star parameter for saving.

This file provides the interface classes to connect the BSE-based code to PeTar.

Data structure: StarParameter: the basic stellar parameter for one star StarparameterOut: the stellar parameter output from calling evolv1 or evolv2 BinaryEvent: the records of binary type changes inside evolv2 (bpp array) Initialization: IOParamsBSE: the class storing all initial parameters needed for BSE-based code. it also provides the function to initialize from commander options and show help information Main Interface: BSEManager: the main class contains the interface to call single and binary evolution function (evolv1/evolv2) Evolution of stars and binaries: evolveStar: evolve one single star by a given time step evolveBinary: evolve one binary by a given time step Next time step for calling BSE: getTimeStepStar: next time step estimation for a single star getTimeStepBinary: next time step estimation for a binary isCallBSENeeded: check whether it is necessary to call evolvebinary for a binary even the next time step is not yet reached.

How it works in PeTar: The bse interface functions are used in src/ar_interaction.hpp. The class ARInteraction has two functions to use BSE: modifyOneParticle: Evolve a single star to a given time using evolveStar; and determine the next time step to call BSE using getTimeStepStar. If stellar type changes or supernova occurs, save information in the file [data filename prefix].[SSE name] If the mass of star becomes zero, set remove flag. The particle is removed in the later on integration. This function is used in Hermite integrator for single stars and also in SDAR integrator for single companion in a multiple system (e.g. the outer star in a triple) every time step. If the given time is less than the next time estimated from the previous call of modifyOneParticle, the star is not evolved.

modifyAndInterruptIter: Evolve a multiple system to a given time using evolveStar and evolveBinary; and determine the next time steps for each single or binary separately. The function check each sub component of a multiple system, For the type of the component: single star: call evolveStar binary: call evolveBinary multiple system (n>2): call modfyAndInterruptIter iteratively. If any single/binary type changes or supernova occurs, save information in the file [data filename prefix].[SSE/BSE name]. This function is used in SDAR integration every time step. For each single star, if the given time is less than the next time estimated from the previous call, it is not evolved. For each binary, if the given time is less than the next time estimated before, and the isCallBSENeeded return false, the binary is not evolved.

The necessary stellar parameters used in BSE are collected into one class StarParameter. PeTar does not save stellar parameters in history, and only record the present values. Thus the member list must be complete for calling evolv1 and evolv2 without knowing previous values.

Member Function Documentation

◆ initial()

void StarParameter::initial ( double  _mass,
int  _kw = 1,
double  _ospin = 0.0,
double  _epoch = 0.0 
)
inline

Landmark luminosities

initial zero age main sequence

Parameters
[in]_massinitial mass
[in]_kwinitial type (default: 1: MS)
[in]_ospininitial spin (default: 0.0)
[in]_epochinitial age for the given type (default: 0.0)
Here is the caller graph for this function:

◆ print()

void StarParameter::print ( std::ostream &  fout) const
inline

for print in one line

Here is the caller graph for this function:

◆ printColumn()

void StarParameter::printColumn ( std::ostream &  _fout,
const int  _width = 20 
) const
inline

print data of class members using column style

print data of class members in one line for column style. Notice no newline is printed at the end

Parameters
[out]_foutstd::ostream output object
[in]_widthprint width (defaulted 20)
Here is the caller graph for this function:

◆ printColumnTitle()

static void StarParameter::printColumnTitle ( std::ostream &  _fout,
const int  _width = 20 
)
inlinestatic

print titles of class members using column style

print titles of class members in one line for column style

Parameters
[out]_foutstd::ostream output object
[in]_widthprint width (defaulted 20)
Here is the caller graph for this function:

◆ printTitleWithMeaning()

static int StarParameter::printTitleWithMeaning ( std::ostream &  _fout,
const int  _counter = 0,
const int  _offset = 0 
)
inlinestatic

print column title with meaning (each line for one column)

Parameters
[out]_foutstd::ostream output object
[in]_counteroffset of the number counter for each line to indicate the column index (defaulted 0)
[in]_offsetthe printing whitespace offset for each line (defaulted 0)
Returns
: the total counter of columns
Here is the caller graph for this function:

◆ readAscii()

void StarParameter::readAscii ( FILE *  fp)
inline

read class data with ASCII format

Parameters
[in]_finfile IO for read

◆ writeAscii()

void StarParameter::writeAscii ( FILE *  fp) const
inline

write class data with ASCII format

Parameters
[in]_foutfile IO for write

Member Data Documentation

◆ epoch

double StarParameter::epoch

spin of star

◆ kw

long long int StarParameter::kw

◆ lum

double StarParameter::lum

physical evolve time in Myr

◆ m0

double StarParameter::m0

stellar type

◆ mc

double StarParameter::mc

Stellar radius in solar units

◆ mt

double StarParameter::mt

Initial stellar mass in solar units

◆ ospin

double StarParameter::ospin

core radius in solar units (output)

◆ r

double StarParameter::r

Current mass in solar units (used for R)

◆ rc

double StarParameter::rc

core mass in solar units

◆ tphys

double StarParameter::tphys

starting time of one evolution phase, age = tphys - epoch


The documentation for this struct was generated from the following file: