![]() |
rebl-AMR
|
This Class Generates a 4:1 balancerd AMR mesh. More...
#include <tree.h>
Public Member Functions | |
| Tree (real *length, real *coords, uint nx, uint ny, uint nz) | |
| Tree (real *length, real *coords) | |
| Tree () | |
| void | construct (real *length, real *coords, uint nx, uint ny, uint nz) |
| virtual void | level (morton< N > key, uint *level) |
| void | centroid (morton< N > key, real *xyz) |
| void | enclosingBox (morton< N > key, real *X) |
| virtual bitmap< N, value >::iterator | begin () |
| virtual bitmap< N, value >::iterator | end () |
| virtual uint | size () |
| void | reserve (uint *reservedsize) |
| void | siblings (morton< N > key, uint mylevel, morton< N > *sibkey) |
| void | refine (morton< N > key) |
| void | derefine (morton< N > key) |
| void | refineRefineList () |
| void | refineRefineList (bitvector< N > &V) |
| void | fourToOneP (uint istart, uint iend) |
| void | refineRefineList (uint istart, uint iend) |
| void | fourToOne () |
| void | findFlipLevel (morton< N > key, uint *mylevel, uint *changedirectionlevel, uint *direction) |
| void | flipForNbr (morton< N > *key, uint *mylevel, uint *changedirectionlevel, uint *direction) |
| uint | IsInVectorList (morton< N > key) |
| void | addToList (morton< N > key) |
| uint | count (morton< N > key) |
| void | addToDerefineList (morton< N > key) |
| If any of the siblings are listed in the dereffinement do not add to the list as derefining one child means removing all the siblings. More... | |
| void | derefineDerefineList (uint nlevel) |
| uint | isInsideSolid (const morton< N > key, const real *geom_xyz, uint n) |
| virtual bitmap< N, value >::iterator | find (morton< N > key) |
| void | insertKey (morton< N > key) |
| void | convertStl2Morton (uint geom_size, real *geom_xyz) |
| void | pushToRefinelist (uint level) |
| bool | isBoundary (morton< N > &key) |
| void | extractBoundary () |
| void | getDirections (morton< N > &key, vector< uint > &directions) |
| uint | refineListSize () |
| void | clearRefineList () |
| void | extractBoundaryP (uint istart, uint iend) |
| bool | isInMeshList (const morton< N > &key) |
| bool | isInRefineList (const morton< N > &key) |
| void | constructHigherLevelNbrs (const morton< N > &key, const uint &keylevel, const uint &direction, morton< N > *nbr) |
| void | printMesh () |
| bool | isBoundary (const morton< N > &key, uint direction) |
| std::pair< morton< N >, int > | readRefineList (typename std::unordered_map< morton< N >, int >::iterator it) |
| morton< N > | readDerefineList (typename std::unordered_map< morton< N >, int >::iterator it) |
| void | getKey (uint i, morton< N > &key) |
| void | clearMortonSTL () |
| void | retainFourToOne () |
| void | removeFromDerefineList (typename std::unordered_map< morton< N >, int >::iterator it) |
| unordered_map< morton< N >, int >::iterator | Dbegin () |
| unordered_map< morton< N >, int >::iterator | Dend () |
| void | derefineDerefineList () |
| void | clearMesh () |
| void | pushToDerefinelist (uint nlevel) |
| unordered_map< morton< N >, int >::iterator | Rbegin () |
| unordered_map< morton< N >, int >::iterator | Rend () |
| std::unordered_map< morton< N >, int >::iterator | findInDerefine (morton< N > key) |
| void | mortonSTLclear () |
| void | flipRefineElemTag (typename std::unordered_map< morton< N >, int >::iterator it) |
| void | refinelistReset () |
| void | constructNonlocalHigherLevelNbrs (const morton< N > &key, const uint &keylevel, const uint &direction, morton< N > *nbr) |
| void | insertSeed (morton< N > &key) |
| void | insertNbrs (vector< int > &Nbrs) |
| void | enclosingBoxFixedLevel (morton< N > key, uint mylevel, real *X) |
| void | centroidFixedLevel (morton< N > key, const uint mylevel, real *xyz) |
| virtual void | convertCoordToMorton (real *xyz, morton< N > &key) |
| std::unordered_map< morton< N >, int >::iterator | findInList (morton< N > key) |
| ~Tree () | |
Public Attributes | |
| bitvector< N > | boundarylist |
Protected Attributes | |
| real | ancestorlength [3] |
| real | ancestorcoords [3] |
| morton< N > | ancestorkey = 0 |
| uint | npx |
| uint | npy |
| uint | npz |
Private Attributes | |
| bitmap< N, value > | mesh |
| std::unordered_map< morton< N >, int > | refinelist |
| bitvector< N > | mortonSTL |
| std::unordered_map< morton< N >, int > | derefinelist |
Friends | |
| template<size_t N1, typename value2 > | |
| class | Hdf5Xmf |
This Class Generates a 4:1 balancerd AMR mesh.
| Tree< N, value >::Tree | ( | real * | length, |
| real * | coords, | ||
| uint | nx, | ||
| uint | ny, | ||
| uint | nz | ||
| ) |
constructor
constructor
Destructor of the class, it frees the memeory pointed by pointer in the hashmap value if allocated
If any of the siblings are listed in the dereffinement do not add to the list as derefining one child means removing all the siblings.
adds the element to derefinelist
adds element to refinelist
|
virtual |
iterator returning the first object
Reimplemented in FullTree< N, value >.
calculates the centroid of the cube given the morton key of the element
| void Tree< N, value >::centroidFixedLevel | ( | morton< N > | key, |
| const uint | mylevel, | ||
| real * | xyz | ||
| ) |
| void Tree< N, value >::clearMesh | ( | ) |
| void Tree< N, value >::clearMortonSTL | ( | ) |
| void Tree< N, value >::clearRefineList | ( | ) |
| void Tree< N, value >::construct | ( | real * | length, |
| real * | coords, | ||
| uint | nx, | ||
| uint | ny, | ||
| uint | nz | ||
| ) |
need to initialize inside forest
| void Tree< N, value >::constructHigherLevelNbrs | ( | const morton< N > & | key, |
| const uint & | keylevel, | ||
| const uint & | direction, | ||
| morton< N > * | nbr | ||
| ) |
| void Tree< N, value >::constructNonlocalHigherLevelNbrs | ( | const morton< N > & | key, |
| const uint & | keylevel, | ||
| const uint & | direction, | ||
| morton< N > * | nbr | ||
| ) |
|
virtual |
converts coordinates of a point to morton code
!< this function is to find a value given the key
Reimplemented in FullTree< N, value >.
| void Tree< N, value >::convertStl2Morton | ( | uint | geom_size, |
| real * | geom_xyz | ||
| ) |
converts stl coordinates to morton and puts them in morton STL
!< this function is to find a value given the key
counts the number of elements
| unordered_map< morton< N >, int >::iterator Tree< N, value >::Dbegin | ( | ) |
| unordered_map< morton< N >, int >::iterator Tree< N, value >::Dend | ( | ) |
if the morton code does not exist in mesh, refinement is not permitted (derefining a nonexsiting element not permitted) Also, if any of the siblings have a higher level of refinement, derefinement is ignored
<if the key does not exist simply igonre doing anything
Derefines the mesh
| void Tree< N, value >::derefineDerefineList | ( | ) |
| void Tree< N, value >::enclosingBox | ( | morton< N > | key, |
| real * | X | ||
| ) |
calculates the range that an element occupies in 3D space for a given Element
| void Tree< N, value >::enclosingBoxFixedLevel | ( | morton< N > | key, |
| uint | mylevel, | ||
| real * | X | ||
| ) |
iterator returning the last object
Reimplemented in FullTree< N, value >.
| void Tree< N, value >::extractBoundary | ( | ) |
| void Tree< N, value >::extractBoundaryP | ( | uint | istart, |
| uint | iend | ||
| ) |
|
virtual |
this function is to find a value given the key
!< this function is to find a value given the key
Reimplemented in FullTree< N, value >.
| void Tree< N, value >::findFlipLevel | ( | morton< N > | key, |
| uint * | mylevel, | ||
| uint * | changedirectionlevel, | ||
| uint * | direction | ||
| ) |
detects the flip level, this info used in finding nonlocal neighbors
| std::unordered_map< morton< N >, int >::iterator Tree< N, value >::findInDerefine | ( | morton< N > | key | ) |
Get the iterator from derefinelist
| key | E;iminate from derefinelist |
| std::unordered_map< morton< N >, int >::iterator Tree< N, value >::findInList | ( | morton< N > | key | ) |
!< this function is to find a value given the key
| void Tree< N, value >::flipForNbr | ( | morton< N > * | key, |
| uint * | mylevel, | ||
| uint * | changedirectionlevel, | ||
| uint * | direction | ||
| ) |
perform the actual operation to identify the nonlocal nbr
| void Tree< N, value >::flipRefineElemTag | ( | typename std::unordered_map< morton< N >, int >::iterator | it | ) |
| void Tree< N, value >::fourToOne | ( | ) |
imposes 4:1 balance given the list of elments to be refined in the vector refine list
< all we are interested is the nonlocal neighbors, i.e. the neighbors of the parents as siblings will have same level
< this approach eliminates search algorithm as now we do not have the restrictions on cutting the cube that we had in the previous approach
imposes 4:1 balance locally for each tree, while loop is eliminated due to parallel implementation
| void Tree< N, value >::getDirections | ( | morton< N > & | key, |
| vector< uint > & | directions | ||
| ) |
| void Tree< N, value >::insertNbrs | ( | vector< int > & | Nbrs | ) |
| Nbrs | add neighbors |
| key | Eliminate from derefinelist |
| bool Tree< N, value >::isBoundary | ( | const morton< N > & | key, |
| uint | direction | ||
| ) |
| bool Tree< N, value >::isInRefineList | ( | const morton< N > & | key | ) |
| uint Tree< N, value >::isInsideSolid | ( | const morton< N > | key, |
| const real * | geom_xyz, | ||
| uint | n | ||
| ) |
tags the elements if any points of the gemoetry resides in the enclosing box
checks to see if a given code is already in the list
|
virtual |
obtains the level of the element from morton key
to prevent unnecesary bit operation, the morton code is placed from starting from left hand side
now look and see if any siblings exist
Reimplemented in FullTree< N, value >.
| void Tree< N, value >::mortonSTLclear | ( | ) |
| void Tree< N, value >::printMesh | ( | ) |
!< this function is to find a value given the key
Note that for dynamic mesh we need to make sure the element exists before adding to this list
!< this function is to find a value given the key
| unordered_map< morton< N >, int >::iterator Tree< N, value >::Rbegin | ( | ) |
| morton< N > Tree< N, value >::readDerefineList | ( | typename std::unordered_map< morton< N >, int >::iterator | it | ) |
| std::pair< morton< N >, int > Tree< N, value >::readRefineList | ( | typename std::unordered_map< morton< N >, int >::iterator | it | ) |
perfomrs refinement for a tagged element given the Morton Key
| void Tree< N, value >::refinelistReset | ( | ) |
| void Tree< N, value >::refineRefineList | ( | ) |
performs derefinement on a single element given a morton key performs the refinement
performs the refinement
| void Tree< N, value >::refineRefineList | ( | uint | istart, |
| uint | iend | ||
| ) |
performs the refinement
| void Tree< N, value >::removeFromDerefineList | ( | typename std::unordered_map< morton< N >, int >::iterator | it | ) |
| it | E;iminate from derefinelist |
| unordered_map< morton< N >, int >::iterator Tree< N, value >::Rend | ( | ) |
this function reserves the memory given the reservedsize of the mesh
| void Tree< N, value >::retainFourToOne | ( | ) |
| void Tree< N, value >::siblings | ( | morton< N > | key, |
| uint | mylevel, | ||
| morton< N > * | sibkey | ||
| ) |
extracts the siblings from morton code
returns the size of the mesh
Reimplemented in FullTree< N, value >.
|
friend |
this is a friend class to write out in hdf5 format
centeroid of the of the first generation (root) element
root value is always set as 0000000000000
original length of the first generation (root) element
list of elements of refinelist that are boundary elements
|
private |
list of elements tagged to be removed, due to 4:1 balance this listi
base main container
vector to store geometric points in morton code
discritization in x direction
discretization in y direction
discretization in y direction
|
private |
list of elements tagged to be refined