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

Tidal tensor perterbation for AR. More...

#include <tidal_tensor.hpp>

Public Member Functions

 TidalTensor ()
 
void dump (FILE *fp)
 
void read (FILE *fp)
 
void clear ()
 
template<class Tptcl >
void fit (Tptcl *_ptcl_tt, Tptcl &_ptcl_cm, const PS::F64 _size)
 tidal tensor fitting function, More...
 
void shiftCM (const PS::F64vec &_pos)
 Shift c.m. to new reference position. More...
 
void eval (PS::F64 *acc, const PS::F64vec &pos) const
 
PS::F64 evalPot (const PS::F64vec &pos) const
 
void print (std::ostream &_fout, const int _width) const
 

Static Public Member Functions

template<class Tptcl >
static void createTidalTensorMeasureParticles (Tptcl *_ptcl_tt, const Tptcl &_ptcl_cm, const PS::F64 _size)
 create tidal tensor measurement particles More...
 
template<class Tptcl >
static void subtractCMForce (Tptcl *_ptcl_tt, const Tptcl &_ptcl_cm)
 subtract c.m. force from measure points More...
 
static PS::S32 getParticleN ()
 get particle number More...
 

Public Attributes

PS::F64vec pos
 
PS::F64 group_id
 

Detailed Description

Tidal tensor perterbation for AR.

Constructor & Destructor Documentation

◆ TidalTensor()

TidalTensor::TidalTensor ( )
inline

Member Function Documentation

◆ clear()

void TidalTensor::clear ( )
inline

◆ createTidalTensorMeasureParticles()

template<class Tptcl >
static void TidalTensor::createTidalTensorMeasureParticles ( Tptcl *  _ptcl_tt,
const Tptcl &  _ptcl_cm,
const PS::F64  _size 
)
inlinestatic

create tidal tensor measurement particles

2nd order: creat 4 zero-mass particles at the corners of regular tentrahedron with edge size of 0.16*_size. the cente is c.m. particle 3rd order: creat 8 zero-mass particles at the corners of cube with edge size of 0.16*_size. the cente is c.m. particle

  • Assume _size is the maximum length,
Here is the call graph for this function:
Here is the caller graph for this function:

◆ dump()

void TidalTensor::dump ( FILE *  fp)
inline

◆ eval()

void TidalTensor::eval ( PS::F64 *  acc,
const PS::F64vec &  pos 
) const
inline
Here is the caller graph for this function:

◆ evalPot()

PS::F64 TidalTensor::evalPot ( const PS::F64vec &  pos) const
inline

◆ fit()

template<class Tptcl >
void TidalTensor::fit ( Tptcl *  _ptcl_tt,
Tptcl &  _ptcl_cm,
const PS::F64  _size 
)
inline

tidal tensor fitting function,

Symmetry T2: xx xy xz 0 1 2 yx yy yz 3(1) 4 5 zx zy zz 6(2) 7(5) 8

General T2: xx xy xz 0 1 2 yx yy yz 3 4 5 zx zy zz 6 7 8

Symmetry T3: xxx xxy xxz 0 1 2 xyx xyy xyz 1 3 4 xzx xzy xzz 2 4 5

yxx yxy yxz 1 3 4 yyx yyy yyz 3 6 7
yzx yzy yzz 4 7 8

zxx zxy zxz 2 4 5 zyx zyy zyz 4 7 8 zzx zzy zzz 5 8 9

Parameters
[in]_ptcl_tttidal tensor measure particles
[in]_ptcl_cmtidal tensor measure particle c.m.
[in]_sizeparticle box size
Here is the call graph for this function:

◆ getParticleN()

static PS::S32 TidalTensor::getParticleN ( )
inlinestatic

get particle number

Here is the caller graph for this function:

◆ print()

void TidalTensor::print ( std::ostream &  _fout,
const int  _width 
) const
inline

◆ read()

void TidalTensor::read ( FILE *  fp)
inline

◆ shiftCM()

void TidalTensor::shiftCM ( const PS::F64vec &  _pos)
inline

Shift c.m. to new reference position.

Only the 1st order tensor need a correction from 2nd order

1st order:

T2: xx xy xz 0 1 2 yx yy yz 3 4 5 zx zy zz 6 7 8

2nd order:

xxx xxy xxz 0 1 2 xyx xyy xyz 1 3 4 xzx xzy xzz 2 4 5

yxx yxy yxz 1 3 4 yyx yyy yyz 3 6 7
yzx yzy yzz 4 7 8

zxx zxy zxz 2 4 5 zyx zyy zyz 4 7 8 zzx zzy zzz 5 8 9

Parameters
[in]_posnew c.m. position

◆ subtractCMForce()

template<class Tptcl >
static void TidalTensor::subtractCMForce ( Tptcl *  _ptcl_tt,
const Tptcl &  _ptcl_cm 
)
inlinestatic

subtract c.m. force from measure points

Here is the caller graph for this function:

Member Data Documentation

◆ group_id

PS::F64 TidalTensor::group_id

◆ pos

PS::F64vec TidalTensor::pos

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