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

Hard system. More...

#include <hard.hpp>

Collaboration diagram for SystemHard:
[legend]

Classes

struct  GroupIndexInfo
 

Public Member Functions

bool checkParams ()
 check paramters More...
 
 SystemHard ()
 
void allocateHardIntegrator (const PS::S32 _n_hard_int)
 allocate memorgy for HardIntegrator More...
 
 ~SystemHard ()
 
void initializeForOneCluster (const PS::S32 n)
 
template<class Tsys , class Tptcl , class Tmediator >
void setPtclForConnectedCluster (const Tsys &sys, const PS::ReallocatableArray< Tmediator > &med, const PS::ReallocatableArray< Tptcl > &ptcl_recv)
 
PS::S32 getGroupPtclRemoteN () const
 
PS::ReallocatableArray< PtclH4 > & getPtcl ()
 
PS::S32 getNumberOfClusters () const
 
PS::S32 getNumberOfInterruptClusters () const
 
HardIntegratorgetInterruptHardIntegrator (const std::size_t i)
 
PS::S32 * getClusterNumberOfMemberList (const std::size_t i=0) const
 
PS::S32 * getClusterNumberOfMemberListOffset (const std::size_t i=0) const
 
PS::S32 * getGroupNumberOfMemberList (const std::size_t i=0) const
 
PS::S32 * getGroupNumberOfMemberListOffset (const std::size_t i=0) const
 
PS::S32 * getAdrPtclArtFirstList (const std::size_t i=0) const
 
PS::S32 getNClusterChangeOverUpdate () const
 
void setTimeOrigin (const PS::F64 _time_origin)
 
void updateTimeWriteBack ()
 
PS::F64 getTimeOrigin () const
 
template<class Tsys >
void setPtclForOneClusterOMP (const Tsys &sys, const PS::ReallocatableArray< PS::S32 > &adr_array)
 
void driveForOneClusterOMP (const PS::F64 _dt)
 integrate one isolated particle More...
 
template<class Tsys >
void writeBackPtclForOneCluster (Tsys &sys, PS::ReallocatableArray< PS::S32 > &_mass_modify_list)
 write back hard particles to global system, check mass modification and update time of write back More...
 
template<class Tsys >
void writeBackPtclForOneClusterOMP (Tsys &sys, PS::ReallocatableArray< PS::S32 > &_mass_modify_list)
 write back hard particles to global system and update time of write back OMP version More...
 
template<class Tsys >
void writeBackPtclForMultiCluster (Tsys &_sys, PS::ReallocatableArray< PS::S32 > &_mass_modify_list)
 write back hard particles to global system, check mass modification and update time of write back More...
 
template<class Tsys >
void writeBackPtclForMultiClusterOMP (Tsys &_sys, PS::ReallocatableArray< PS::S32 > &_mass_modify_list)
 write back hard particles to global system and update time of write back OMP version More...
 
template<class Tsys >
void setPtclForIsolatedMultiClusterOMP (const Tsys &sys, const PS::ReallocatableArray< PS::S32 > &_adr_array, const PS::ReallocatableArray< PS::S32 > &_n_ptcl_in_cluster)
 
template<class Tpsoft >
int driveForMultiClusterOMP (const PS::F64 dt, Tpsoft *_ptcl_soft)
 Hard integration for clusters. More...
 
PS::S32 finishIntegrateInterruptClustersOMP ()
 Finish interrupt integration. More...
 
template<class Tptcl >
void findGroupsAndCreateArtificialParticlesOneCluster (const PS::S32 _i_cluster, Tptcl *_ptcl_in_cluster, const PS::S32 _n_ptcl, PS::ReallocatableArray< Tptcl > &_ptcl_artificial, PS::ReallocatableArray< COMM::BinaryTree< PtclH4, COMM::Binary >> &_binary_table, PS::S32 &_n_groups, PS::ReallocatableArray< GroupIndexInfo > &_n_member_in_group, PS::ReallocatableArray< PS::S32 > &_changeover_update_list, SearchGroupCandidate< Tptcl > &_groups, const PS::F64 _dt_tree)
 generate artificial particles, More...
 
template<class Tsys , class Tptcl >
void findGroupsAndCreateArtificialParticlesOMP (Tsys &_sys, const PS::F64 _dt_tree)
 Find groups and create aritfical particles to sys. More...
 
