SlowDown Algorithmic Regularization (SDAR)
Algorithmic Regularization with slowdown method for integrating few-body motions
AR::TimeTransformedSymplecticIntegrator< Tparticle, Tpcm, Tpert, Tmethod, Tinfo > Class Template Reference

Time Transformed Symplectic integrator class for a group of particles. More...

#include <symplectic_integrator.h>

Collaboration diagram for AR::TimeTransformedSymplecticIntegrator< Tparticle, Tpcm, Tpert, Tmethod, Tinfo >:
[legend]

Public Member Functions

 TimeTransformedSymplecticIntegrator ()
 Constructor. More...
 
bool checkParams ()
 check whether parameters values are correct More...
 
void reserveIntegratorMem ()
 reserve memory for force More...
 
void clear ()
 Clear function. More...
 
 ~TimeTransformedSymplecticIntegrator ()
 destructor More...
 
TimeTransformedSymplecticIntegratoroperator= (const TimeTransformedSymplecticIntegrator &_sym)
 operator = More...
 
void initialIntegration (const Float _time)
 initialization for integration More...
 
void integrateOneStep (const Float _ds, Float _time_table[])
 integration for one step More...
 
void integrateTwoOneStep (const Float _ds, Float _time_table[])
 integration for two body one step More...
 
InterruptBinary< Tparticle > integrateToTime (const Float _time_end)
 
void correctCenterOfMassDrift ()
 correct CM drift More...
 
template<class Tptcl >
void writeBackParticlesOriginFrame ()
 write back particles to original address More...
 
Float getTime () const
 Get current physical time. More...
 
Float getEkin () const
 Get current kinetic energy. More...
 
Float getEpot () const
 Get current potential energy. More...
 
Float getEtotRef () const
 Get current total integrated energy. More...
 
Float getEtot () const
 Get current total energy from ekin and epot. More...
 
Float getEpert () const
 get perturbation potential energy More...
 
Float getEnergyError () const
 get energy error More...
 
Float getEnergyErrorFromBackup (Float *_bk) const
 get energy error from backup data More...
 
Float getEtotRefFromBackup (Float *_bk) const
 get integrated energy from backup data More...
 
Float getEtotFromBackup (Float *_bk) const
 get total energy from backup data (ekin+epot) More...
 
void resetDEChangeBinaryInterrupt ()
 reset cumulative energy/hamiltonian change due to interruption More...
 
Float getDEChangeBinaryInterrupt () const
 get cumulative energy change due to interruption More...
 
Float getDHChangeBinaryInterrupt () const
 get cumulative hamiltonian change due to interruption More...
 
Float getH () const
 get Hamiltonian More...
 
Float getHFromBackup (Float *_bk) const
 get Hamiltonian from backup data More...
 
int getBackupDataSize () const
 get backup data size More...
 
int backupIntData (Float *_bk)
 Backup integration data. More...
 
int restoreIntData (Float *_bk)
 Restore integration data. More...
 
template<class Tptcl >
void printGroupInfo (const int _type, std::ostream &_fout, const int _width, const Tptcl *_pcm=NULL)
 print group information More...
 
void printColumnTitle (std::ostream &_fout, const int _width=20, const int _n_sd=0)
 print titles of class members using column style More...
 
void printColumn (std::ostream &_fout, const int _width=20, const int _n_sd=0)
 print data of class members using column style More...
 
void writeBinary (FILE *_fout)
 write class data with BINARY format More...
 
void readBinary (FILE *_fin)
 read class data with BINARY format and initial the array More...
 

Public Attributes

TimeTransformedSymplecticManager< Tmethod > * manager
 integration manager More...
 
COMM::ParticleGroup< Tparticle, Tpcm > particles
 particle group manager More...
 
Tpert perturber
 perturber class More...
 
Tinfo info
 information of the system More...
 
Profile profile
 profile to measure the performance More...
 

Detailed Description

template<class Tparticle, class Tpcm, class Tpert, class Tmethod, class Tinfo>
class AR::TimeTransformedSymplecticIntegrator< Tparticle, Tpcm, Tpert, Tmethod, Tinfo >

Time Transformed Symplectic integrator class for a group of particles.

