Bembel
Bembel::ElementTree Class Reference

This class organizes an element structure on a Geometry object and handles refinement. More...

#include <ElementTree.hpp>

Detailed Description

This class organizes an element structure on a Geometry object and handles refinement.

This class implements a tree which realizes the refinement of the geometry. On the first level of refinement the leafs/elements are all patches of the geometry. Currently, the construction of the tree allows uniform refinement. In the refinement process each element get four sons and the neighborhood relations get updated.

The heart of the ElementTree is the leaf iterator which implements a Morton Z-curve. If an element get refined it gets replaced by it four sons element. This core routine can handle adaptive refinement but with some limitations in the resolution of neighborhood relations.

Definition at line 32 of file ElementTree.hpp.

Public Member Functions

 ElementTree (const ElementTree &)=delete
 Deleted copy constructor for the ElementTree class. More...
 
 ElementTree (ElementTree &&)=delete
 Deleted move constructor for the ElementTree class. More...
 
ElementTreeoperator= (const ElementTree &)=delete
 Deleted copy assignment operator for the ElementTree class. More...
 
ElementTreeoperator= (ElementTree &&)=delete
 Deleted move assignment operator for the ElementTree class. More...
 
 ElementTree ()
 constructors More...
 
 ElementTree (const Geometry &g, unsigned int max_level=0)
 Explicit constructor for the ElementTree class. More...
 
void init_ElementTree (const Geometry &g, unsigned int max_level)
 init More...
 
void refineUniformly_recursion (ElementTreeNode &el)
 Refine the given element or it's sons. More...
 
void refineUniformly ()
 Refine all patches uniformly.
 
void refinePatch (int patch)
 Refine a given patch.
 
Eigen::MatrixXd generatePointList (Eigen::VectorXi *idct=nullptr) const
 Return the coordinates of all points of the elements. More...
 
Eigen::MatrixXi generateElementList () const
 Return list of elements containing the indices of the vertices. More...
 
int get_number_of_points () const
 getter More...
 
int get_number_of_elements () const
 Return number of elements in the ElementTree. More...
 
int get_max_level () const
 Return maximum level of refinement. More...
 
ElementTreeNoderoot ()
 Return reference to the root ElementTreeNode. More...
 
const ElementTreeNoderoot () const
 Return const reference to the root ElementTreeNode. More...
 
const PatchVectorget_geometry () const
 Return const reference to the Geometry. More...
 
ElementTreeNode::const_iterator pbegin () const
 iterators More...
 
ElementTreeNode::const_iterator pend () const
 Returns an iterator one past the end of the sequence represented by the leafs as ElementTreeNodes of the ElementTree. More...
 
ElementTreeNode::const_iterator cpbegin () const
 Returns an iterator to the beginning of the sequence represented by the leafs as ElementTreeNodes of the ElementTree. More...
 
ElementTreeNode::const_iterator cpend () const
 Returns an iterator one past the end of the sequence represented by the leafs as ElementTreeNodes of the ElementTree. More...
 
ElementTreeNode::const_iterator cluster_begin (const ElementTreeNode &cl) const
 Returns a cluster iterator to the beginning of the sequence represented by the the given ElementTreeNode. More...
 
ElementTreeNode::const_iterator cluster_end (const ElementTreeNode &cl) const
 Returns a cluster iterator one past the end of the sequence represented by the the given ElementTreeNode. More...
 
Eigen::MatrixXd computeElementEnclosings ()
 Computes enclosing balls surrounding all elements. More...
 
void computeElementEnclosings_recursion (ElementTreeNode &el, const Eigen::MatrixXd &P)
 Computes enclosing balls of one element and all its sons. More...
 
void printPanels () const
 Prints all Elements of the Tree.
 
Eigen::MatrixXd generateMidpointList () const
 other Stuff More...
 
Eigen::MatrixXd generateRadiusList () const
 Return a matrix with all radii of the element enclosing. More...
 
Eigen::VectorXi generateElementLabels () const
 Return a vector with computed global indices of the elements. More...
 
Eigen::VectorXi generatePatchBoundaryLabels () const
 Generate list of labels if elements are on the patch boundary or at the boundary of the geometry. More...
 
Eigen::VectorXi identifyPatch (unsigned int pn) const
 Generate list of labels if elements contained within a given patch. More...
 
std::vector< std::array< int, 4 > > patchTopologyInfo () const
 Resolves neighborhood relations of the patches. More...
 
std::vector< int > computeReorderingVector () const
 The ordering of elements in the element tree does not correspond to the element order underlying the coefficient vector. This reordering can be computed for look ups by this function. More...
 
size_t compute_global_id (const ElementTreeNode &el) const
 

Constructor & Destructor Documentation

◆ ElementTree() [1/4]

Bembel::ElementTree::ElementTree ( const ElementTree )
delete

Deleted copy constructor for the ElementTree class.

This copy constructor is explicitly deleted to prevent copying of ElementTree objects.

◆ ElementTree() [2/4]

