SlowDown Algorithmic Regularization (SDAR)
Algorithmic Regularization with slowdown method for integrating few-body motions
|
Particle group class to store and manage a group of particle. More...
#include <particle_group.h>
Public Member Functions | |
ParticleGroup () | |
center of mass particle for the group More... | |
void | clear () |
Clear function. More... | |
ParticleGroup & | operator= (const ParticleGroup &_particle_group) |
operator = is copy More... | |
~ParticleGroup () | |
destructor More... | |
int | getBackupDataSize () const |
get backup data size More... | |
int | backupParticlePosVel (Float *_bk) |
Backup member particle position and velocity. More... | |
int | restoreParticlePosVel (Float *_bk) |
restore member particle position and velocity More... | |
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 *_fout) |
write particle data to files (notice original address is lost) More... | |
void | writeMemberAscii (std::ostream &_fout) const |
write particle data to files (notice original address is lost) More... | |
void | readBinary (FILE *_fin) |
Read particle data from file. More... | |
void | readMemberAscii (std::istream &_fin) |
Read particle data from file. More... | |
void | shiftToCenterOfMassFrame () |
shift particle to their c.m. frame More... | |
void | shiftToOriginFrame () |
shift particle to their original frame More... | |
void | calcCenterOfMass () |
calculate center-of-mass More... | |
bool | isOriginFrame () const |
return true if the system is the in their origin frame More... | |
![]() | |
List () | |
Constructor. More... | |
void | setMode (const ListMode _mode) |
set mode More... | |
void | reserveMem (const int _nmax) |
Memory allocation for storing members. More... | |
void | clear () |
Clear function. More... | |
List & | operator= (const List &_list) |
operator = is copy More... | |
~List () | |
destructor More... | |
int | getSize () const |
get current member number More... | |
ListMode | getMode () const |
Tparticle & | getMember (const int _index) |
return one member data reference More... | |
Tparticle * | getDataAddress () const |
return member data array address More... | |
Tparticle ** | getOriginAddressArray () const |
return member original address array More... | |
Tparticle & | getLastMember () |
return last member More... | |
Tparticle & | operator[] (const int _index) const |
return one member data reference operator More... | |
Tparticle * | getMemberOriginAddress (const int _index) const |
return one member original address More... | |
int | getSizeMax () const |
Get maximum member number allow to store. More... | |
void | addMemberAndAddress (T &_member) |
copy one member and its address More... | |
void | addMember (const T &_member) |
copy one member and its address More... | |
void | increaseSizeNoInitialize (const int _n) |
increase size without initialization More... | |
void | decreaseSizeNoInitialize (const int _n) |
increase size without initialization More... | |
void | resizeNoInitialize (const int _n) |
increase size without initialization More... | |
void | linkMemberArray (Tparticle _member[], const int _n_member) |
link a member array More... | |
void | removeMember (const int _index, const bool _shift_last_only_flag) |
remove one member More... | |
void | removeMemberTable (const int *remove_table) |
remove a list of member based on remove table More... | |
void | removeMemberList (const int *_index, const int _n_index) |
remove a list of member based on an index list More... | |
void | writeBackMemberAll () |
copy all member data back to original address More... | |
void | writeBackMemberList (const int *_index, const int _n) |
copy a list of member data back to original address More... | |
bool | isModified () const |
Get modified status. More... | |
void | setModifiedFalse () |
Reset modified status to false. More... | |
Public Attributes | |
Tpcm | cm |
Additional Inherited Members | |
![]() | |
static void | createRemoveTable (const int *_index, const int _n_index, const int _n_member, int *_remove_table) |
create remove table for removing a list of members More... | |
![]() | |
int | num_ |
number of current members in the list More... | |
int | nmax_ |
maximum number of members allocated in memory More... | |
Tparticle * | data_ |
member array to store the data, or a link to existed member array (not allocated) More... | |
Tparticle ** | adr_ |
original member address of member members More... | |
ListMode | mode_ |
mode indicator More... | |
bool | modified_flag_ |
true: member list is modified; used for safety checking More... | |
Particle group class to store and manage a group of particle.
A list that storing particle memory addresses and their copy (based on template class particle_)
|
inline |
center of mass particle for the group
Constructor
Set particle number to zero, clear pointers
|
inline |
destructor
|
inline |
Backup member particle position and velocity.
|
inline |
calculate center-of-mass
|
inline |
Clear function.
Free dynamical memory space allocated
|
inline |
get backup data size
|
inline |
return true if the system is the in their origin frame
|
inline |
operator = is copy
|
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 (defaulted 20) |
|
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 (defaulted 20) |
|
inline |
Read particle data from file.
Read particle data from file with BINARY format. Number of particles should be first variable, then the data of particles. Only work for ListMode::local case
[in] | _fin | FILE IO for reading. |
|
inline |
Read particle data from file.
Read particle data from file with BINARY format. Number of particles should be first variable, then the data of particles. Notice the memory should be allocated first, and the free space is enough to save the reading particles
[in] | _fin | std::istream IO for reading. |
|
inline |
restore member particle position and velocity
|
inline |
shift particle to their c.m. frame
Shift positions and velocities of particles from original frame to their center-of-mass frame
Notice the center-of-mass position and velocity use values from cm
|
inline |
shift particle to their original frame
Shift positions and velocities of particles from center-of-mass frame to original frame
Notice the center-of-mass position and velocity use values from cm
|
inline |
write particle data to files (notice original address is lost)
write particle data into file with BINARY format. Number of particles is written first, then the data of particles
[in] | _fout | FILE IO for writing |
|
inline |
write particle data to files (notice original address is lost)
! write particle data to files (notice original address is lost) *! write particle data into file with ASCII format. Number of particles is written first, then the data of particles
write particle data into file with ASCII format. Number of particles is written first, then the data of particles
[in] | _fout | std::ostream IO for writing |
Tpcm COMM::ParticleGroup< Tparticle, Tpcm >::cm |