rebl-AMR
TemplateForest< N, Nvalue, M, Mvalue, T > Class Template Reference

Template Class designed to unify tree and full_tree topologies. More...

#include <templateForest.h>

Public Member Functions

 TemplateForest ()
 
 TemplateForest (int argcs, char *pArgs[], T &proc, real *length, real *coords, uint nx, uint ny, uint nz)
 
void construct (int argcs, char *pArgs[], T &proc, real *length, real *coords, uint nx, uint ny, uint nz)
 
uint getTotalSize ()
 
void assignSeeds (real *length, T &proc)
 
void assignGeom (T &proc, real *geom_xyz, uint geom_nn)
 
void encodeGeometry ()
 
void refineEachTree (uint nlevel)
 
void moveGeom (T &proc, real *geom_xyz, uint n, real x[3])
 
void getListEachTree ()
 
bool isInSeed (morton< M > &key, uint *counter)
 
void flipAll (morton< N > &key, uint *mylevel, uint *direction)
 
void getDirections (morton< N+M > &key, uint combinedlevel, vector< uint > &directions)
 
void recoverAllZeroSingularity (morton< N+M > &key, const uint &combinedlevel)
 
void combinedLevel (const morton< N+M > &key, uint *level)
 
void findSeedLevelForRcvdMessage (const morton< N+M > &key, uint *mylevel, Tree< M, Mvalue > &proc)
 
void findSeedLevelForRcvdMessage (const morton< N+M > &key, uint *mylevel, FullTree< M, Mvalue > &proc)
 
void constructSeedKeyForRcvdMessage (const morton< N+M > &key, const uint &seedlevel, morton< M > &seedkey)
 
void constructElementKeyForRcvdMessage (const morton< N+M > &key, const uint &seedlevel, morton< N > &elementkey)
 
void removeAllZeroSingularity (morton< N+M > &key, const uint &combinedlevel)
 
void getMaxSeedsLevel (T &proc)
 
void findFlipLevel (morton< N+M > key, uint *mylevel, uint *changedirectionlevel, uint *direction)
 
void flipForNbr (morton< N+M > &key, uint *mylevel, uint *changedirectionlevel, uint *direction)
 
void getTotalMeshSize ()
 
void getNbrSeedLevel (morton< N+M > &combinedkey, uint topologylevel, uint *nbrseedleve, Tree< M, Mvalue > &proc)
 
void getNbrSeedLevel (morton< N+M > &combinedkey, uint topologylevel, uint *nbrseedleve, FullTree< M, Mvalue > &proc)
 
uint forestsize ()
 
void getElemNbrs (Tree< M, Mvalue > &proc, const morton< M > key, bitvector< M > &nbr)
 
void comPatternConstruct (Tree< M, Mvalue > &proc)
 
void comPatternConstruct (FullTree< M, Mvalue > &proc, vector< uint > &Nbrs)
 
void fourToOneBalance (T &proc)
 
void refineForestBalanced (uint nlevel, T &proc)
 
void nonCollectiveNbrComm ()
 
void pushToDerefineEachTree (uint nlevel, Tree< M, uint > &proc)
 
void retainFourToOneBalance (Tree< M, uint > &proc)
 
void checkZoltanPartConsistency (Tree< M, Mvalue > &proc)
 
void createCommGraph (uint Nnbr)
 
void createNbrsOfNbrs ()
 
void checkGraphConsistency ()
 
void filterRefineList ()
 
void setMaxProcLevel (const uint refinelevel)
 
uint findIndexInSeed (T &proc, morton< M > &seedkey)
 
void appendToMessage (T &proc, morton< M > &seednbrkey, morton< M+N > &combinedkey, const uint combinedlevel)
 
void MPIStartUp ()
 
void checkInputParams (int argcs, char *pArgs[])
 
void runInfo ()
 
void currentDateTime ()
 
 ~TemplateForest ()
 

Protected Attributes

real ancestorlength [3]
 
real ancestorcoords [3]
 
uint npx
 
uint npy
 
uint npz
 

Private Attributes

MpiCom Com
 
int duplicated =0
 
treeList< Tree< N, Nvalue > > trees
 