Bembel::ElementTree::ElementTree ( ElementTree &&  )
delete

Deleted move constructor for the ElementTree class.

This move constructor is explicitly deleted to prevent moving of ElementTree objects.

◆ ElementTree() [3/4]

Bembel::ElementTree::ElementTree ( )
inline

constructors

Default constructor for the ElementTree class.

Definition at line 76 of file ElementTree.hpp.

◆ ElementTree() [4/4]

Bembel::ElementTree::ElementTree ( const Geometry g,
unsigned int  max_level = 0 
)
inlineexplicit

Explicit constructor for the ElementTree class.

This constructor initializes an ElementTree object for the provided geometry and maximum level. Currently this constructor is implemented for uniform refinement.

Parameters
gThe geometry object defining the patches.
max_level(optional) The maximum level of the ElementTree. Default is 0.

Definition at line 88 of file ElementTree.hpp.

Member Function Documentation

◆ cluster_begin()

ElementTreeNode::const_iterator Bembel::ElementTree::cluster_begin ( const ElementTreeNode cl) const
inline

Returns a cluster iterator to the beginning of the sequence represented by the the given ElementTreeNode.

Parameters
clConst reference to the ElementTreeNode to start the iterator.
Returns
Returns a ElementTreeNode::const_iterator object.

Definition at line 331 of file ElementTree.hpp.

◆ cluster_end()

ElementTreeNode::const_iterator Bembel::ElementTree::cluster_end ( const ElementTreeNode cl) const
inline

Returns a cluster iterator one past the end of the sequence represented by the the given ElementTreeNode.

Parameters
clConst reference to the ElementTreeNode to start the iterator.
Returns
Returns a ElementTreeNode::const_iterator object.

Definition at line 342 of file ElementTree.hpp.

◆ computeElementEnclosings()

Eigen::MatrixXd Bembel::ElementTree::computeElementEnclosings ( )
inline

Computes enclosing balls surrounding all elements.

This functions sets the parameters midpoint_ radius_ of the ElementTreeNode objects stored in the tree.

Returns
The point list as 3xN matrix with N the number of points.

Definition at line 354 of file ElementTree.hpp.

◆ computeElementEnclosings_recursion()

void Bembel::ElementTree::computeElementEnclosings_recursion ( ElementTreeNode el,
const Eigen::MatrixXd &  P 
)
inline

Computes enclosing balls of one element and all its sons.

Parameters
elElementTreeNode to start the recursion.
PPoint list of the vertices.

Definition at line 368 of file ElementTree.hpp.

◆ computeReorderingVector()

std::vector<int> Bembel::ElementTree::computeReorderingVector ( ) const
inline

The ordering of elements in the element tree does not correspond to the element order underlying the coefficient vector. This reordering can be computed for look ups by this function.

Limitation to the uniform case!

Returns
Vector with the tensor product index of the elements.

Definition at line 544 of file ElementTree.hpp.

◆ cpbegin()

ElementTreeNode::const_iterator Bembel::ElementTree::cpbegin ( ) const
inline

Returns an iterator to the beginning of the sequence represented by the leafs as ElementTreeNodes of the ElementTree.

Returns
Returns a ElementTreeNode::const_iterator object.

Definition at line 316 of file ElementTree.hpp.

◆ cpend()

ElementTreeNode::const_iterator Bembel::ElementTree::cpend ( ) const
inline

Returns an iterator one past the end of the sequence represented by the leafs as ElementTreeNodes of the ElementTree.

Returns
Returns a ElementTreeNode::const_iterator object.

Definition at line 323 of file ElementTree.hpp.

◆ generateElementLabels()

Eigen::VectorXi Bembel::ElementTree::generateElementLabels ( ) const
inline

Return a vector with computed global indices of the elements.

Returns
A vector with global indices of the elements.

Definition at line 447 of file ElementTree.hpp.

◆ generateElementList()

Eigen::MatrixXi Bembel::ElementTree::generateElementList ( ) const
inline

Return list of elements containing the indices of the vertices.

This function stores all indices of an element in the column of the returned matrix.

Returns
A 4xN integer Matrix where N is the number elements.

Definition at line 240 of file ElementTree.hpp.

◆ generateMidpointList()

Eigen::MatrixXd Bembel::ElementTree::generateMidpointList ( ) const
inline

other Stuff

Return a matrix with all midpoints of the elements.

Returns
The midpoint list as 3xN matrix with N the number of points.

Definition at line 417 of file ElementTree.hpp.

◆ generatePatchBoundaryLabels()

Eigen::VectorXi Bembel::ElementTree::generatePatchBoundaryLabels ( ) const
inline

Generate list of labels if elements are on the patch boundary or at the boundary of the geometry.

The value at the index of the element is 1 if the element is at the patch boundary and there is a neighbor patch. If there is no neighbor patch then the value is -1.

Returns
A vector of integers of size N with N the number of elements.

Definition at line 467 of file ElementTree.hpp.

