SlowDown Algorithmic Regularization (SDAR)
Algorithmic Regularization with slowdown method for integrating few-body motions
H4::BlockTimeStep4th Class Reference

#include <block_time_step.h>

Inheritance diagram for H4::BlockTimeStep4th:
[legend]
Collaboration diagram for H4::BlockTimeStep4th:
[legend]

Public Member Functions

 BlockTimeStep4th ()
 contructor More...
 
void setDtRange (const Float _dt_max, const int _pow_index_min)
 set dt limit (max and min) More...
 
Float getDtMax () const
 get maximum time step More...
 
Float getDtMin () const
 get minimum time step More...
 
Float calcNextDtLimit (const Float _time)
 calculate the maximum time step limit for next block step based on the input (current) time More...
 
Float calcBlockDt2nd (const Float *_acc0, const Float *_acc1, const Float _dt_limit) const
 Calculate 2nd order block time step. More...
 
Float calcBlockDt4th (const Float *acc0, const Float *acc1, const Float *acc2, const Float *acc3, const Float _dt_limit) const
 Calculate 4th order block time step. More...
 
void print (std::ostream &_fout) const
 
void printColumnTitle (std::ostream &_fout, const int _width=20)
 print titles of class members using column style More...
 
void printColumn (std::ostream &_fout, const int _width=20)
 print data of class members using column style More...
 
void writeBinary (FILE *_fp) const
 write class data to file with binary format More...
 
void readBinary (FILE *_fin)
 read class data to file with binary format More...
 
- Public Member Functions inherited from H4::TimeStep4th
 TimeStep4th ()
 

acceleration offset to avoid too small step when weak acceleration exist

More...
 
bool checkParams ()
 check whether parameters values are correct More...
 
void calcAcc0OffsetSq (const Float _mass, const Float _r, const Float _G)
 calculate a0_offset_sq More...
 
Float calcDt2nd (const Float *acc0, const Float *acc1) const
 calculate 2nd order time step More...
 
Float calcDt4th (const Float *acc0, const Float *acc1, const Float *acc2, const Float *acc3) const
 calculate 4th order time step More...
 
void print (std::ostream &_fout) const
 
void printColumnTitle (std::ostream &_fout, const int _width=20)
 print titles of class members using column style More...
 
void printColumn (std::ostream &_fout, const int _width=20)
 print data of class members using column style More...
 
void writeBinary (FILE *_fp) const
 write class data to file with binary format More...
 
void readBinary (FILE *_fin)
 read class data to file with binary format More...
 

Additional Inherited Members

- Public Attributes inherited from H4::TimeStep4th
Float eta_4th
 
Float eta_2nd
 

time step coefficient (outside sqrt) for forth order

More...
 
Float acc0_offset_sq
 

time step coefficient (outside sqrt) for second order

More...
 

Constructor & Destructor Documentation

◆ BlockTimeStep4th()

H4::BlockTimeStep4th::BlockTimeStep4th ( )
inline

contructor

Member Function Documentation

◆ calcBlockDt2nd()

Float H4::BlockTimeStep4th::calcBlockDt2nd ( const Float _acc0,
const Float _acc1,
const Float  _dt_limit 
) const
inline

Calculate 2nd order block time step.

calculate block time step based on Acc and its derivatives

Parameters
[in]_acc0acceleration
[in]_acc1first order derivative of acc0
[in]_dt_limitmaximum step limit
Returns
step size, if dt<dt_min, return -dt;
Here is the call graph for this function:

◆ calcBlockDt4th()

Float H4::BlockTimeStep4th::calcBlockDt4th ( const Float acc0,
const Float acc1,
const Float acc2,
const Float acc3,
const Float  _dt_limit 
) const
inline

Calculate 4th order block time step.

calculate 4th order block time step based on Acc and its derivatives

Parameters
[in]acc0acceleration
[in]acc1first order derivative of acc0
[in]acc2second order derivative of acc0
[in]acc3thrid order derivative of acc0
[in]_dt_limitmaximum step limit
Returns
step size, if dt<dt_min, return -dt;
Here is the call graph for this function:

◆ calcNextDtLimit()

Float H4::BlockTimeStep4th::calcNextDtLimit ( const Float  _time)
inline

calculate the maximum time step limit for next block step based on the input (current) time

Basic algorithm: the integer of time/dt_min is the binary tree for block step, counting from the minimum digital, the last zero indicate the maximum block step level allown for next step

Parameters
[in]_timecurrent time
Here is the caller graph for this function:

◆ getDtMax()

Float H4::BlockTimeStep4th::getDtMax ( ) const
inline

get maximum time step

Returns
maximum time step
Here is the caller graph for this function:

◆ getDtMin()

Float H4::BlockTimeStep4th::getDtMin ( ) const
inline

get minimum time step

Returns
miniimum time step

◆ print()

void H4::BlockTimeStep4th::print ( std::ostream &  _fout) const
inline
Here is the call graph for this function:
Here is the caller graph for this function:

◆ printColumn()

void H4::BlockTimeStep4th::printColumn ( std::ostream &  _fout,
const int  _width = 20 
)
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 call graph for this function:
Here is the caller graph for this function:

◆ printColumnTitle()

void H4::BlockTimeStep4th::printColumnTitle ( std::ostream &  _fout,
const int  _width = 20 
)
inline

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 call graph for this function:
Here is the caller graph for this function:

◆ readBinary()

void H4::BlockTimeStep4th::readBinary ( FILE *  _fin)
inline

read class data to file with binary format

Parameters
[in]_finFILE type file for reading
Here is the caller graph for this function:

◆ setDtRange()

void H4::BlockTimeStep4th::setDtRange ( const Float  _dt_max,
const int  _pow_index_min 
)
inline

set dt limit (max and min)

Parameters
[in]_dt_maxmaximum step size
[in]_pow_index_minthe power index (k) to set the minimum step size: _dt_max*(0.5^k)

◆ writeBinary()

void H4::BlockTimeStep4th::writeBinary ( FILE *  _fp) const
inline

write class data to file with binary format

Parameters
[in]_fpFILE type file for output
Here is the caller graph for this function:

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