uint maxProcLevel
 
bitlist< M > seeds
 
uint maxseedlevel
 
Tree< M, realgeom
 
vector< uintdestination
 
vector< uintsendtag
 
vector< uintrecvtag
 
vector< uintnbrsOfNbrs
 
vector< bitset< M+N > > * message =nullptr
 
struct Zoltan_Struct * zz =nullptr
 
Zoltan_Out zoltan_out
 
MPI_Comm graphComm
 
MPI_Request * request =nullptr
 
MPI_Request * request1 =nullptr
 
char nameAppendix [80]
 
unsigned long long meshSize
 

Friends

template<size_t N1, typename Nvalue1 , size_t M1, typename Mvalue1 , class T1 >
class templatePhdf5
 

Detailed Description

template<size_t N, typename Nvalue, size_t M, typename Mvalue, class T>
class TemplateForest< N, Nvalue, M, Mvalue, T >

Template Class designed to unify tree and full_tree topologies.

Constructor & Destructor Documentation

◆ TemplateForest() [1/2]

template<size_t N, typename Nvalue, size_t M, typename Mvalue, class T>
TemplateForest< N, Nvalue, M, Mvalue, T >::TemplateForest ( )
inline

◆ TemplateForest() [2/2]

template<size_t N, typename Nvalue , size_t M, typename Mvalue , class T>
TemplateForest< N, Nvalue, M, Mvalue, T >::TemplateForest ( int  argcs,
char *  pArgs[],
T &  proc,
real length,
real coords,
uint  nx,
uint  ny,
uint  nz 
)

constructor constructor

<part I, initialize the ancestor coords and length, just like we did for class tree

◆ ~TemplateForest()

template<size_t N, typename Nvalue , size_t M, typename Mvalue , class T >
TemplateForest< N, Nvalue, M, Mvalue, T >::~TemplateForest ( )

Destructor of the object

Member Function Documentation

◆ appendToMessage()

template<size_t N, typename Nvalue , size_t M, typename Mvalue , class T>
void TemplateForest< N, Nvalue, M, Mvalue, T >::appendToMessage ( T &  proc,
morton< M > &  seednbrkey,
morton< M+N > &  combinedkey,
const uint  combinedlevel 
)

◆ assignGeom()

template<size_t N, typename Nvalue , size_t M, typename Mvalue , class T>
void TemplateForest< N, Nvalue, M, Mvalue, T >::assignGeom ( T &  proc,
real geom_xyz,
uint  geom_nn 
)

◆ assignSeeds()

template<size_t N, typename Nvalue , size_t M, typename Mvalue , class T>
void TemplateForest< N, Nvalue, M, Mvalue, T >::assignSeeds ( real length,
T &  proc 
)

◆ checkGraphConsistency()

template<size_t N, typename Nvalue , size_t M, typename Mvalue , class T >
void TemplateForest< N, Nvalue, M, Mvalue, T >::checkGraphConsistency ( )

◆ checkInputParams()

template<size_t N, typename Nvalue , size_t M, typename Mvalue , class T >
void TemplateForest< N, Nvalue, M, Mvalue, T >::checkInputParams ( int  argcs,
char *  pArgs[] 
)

Checks input parameters for consistency

◆ checkZoltanPartConsistency()

template<size_t N, typename Nvalue , size_t M, typename Mvalue, class T >
void TemplateForest< N, Nvalue, M, Mvalue, T >::checkZoltanPartConsistency ( Tree< M, Mvalue > &  proc)
Parameters
proccreates distributed (acalable) graph for communication

◆ combinedLevel()

template<size_t N, typename Nvalue , size_t M, typename Mvalue , class T >
void TemplateForest< N, Nvalue, M, Mvalue, T >::combinedLevel ( const morton< N+M > &  key,
uint level 
)

to prevent unnecesary bit operation, the morton code is placed from starting from left hand side

◆ comPatternConstruct() [1/2]

template<size_t N, typename Nvalue , size_t M, typename Mvalue, class T >
void TemplateForest< N, Nvalue, M, Mvalue, T >::comPatternConstruct ( Tree< M, Mvalue > &  proc)

◆ comPatternConstruct() [2/2]

