IBAMR  IBAMR version 0.19.
Classes | Public Member Functions | Private Member Functions | Private Attributes | List of all members
SAMRAI::hier::BinaryTree< DIM > Class Template Reference

#include <BinaryTree.h>

Classes

struct  binTreeNode
 

Public Member Functions

 BinaryTree (const ProcessorMapping &mapping, const BoxArray< DIM > &boxes)
 
 ~BinaryTree ()
 
bool participates (int node_id, const Box< DIM > &box)
 
int findParticipatingAnscestor (const Box< DIM > &box)
 
void findParticipatingDescendants (const Box< DIM > &box, tbox::Array< int > &id_out)
 
void reduce (const Box< DIM > &box, int *data, int len)
 
void partialBcast (const Box< DIM > &participants_box, Box< DIM > &box_to_bcast)
 
void partialBcast (const Box< DIM > &participants_box, int &value)
 
void buildParticipatingCommunicator (const Box< DIM > &box, tbox::SAMRAI_MPI::comm old_comm, tbox::SAMRAI_MPI::group &new_group, tbox::SAMRAI_MPI::comm &new_comm)
 

Private Member Functions

int findParent (int node)
 
int findLeftChild (int node)
 
int findRightChild (int node)
 
int findRoot ()
 
void preorderComputation (int node_id, const Box< DIM > &box)
 
 BinaryTree (const BinaryTree< DIM > &)
 
BinaryTree< DIM > & operator= (const BinaryTree< DIM > &)
 

Private Attributes

tbox::Array< binTreeNoded_tree
 
int d_root
 
ProcessorMapping d_mapping
 
tbox::Array< Box< DIM > > d_boxes
 
tbox::Array< intd_first
 
tbox::Array< intd_descendants
 
int d_descendants_len
 
int d_myid
 

Detailed Description

template<int DIM>
class SAMRAI::hier::BinaryTree< DIM >

Class BinaryTree<DIM> is a utility class designed to support more efficient implementations of the Berger-Rigoutsous clustering algorithm.

Constructor & Destructor Documentation

◆ BinaryTree() [1/2]

template<int DIM>
SAMRAI::hier::BinaryTree< DIM >::BinaryTree ( const ProcessorMapping mapping,
const BoxArray< DIM > &  boxes 
)

Constructs a binary tree. If "number_of_nodes = 0," the tree will be constructed with the same number of nodes as there are MPI processes.

◆ ~BinaryTree()

template<int DIM>
SAMRAI::hier::BinaryTree< DIM >::~BinaryTree ( )

The destructor does nothing of public interest.

◆ BinaryTree() [2/2]

template<int DIM>
SAMRAI::hier::BinaryTree< DIM >::BinaryTree ( const BinaryTree< DIM > &  )
private

Member Function Documentation

◆ participates()

template<int DIM>
bool SAMRAI::hier::BinaryTree< DIM >::participates ( int  node_id,
const Box< DIM > &  box 
)

Returns true if "box" intersects a patch that is local to the processor "node_id;" else returns false. However, always returns true when node_id == findRoot(). (This a highly specialized call, designed for use with Berger-Rigoutsous research.) (You must call init() before calling this method.)

◆ findParticipatingAnscestor()

template<int DIM>
int SAMRAI::hier::BinaryTree< DIM >::findParticipatingAnscestor ( const Box< DIM > &  box)

Returns the processor id of the nearest anscestor in the tree that has a local patch that intersects with box.
If no such processor exists, returns the id of the root node. (This a highly specialized call, designed for use with Berger-Rigoutsous research.) (You must call init() before calling this method.)

◆ findParticipatingDescendants()

template<int DIM>
void SAMRAI::hier::BinaryTree< DIM >::findParticipatingDescendants ( const Box< DIM > &  box,
tbox::Array< int > &  id_out 
)

Returns, in id_out, the processor ids of this processor's descendants that will send to this processor (i.e., if "i" is listed in id_out, then when processor "i" calls findParticipatingAnscestor, id_out = this processor). Note that id_out may be empty on return. (This a highly specialized call, designed for use with Berger-Rigoutsous research.) (You must call init() before calling this method.)

◆ reduce()

template<int DIM>
void SAMRAI::hier::BinaryTree< DIM >::reduce ( const Box< DIM > &  box,
int data,
int  len 
)

Performs an all-to-one sum reduction on data; root ends up with the summation; a processor participates in the reduction only if it has a local patch that intersects with box. (This a highly specialized call, designed for use with Berger-Rigoutsous research.) (You must call init() before calling this method.)

◆ partialBcast() [1/2]

template<int DIM>
void SAMRAI::hier::BinaryTree< DIM >::partialBcast ( const Box< DIM > &  participants_box,
Box< DIM > &  box_to_bcast 
)

Broadcasts "box_to_bcast" to a subset of processors. The subset is composed of those processors for which participatesInReduction(processor, participants_box) is true. (This a highly specialized call, designed for use with Berger-Rigoutsous research.) (You must call init() before calling this method.)

◆ partialBcast() [2/2]

template<int DIM>
void SAMRAI::hier::BinaryTree< DIM >::partialBcast ( const Box< DIM > &  participants_box,
int value 
)

◆ buildParticipatingCommunicator()

template<int DIM>
void SAMRAI::hier::BinaryTree< DIM >::buildParticipatingCommunicator ( const Box< DIM > &  box,
tbox::SAMRAI_MPI::comm  old_comm,
tbox::SAMRAI_MPI::group new_group,
tbox::SAMRAI_MPI::comm new_comm 
)

◆ findParent()

template<int DIM>
int SAMRAI::hier::BinaryTree< DIM >::findParent ( int  node)
private

◆ findLeftChild()

template<int DIM>
int SAMRAI::hier::BinaryTree< DIM >::findLeftChild ( int  node)
private

◆ findRightChild()

template<int DIM>
int SAMRAI::hier::BinaryTree< DIM >::findRightChild ( int  node)
private

◆ findRoot()

template<int DIM>
int SAMRAI::hier::BinaryTree< DIM >::findRoot ( )
private

◆ preorderComputation()

template<int DIM>
void SAMRAI::hier::BinaryTree< DIM >::preorderComputation ( int  node_id,
const Box< DIM > &  box 
)
private

◆ operator=()

template<int DIM>
BinaryTree<DIM>& SAMRAI::hier::BinaryTree< DIM >::operator= ( const BinaryTree< DIM > &  )
private

Member Data Documentation

◆ d_tree

template<int DIM>
tbox::Array<binTreeNode> SAMRAI::hier::BinaryTree< DIM >::d_tree
private

◆ d_root

template<int DIM>
int SAMRAI::hier::BinaryTree< DIM >::d_root
private

◆ d_mapping

template<int DIM>
ProcessorMapping SAMRAI::hier::BinaryTree< DIM >::d_mapping
private

◆ d_boxes

template<int DIM>
tbox::Array< Box<DIM> > SAMRAI::hier::BinaryTree< DIM >::d_boxes
private

◆ d_first

template<int DIM>
tbox::Array<int> SAMRAI::hier::BinaryTree< DIM >::d_first
private

◆ d_descendants

template<int DIM>
tbox::Array<int> SAMRAI::hier::BinaryTree< DIM >::d_descendants
private

◆ d_descendants_len

template<int DIM>
int SAMRAI::hier::BinaryTree< DIM >::d_descendants_len
private

◆ d_myid

template<int DIM>
int SAMRAI::hier::BinaryTree< DIM >::d_myid
private

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