template<class Tsys >
void correctPotWithCutoffOMP (Tsys &_sys, const PS::ReallocatableArray< PS::S32 > &_ptcl_list)
 potential correction for single cluster More...
 
template<class Tsys , class Tpsoft , class Ttree , class Tepj >
void correctForceWithCutoffTreeNeighborAndClusterOMP (Tsys &_sys, Ttree &_tree, const PS::ReallocatableArray< PS::S32 > &_adr_send, const bool _acorr_flag=false)
 Soft force correction due to different cut-off function. More...
 
template<class Tsys >
void correctForceWithCutoffClusterOMP (Tsys &_sys, const bool _acorr_flag=false)
 Soft force correction due to different cut-off function. More...
 
template<class Tsys , class Ttree , class Tepj >
void correctForceForChangeOverUpdateOMP (Tsys &_sys, Ttree &_tree, const PS::S32 *_adr_send=NULL, const PS::S32 _n_send=0)
 Correct force due to change over factor change. More...
 

Static Public Member Functions

template<class Tsys , class Tpsoft , class Ttree , class Tepj >
static void correctForceWithCutoffTreeNeighborOMP (Tsys &_sys, Ttree &_tree, const PS::S32 _adr_ptcl_artificial_start, ArtificialParticleManager &_ap_manager, const bool _acorr_flag=false)
 Soft force correction due to different cut-off function. More...
 

Public Attributes

PS::ReallocatableArray< COMM::BinaryTree< PtclH4, COMM::Binary > > binary_table
 
HardManagermanager
 

Detailed Description

Hard system.

Constructor & Destructor Documentation

◆ SystemHard()

SystemHard::SystemHard ( )
inline
Here is the call graph for this function:

◆ ~SystemHard()

SystemHard::~SystemHard ( )
inline

Member Function Documentation

◆ allocateHardIntegrator()

void SystemHard::allocateHardIntegrator ( const PS::S32  _n_hard_int)
inline

allocate memorgy for HardIntegrator

For record interrupt clusters. A array of HardIntegrator is allocated

Parameters
[in]_n_hard_intnumber of HardIntegrator
Here is the caller graph for this function:

◆ checkParams()

bool SystemHard::checkParams ( )
inline

check paramters

Here is the call graph for this function:

◆ correctForceForChangeOverUpdateOMP()

template<class Tsys , class Ttree , class Tepj >
void SystemHard::correctForceForChangeOverUpdateOMP ( Tsys &  _sys,
Ttree &  _tree,
const PS::S32 *  _adr_send = NULL,
const PS::S32  _n_send = 0 
)
inline

Correct force due to change over factor change.

Parameters
[in,out]_sysglobal particle system, acc is updated
[in]_treetree for force, to get neighbor list
[in]_adr_sendfor connected case, correct sending list
[in]_n_sendsending particle number

◆ correctForceWithCutoffClusterOMP()

template<class Tsys >
void SystemHard::correctForceWithCutoffClusterOMP ( Tsys &  _sys,
const bool  _acorr_flag = false 
)
inline

Soft force correction due to different cut-off function.

◆ correctForceWithCutoffTreeNeighborAndClusterOMP()

template<class Tsys , class Tpsoft , class Ttree , class Tepj >
void SystemHard::correctForceWithCutoffTreeNeighborAndClusterOMP ( Tsys &  _sys,
Ttree &  _tree,
const PS::ReallocatableArray< PS::S32 > &  _adr_send,
const bool  _acorr_flag = false 
)
inline

Soft force correction due to different cut-off function.

Use tree neighbor search

  1. first correct for artificial particles use cluster information,
  2. The c.m. force is substracted from tidal tensor force
  3. c.m. force is replaced by the averaged force on orbital particles
  4. then use tree neighbor search for local cluster real member.
Parameters
[in]_sysglobal particle system, acc is updated
[in]_treetree for force
[in]_adr_sendparticle in sending list of connected clusters
[in]_acorr_flagflag to do acorr for KDKDK_4TH case

◆ correctForceWithCutoffTreeNeighborOMP()

