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

class to organize artificial particles More...

#include <artificial_particles.hpp>

Collaboration diagram for ArtificialParticleManager:
[legend]

Public Member Functions

 ArtificialParticleManager ()
 

orbit particle method

More...
 
bool checkParams ()
 check paramters More...
 
template<class Tptcl >
void createArtificialParticles (Tptcl *_ptcl_artificial, COMM::BinaryTree< Tptcl, COMM::Binary > &_bin, const PS::F64 *_data_to_store, const PS::S32 _n_data)
 create artificial particles More...
 
template<class Tptcl >
void correctOrbitalParticleForce (Tptcl *_ptcl_artificial)
 correct orbit-samping/pseudo particles force More...
 
template<class Tptcl >
void correctArtficialParticleForce (Tptcl *_ptcl_artificial)
 correct artificial particles force for furture use More...
 
template<class Tptcl >
Tptcl * getOrbitalParticles (Tptcl *_ptcl_list)
 get oribit/pseudo particle list address from a artificial particle array More...
 
template<class Tptcl >
Tptcl * getTidalTensorParticles (Tptcl *_ptcl_list)
 get tidal tensor particle list address from a artificial particle array More...
 
template<class Tptcl >
Tptcl * getCMParticles (Tptcl *_ptcl_list)
 get c.m. particle list address from a artificial particle array More...
 
PS::S32 getIndexOffsetTT () const
 tidal tensor particle index offset More...
 
PS::S32 getIndexOffsetOrb () const
 orbital/pseudo particle index offset More...
 
PS::S32 getIndexOffsetCM () const
 CM particle index offset. More...
 
PS::S32 getArtificialParticleN () const
 get artificial particle total number More...
 
PS::S32 getTidalTensorParticleN () const
 get artificial particle total number More...
 
PS::S32 getOrbitalParticleN () const
 get orbitial particle number More...
 
template<class Tptcl >
PS::S32 getLeftMemberN (const Tptcl *_ptcl_list) const
 get left member number More...
 
template<class Tptcl >
PS::S32 getMemberN (const Tptcl *_ptcl_list) const
 get member number More...
 
template<class Tptcl >
PS::S32 getRightMemberN (const Tptcl *_ptcl_list) const
 get right member number More...
 
template<class Tptcl >
PS::S64 getCMID (const Tptcl *_ptcl_list) const
 get center of mass id More...
 
template<class Tptcl >
PS::F64 getStoredData (const Tptcl *_ptcl_list, const PS::S32 _index, const bool _is_positive) const
 get stored data More...
 
void writeBinary (FILE *_fp)
 write class data to file with binary format More...
 
void readBinary (FILE *_fin)
 read class data to file with binary format More...
 
void print (std::ostream &_fout) const
 print parameters More...
 

Public Attributes

PS::F64 r_tidal_tensor
 
PS::S64 id_offset
 

tidal tensor maximum distance of particles

More...
 
PS::F64 gravitational_constant
 

offset to generate ID for artificial particles

More...
 
OrbitManager orbit_manager
 

gravitational constant

More...
 

Detailed Description

class to organize artificial particles

Constructor & Destructor Documentation

◆ ArtificialParticleManager()

ArtificialParticleManager::ArtificialParticleManager ( )
inline

orbit particle method

initializer, require setParticleSplitN later to initialize the size

Member Function Documentation

◆ checkParams()

bool ArtificialParticleManager::checkParams ( )
inline

check paramters

Here is the call graph for this function:
Here is the caller graph for this function:

◆ correctArtficialParticleForce()

template<class Tptcl >
void ArtificialParticleManager::correctArtficialParticleForce ( Tptcl *  _ptcl_artificial)
inline

correct artificial particles force for furture use

substract c.m. force (acc) from tidal tensor force (acc)
replace c.m. force by the averaged force on orbital particles

Parameters
[in,out]_ptcl_artificialone group of artificial particles
Here is the call graph for this function:
Here is the caller graph for this function:

◆ correctOrbitalParticleForce()

template<class Tptcl >
void ArtificialParticleManager::correctOrbitalParticleForce ( Tptcl *  _ptcl_artificial)
inline

correct orbit-samping/pseudo particles force

replace c.m. force by the averaged force on sample/pseudo particles

Parameters
[in,out]_ptcl_artificialone group of artificial particles
Here is the call graph for this function:

◆ createArtificialParticles()

template<class Tptcl >
void ArtificialParticleManager::createArtificialParticles ( Tptcl *  _ptcl_artificial,
COMM::BinaryTree< Tptcl, COMM::Binary > &  _bin,
const PS::F64 *  _data_to_store,
const PS::S32  _n_data 
)
inline