template<size_t N, typename Nvalue , size_t M, typename Mvalue, class T >
void TemplateForest< N, Nvalue, M, Mvalue, T >::comPatternConstruct ( FullTree< M, Mvalue > &  proc,
vector< uint > &  Nbrs 
)

◆ construct()

template<size_t N, typename Nvalue , size_t M, typename Mvalue , class T>
void TemplateForest< N, Nvalue, M, Mvalue, T >::construct ( int  argcs,
char *  pArgs[],
T &  proc,
real length,
real coords,
uint  nx,
uint  ny,
uint  nz 
)

<part I, initialize the ancestor coords and length, just like we did for class tree

◆ constructElementKeyForRcvdMessage()

template<size_t N, typename Nvalue , size_t M, typename Mvalue , class T >
void TemplateForest< N, Nvalue, M, Mvalue, T >::constructElementKeyForRcvdMessage ( const morton< N+M > &  key,
const uint seedlevel,
morton< N > &  elementkey 
)

◆ constructSeedKeyForRcvdMessage()

template<size_t N, typename Nvalue , size_t M, typename Mvalue , class T >
void TemplateForest< N, Nvalue, M, Mvalue, T >::constructSeedKeyForRcvdMessage ( const morton< N+M > &  key,
const uint seedlevel,
morton< M > &  seedkey 
)

◆ createCommGraph()

template<size_t N, typename Nvalue , size_t M, typename Mvalue , class T >
void TemplateForest< N, Nvalue, M, Mvalue, T >::createCommGraph ( uint  Lnbr)

Zoltan might give zero elements to a processor, this function checks to see each element has at least one element assigned to it and that the number of elements before and after partitioning is the same level of neighbors

Parameters
Lnbrcreates distributed (scalable) graph for communication

◆ createNbrsOfNbrs()

template<size_t N, typename Nvalue , size_t M, typename Mvalue , class T >
void TemplateForest< N, Nvalue, M, Mvalue, T >::createNbrsOfNbrs ( )

◆ currentDateTime()

template<size_t N, typename Nvalue , size_t M, typename Mvalue , class T >
void TemplateForest< N, Nvalue, M, Mvalue, T >::currentDateTime ( )

◆ encodeGeometry()

template<size_t N, typename Nvalue , size_t M, typename Mvalue , class T >
void TemplateForest< N, Nvalue, M, Mvalue, T >::encodeGeometry ( )

encode the geometry once to the deepest level

◆ filterRefineList()

template<size_t N, typename Nvalue, size_t M, typename Mvalue, class T>
void TemplateForest< N, Nvalue, M, Mvalue, T >::filterRefineList ( )

Sanity check for the graph, it checks he fact that if element "A" is a neighbor of element "B", element "B" should be a neighbor of element "A" as well

◆ findFlipLevel()

template<size_t N, typename Nvalue , size_t M, typename Mvalue , class T >
void TemplateForest< N, Nvalue, M, Mvalue, T >::findFlipLevel ( morton< N+M >  key,
uint mylevel,
uint changedirectionlevel,
uint direction 
)

same as the function defined in class three except that it workd on (M+N) bits

◆ findIndexInSeed()

template<size_t N, typename Nvalue , size_t M, typename Mvalue , class T>
uint TemplateForest< N, Nvalue, M, Mvalue, T >::findIndexInSeed ( T &  proc,
morton< M > &  seedkey 
)

◆ findSeedLevelForRcvdMessage() [1/2]

template<size_t N, typename Nvalue , size_t M, typename Mvalue, class T >
void TemplateForest< N, Nvalue, M, Mvalue, T >::findSeedLevelForRcvdMessage ( const morton< N+M > &  key,
uint mylevel,
Tree< M, Mvalue > &  proc 
)

◆ findSeedLevelForRcvdMessage() [2/2]

template<size_t N, typename Nvalue , size_t M, typename Mvalue, class T >
void TemplateForest< N, Nvalue, M, Mvalue, T >::findSeedLevelForRcvdMessage ( const morton< N+M > &  key,
uint mylevel,
FullTree< M, Mvalue > &  proc 
)

◆ flipAll()