template<class Tsys , class Tpsoft , class Ttree , class Tepj >
static void SystemHard::correctForceWithCutoffTreeNeighborOMP ( Tsys &  _sys,
Ttree &  _tree,
const PS::S32  _adr_ptcl_artificial_start,
ArtificialParticleManager _ap_manager,
const bool  _acorr_flag = false 
)
inlinestatic

Soft force correction due to different cut-off function.

Use tree neighbor search for all particles. c.m. force is replaced by the averaged force on orbital particles Tidal tensor particle subtract the c.m. acc

Parameters
[in]_sysglobal particle system, acc is updated
[in]_treetree for force
[in]_adr_ptcl_artificial_startstart address of artificial particle in _sys
[in]_ap_managerartificial particle manager
Here is the call graph for this function:

◆ correctPotWithCutoffOMP()

template<class Tsys >
void SystemHard::correctPotWithCutoffOMP ( Tsys &  _sys,
const PS::ReallocatableArray< PS::S32 > &  _ptcl_list 
)
inline

potential correction for single cluster

◆ driveForMultiClusterOMP()

template<class Tpsoft >
int SystemHard::driveForMultiClusterOMP ( const PS::F64  dt,
Tpsoft *  _ptcl_soft 
)
inline

Hard integration for clusters.

Integrate (drift) all clusters with OpenMP If interrupt integration exist, record in the interrupt_list_;

Parameters
[in]_dtintegration ending time (initial time is fixed to 0)
[in]_ptcl_softglobal particle array which contains the artificial particles for constructing tidal tensors.
Returns
interrupt cluster number
Here is the caller graph for this function:

◆ driveForOneClusterOMP()

void SystemHard::driveForOneClusterOMP ( const PS::F64  _dt)
inline

integrate one isolated particle

integrate one isolated particle and calculate new r_search

Parameters
[in]_dttree time step

◆ findGroupsAndCreateArtificialParticlesOMP()

template<class Tsys , class Tptcl >
void SystemHard::findGroupsAndCreateArtificialParticlesOMP ( Tsys &  _sys,
const PS::F64  _dt_tree 
)
inline

Find groups and create aritfical particles to sys.

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

◆ findGroupsAndCreateArtificialParticlesOneCluster()

template<class Tptcl >
void SystemHard::findGroupsAndCreateArtificialParticlesOneCluster ( const PS::S32  _i_cluster,
Tptcl *  _ptcl_in_cluster,
const PS::S32  _n_ptcl,
PS::ReallocatableArray< Tptcl > &  _ptcl_artificial,
PS::ReallocatableArray< COMM::BinaryTree< PtclH4, COMM::Binary >> &  _binary_table,
PS::S32 &  _n_groups,
PS::ReallocatableArray< GroupIndexInfo > &  _n_member_in_group,
PS::ReallocatableArray< PS::S32 > &  _changeover_update_list,
SearchGroupCandidate< Tptcl > &  _groups,
const PS::F64  _dt_tree 
)
inline

generate artificial particles,

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

◆ finishIntegrateInterruptClustersOMP()

PS::S32 SystemHard::finishIntegrateInterruptClustersOMP ( )
inline

Finish interrupt integration.

Finish interrupted integrations, if new interruption appear, record in the interrupt_list and this function need to be called again after modification of interrupt clusters If no new interrupt cluster appear, update time_origin_ with drift time.

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

◆ getAdrPtclArtFirstList()

PS::S32* SystemHard::getAdrPtclArtFirstList ( const std::size_t  i = 0) const
inline

◆ getClusterNumberOfMemberList()

PS::S32* SystemHard::getClusterNumberOfMemberList ( const std::size_t  i = 0) const
inline

◆ getClusterNumberOfMemberListOffset()

PS::S32* SystemHard::getClusterNumberOfMemberListOffset ( const std::size_t  i = 0) const
inline

◆ getGroupNumberOfMemberList()

PS::S32* SystemHard::getGroupNumberOfMemberList ( const std::size_t  i = 0) const
inline

◆ getGroupNumberOfMemberListOffset()

PS::S32* SystemHard::getGroupNumberOfMemberListOffset ( const std::size_t  i = 0) const
inline

◆ getGroupPtclRemoteN()

PS::S32 SystemHard::getGroupPtclRemoteN ( ) const
inline

◆ getInterruptHardIntegrator()