The basic steps to use the integrator

  1. Add particles (particles.addParticle/particles.linkParticleList)
  2. Initial system (initial)
  3. Integration (integrateOneStep/integrateToTime)
    Requirement for Tparticle class, public memebers: pos[3], vel[3], mass
    Template dependence: Tparticle: particle type; Tpcm: particle cm type Tpert: perturber class type, Tmethod: interaction class;

Constructor & Destructor Documentation

◆ TimeTransformedSymplecticIntegrator()

template<class Tparticle , class Tpcm , class Tpert , class Tmethod , class Tinfo >
AR::TimeTransformedSymplecticIntegrator< Tparticle, Tpcm, Tpert, Tmethod, Tinfo >::TimeTransformedSymplecticIntegrator ( )
inline

Constructor.

◆ ~TimeTransformedSymplecticIntegrator()

template<class Tparticle , class Tpcm , class Tpert , class Tmethod , class Tinfo >
AR::TimeTransformedSymplecticIntegrator< Tparticle, Tpcm, Tpert, Tmethod, Tinfo >::~TimeTransformedSymplecticIntegrator ( )
inline

destructor

Here is the call graph for this function:

Member Function Documentation

◆ backupIntData()

template<class Tparticle , class Tpcm , class Tpert , class Tmethod , class Tinfo >
int AR::TimeTransformedSymplecticIntegrator< Tparticle, Tpcm, Tpert, Tmethod, Tinfo >::backupIntData ( Float _bk)
inline

Backup integration data.

Backup $time_, $etot_, $ekin_, $epot_, $gt_drift_, $gt_kick_inv_, particles, $slowdown to one Float data array

Returns
backup array size
Here is the call graph for this function:

◆ checkParams()

template<class Tparticle , class Tpcm , class Tpert , class Tmethod , class Tinfo >
bool AR::TimeTransformedSymplecticIntegrator< Tparticle, Tpcm, Tpert, Tmethod, Tinfo >::checkParams ( )
inline

check whether parameters values are correct

Returns
true: all correct

◆ clear()

template<class Tparticle , class Tpcm , class Tpert , class Tmethod , class Tinfo >
void AR::TimeTransformedSymplecticIntegrator< Tparticle, Tpcm, Tpert, Tmethod, Tinfo >::clear ( )
inline

Clear function.

Free dynamical memory space allocated

Here is the call graph for this function:
Here is the caller graph for this function:

◆ correctCenterOfMassDrift()

template<class Tparticle , class Tpcm , class Tpert , class Tmethod , class Tinfo >
void AR::TimeTransformedSymplecticIntegrator< Tparticle, Tpcm, Tpert, Tmethod, Tinfo >::correctCenterOfMassDrift ( )
inline

correct CM drift

calculate c.m. and correct the member data to the c.m. frame. This is used after the perturbation, in case the c.m. drift when members are in c.m. frame

Here is the call graph for this function:

◆ getBackupDataSize()

template<class Tparticle , class Tpcm , class Tpert , class Tmethod , class Tinfo >
int AR::TimeTransformedSymplecticIntegrator< Tparticle, Tpcm, Tpert, Tmethod, Tinfo >::getBackupDataSize ( ) const
inline

get backup data size

Here is the call graph for this function:

◆ getDEChangeBinaryInterrupt()

template<class Tparticle , class Tpcm , class Tpert , class Tmethod , class Tinfo >
Float AR::TimeTransformedSymplecticIntegrator< Tparticle, Tpcm, Tpert, Tmethod, Tinfo >::getDEChangeBinaryInterrupt ( ) const
inline

get cumulative energy change due to interruption

◆ getDHChangeBinaryInterrupt()

template<class Tparticle , class Tpcm , class Tpert , class Tmethod , class Tinfo >
Float AR::TimeTransformedSymplecticIntegrator< Tparticle, Tpcm, Tpert, Tmethod, Tinfo >::getDHChangeBinaryInterrupt ( ) const
inline

get cumulative hamiltonian change due to interruption

◆ getEkin()

template<class Tparticle , class Tpcm , class Tpert , class Tmethod , class Tinfo >
Float AR::TimeTransformedSymplecticIntegrator< Tparticle, Tpcm, Tpert, Tmethod, Tinfo >::getEkin ( ) const
inline

