Chombo + EB  3.0
Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes | Friends | List of all members
TreeIntVectSet Class Reference

IntVectSet implementation based on tree representation. More...

#include <TreeIntVectSet.H>

Public Member Functions

 TreeIntVectSet ()
 
 TreeIntVectSet (const Box &)
 
 TreeIntVectSet (const TreeIntVectSet &a_sivs)
 
 ~TreeIntVectSet ()
 
void define (const Box &)
 
void define (const TreeIntVectSet &a_sivs)
 
void swap (TreeIntVectSet &a_other)
 trade internals of two objects More...
 
TreeIntVectSetoperator= (const TreeIntVectSet &a_sivs)
 
TreeIntVectSetoperator|= (const TreeIntVectSet &a_sivs)
 or More...
 
TreeIntVectSetoperator|= (const IntVect &a_iv)
 
TreeIntVectSetoperator|= (const Box &a_box)
 
TreeIntVectSetoperator &= (const TreeIntVectSet &s_sivs)
 and More...
 
TreeIntVectSetoperator &= (const Box &a_box)
 and More...
 
TreeIntVectSetoperator &= (const ProblemDomain &a_domain)
 and More...
 
TreeIntVectSetoperator-= (const TreeIntVectSet &a_sivs)
 not More...
 
TreeIntVectSetoperator-= (const IntVect &a_iv)
 not More...
 
TreeIntVectSetoperator-= (const Box &a_box)
 not More...
 
bool operator== (const TreeIntVectSet &lhs) const
 returns true if More...
 
bool operator< (const TreeIntVectSet &a_sivs) const
 
Vector< BoxcreateBoxes () const
 Returns Vector<Box> representation of this IntVectSet. More...
 
void createBoxes (Vector< Box > &boxes, int &size) const
 Returns Vector<Box> representation of this IntVectSet. More...
 
bool contains (const IntVect &iv) const
 
bool contains (const Box &box) const
 
TreeIntVectSet chop (int idir, int chop_pnt)
 
void chop (int dir, int chop_pnt, TreeIntVectSet &a_hi)
 
void grow (int igrow)
 
void grow (int idir, int igrow)
 
void growHi ()
 
void growHi (int a_dir)
 
void refine (int iref=2)
 fast if iref is power of 2 More...
 
void coarsen (int iref=2)
 fast if iref is power of 2 More...
 
void shift (const IntVect &iv)
 slow operation More...
 
void clear ()
 
void nestingRegion (int a_radius, const Box &a_domain, int granularity)
 
void nestingRegion (int a_radius, const ProblemDomain &a_domain, int granularity)
 
const BoxminBox () const
 
bool isEmpty () const
 
int numPts () const
 
void compact () const
 
void recalcMinBox () const
 
Linearization routines
int linearSize () const
 
void linearIn (const void *const inBuf)
 
void linearOut (void *const a_outBuf) const
 

Private Member Functions

void trimCoarsen (int icoarse)
 
void growTree ()
 
void remove (const Box &box, TreeIntVectSet *resdiual)
 
void transfer (TreeNode &node, const Box &a_box)
 

Static Private Member Functions

static void quadrantBox (const Box &inputBox, int quadrant, Box &outputQuadrant)
 
static void clearTree (TreeNode &tree)
 
static void expandNode (TreeNode &node)
 
static int oppositeQuadrant (int index)
 
static bool nextIntVect (const Box &box, IntVect &iv)
 
static void nextNode (int &currentDepth)
 
static void cloneNode (const TreeNode &src, TreeNode &dest)
 

Private Attributes

TreeNode m_tree
 
Box m_minBox
 
Box m_spanBox
 
int m_depth
 

Static Private Attributes

static Pool treeNodePoolObject
 
static PooltreeNodePool
 
static Vector< int > index
 
static Vector< int > bufferOffset
 
static Vector< TreeNode * > parents
 
static Vector< Boxboxes
 
static TreeNode full
 

Friends

class TreeIntVectSetIterator
 
class MeshRefine
 
struct Flag
 
class IntVectSet
 
void dumpTree (const TreeIntVectSet *set)
 

Detailed Description

IntVectSet implementation based on tree representation.

For explanations of these functions please look at IntVectSet class when the documentation doesn't appear here.

See also
IntVectSet

 Further details of how non-recursive TreeNode design works:
 (for a 2D tree)
   (m_tree)
          + – 0
            (a)+ - 0
                   1
               1   +
                   1  <---—you are here
               + - + - 0
                   0   1
                   0   1
                   0   0
 for the node indicated, the 'index' vector  would contain
 index=[ 0      1    3  ...............]
 parents=[&m_tree &a   ..................]
