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

hermite interaction class More...

#include <hermite_interaction.hpp>

Public Member Functions

 HermiteInteraction ()
 
bool checkParams ()
 check whether parameters values are correct More...
 
void print (std::ostream &_fout) const
 print parameters More...
 
template<class Tpi , class Tpj >
Float calcR2Pair (const Tpi &_pi, const Tpj &_pj)
 calculate separation square between i and j particles More...
 
template<class Tpi , class Tpj >
Float calcAccJerkPairSingleSingle (H4::ForceH4 &_fi, const Tpi &_pi, const Tpj &_pj)
 calculate acceleration and jerk of one pair More...
 
template<class Tpi , class Tgroup >
Float calcAccJerkPairSingleGroupMember (H4::ForceH4 &_fi, const Tpi &_pi, const Tgroup &_gj)
 calculate acceleration and jerk of one pair single and resolved group More...
 
template<class Tpi , class Tgroup , class Tpcmj >
Float calcAccJerkPairSingleGroupCM (H4::ForceH4 &_fi, const Tpi &_pi, const Tgroup &_gj, const Tpcmj &_pj)
 calculate acceleration and jerk of one pair single and resolved group More...
 
template<class Tgroup , class Tpcmi , class Tpj >
Float calcAccJerkPairGroupCMSingle (H4::ForceH4 &_fi, const Tgroup &_gi, const Tpcmi &_pi, const Tpj &_pj)
 calculate acceleration and jerk of one pair group cm and single More...
 
template<class Tpi , class Tgroup >
Float calcAccJerkPairGroupCMGroupMember (H4::ForceH4 &_fi, const Tgroup &_gi, const Tpi &_pi, const Tgroup &_gj)
 calculate acceleration and jerk of one pair group cm and resolved group More...
 
template<class Tpcmi , class Tgroup , class Tpcmj >
Float calcAccJerkPairGroupCMGroupCM (H4::ForceH4 &_fi, const Tgroup &_gi, const Tpcmi &_pi, const Tgroup &_gj, const Tpcmj &_pj)
 calculate acceleration and jerk of one pair single and resolved group More...
 
template<class Tpi , class Tpj >
Float calcEnergyPotSingleSingle (const Tpi &pi, const Tpj &pj)
 calculate pair potential energy More...
 
template<class Tgroup , class Tpert >
Float calcEnergyPertOneGroup (const Tgroup &_group, const Tpert &_perturber)
 calculate peturbation energy to one group More...
 
template<class Tp , class Tgroup , class Tpert >
void calcEnergy (H4::HermiteEnergy &_energy, const Tp *_particles, const int _n_particle, const Tgroup *_groups, const int *_group_index, const int _n_group, const Tpert &_perturber)
 calculate kinetic and potential energy of the system More...
 
void writeBinary (FILE *_fp) const
 write class data to file with binary format More...
 
void readBinary (FILE *_fin)
 read class data to file with binary format More...
 

Public Attributes

Float eps_sq
 
Float gravitational_constant
 

Detailed Description

hermite interaction class

Constructor & Destructor Documentation

◆ HermiteInteraction()

HermiteInteraction::HermiteInteraction ( )
inline

Member Function Documentation

◆ calcAccJerkPairGroupCMGroupCM()

template<class Tpcmi , class Tgroup , class Tpcmj >
Float HermiteInteraction::calcAccJerkPairGroupCMGroupCM ( H4::ForceH4 &  _fi,
const Tgroup &  _gi,
const Tpcmi &  _pi,
const Tgroup &  _gj,
const Tpcmj &  _pj 
)
inline

calculate acceleration and jerk of one pair single and resolved group

Parameters
[out]
Here is the call graph for this function:

◆ calcAccJerkPairGroupCMGroupMember()

template<class Tpi , class Tgroup >
Float HermiteInteraction::calcAccJerkPairGroupCMGroupMember ( H4::ForceH4 &  _fi,
const Tgroup &  _gi,
const Tpi &  _pi,
const Tgroup &  _gj 
)
inline