Get current kinetic energy.

Returns
current kinetic energy

◆ getEnergyError()

template<class Tparticle , class Tpcm , class Tpert , class Tmethod , class Tinfo >
Float AR::TimeTransformedSymplecticIntegrator< Tparticle, Tpcm, Tpert, Tmethod, Tinfo >::getEnergyError ( ) const
inline

get energy error

Returns
energy error

◆ getEnergyErrorFromBackup()

template<class Tparticle , class Tpcm , class Tpert , class Tmethod , class Tinfo >
Float AR::TimeTransformedSymplecticIntegrator< Tparticle, Tpcm, Tpert, Tmethod, Tinfo >::getEnergyErrorFromBackup ( Float _bk) const
inline

get energy error from backup data

◆ getEpert()

template<class Tparticle , class Tpcm , class Tpert , class Tmethod , class Tinfo >
Float AR::TimeTransformedSymplecticIntegrator< Tparticle, Tpcm, Tpert, Tmethod, Tinfo >::getEpert ( ) const
inline

get perturbation potential energy

Returns
perturbation potential energy
Here is the call graph for this function:

◆ getEpot()

template<class Tparticle , class Tpcm , class Tpert , class Tmethod , class Tinfo >
Float AR::TimeTransformedSymplecticIntegrator< Tparticle, Tpcm, Tpert, Tmethod, Tinfo >::getEpot ( ) const
inline

Get current potential energy.

Returns
current potetnial energy (negative value for bounded systems)

◆ getEtot()

template<class Tparticle , class Tpcm , class Tpert , class Tmethod , class Tinfo >
Float AR::TimeTransformedSymplecticIntegrator< Tparticle, Tpcm, Tpert, Tmethod, Tinfo >::getEtot ( ) const
inline

Get current total energy from ekin and epot.

Returns
total integrated energy

◆ getEtotFromBackup()

template<class Tparticle , class Tpcm , class Tpert , class Tmethod , class Tinfo >
Float AR::TimeTransformedSymplecticIntegrator< Tparticle, Tpcm, Tpert, Tmethod, Tinfo >::getEtotFromBackup ( Float _bk) const
inline

get total energy from backup data (ekin+epot)

◆ getEtotRef()

template<class Tparticle , class Tpcm , class Tpert , class Tmethod , class Tinfo >
Float AR::TimeTransformedSymplecticIntegrator< Tparticle, Tpcm, Tpert, Tmethod, Tinfo >::getEtotRef ( ) const
inline

Get current total integrated energy.

Returns
total integrated energy

◆ getEtotRefFromBackup()

template<class Tparticle , class Tpcm , class Tpert , class Tmethod , class Tinfo >
Float AR::TimeTransformedSymplecticIntegrator< Tparticle, Tpcm, Tpert, Tmethod, Tinfo >::getEtotRefFromBackup ( Float _bk) const
inline

get integrated energy from backup data

◆ getH()

template<class Tparticle , class Tpcm , class Tpert , class Tmethod , class Tinfo >
Float AR::TimeTransformedSymplecticIntegrator< Tparticle, Tpcm, Tpert, Tmethod, Tinfo >::getH ( ) const
inline

get Hamiltonian

◆ getHFromBackup()

template<class Tparticle , class Tpcm , class Tpert , class Tmethod , class Tinfo >
Float AR::TimeTransformedSymplecticIntegrator< Tparticle, Tpcm, Tpert, Tmethod, Tinfo >::getHFromBackup ( Float _bk) const
inline

get Hamiltonian from backup data

◆ getTime()

template<class Tparticle , class Tpcm , class Tpert , class Tmethod , class Tinfo >
Float AR::TimeTransformedSymplecticIntegrator< Tparticle, Tpcm, Tpert, Tmethod, Tinfo >::getTime ( ) const
inline

Get current physical time.

Returns
current physical time

◆ initialIntegration()

template<class Tparticle , class Tpcm , class Tpert , class Tmethod , class Tinfo >
void AR::TimeTransformedSymplecticIntegrator< Tparticle, Tpcm, Tpert, Tmethod, Tinfo >::initialIntegration ( const Float  _time)
inline

initialization for integration

