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

template class that is a forest of octrees with semi-structured process topology More...

#include <forest.h>

Public Member Functions

 Forest (real *length, real *coords, Tree< M, Mvalue > &proc, const int fixedlevel, uint nx, uint ny, uint nz)
 
void assignSeeds (real *length, Tree< M, Mvalue > &proc, const int ficedlevel)
 
uint getTotalSize ()
 
void refineEachTreeVoxel (uint nlevel)
 
void assignGeom (Tree< M, Mvalue > &proc, const uint fixedlevel, real *geom_xyz, uint geom_nn)
 
void refineEachTree (uint nlevel)
 
void getListEachTree ()
 
void fourToOneBalance (Tree< M, uint > &proc)
 
bool isInSeed (morton< M > &key, uint *counter)
 
void flipAll (morton< N > &key, uint *mylevel, uint *direction)
 
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 getNbrSeedLevel (morton< N+M > &combinedkey, uint topologylevel, uint *nbrseedleve, Tree< M, uint > &proc)
 
void debug (Tree< M, Mvalue > &proc)
 
void getElemNbrs (Tree< M, Mvalue > &proc, const morton< M > key, bitvector< M > &nbr)
 
void comPatternConstruct (Tree< M, Mvalue > &proc)
 
void getDirections (morton< N+M > &key, uint combinedlevel, vector< uint > &directions)
 
void encodeGeometry ()
 
void removeAllZeroSingularity (morton< N+M > &key, const uint &combinedlevel)
 
void getMaxSeedsLevel (Tree< M, Mvalue > &proc)
 
void findSeedLevelForRcvdMessage (const morton< N+M > &key, uint *mylevel, Tree< M, Mvalue > &proc)
 
void recoverAllZeroSingularity (morton< N+M > &key, const uint &combinedlevel)
 
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 refineForestBalanced (uint nlevel, Tree< M, Mvalue > &proc)
 
void combinedLevel (const morton< N+M > &key, uint *level)
 
void zoltanGeomrepart (Tree< M, Mvalue > &proc, uint setmethod)
 
uint forestsize ()
 
void retainFourToOneBalance (Tree< M, uint > &proc)
 
void moveGeom (Tree< M, Mvalue > &proc, const uint fixedlevel, real *geom_xyz, uint n, real x[3])
 
void pushToDerefineEachTree (uint nlevel, Tree< M, uint > &proc)
 
void convertBitsToDouble (morton< N+M > key, double *val)
 
void convertDoubleToBits (morton< N+M > &key, const double val)
 
void createCommGraph (uint Nnbr)
 
void createNbrsOfNbrs ()
 
void debugDerefine (Tree< M, Mvalue > &proc)
 
void checkGraphConsistency ()
 
void checkNbrsOfNbrsConsistency ()
 
bool checkWithNbrs (bool *sendbuf, bool *recvbuf)
 
void rcvrMessageSize (int *sendbuf, int *recvbuf)
 
void getTotalMeshSize ()
 
void checkZoltanPartConsistency (Tree< M, Mvalue > &proc)
 
void constructCommWeak (const vector< int >Nbr)
 
 ~Forest ()
 

Protected Attributes

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

Private Attributes

MpiCom Com
 
treelist< N, Nvalue > trees
 
bitlist< M > seeds
 
uint maxseedlevel
 
Tree< M, realgeom
 
vector< uintdestination
 
vector< uintnbrsOfNbrs
 
struct Zoltan_Struct * zz =nullptr
 
Zoltan_Out zoltan_out
 
MPI_Comm graphComm
 

Friends

template<size_t N1, typename Nvalue1 , size_t M1, typename Mvalue1 >
class Phdf5
 

Detailed Description

template<size_t N, typename Nvalue, size_t M, typename Mvalue>
class Forest< N, Nvalue, M, Mvalue >

template class that is a forest of octrees with semi-structured process topology

includes a list of tree's and functionality for manipulation as well as exchange of the trees with neighboring processes The algorithm starts with a very coarse 16 bit semi-structured processor topology, for now only 16 bits are used but it can be modified according to the need each process will have one forest and trees will be distributed dynamically as the solution porogresses

Constructor & Destructor Documentation

◆ Forest()

template<size_t N, typename Nvalue, size_t M, typename Mvalue>
Forest< N, Nvalue, M, Mvalue >::Forest ( real length,
real coords,
Tree< M, Mvalue > &  proc,
const int  fixedlevel,
uint  nx,
uint  ny,
uint  nz 
)

constructor

◆ ~Forest()

template<size_t N, typename Nvalue, size_t M, typename Mvalue>
Forest< N, Nvalue, M, Mvalue >::~Forest ( )
inline

Member Function Documentation

◆ assignGeom()