calculate acceleration and jerk of one pair group cm and resolved group

Parameters
[out]

◆ calcAccJerkPairGroupCMSingle()

template<class Tgroup , class Tpcmi , class Tpj >
Float HermiteInteraction::calcAccJerkPairGroupCMSingle ( H4::ForceH4 &  _fi,
const Tgroup &  _gi,
const Tpcmi &  _pi,
const Tpj &  _pj 
)
inline

calculate acceleration and jerk of one pair group cm and single

Parameters
[out]

◆ calcAccJerkPairSingleGroupCM()

template<class Tpi , class Tgroup , class Tpcmj >
Float HermiteInteraction::calcAccJerkPairSingleGroupCM ( H4::ForceH4 &  _fi,
const Tpi &  _pi,
const Tgroup &  _gj,
const Tpcmj &  _pj 
)
inline

calculate acceleration and jerk of one pair single and resolved group

Parameters
[out]
Here is the call graph for this function:

◆ calcAccJerkPairSingleGroupMember()

template<class Tpi , class Tgroup >
Float HermiteInteraction::calcAccJerkPairSingleGroupMember ( H4::ForceH4 &  _fi,
const Tpi &  _pi,
const Tgroup &  _gj 
)
inline

calculate acceleration and jerk of one pair single and resolved group

Parameters
[out]
Here is the call graph for this function:

◆ calcAccJerkPairSingleSingle()

template<class Tpi , class Tpj >
Float HermiteInteraction::calcAccJerkPairSingleSingle ( H4::ForceH4 &  _fi,
const Tpi &  _pi,
const Tpj &  _pj 
)
inline

calculate acceleration and jerk of one pair

Parameters
[out]
Here is the call graph for this function:

◆ calcEnergy()

template<class Tp , class Tgroup , class Tpert >
void HermiteInteraction::calcEnergy ( H4::HermiteEnergy &  _energy,
const Tp *  _particles,
const int  _n_particle,
const Tgroup *  _groups,
const int *  _group_index,
const int  _n_group,
const Tpert &  _perturber 
)
inline

calculate kinetic and potential energy of the system

Parameters
[out]_energyhermite energy
[in]_particles(all) particle list
[in]_n_particlenumber of particles
[in]_groupsgroup list
[in]_group_indexactive groups index array for energy calculation
[in]_n_groupnumber of active groups
[in]_perturberperturber

◆ calcEnergyPertOneGroup()

template<class Tgroup , class Tpert >
Float HermiteInteraction::calcEnergyPertOneGroup ( const Tgroup &  _group,
const Tpert &  _perturber 
)
inline

calculate peturbation energy to one group

Parameters
[in]_grouptarget group
[in]_perturberperturber

◆ calcEnergyPotSingleSingle()

template<class Tpi , class Tpj >
Float HermiteInteraction::calcEnergyPotSingleSingle ( const Tpi &  pi,
const Tpj &  pj 
)
inline

calculate pair potential energy

◆ calcR2Pair()

template<class Tpi , class Tpj >
Float HermiteInteraction::calcR2Pair ( const Tpi &  _pi,
const Tpj &  _pj 
)
inline

calculate separation square between i and j particles

Parameters
[in]

◆ checkParams()

bool HermiteInteraction::checkParams ( )
inline

check whether parameters values are correct

Returns
true: all correct

◆ print()

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

print parameters

◆ readBinary()

void HermiteInteraction::readBinary ( FILE *  _fin)
inline

read class data to file with binary format

Parameters
[in]_fpFILE type file for reading

◆ writeBinary()

void HermiteInteraction::writeBinary ( FILE *  _fp) const
inline

write class data to file with binary format

Parameters
[in]_fpFILE type file for output

Member Data Documentation

◆ eps_sq

Float HermiteInteraction::eps_sq

◆ gravitational_constant

Float HermiteInteraction::gravitational_constant

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