template<size_t N, typename Nvalue , size_t M, typename Mvalue , class T >
void TemplateForest< N, Nvalue, M, Mvalue, T >::flipAll ( morton< N > &  key,
uint mylevel,
uint direction 
)

◆ flipForNbr()

template<size_t N, typename Nvalue , size_t M, typename Mvalue , class T >
void TemplateForest< N, Nvalue, M, Mvalue, T >::flipForNbr ( morton< N+M > &  key,
uint mylevel,
uint changedirectionlevel,
uint direction 
)

same as the function defined in class three except that it workd on (M+N) bits

◆ forestsize()

template<size_t N, typename Nvalue , size_t M, typename Mvalue , class T >
uint TemplateForest< N, Nvalue, M, Mvalue, T >::forestsize ( )

◆ fourToOneBalance()

template<size_t N, typename Nvalue , size_t M, typename Mvalue , class T>
void TemplateForest< N, Nvalue, M, Mvalue, T >::fourToOneBalance ( T &  proc)

4:1 balance enforced at forest including the other processors

◆ getDirections()

template<size_t N, typename Nvalue , size_t M, typename Mvalue , class T >
void TemplateForest< N, Nvalue, M, Mvalue, T >::getDirections ( morton< N+M > &  key,
uint  combinedlevel,
vector< uint > &  directions 
)

◆ getElemNbrs()

template<size_t N, typename Nvalue , size_t M, typename Mvalue, class T >
void TemplateForest< N, Nvalue, M, Mvalue, T >::getElemNbrs ( Tree< M, Mvalue > &  proc,
const morton< M >  key,
bitvector< M > &  nbr 
)

collects the neghbors of a given element

◆ getListEachTree()

template<size_t N, typename Nvalue , size_t M, typename Mvalue , class T >
void TemplateForest< N, Nvalue, M, Mvalue, T >::getListEachTree ( )

◆ getMaxSeedsLevel()

template<size_t N, typename Nvalue , size_t M, typename Mvalue , class T>
void TemplateForest< N, Nvalue, M, Mvalue, T >::getMaxSeedsLevel ( T &  proc)

◆ getNbrSeedLevel() [1/2]

template<size_t N, typename Nvalue , size_t M, typename Mvalue, class T >
void TemplateForest< N, Nvalue, M, Mvalue, T >::getNbrSeedLevel ( morton< N+M > &  combinedkey,
uint  topologylevel,
uint nbrseedleve,
Tree< M, Mvalue > &  proc 
)

◆ getNbrSeedLevel() [2/2]

template<size_t N, typename Nvalue , size_t M, typename Mvalue, class T >
void TemplateForest< N, Nvalue, M, Mvalue, T >::getNbrSeedLevel ( morton< N+M > &  combinedkey,
uint  topologylevel,
uint nbrseedleve,
FullTree< M, Mvalue > &  proc 
)

◆ getTotalMeshSize()

template<size_t N, typename Nvalue , size_t M, typename Mvalue , class T >
void TemplateForest< N, Nvalue, M, Mvalue, T >::getTotalMeshSize ( )

calculates the final number of the mesh generated with all processes

◆ getTotalSize()

template<size_t N, typename Nvalue , size_t M, typename Mvalue , class T >
uint TemplateForest< N, Nvalue, M, Mvalue, T >::getTotalSize ( )

◆ isInSeed()

template<size_t N, typename Nvalue , size_t M, typename Mvalue , class T >
bool TemplateForest< N, Nvalue, M, Mvalue, T >::isInSeed ( morton< M > &  key,
uint counter 
)

check and see if the forest incldues the particluar seed

◆ moveGeom()

template<size_t N, typename Nvalue , size_t M, typename Mvalue , class T>
void TemplateForest< N, Nvalue, M, Mvalue, T >::moveGeom ( T &  proc,
real geom_xyz,
uint  n,
real  x[3] 
)

moves the geomerty with displacements specified in x[3] in x,y and z directions

◆ MPIStartUp()

template<size_t N, typename Nvalue , size_t M, typename Mvalue , class T >
void TemplateForest< N, Nvalue, M, Mvalue, T >::MPIStartUp ( )