initialize the system. Acceleration, energy and time transformation factors are updated. If the center-of-mass is not yet calculated, the system will be shifted to center-of-mass frame.

Parameters
[in]_timereal physical time to initialize
Here is the call graph for this function:

◆ integrateOneStep()

template<class Tparticle , class Tpcm , class Tpert , class Tmethod , class Tinfo >
void AR::TimeTransformedSymplecticIntegrator< Tparticle, Tpcm, Tpert, Tmethod, Tinfo >::integrateOneStep ( const Float  _ds,
Float  _time_table[] 
)
inline

integration for one step

Parameters
[in]_dsstep size
[out]_time_tablefor high order symplectic integration, store the substep integrated (real) time, used for estimate the step for time synchronization, size should be consistent with step.getCDPairSize().

calc force, potential and inverse time transformation factor for kick

Here is the call graph for this function:

◆ integrateToTime()

template<class Tparticle , class Tpcm , class Tpert , class Tmethod , class Tinfo >
InterruptBinary<Tparticle> AR::TimeTransformedSymplecticIntegrator< Tparticle, Tpcm, Tpert, Tmethod, Tinfo >::integrateToTime ( const Float  _time_end)
inline
Parameters
[in]_time_endthe expected finishing time without offset
Returns
binary tree of the pair which triggers interruption condition

regular block time step modification factor

Here is the call graph for this function:

◆ integrateTwoOneStep()

template<class Tparticle , class Tpcm , class Tpert , class Tmethod , class Tinfo >
void AR::TimeTransformedSymplecticIntegrator< Tparticle, Tpcm, Tpert, Tmethod, Tinfo >::integrateTwoOneStep ( const Float  _ds,
Float  _time_table[] 
)
inline

integration for two body one step

For two-body problem the calculation can be much symplified to improve performance. Besides, the slow-down factor calculation is embedded in the Drift (for time) and Kick (for perturbation).

Parameters
[in]_dsstep size
[out]_time_tablefor high order symplectic integration, store the substep integrated (real) time, used for estimate the step for time synchronization, size should be consistent with step.getCDPairSize().
Here is the call graph for this function:

◆ operator=()

template<class Tparticle , class Tpcm , class Tpert , class Tmethod , class Tinfo >
TimeTransformedSymplecticIntegrator& AR::TimeTransformedSymplecticIntegrator< Tparticle, Tpcm, Tpert, Tmethod, Tinfo >::operator= ( const TimeTransformedSymplecticIntegrator< Tparticle, Tpcm, Tpert, Tmethod, Tinfo > &  _sym)
inline

operator =

Copy function will remove the local data and also copy the particle data or the link

Here is the call graph for this function:

◆ printColumn()

template<class Tparticle , class Tpcm , class Tpert , class Tmethod , class Tinfo >
void AR::TimeTransformedSymplecticIntegrator< Tparticle, Tpcm, Tpert, Tmethod, Tinfo >::printColumn ( std::ostream &  _fout,
const int  _width = 20,
const int  _n_sd = 0 
)
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
[in]_n_sdslowdown inner group
Here is the call graph for this function:

◆ printColumnTitle()

template<class Tparticle , class Tpcm , class Tpert , class Tmethod , class Tinfo >
void AR::TimeTransformedSymplecticIntegrator< Tparticle, Tpcm, Tpert, Tmethod, Tinfo >::printColumnTitle ( std::ostream &  _fout,
const int  _width = 20,
const int  _n_sd = 0 
)
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
[in]_n_sdslowdown inner group
Here is the call graph for this function:

◆ printGroupInfo()

template<class Tparticle , class Tpcm , class Tpert , class Tmethod , class Tinfo >
template<class Tptcl >
void AR::TimeTransformedSymplecticIntegrator< Tparticle, Tpcm, Tpert, Tmethod, Tinfo >::printGroupInfo ( const int  _type,
std::ostream &  _fout,
const int  _width,
const Tptcl *  _pcm = NULL 
)
inline

print group information

Message, Number of members, time, binary tree printing interation

Parameters
[in]_type0: new group (if pair id is same, no printing); 1: end group (always print and reset pair id)
[in]_foutFILE IO
[in]_widthprint width
[in]_pcmcenter of mass particle to calculate origin position and velocity, if NULL, assume cm pos and vel are zero