template<size_t N, typename Nvalue, size_t M, typename Mvalue>
void Forest< N, Nvalue, M, Mvalue >::assignGeom ( Tree< M, Mvalue > &  proc,
const uint  fixedlevel,
real geom_xyz,
uint  geom_nn 
)

◆ assignSeeds()

template<size_t N, typename Nvalue, size_t M, typename Mvalue>
void Forest< N, Nvalue, M, Mvalue >::assignSeeds ( real length,
Tree< M, Mvalue > &  proc,
const int  ficedlevel 
)

◆ checkGraphConsistency()

template<size_t N, typename Nvalue, size_t M, typename Mvalue>
void Forest< N, Nvalue, M, Mvalue >::checkGraphConsistency ( )

◆ checkNbrsOfNbrsConsistency()

template<size_t N, typename Nvalue, size_t M, typename Mvalue>
void Forest< N, Nvalue, M, Mvalue >::checkNbrsOfNbrsConsistency ( )

◆ checkWithNbrs()

template<size_t N, typename Nvalue, size_t M, typename Mvalue>
bool Forest< N, Nvalue, M, Mvalue >::checkWithNbrs ( bool *  sendbuf,
bool *  recvbuf 
)

this is to enforce broadcast only with first degree neighbors

◆ checkZoltanPartConsistency()

template<size_t N, typename Nvalue, size_t M, typename Mvalue>
void Forest< N, Nvalue, M, Mvalue >::checkZoltanPartConsistency ( Tree< M, Mvalue > &  proc)

◆ combinedLevel()

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

◆ comPatternConstruct()

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

◆ constructCommWeak()

template<size_t N, typename Nvalue, size_t M, typename Mvalue>
void Forest< N, Nvalue, M, Mvalue >::constructCommWeak ( const vector< int >  Nbr)

◆ constructElementKeyForRcvdMessage()

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

◆ constructSeedKeyForRcvdMessage()

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

◆ convertBitsToDouble()

template<size_t N, typename Nvalue, size_t M, typename Mvalue>
void Forest< N, Nvalue, M, Mvalue >::convertBitsToDouble ( morton< N+M >  key,
double *  val 
)

◆ convertDoubleToBits()

template<size_t N, typename Nvalue, size_t M, typename Mvalue>
void Forest< N, Nvalue, M, Mvalue >::convertDoubleToBits ( morton< N+M > &  key,
const double  val 
)

◆ createCommGraph()

template<size_t N, typename Nvalue, size_t M, typename Mvalue>
void Forest< N, Nvalue, M, Mvalue >::createCommGraph ( uint  Nnbr)

level of neighbors

◆ createNbrsOfNbrs()

template<size_t N, typename Nvalue, size_t M, typename Mvalue>
void Forest< N, Nvalue, M, Mvalue >::createNbrsOfNbrs ( )

◆ debug()

template<size_t N, typename Nvalue, size_t M, typename Mvalue>
void Forest< N, Nvalue, M, Mvalue >::debug ( Tree< M, Mvalue > &  proc)

◆ debugDerefine()

template<size_t N, typename Nvalue, size_t M, typename Mvalue>
void Forest< N, Nvalue, M, Mvalue >::debugDerefine ( Tree< M, Mvalue > &  proc)

◆ encodeGeometry()

template<size_t N, typename Nvalue, size_t M, typename Mvalue>
void Forest< N, Nvalue, M, Mvalue >::encodeGeometry ( )

◆ findFlipLevel()

template<size_t N, typename Nvalue, size_t M, typename Mvalue>
void Forest< N, Nvalue, M, Mvalue >::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

◆ findSeedLevelForRcvdMessage()

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

◆ flipAll()

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

◆ flipForNbr()

template<size_t N, typename Nvalue, size_t M, typename Mvalue>
void Forest< N, Nvalue, M, Mvalue >::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>
uint Forest< N, Nvalue, M, Mvalue >::forestsize ( )

◆ fourToOneBalance()

template<size_t N, typename Nvalue, size_t M, typename Mvalue>
void Forest< N, Nvalue, M, Mvalue >::fourToOneBalance ( Tree< M, uint > &  proc)

4:1 balance enforced at forest including the other processors

◆ getDirections()

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

◆ getElemNbrs()

template<size_t N, typename Nvalue, size_t M, typename Mvalue>
void Forest< N, Nvalue, M, Mvalue >::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>
void Forest< N, Nvalue, M, Mvalue >::getListEachTree ( )

◆ getMaxSeedsLevel()

template<size_t N, typename Nvalue, size_t M, typename Mvalue>
void Forest< N, Nvalue, M, Mvalue >::getMaxSeedsLevel ( Tree< M, Mvalue > &  proc)

