SlowDown Algorithmic Regularization (SDAR)
Algorithmic Regularization with slowdown method for integrating few-body motions
|
Time Transformed Symplectic integrator class for a group of particles. More...
#include <symplectic_integrator.h>
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... | |
TimeTransformedSymplecticIntegrator & | operator= (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... | |
Time Transformed Symplectic integrator class for a group of particles.
The basic steps to use the integrator
|
inline |
Constructor.
|
inline |
destructor
|
inline |
Backup integration data.
Backup $time_, $etot_, $ekin_, $epot_, $gt_drift_, $gt_kick_inv_, particles, $slowdown to one Float data array
|
inline |
check whether parameters values are correct
|
inline |
Clear function.
Free dynamical memory space allocated
|
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
|
inline |
get backup data size
|
inline |
get cumulative energy change due to interruption
|
inline |
get cumulative hamiltonian change due to interruption
|
inline |
Get current kinetic energy.
|
inline |
get energy error
|
inline |
get energy error from backup data
|
inline |
get perturbation potential energy
|
inline |
Get current potential energy.
|
inline |
Get current total energy from ekin and epot.
|
inline |
get total energy from backup data (ekin+epot)
|
inline |
Get current total integrated energy.
|
inline |
get integrated energy from backup data
|
inline |
get Hamiltonian
|
inline |
get Hamiltonian from backup data
|
inline |
Get current physical 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.
[in] | _time | real physical time to initialize |
|
inline |
integration for one step
[in] | _ds | step size |
[out] | _time_table | for 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
|
inline |
[in] | _time_end | the expected finishing time without offset |
regular block time step modification factor
|
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).
[in] | _ds | step size |
[out] | _time_table | for 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(). |
|
inline |
operator =
Copy function will remove the local data and also copy the particle data or the link
|
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
[out] | _fout | std::ostream output object |
[in] | _width | print width |
[in] | _n_sd | slowdown inner group |
|
inline |
print titles of class members using column style
print titles of class members in one line for column style
[out] | _fout | std::ostream output object |
[in] | _width | print width |
[in] | _n_sd | slowdown inner group |
|
inline |
print group information
Message, Number of members, time, binary tree printing interation
[in] | _type | 0: new group (if pair id is same, no printing); 1: end group (always print and reset pair id) |
[in] | _fout | FILE IO |
[in] | _width | print width |
[in] | _pcm | center of mass particle to calculate origin position and velocity, if NULL, assume cm pos and vel are zero |
|
inline |
read class data with BINARY format and initial the array
[in] | _fin | file IO for read |
|
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
|
inline |
reset cumulative energy/hamiltonian change due to interruption
|
inline |
Restore integration data.
restore $time_, $etot_, $ekin_, $epot_, $gt_drift_, $gt_kick_inv_, particles, $slowdown from one Float data array
|
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
|
inline |
write class data with BINARY format
[in] | _fout | file IO for write |
Tinfo AR::TimeTransformedSymplecticIntegrator< Tparticle, Tpcm, Tpert, Tmethod, Tinfo >::info |
information of the system
TimeTransformedSymplecticManager<Tmethod>* AR::TimeTransformedSymplecticIntegrator< Tparticle, Tpcm, Tpert, Tmethod, Tinfo >::manager |
integration manager
COMM::ParticleGroup<Tparticle,Tpcm> AR::TimeTransformedSymplecticIntegrator< Tparticle, Tpcm, Tpert, Tmethod, Tinfo >::particles |
particle group manager
Tpert AR::TimeTransformedSymplecticIntegrator< Tparticle, Tpcm, Tpert, Tmethod, Tinfo >::perturber |
perturber class
Profile AR::TimeTransformedSymplecticIntegrator< Tparticle, Tpcm, Tpert, Tmethod, Tinfo >::profile |
profile to measure the performance