PeTar
N-body code for collisional gravitational systems
|
Basic particle class. More...
#include <particle_base.hpp>
Public Member Functions | |
void | setBinaryPairID (const PS::S64 _id) |
save pair id in binary_state with shift bit size of BINARY_STATE_ID_SHIFT More... | |
void | setBinaryInterruptState (const BinaryInterruptState _state) |
save binary interrupt state in the first BINARY_STATE_ID_SHIFT bit in binary_state More... | |
BinaryInterruptState | getBinaryInterruptState () const |
get binary interrupt state from binary_state More... | |
PS::S64 | getBinaryPairID () const |
get pair ID from binary_state More... | |
ParticleBase () | |
defaulted constructor More... | |
template<class Tp > | |
ParticleBase (const Tp &p) | |
ParticleBase (const PS::F64 _mass, const PS::F64vec &_pos, const PS::F64vec &_vel) | |
constructor More... | |
ParticleBase (const PS::F64 _mass, const PS::F64vec &_pos, const PS::F64vec &_vel, const PS::S64 _binary_state) | |
constructor More... | |
void | writeAscii (FILE *fp) const |
write class data with ASCII format More... | |
void | readAscii (FILE *fp) |
read class data with ASCII format More... | |
void | writeBinary (FILE *fp) const |
write class data with BINARY format More... | |
void | readBinary (FILE *fp) |
read class data with BINARY format More... | |
void | print (std::ostream &fout) const |
for print debugging More... | |
void | printColumn (std::ostream &_fout, const int _width=20) const |
print data of class members using column style More... | |
template<class Tpcm > | |
void | printColumnWithOffset (Tpcm &_pcm, std::ostream &_fout, const int _width=20) const |
print data of class members with pos and vel offset using column style More... | |
template<class Tp > | |
void | DataCopy (const Tp &din) |
Copy from another ParticleBase. More... | |
PS::F64 | getMass () |
Get mass (required for ARC::chain) More... | |
PS::F64 * | getPos () |
Get position (required for ARC::chain) More... | |
PS::F64 * | getVel () |
Get velocity (required for ARC::chain) More... | |
void | setPos (const PS::F64 x, const PS::F64 y, const PS::F64 z) |
Set position (required for ARC::chain) More... | |
void | setPos (const PS::F64vec &_pos) |
Set position (used in soft part) More... | |
void | setVel (const PS::F64 vx, const PS::F64 vy, const PS::F64 vz) |
Set velocity (required for ARC::chain) More... | |
void | setVel (const PS::F64vec &_vel) |
Set velocity. More... | |
void | setMass (const PS::F64 m) |
Set mass (required for ARC::chain) More... | |
Static Public Member Functions | |
static void | printColumnTitle (std::ostream &_fout, const int _width=20) |
print titles of class members using column style More... | |
static int | printTitleWithMeaning (std::ostream &_fout, const int _counter=0, const int _offset=0) |
print column title with meaning (each line for one column) More... | |
Public Attributes | |
PS::F64 | mass |
PS::F64vec | pos |
PS::F64vec | vel |
PS::S64 | binary_state |
Basic particle class.
|
inline |
defaulted constructor
|
inline |
|
inline |
constructor
|
inline |
constructor
|
inline |
Copy from another ParticleBase.
This is used for data transfer between nodes and between soft and hard parts
[in] | din | data need to be copied |
|
inline |
get binary interrupt state from binary_state
|
inline |
get pair ID from binary_state
|
inline |
Get mass (required for ARC::chain)
|
inline |
Get position (required for ARC::chain)
|
inline |
Get velocity (required for ARC::chain)
|
inline |
for print debugging
|
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) |
|
inlinestatic |
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 |
print data of class members with pos and vel offset using column style
print data of class members in one line for column style. Notice no newline is printed at the end
[in] | _pcm | particle data with position and velocity offset that are added when print data |
[out] | _fout | std::ostream output object |
[in] | _width | print width (defaulted 20) |
|
inlinestatic |
print column title with meaning (each line for one column)
[out] | _fout | std::ostream output object |
[in] | _counter | offset of the number counter for each line to indicate the column index (defaulted 0) |
[in] | _offset | the printing whitespace offset for each line (defaulted 0) |
|
inline |
read class data with ASCII format
[in] | _fin | file IO for read |
|
inline |
read class data with BINARY format
[in] | _fin | file IO for read |
|
inline |
save binary interrupt state in the first BINARY_STATE_ID_SHIFT bit in binary_state
|
inline |
save pair id in binary_state with shift bit size of BINARY_STATE_ID_SHIFT
|
inline |
Set mass (required for ARC::chain)
NAN check will be done
[in] | m | particle mass |
|
inline |
Set position (required for ARC::chain)
NAN check will be done
[in] | x | particle position in x axis |
[in] | y | particle position in y axis |
[in] | z | particle position in z axis |
|
inline |
Set position (used in soft part)
|
inline |
Set velocity (required for ARC::chain)
NAN check will be done
[in] | vx | particle velocity in x axis |
[in] | vy | particle velocity in y axis |
[in] | vz | particle velocity in z axis |
|
inline |
Set velocity.
|
inline |
write class data with ASCII format
[in] | _fout | file IO for write |
|
inline |
write class data with BINARY format
[in] | _fout | file IO for write |
PS::S64 ParticleBase::binary_state |
PS::F64 ParticleBase::mass |
PS::F64vec ParticleBase::pos |
PS::F64vec ParticleBase::vel |