PeTar
N-body code for collisional gravitational systems
Ptcl Class Reference

Particle class. More...

#include <ptcl.hpp>

Inheritance diagram for Ptcl:
[legend]
Collaboration diagram for Ptcl:
[legend]

Public Member Functions

 Ptcl ()
 
template<class Tptcl >
 Ptcl (const Tptcl &_p)
 
template<class Tptcl >
 Ptcl (const Tptcl &_p, const PS::F64 _r_search, const PS::S64 _id, const GroupDataDeliver &_group_data, const ChangeOver &_co)
 
template<class Tptcl >
void DataCopy (const Tptcl &_p)
 
template<class Tptcl >
Ptcloperator= (const Tptcl &_p)
 
void print (std::ostream &_fout) const
 
void printColumn (std::ostream &_fout, const int _width=20)
 print data of class members using column style More...
 
template<class Tpcm >
void printColumnWithOffset (Tpcm &_pcm, std::ostream &_fout, const int _width=20)
 print data of class members with pos and vel offset using column style More...
 
void writeAscii (FILE *_fout) const
 write class data with ASCII format More...
 
void writeBinary (FILE *_fout) const
 write class data with BINARY format More...
 
void readAscii (FILE *_fin)
 read class data with ASCII format More...
 
void readBinary (FILE *_fin)
 read class data with BINARY format More...
 
void setParticleCMAddress (const PS::S64 _adr)
 set status to c.m. particle address More...
 
PS::S64 getParticleCMAddress () const
 get c.m. particle address More...
 
void calcRSearch (const PS::F64 _dt_tree)
 calculate new rsearch More...
 
PS::F64 getRNeighbor () const
 Get neighbor distance criterion. More...
 
PS::F64 getRGroupCandidate () const
 Get group candidate distance criterion. More...
 
PS::F64 getRGroup () const
 Get group distance criterion. More...
 
- Public Member Functions inherited from ParticleBase
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...
 
- Static Public Member Functions inherited from ParticleBase
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 r_search
 
PS::S64 id
 
GroupDataDeliver group_data
 
ChangeOver changeover
 
- Public Attributes inherited from ParticleBase
PS::F64 mass
 
PS::F64vec pos
 
PS::F64vec vel
 
PS::S64 binary_state
 

Static Public Attributes

static PS::F64 search_factor = 0.0
 
static PS::F64 r_search_min = 0.0
 
static PS::F64 r_group_crit_ratio =0.0
 
static PS::F64 mean_mass_inv = 0.0
 
static GroupDataMode group_data_mode = GroupDataMode::none
 

Detailed Description

Particle class.

Constructor & Destructor Documentation

◆ Ptcl() [1/3]

Ptcl::Ptcl ( )
inline

◆ Ptcl() [2/3]

template<class Tptcl >
Ptcl::Ptcl ( const Tptcl &  _p)
inline
Here is the call graph for this function:

◆ Ptcl() [3/3]

template<class Tptcl >
Ptcl::Ptcl ( const Tptcl &  _p,
const PS::F64  _r_search,
const PS::S64  _id,
const GroupDataDeliver _group_data,
const ChangeOver _co 
)
inline

Member Function Documentation

◆ calcRSearch()

void Ptcl::calcRSearch ( const PS::F64  _dt_tree)
inline

calculate new rsearch

calculate r_search based on velocity and tree step

Here is the call graph for this function:

◆ DataCopy()

template<class Tptcl >
void Ptcl::DataCopy ( const Tptcl &  _p)
inline
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getParticleCMAddress()

PS::S64 Ptcl::getParticleCMAddress ( ) const
inline

get c.m. particle address

Here is the call graph for this function:

◆ getRGroup()

PS::F64 Ptcl::getRGroup ( ) const
inline

Get group distance criterion.

Here is the call graph for this function:

◆ getRGroupCandidate()

PS::F64 Ptcl::getRGroupCandidate ( ) const
inline

Get group candidate distance criterion.

Here is the call graph for this function:

◆ getRNeighbor()

PS::F64 Ptcl::getRNeighbor ( ) const
inline

Get neighbor distance criterion.

Here is the call graph for this function:

◆ operator=()

template<class Tptcl >
Ptcl& Ptcl::operator= ( const Tptcl &  _p)
inline
Here is the call graph for this function:

◆ print()

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

◆ printColumn()

void Ptcl::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()

static void Ptcl::printColumnTitle ( std::ostream &  _fout,
const int  _width = 20 
)
inlinestatic

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:

◆ printColumnWithOffset()

template<class Tpcm >
void Ptcl::printColumnWithOffset ( Tpcm &  _pcm,
std::ostream &  _fout,
const int  _width = 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

Parameters
[in]_pcmparticle data with position and velocity offset that are added when print data
[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:

◆ printTitleWithMeaning()

static int Ptcl::printTitleWithMeaning ( std::ostream &  _fout,
const int  _counter = 0,
const int  _offset = 0 
)
inlinestatic

print column title with meaning (each line for one column)

Parameters
[out]_foutstd::ostream output object
[in]_counteroffset of the number counter for each line to indicate the column index (defaulted 0)
[in]_offsetthe printing whitespace offset for each line (defaulted 0)
Returns
: the total counter of columns
Here is the call graph for this function:
Here is the caller graph for this function:

◆ readAscii()

void Ptcl::readAscii ( FILE *  _fin)
inline

read class data with ASCII format

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

◆ readBinary()

void Ptcl::readBinary ( FILE *  _fin)
inline

read class data with BINARY format

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

◆ setParticleCMAddress()

void Ptcl::setParticleCMAddress ( const PS::S64  _adr)
inline

set status to c.m. particle address

Here is the call graph for this function:

◆ writeAscii()

void Ptcl::writeAscii ( FILE *  _fout) const
inline

write class data with ASCII format

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

◆ writeBinary()

void Ptcl::writeBinary ( FILE *  _fout) const
inline

write class data with BINARY format

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

Member Data Documentation

◆ changeover

ChangeOver Ptcl::changeover

◆ group_data

GroupDataDeliver Ptcl::group_data

◆ group_data_mode

GroupDataMode Ptcl::group_data_mode = GroupDataMode::none
static

◆ id

PS::S64 Ptcl::id

◆ mean_mass_inv

PS::F64 Ptcl::mean_mass_inv = 0.0
static

◆ r_group_crit_ratio

PS::F64 Ptcl::r_group_crit_ratio =0.0
static

◆ r_search

PS::F64 Ptcl::r_search

◆ r_search_min

PS::F64 Ptcl::r_search_min = 0.0
static

◆ search_factor

PS::F64 Ptcl::search_factor = 0.0
static

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