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

#include <hard_ptcl.hpp>

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

Public Member Functions

 PtclHard ()
 
template<class Tptcl >
 PtclHard (const Tptcl &_p, const PS::F64 _r_search, const PS::F64 _mass_bk, const PS::S64 _id, const PS::S64 _status, const ChangeOver &_co, const PS::S32 _id_cluster, const PS::S32 _adr_org)
 
template<class Tptcl >
 PtclHard (const Tptcl &_p, const PS::S32 _id_cluster, const PS::S32 _adr_org)
 
template<class Tptcl >
 PtclHard (const Tptcl &_p)
 
template<class Tptcl >
void DataCopy (const Tptcl &_p)
 
template<class Tptcl >
PtclHardoperator= (const Tptcl &_p)
 
void setTidalTensorID (const PS::S32 _id)
 
PS::S32 getTidalTensorID () const
 
void calcRSearch (const PS::F64 _Gm, const PS::F64 _pot, const PS::F64vec &_vel_cm, const PS::F64 _dt_tree)
 
void dump (FILE *_fout)
 
void read (FILE *_fin)
 
void print (std::ostream &_fout) const
 
- Public Member Functions inherited from Ptcl
 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...
 

Public Attributes

PS::S32 id_cluster
 
PS::S32 adr_org
 
- Public Attributes inherited from Ptcl
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
 

Additional Inherited Members

- Static Public Member Functions inherited from Ptcl
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...
 
- Static Public Attributes inherited from Ptcl
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
 

Constructor & Destructor Documentation

◆ PtclHard() [1/4]

PtclHard::PtclHard ( )
inline

◆ PtclHard() [2/4]

template<class Tptcl >
PtclHard::PtclHard ( const Tptcl &  _p,
const PS::F64  _r_search,
const PS::F64  _mass_bk,
const PS::S64  _id,
const PS::S64  _status,
const ChangeOver _co,
const PS::S32  _id_cluster,
const PS::S32  _adr_org 
)
inline

◆ PtclHard() [3/4]

template<class Tptcl >
PtclHard::PtclHard ( const Tptcl &  _p,
const PS::S32  _id_cluster,
const PS::S32  _adr_org 
)
inline

◆ PtclHard() [4/4]

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

Member Function Documentation

◆ calcRSearch()

void PtclHard::calcRSearch ( const PS::F64  _Gm,
const PS::F64  _pot,
const PS::F64vec &  _vel_cm,
const PS::F64  _dt_tree 
)
inline

Potential criterion: pot = -Gm/r0 -Gm/r0 + 1/2 v^2 = -Gm/(r0+dr) dr = r0/[2Gm/(r0 v^2) - 1] If energy is positive, dr < 0

velocity criterion: v*dt_tree

Use min of two

Here is the call graph for this function:

◆ DataCopy()

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

◆ dump()

void PtclHard::dump ( FILE *  _fout)
inline

◆ getTidalTensorID()

PS::S32 PtclHard::getTidalTensorID ( ) const
inline
Here is the call graph for this function:

◆ operator=()

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

◆ print()

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

◆ read()

void PtclHard::read ( FILE *  _fin)
inline

◆ setTidalTensorID()

void PtclHard::setTidalTensorID ( const PS::S32  _id)
inline
Here is the call graph for this function:

Member Data Documentation

◆ adr_org

PS::S32 PtclHard::adr_org

◆ id_cluster

PS::S32 PtclHard::id_cluster

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