◆ generatePointList()

Eigen::MatrixXd Bembel::ElementTree::generatePointList ( Eigen::VectorXi *  idct = nullptr) const
inline

Return the coordinates of all points of the elements.

This function iterates all elements and returns the coordinates of the vertices.

Parameters
idctPointer to an Eigen::VectorXi to count how often a vertex is part of all elements.
Returns
A 3xN Matrix where N is the number of all vertices in the geometry.

Definition at line 206 of file ElementTree.hpp.

◆ generateRadiusList()

Eigen::MatrixXd Bembel::ElementTree::generateRadiusList ( ) const
inline

Return a matrix with all radii of the element enclosing.

Returns
A vector containing the radii of the element enclosing.

Definition at line 432 of file ElementTree.hpp.

◆ get_geometry()

const PatchVector& Bembel::ElementTree::get_geometry ( ) const
inline

Return const reference to the Geometry.

Returns
Const Reference to the PatchVector.

Definition at line 288 of file ElementTree.hpp.

◆ get_max_level()

int Bembel::ElementTree::get_max_level ( ) const
inline

Return maximum level of refinement.

Returns
Level of refinement.

Definition at line 270 of file ElementTree.hpp.

◆ get_number_of_elements()

int Bembel::ElementTree::get_number_of_elements ( ) const
inline

Return number of elements in the ElementTree.

Returns
Number of elements.

Definition at line 264 of file ElementTree.hpp.

◆ get_number_of_points()

int Bembel::ElementTree::get_number_of_points ( ) const
inline

getter

Return number of points in the ElementTree.

Returns
Number of points.

Definition at line 258 of file ElementTree.hpp.

◆ identifyPatch()

Eigen::VectorXi Bembel::ElementTree::identifyPatch ( unsigned int  pn) const
inline

Generate list of labels if elements contained within a given patch.

The value at the index of the element is 1 if the element is contained within the given patch. Otherwise its zero.

Returns
A vector of integers of size N with N the number of elements.

Definition at line 492 of file ElementTree.hpp.

◆ init_ElementTree()

void Bembel::ElementTree::init_ElementTree ( const Geometry g,
unsigned int  max_level 
)
inline

init

This function initializes the ElementTree

First Each Patch becomes an ElementTreeNode. After resolving the patch neighborhood relations each patch gets refined to the common maximum level of refinement.

Parameters
gThe geometry object defining the patches.
max_level(optional) The maximum level of the ElementTree. Default is 0.

Definition at line 105 of file ElementTree.hpp.

◆ operator=() [1/2]

ElementTree& Bembel::ElementTree::operator= ( const ElementTree )
delete

Deleted copy assignment operator for the ElementTree class.

This copy assignment operator is explicitly deleted to prevent copying of ElementTree objects.

Returns
A reference to the updated ElementTree object.

◆ operator=() [2/2]

ElementTree& Bembel::ElementTree::operator= ( ElementTree &&  )
delete

Deleted move assignment operator for the ElementTree class.

This move assignment operator is explicitly deleted to prevent moving of ElementTree objects.

Returns
A reference to the updated ElementTree object.

◆ patchTopologyInfo()

std::vector<std::array<int, 4> > Bembel::ElementTree::patchTopologyInfo ( ) const
inline

Resolves neighborhood relations of the patches.

Returns
A vector where each entry defines a patch interface or boundary. The entries correspond to [patchIndex1, edgeCase1, patchIndex2, edgeCase2].

Definition at line 510 of file ElementTree.hpp.

◆ pbegin()

ElementTreeNode::const_iterator Bembel::ElementTree::pbegin ( ) const
inline

iterators

Returns an iterator to the beginning of the sequence represented by the leafs as ElementTreeNodes of the ElementTree.

Returns
Returns a ElementTreeNode::const_iterator object.

Definition at line 298 of file ElementTree.hpp.

◆ pend()

ElementTreeNode::const_iterator Bembel::ElementTree::pend ( ) const
inline

Returns an iterator one past the end of the sequence represented by the leafs as ElementTreeNodes of the ElementTree.

Returns
Returns a ElementTreeNode::const_iterator object.

Definition at line 307 of file ElementTree.hpp.

◆ refineUniformly_recursion()

void Bembel::ElementTree::refineUniformly_recursion ( ElementTreeNode el)
inline

Refine the given element or it's sons.

This function refines an element recursively. If the given element is already refined than iterate all sons and refine them and so on.

Definition at line 169 of file ElementTree.hpp.

◆ root() [1/2]

ElementTreeNode& Bembel::ElementTree::root ( )
inline

Return reference to the root ElementTreeNode.

Returns
Reference to the root ElementTreeNode.

Definition at line 276 of file ElementTree.hpp.

◆ root() [2/2]

const ElementTreeNode& Bembel::ElementTree::root ( ) const
inline

Return const reference to the root ElementTreeNode.

Returns
Const Reference to the root ElementTreeNode.

Definition at line 282 of file ElementTree.hpp.


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