◆ readBinary()

template<class Tparticle , class Tpcm , class Tpert , class Tmethod , class Tinfo >
void AR::TimeTransformedSymplecticIntegrator< Tparticle, Tpcm, Tpert, Tmethod, Tinfo >::readBinary ( FILE *  _fin)
inline

read class data with BINARY format and initial the array

Parameters
[in]_finfile IO for read
Here is the call graph for this function:

◆ reserveIntegratorMem()

template<class Tparticle , class Tpcm , class Tpert , class Tmethod , class Tinfo >
void AR::TimeTransformedSymplecticIntegrator< Tparticle, Tpcm, Tpert, Tmethod, Tinfo >::reserveIntegratorMem ( )
inline

reserve memory for force

The size of force depends on the particle data size.Thus particles should be added first before call this function

Here is the call graph for this function:

◆ resetDEChangeBinaryInterrupt()

template<class Tparticle , class Tpcm , class Tpert , class Tmethod , class Tinfo >
void AR::TimeTransformedSymplecticIntegrator< Tparticle, Tpcm, Tpert, Tmethod, Tinfo >::resetDEChangeBinaryInterrupt ( )
inline

reset cumulative energy/hamiltonian change due to interruption

◆ restoreIntData()

template<class Tparticle , class Tpcm , class Tpert , class Tmethod , class Tinfo >
int AR::TimeTransformedSymplecticIntegrator< Tparticle, Tpcm, Tpert, Tmethod, Tinfo >::restoreIntData ( Float _bk)
inline

Restore integration data.

restore $time_, $etot_, $ekin_, $epot_, $gt_drift_, $gt_kick_inv_, particles, $slowdown from one Float data array

Returns
backup array size
Here is the call graph for this function:

◆ writeBackParticlesOriginFrame()

template<class Tparticle , class Tpcm , class Tpert , class Tmethod , class Tinfo >
template<class Tptcl >
void AR::TimeTransformedSymplecticIntegrator< Tparticle, Tpcm, Tpert, Tmethod, Tinfo >::writeBackParticlesOriginFrame ( )
inline

write back particles to original address

If particles are in center-off-mass frame, write back the particle in original frame but not modify local copies to avoid roundoff error

Here is the call graph for this function:

◆ writeBinary()

template<class Tparticle , class Tpcm , class Tpert , class Tmethod , class Tinfo >
void AR::TimeTransformedSymplecticIntegrator< Tparticle, Tpcm, Tpert, Tmethod, Tinfo >::writeBinary ( FILE *  _fout)
inline

write class data with BINARY format

Parameters
[in]_foutfile IO for write
Here is the call graph for this function:

Member Data Documentation

◆ info

template<class Tparticle , class Tpcm , class Tpert , class Tmethod , class Tinfo >
Tinfo AR::TimeTransformedSymplecticIntegrator< Tparticle, Tpcm, Tpert, Tmethod, Tinfo >::info

information of the system

◆ manager

template<class Tparticle , class Tpcm , class Tpert , class Tmethod , class Tinfo >
TimeTransformedSymplecticManager<Tmethod>* AR::TimeTransformedSymplecticIntegrator< Tparticle, Tpcm, Tpert, Tmethod, Tinfo >::manager

integration manager

◆ particles

template<class Tparticle , class Tpcm , class Tpert , class Tmethod , class Tinfo >
COMM::ParticleGroup<Tparticle,Tpcm> AR::TimeTransformedSymplecticIntegrator< Tparticle, Tpcm, Tpert, Tmethod, Tinfo >::particles

particle group manager

◆ perturber

template<class Tparticle , class Tpcm , class Tpert , class Tmethod , class Tinfo >
Tpert AR::TimeTransformedSymplecticIntegrator< Tparticle, Tpcm, Tpert, Tmethod, Tinfo >::perturber

perturber class

◆ profile

template<class Tparticle , class Tpcm , class Tpert , class Tmethod , class Tinfo >
Profile AR::TimeTransformedSymplecticIntegrator< Tparticle, Tpcm, Tpert, Tmethod, Tinfo >::profile

profile to measure the performance


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