◆ getNbrSeedLevel()

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

◆ getTotalMeshSize()

template<size_t N, typename Nvalue, size_t M, typename Mvalue>
void Forest< N, Nvalue, M, Mvalue >::getTotalMeshSize ( )

◆ getTotalSize()

template<size_t N, typename Nvalue, size_t M, typename Mvalue>
uint Forest< N, Nvalue, M, Mvalue >::getTotalSize ( )

◆ isInSeed()

template<size_t N, typename Nvalue, size_t M, typename Mvalue>
bool Forest< N, Nvalue, M, Mvalue >::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>
void Forest< N, Nvalue, M, Mvalue >::moveGeom ( Tree< M, Mvalue > &  proc,
const uint  fixedlevel,
real geom_xyz,
uint  n,
real  x[3] 
)

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

◆ pushToDerefineEachTree()

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

◆ rcvrMessageSize()

template<size_t N, typename Nvalue, size_t M, typename Mvalue>
void Forest< N, Nvalue, M, Mvalue >::rcvrMessageSize ( int *  sendbuf,
int *  recvbuf 
)

◆ recoverAllZeroSingularity()

template<size_t N, typename Nvalue, size_t M, typename Mvalue>
void Forest< N, Nvalue, M, Mvalue >::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>
void Forest< N, Nvalue, M, Mvalue >::refineEachTree ( uint  nlevel)

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

◆ refineEachTreeVoxel()

template<size_t N, typename Nvalue, size_t M, typename Mvalue>
void Forest< N, Nvalue, M, Mvalue >::refineEachTreeVoxel ( uint  nlevel)

Refines every Tree in the list, nlevels, balance is satisfired for each tree but not in the boundaries with other trees

◆ refineForestBalanced()

template<size_t N, typename Nvalue, size_t M, typename Mvalue>
void Forest< N, Nvalue, M, Mvalue >::refineForestBalanced ( uint  nlevel,
Tree< M, Mvalue > &  proc 
)

◆ removeAllZeroSingularity()

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

◆ retainFourToOneBalance()

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

◆ zoltanGeomrepart()

template<size_t N, typename Nvalue, size_t M, typename Mvalue>
void Forest< N, Nvalue, M, Mvalue >::zoltanGeomrepart ( Tree< M, Mvalue > &  proc,
uint  setmethod 
)

Friends And Related Function Documentation

◆ Phdf5

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

Member Data Documentation

◆ ancestorcoords

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

centeroid of the of the first generation (root) element

◆ ancestorlength

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

original length of the first generation (root) element

◆ Com

template<size_t N, typename Nvalue, size_t M, typename Mvalue>
MpiCom Forest< N, Nvalue, M, Mvalue >::Com
private

◆ destination

template<size_t N, typename Nvalue, size_t M, typename Mvalue>
vector<uint> Forest< N, Nvalue, M, Mvalue >::destination
private

◆ geom

template<size_t N, typename Nvalue, size_t M, typename Mvalue>
Tree<M, real> Forest< N, Nvalue, M, Mvalue >::geom
private

◆ graphComm

template<size_t N, typename Nvalue, size_t M, typename Mvalue>
MPI_Comm Forest< N, Nvalue, M, Mvalue >::graphComm
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

◆ maxseedlevel

template<size_t N, typename Nvalue, size_t M, typename Mvalue>
uint Forest< N, Nvalue, M, Mvalue >::maxseedlevel
private

finds tha maximum level of the seeds

◆ nbrsOfNbrs

template<size_t N, typename Nvalue, size_t M, typename Mvalue>
vector<uint> Forest< N, Nvalue, M, Mvalue >::nbrsOfNbrs
private

◆ npx

template<size_t N, typename Nvalue, size_t M, typename Mvalue>
uint Forest< N, Nvalue, M, Mvalue >::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>
uint Forest< N, Nvalue, M, Mvalue >::npy
protected

discretization in y direction

◆ npz

template<size_t N, typename Nvalue, size_t M, typename Mvalue>
uint Forest< N, Nvalue, M, Mvalue >::npz
protected

discretization in z direction

◆ seeds

template<size_t N, typename Nvalue, size_t M, typename Mvalue>
bitlist<M> Forest< N, Nvalue, M, Mvalue >::seeds
private

seeds: morton code for boxes to grow tree

◆ trees

template<size_t N, typename Nvalue, size_t M, typename Mvalue>
treelist<N, Nvalue> Forest< N, Nvalue, M, Mvalue >::trees
private

list of trees that each processor includes

◆ zoltan_out

template<size_t N, typename Nvalue, size_t M, typename Mvalue>
Zoltan_Out Forest< N, Nvalue, M, Mvalue >::zoltan_out
private

◆ zz

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

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