HardIntegrator* SystemHard::getInterruptHardIntegrator ( const std::size_t  i)
inline

◆ getNClusterChangeOverUpdate()

PS::S32 SystemHard::getNClusterChangeOverUpdate ( ) const
inline

◆ getNumberOfClusters()

PS::S32 SystemHard::getNumberOfClusters ( ) const
inline

◆ getNumberOfInterruptClusters()

PS::S32 SystemHard::getNumberOfInterruptClusters ( ) const
inline

◆ getPtcl()

PS::ReallocatableArray<PtclH4>& SystemHard::getPtcl ( )
inline
Here is the caller graph for this function:

◆ getTimeOrigin()

PS::F64 SystemHard::getTimeOrigin ( ) const
inline

◆ initializeForOneCluster()

void SystemHard::initializeForOneCluster ( const PS::S32  n)
inline

◆ setPtclForConnectedCluster()

template<class Tsys , class Tptcl , class Tmediator >
void SystemHard::setPtclForConnectedCluster ( const Tsys &  sys,
const PS::ReallocatableArray< Tmediator > &  med,
const PS::ReallocatableArray< Tptcl > &  ptcl_recv 
)
inline

◆ setPtclForIsolatedMultiClusterOMP()

template<class Tsys >
void SystemHard::setPtclForIsolatedMultiClusterOMP ( const Tsys &  sys,
const PS::ReallocatableArray< PS::S32 > &  _adr_array,
const PS::ReallocatableArray< PS::S32 > &  _n_ptcl_in_cluster 
)
inline
Here is the caller graph for this function:

◆ setPtclForOneClusterOMP()

template<class Tsys >
void SystemHard::setPtclForOneClusterOMP ( const Tsys &  sys,
const PS::ReallocatableArray< PS::S32 > &  adr_array 
)
inline

◆ setTimeOrigin()

void SystemHard::setTimeOrigin ( const PS::F64  _time_origin)
inline
Here is the caller graph for this function:

◆ updateTimeWriteBack()

void SystemHard::updateTimeWriteBack ( )
inline
Here is the caller graph for this function:

◆ writeBackPtclForMultiCluster()

template<class Tsys >
void SystemHard::writeBackPtclForMultiCluster ( Tsys &  _sys,
PS::ReallocatableArray< PS::S32 > &  _mass_modify_list 
)
inline

write back hard particles to global system, check mass modification and update time of write back

Parameters
[in,out]_sysparticle system
[out]_mass_modify_listaddress on _sys of particles where mass is modified
Here is the call graph for this function:
Here is the caller graph for this function:

◆ writeBackPtclForMultiClusterOMP()

template<class Tsys >
void SystemHard::writeBackPtclForMultiClusterOMP ( Tsys &  _sys,
PS::ReallocatableArray< PS::S32 > &  _mass_modify_list 
)
inline

write back hard particles to global system and update time of write back OMP version

Parameters
[in,out]_sysparticle system
[out]_mass_modify_listaddress on _sys of particles where mass is modified
[out]_removelistaddress on _sys of particles that are need to be removed are stored.
Here is the call graph for this function:

◆ writeBackPtclForOneCluster()

template<class Tsys >
void SystemHard::writeBackPtclForOneCluster ( Tsys &  sys,
PS::ReallocatableArray< PS::S32 > &  _mass_modify_list 
)
inline

write back hard particles to global system, check mass modification and update time of write back

Parameters
[in,out]_sysparticle system
[out]_mass_modify_listaddress on _sys of particles where mass is modified
Here is the call graph for this function:
Here is the caller graph for this function:

◆ writeBackPtclForOneClusterOMP()

template<class Tsys >
void SystemHard::writeBackPtclForOneClusterOMP ( Tsys &  sys,
PS::ReallocatableArray< PS::S32 > &  _mass_modify_list 
)
inline

write back hard particles to global system and update time of write back OMP version

Parameters
[in,out]_sysparticle system
[out]_mass_modify_listaddress on _sys of particles where mass is modified
Here is the caller graph for this function:

Member Data Documentation

◆ binary_table

PS::ReallocatableArray<COMM::BinaryTree<PtclH4,COMM::Binary> > SystemHard::binary_table

◆ manager

HardManager* SystemHard::manager

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