Creates an MPI communicator for ReblAmr and assigns ranks

◆ nonCollectiveNbrComm()

template<size_t N, typename Nvalue , size_t M, typename Mvalue , class T >
void TemplateForest< N, Nvalue, M, Mvalue, T >::nonCollectiveNbrComm ( )

◆ pushToDerefineEachTree()

template<size_t N, typename Nvalue , size_t M, typename Mvalue , class T >
void TemplateForest< N, Nvalue, M, Mvalue, T >::pushToDerefineEachTree ( uint  nlevel,
Tree< M, uint > &  proc 
)

◆ recoverAllZeroSingularity()

template<size_t N, typename Nvalue , size_t M, typename Mvalue , class T >
void TemplateForest< N, Nvalue, M, Mvalue, T >::recoverAllZeroSingularity ( morton< N+M > &  key,
const uint combinedlevel 
)

note that this function operates on the element key, this is done to remove redundant calc

◆ refineEachTree()

template<size_t N, typename Nvalue , size_t M, typename Mvalue , class T >
void TemplateForest< N, Nvalue, M, Mvalue, T >::refineEachTree ( uint  nlevel)

Refines every Tree in the list, nlevels, balance is satisfired for each tree but not in the global scope

◆ refineForestBalanced()

template<size_t N, typename Nvalue , size_t M, typename Mvalue , class T>
void TemplateForest< N, Nvalue, M, Mvalue, T >::refineForestBalanced ( uint  nlevel,
T &  proc 
)

◆ removeAllZeroSingularity()

template<size_t N, typename Nvalue , size_t M, typename Mvalue , class T >
void TemplateForest< N, Nvalue, M, Mvalue, T >::removeAllZeroSingularity ( morton< N+M > &  key,
const uint combinedlevel 
)

we use one bit to communicate the level of the element ending in zero at element level

◆ retainFourToOneBalance()

template<size_t N, typename Nvalue , size_t M, typename Mvalue , class T >
void TemplateForest< N, Nvalue, M, Mvalue, T >::retainFourToOneBalance ( Tree< M, uint > &  proc)

Eliminates the elements that their removal would destroy the 2:1 balance

◆ runInfo()

template<size_t N, typename Nvalue , size_t M, typename Mvalue , class T >
void TemplateForest< N, Nvalue, M, Mvalue, T >::runInfo ( )

◆ setMaxProcLevel()

template<size_t N, typename Nvalue , size_t M, typename Mvalue , class T >
void TemplateForest< N, Nvalue, M, Mvalue, T >::setMaxProcLevel ( const uint  refinelevel)

Friends And Related Function Documentation

◆ templatePhdf5

template<size_t N, typename Nvalue, size_t M, typename Mvalue, class T>
template<size_t N1, typename Nvalue1 , size_t M1, typename Mvalue1 , class T1 >
friend class templatePhdf5
friend

Member Data Documentation

◆ ancestorcoords

template<size_t N, typename Nvalue, size_t M, typename Mvalue, class T>
real TemplateForest< N, Nvalue, M, Mvalue, T >::ancestorcoords[3]
protected

centeroid of the of the first generation (root) element

◆ ancestorlength

template<size_t N, typename Nvalue, size_t M, typename Mvalue, class T>
real TemplateForest< N, Nvalue, M, Mvalue, T >::ancestorlength[3]
protected

original length of the first generation (root) element

◆ Com

template<size_t N, typename Nvalue, size_t M, typename Mvalue, class T>
MpiCom TemplateForest< N, Nvalue, M, Mvalue, T >::Com
private

Object to hold communicator data such as rank, size, etc

◆ destination

template<size_t N, typename Nvalue, size_t M, typename Mvalue, class T>
vector<uint> TemplateForest< N, Nvalue, M, Mvalue, T >::destination
private

neighbor processes to communicate messages

◆ duplicated

template<size_t N, typename Nvalue, size_t M, typename Mvalue, class T>
int TemplateForest< N, Nvalue, M, Mvalue, T >::duplicated =0
private

◆ geom

template<size_t N, typename Nvalue, size_t M, typename Mvalue, class T>
Tree<M, real> TemplateForest< N, Nvalue, M, Mvalue, T >::geom
private