create artificial particles

First TidalTensor::getParticleN() are tidal tensor particles; others-1 are orbitial sample particles; last is c.m.
id: tt/orb: id_offset + abs(member->id)*(n_artificial-1)/2 + index/2; cm: - abs(_bin.id)

status: Tidal tensors/orbital 0: left member N 1: right member N others: index+1 (_data_to_store>0.0)

c.m.: n_members

mass_backup: Tidial tensors/orbital: 0.0 (_data_to_store <=0.0) c.m.: mass(cm)

Parameters
[out]_ptcl_newartificial particles that will be added
[in]_binbinary tree root
[in]_data_to_storearray of data to be stored in the status of artificial particles
[in]_n_datanumber of data
Here is the call graph for this function:

◆ getArtificialParticleN()

PS::S32 ArtificialParticleManager::getArtificialParticleN ( ) const
inline

get artificial particle total number

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getCMID()

template<class Tptcl >
PS::S64 ArtificialParticleManager::getCMID ( const Tptcl *  _ptcl_list) const
inline

get center of mass id

Here is the call graph for this function:

◆ getCMParticles()

template<class Tptcl >
Tptcl* ArtificialParticleManager::getCMParticles ( Tptcl *  _ptcl_list)
inline

get c.m. particle list address from a artificial particle array

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getIndexOffsetCM()

PS::S32 ArtificialParticleManager::getIndexOffsetCM ( ) const
inline

CM particle index offset.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getIndexOffsetOrb()

PS::S32 ArtificialParticleManager::getIndexOffsetOrb ( ) const
inline

orbital/pseudo particle index offset

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getIndexOffsetTT()

PS::S32 ArtificialParticleManager::getIndexOffsetTT ( ) const
inline

tidal tensor particle index offset

Here is the caller graph for this function:

◆ getLeftMemberN()

template<class Tptcl >
PS::S32 ArtificialParticleManager::getLeftMemberN ( const Tptcl *  _ptcl_list) const
inline

get left member number

◆ getMemberN()

template<class Tptcl >
PS::S32 ArtificialParticleManager::getMemberN ( const Tptcl *  _ptcl_list) const
inline

get member number

Here is the call graph for this function:

◆ getOrbitalParticleN()

PS::S32 ArtificialParticleManager::getOrbitalParticleN ( ) const
inline

get orbitial particle number

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getOrbitalParticles()

template<class Tptcl >
Tptcl* ArtificialParticleManager::getOrbitalParticles ( Tptcl *  _ptcl_list)
inline

get oribit/pseudo particle list address from a artificial particle array

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getRightMemberN()

template<class Tptcl >
PS::S32 ArtificialParticleManager::getRightMemberN ( const Tptcl *  _ptcl_list) const
inline

get right member number

◆ getStoredData()

template<class Tptcl >
PS::F64 ArtificialParticleManager::getStoredData ( const Tptcl *  _ptcl_list,
const PS::S32  _index,
const bool  _is_positive 
) const
inline

get stored data

◆ getTidalTensorParticleN()

PS::S32 ArtificialParticleManager::getTidalTensorParticleN ( ) const
inline

get artificial particle total number

Here is the call graph for this function:

◆ getTidalTensorParticles()

template<class Tptcl >
Tptcl* ArtificialParticleManager::getTidalTensorParticles ( Tptcl *  _ptcl_list)
inline

get tidal tensor particle list address from a artificial particle array

Here is the call graph for this function:
Here is the caller graph for this function:

◆ print()

void ArtificialParticleManager::print ( std::ostream &  _fout) const
inline

print parameters

Here is the call graph for this function:
Here is the caller graph for this function:

◆ readBinary()

void ArtificialParticleManager::readBinary ( FILE *  _fin)
inline

read class data to file with binary format

Parameters
[in]_fpFILE type file for reading
Here is the call graph for this function:
Here is the caller graph for this function:

◆ writeBinary()

void ArtificialParticleManager::writeBinary ( FILE *  _fp)
inline

write class data to file with binary format

Parameters
[in]_fpFILE type file for output
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ gravitational_constant

PS::F64 ArtificialParticleManager::gravitational_constant

offset to generate ID for artificial particles

◆ id_offset

PS::S64 ArtificialParticleManager::id_offset

tidal tensor maximum distance of particles

◆ orbit_manager

OrbitManager ArtificialParticleManager::orbit_manager

gravitational constant

◆ r_tidal_tensor

PS::F64 ArtificialParticleManager::r_tidal_tensor

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