or directly refered to as m_tree.nodes[1].nodes[3]
 the tree indicates a covering of an index space in either
 1 or 0.   1 is stored in the tree by pointing at the static
 'full' data member, 0 is stored as a 0.
 every 'nodes' member of a TreeNode object can be either
  0, &full, or a pointer .
  The interpretation of the tree depends on what m_spanBox is.
    nodes[i] indicates whether the i'th quadrant of the parent
    Box is full, empty, or needs to be parsed deeper.
 

Constructor & Destructor Documentation

◆ TreeIntVectSet() [1/3]

TreeIntVectSet::TreeIntVectSet ( )
inline

◆ TreeIntVectSet() [2/3]

TreeIntVectSet::TreeIntVectSet ( const Box a_box)
inline

◆ TreeIntVectSet() [3/3]

TreeIntVectSet::TreeIntVectSet ( const TreeIntVectSet a_sivs)
inline

◆ ~TreeIntVectSet()

TreeIntVectSet::~TreeIntVectSet ( )
inline

Member Function Documentation

◆ define() [1/2]

void TreeIntVectSet::define ( const Box )

◆ define() [2/2]

void TreeIntVectSet::define ( const TreeIntVectSet a_sivs)

◆ swap()

void TreeIntVectSet::swap ( TreeIntVectSet a_other)

trade internals of two objects

◆ operator=()

TreeIntVectSet& TreeIntVectSet::operator= ( const TreeIntVectSet a_sivs)

◆ operator|=() [1/3]

TreeIntVectSet& TreeIntVectSet::operator|= ( const TreeIntVectSet a_sivs)

or

◆ operator|=() [2/3]

TreeIntVectSet & TreeIntVectSet::operator|= ( const IntVect a_iv)
inline

◆ operator|=() [3/3]

TreeIntVectSet& TreeIntVectSet::operator|= ( const Box a_box)

◆ operator &=() [1/3]

TreeIntVectSet& TreeIntVectSet::operator&= ( const TreeIntVectSet s_sivs)

and

◆ operator &=() [2/3]

TreeIntVectSet& TreeIntVectSet::operator&= ( const Box a_box)

and

◆ operator &=() [3/3]

TreeIntVectSet& TreeIntVectSet::operator&= ( const ProblemDomain a_domain)

and

◆ operator-=() [1/3]

TreeIntVectSet& TreeIntVectSet::operator-= ( const TreeIntVectSet a_sivs)

not

◆ operator-=() [2/3]

TreeIntVectSet & TreeIntVectSet::operator-= ( const IntVect a_iv)
inline

not

◆ operator-=() [3/3]

TreeIntVectSet& TreeIntVectSet::operator-= ( const Box a_box)

not

◆ operator==()

bool TreeIntVectSet::operator== ( const TreeIntVectSet lhs) const

returns true if

◆ operator<()

bool TreeIntVectSet::operator< ( const TreeIntVectSet a_sivs) const

Primary sorting criterion: numPts(). Secondary sorting criterion: lexigraphical ordering of the IntVects, taken in the order traversed by TreeIntVectSetIterator. In a total tie, returns false.

◆ createBoxes() [1/2]

Vector<Box> TreeIntVectSet::createBoxes ( ) const

Returns Vector<Box> representation of this IntVectSet.

Returns Vector<Box> representation of this IntVectSet.

◆ createBoxes() [2/2]

void TreeIntVectSet::createBoxes ( Vector< Box > &  boxes,
int &  size 
) const

Returns Vector<Box> representation of this IntVectSet.

Returns Vector<Box> representation of this IntVectSet.

◆ contains() [1/2]

bool TreeIntVectSet::contains ( const IntVect iv) const

◆ contains() [2/2]

bool TreeIntVectSet::contains ( const Box box) const

◆ chop() [1/2]

TreeIntVectSet TreeIntVectSet::chop ( int  idir,
int  chop_pnt 
)

somewhat expensive, but shouldn't be ;-)

See also
IntVectSet::chop

◆ chop() [2/2]

void TreeIntVectSet::chop ( int  dir,
int  chop_pnt,
TreeIntVectSet a_hi 
)

a proper faster chop function that does it all in-place and saves the giant memory cost.

◆ grow() [1/2]