◆ graphComm

template<size_t N, typename Nvalue, size_t M, typename Mvalue, class T>
MPI_Comm TemplateForest< N, Nvalue, M, Mvalue, T >::graphComm
private

◆ maxProcLevel

template<size_t N, typename Nvalue, size_t M, typename Mvalue, class T>
uint TemplateForest< N, Nvalue, M, Mvalue, T >::maxProcLevel
private

◆ maxseedlevel

template<size_t N, typename Nvalue, size_t M, typename Mvalue, class T>
uint TemplateForest< N, Nvalue, M, Mvalue, T >::maxseedlevel
private

finds tha maximum level of the seeds

◆ meshSize

template<size_t N, typename Nvalue, size_t M, typename Mvalue, class T>
unsigned long long TemplateForest< N, Nvalue, M, Mvalue, T >::meshSize
private

Each seed will contain its own geometry points to search, this assumption implicitly coincides processor topology with geometry voxelization this way tree's root will be morton code used in geometry voxelization and no extra operation is necessary

◆ message

template<size_t N, typename Nvalue, size_t M, typename Mvalue, class T>
vector<bitset<M + N> >* TemplateForest< N, Nvalue, M, Mvalue, T >::message =nullptr
private

◆ nameAppendix

template<size_t N, typename Nvalue, size_t M, typename Mvalue, class T>
char TemplateForest< N, Nvalue, M, Mvalue, T >::nameAppendix[80]
private

◆ nbrsOfNbrs

template<size_t N, typename Nvalue, size_t M, typename Mvalue, class T>
vector<uint> TemplateForest< N, Nvalue, M, Mvalue, T >::nbrsOfNbrs
private

◆ npx

template<size_t N, typename Nvalue, size_t M, typename Mvalue, class T>
uint TemplateForest< N, Nvalue, M, Mvalue, T >::npx
protected

discritization in x direction, this value for proc tree is 2, therefore forest needs its own value of npx

◆ npy

template<size_t N, typename Nvalue, size_t M, typename Mvalue, class T>
uint TemplateForest< N, Nvalue, M, Mvalue, T >::npy
protected

discretization in y direction

◆ npz

template<size_t N, typename Nvalue, size_t M, typename Mvalue, class T>
uint TemplateForest< N, Nvalue, M, Mvalue, T >::npz
protected

discretization in z direction

◆ recvtag

template<size_t N, typename Nvalue, size_t M, typename Mvalue, class T>
vector<uint> TemplateForest< N, Nvalue, M, Mvalue, T >::recvtag
private

◆ request

template<size_t N, typename Nvalue, size_t M, typename Mvalue, class T>
MPI_Request* TemplateForest< N, Nvalue, M, Mvalue, T >::request =nullptr
private

◆ request1

template<size_t N, typename Nvalue, size_t M, typename Mvalue, class T>
MPI_Request* TemplateForest< N, Nvalue, M, Mvalue, T >::request1 =nullptr
private

◆ seeds

template<size_t N, typename Nvalue, size_t M, typename Mvalue, class T>
bitlist<M> TemplateForest< N, Nvalue, M, Mvalue, T >::seeds
private

< Maximum level in processor topology. i.e. tree seeds: morton code for boxes to grow tree

◆ sendtag

template<size_t N, typename Nvalue, size_t M, typename Mvalue, class T>
vector<uint> TemplateForest< N, Nvalue, M, Mvalue, T >::sendtag
private

◆ trees

template<size_t N, typename Nvalue, size_t M, typename Mvalue, class T>
treeList<Tree<N,Nvalue> > TemplateForest< N, Nvalue, M, Mvalue, T >::trees
private

list of trees that each processor includes

◆ zoltan_out

template<size_t N, typename Nvalue, size_t M, typename Mvalue, class T>
Zoltan_Out TemplateForest< N, Nvalue, M, Mvalue, T >::zoltan_out
private

◆ zz

template<size_t N, typename Nvalue, size_t M, typename Mvalue, class T>
struct Zoltan_Struct* TemplateForest< N, Nvalue, M, Mvalue, T >::zz =nullptr
private

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