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.