void TreeIntVectSet::grow ( int  igrow)
See also
IntVectSet::grow expensive

◆ grow() [2/2]

void TreeIntVectSet::grow ( int  idir,
int  igrow 
)

expensive

◆ growHi() [1/2]

void TreeIntVectSet::growHi ( )
See also
IntVectSet::growHi expensive

◆ growHi() [2/2]

void TreeIntVectSet::growHi ( int  a_dir)
See also
IntVectSet::growHi(int) expensive

◆ refine()

void TreeIntVectSet::refine ( int  iref = 2)

fast if iref is power of 2

fast if iref is power of 2

◆ coarsen()

void TreeIntVectSet::coarsen ( int  iref = 2)

fast if iref is power of 2

fast if iref is power of 2

◆ shift()

void TreeIntVectSet::shift ( const IntVect iv)

slow operation

◆ clear()

void TreeIntVectSet::clear ( )

◆ nestingRegion() [1/2]

void TreeIntVectSet::nestingRegion ( int  a_radius,
const Box a_domain,
int  granularity 
)

◆ nestingRegion() [2/2]

void TreeIntVectSet::nestingRegion ( int  a_radius,
const ProblemDomain a_domain,
int  granularity 
)

◆ minBox()

const Box & TreeIntVectSet::minBox ( ) const
inline

◆ isEmpty()

bool TreeIntVectSet::isEmpty ( ) const

◆ numPts()

int TreeIntVectSet::numPts ( ) const

◆ compact()

void TreeIntVectSet::compact ( ) const

◆ recalcMinBox()

void TreeIntVectSet::recalcMinBox ( ) const

◆ linearSize()

int TreeIntVectSet::linearSize ( ) const

◆ linearIn()

void TreeIntVectSet::linearIn ( const void *const  inBuf)

◆ linearOut()

void TreeIntVectSet::linearOut ( void *const  a_outBuf) const

◆ trimCoarsen()

void TreeIntVectSet::trimCoarsen ( int  icoarse)
private

◆ quadrantBox()

static void TreeIntVectSet::quadrantBox ( const Box inputBox,
int  quadrant,
Box outputQuadrant 
)
staticprivate

◆ clearTree()

static void TreeIntVectSet::clearTree ( TreeNode &  tree)
staticprivate

◆ expandNode()

static void TreeIntVectSet::expandNode ( TreeNode &  node)
staticprivate

◆ growTree()

void TreeIntVectSet::growTree ( )
private

◆ remove()

void TreeIntVectSet::remove ( const Box box,
TreeIntVectSet resdiual 
)
private

◆ transfer()

void TreeIntVectSet::transfer ( TreeNode &  node,
const Box a_box 
)
private

◆ oppositeQuadrant()

static int TreeIntVectSet::oppositeQuadrant ( int  index)
staticprivate

◆ nextIntVect()

static bool TreeIntVectSet::nextIntVect ( const Box box,
IntVect iv 
)
staticprivate

◆ nextNode()

void TreeIntVectSet::nextNode ( int &  currentDepth)
inlinestaticprivate

◆ cloneNode()

static void TreeIntVectSet::cloneNode ( const TreeNode &  src,
TreeNode &  dest 
)
staticprivate

Friends And Related Function Documentation

◆ TreeIntVectSetIterator

friend class TreeIntVectSetIterator
friend

◆ MeshRefine

friend class MeshRefine
friend

◆ Flag

friend struct Flag
friend

◆ IntVectSet

friend class IntVectSet
friend

◆ dumpTree

void dumpTree ( const TreeIntVectSet set)
friend

Member Data Documentation

◆ m_tree

TreeNode TreeIntVectSet::m_tree
private

◆ m_minBox

Box TreeIntVectSet::m_minBox
private

◆ m_spanBox

Box TreeIntVectSet::m_spanBox
private

◆ m_depth

int TreeIntVectSet::m_depth
private

◆ treeNodePoolObject

Pool TreeIntVectSet::treeNodePoolObject
staticprivate

◆ treeNodePool

Pool* TreeIntVectSet::treeNodePool
staticprivate

◆ index

Vector<int> TreeIntVectSet::index
staticprivate

◆ bufferOffset

Vector<int> TreeIntVectSet::bufferOffset
staticprivate

◆ parents

Vector<TreeNode*> TreeIntVectSet::parents
staticprivate

◆ boxes

Vector<Box> TreeIntVectSet::boxes
staticprivate

◆ full

TreeNode TreeIntVectSet::full
staticprivate

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