G+Smo  23.12.0
Geometry + Simulation Modules
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
gsHBoxContainer< d, T > Class Template Reference

Detailed Description

template<short_t d, class T>
class gismo::gsHBoxContainer< d, T >

The Hierarchical Box Container provides a container for gsHBox objects.

The gsHBoxContainer stores gsHBox objects in a smart way. The container allows to perform routines from the gsHBox (e.g. gsHBox::getParent) on a group of gsHBox. In addition, it can be used to pass multiple gsHBox objects efficiently.

The gsHBoxContainer provides a function to convert it to so-called RefBoxes. RefBoxes are boxes defined using a std::vector<index_t> to pass refinement boxes to gsHTensorBasis. Furthermore, UnitBoxes can also be produced, which basically means that every contained gsHBox is split such that it contains a single element.

Template Parameters
d{ description }
T{ description }

Public Types

typedef memory::shared_ptr
< gsHBoxContainer
Ptr
 Shared pointer for gsHTensorBasis.
 
typedef memory::unique_ptr
< gsHBoxContainer
uPtr
 Unique pointer for gsHTensorBasis.
 

Public Member Functions

void add (const gsHBox< d, T > &box)
 Adds a single box.
 
void add (const Container &boxes)
 Adds boxes stored in a container.
 
void add (const HContainer &boxes)
 Adds boxes stored in a hierarchical container.
 
void add (const gsHBoxContainer< d, T > &boxes)
 Adds boxes stored in a gsHBoxContainer.
 
HContainer & boxes ()
 Returns a heirarchical container with the boxes stored in the container.
 
const HContainer & boxes () const
 Returns a heirarchical container with the boxes stored in the container.
 
bool check ()
 Checks if the hierarchical container is correctly defined.
 
Container & getActivesOnLevel (index_t lvl)
 Returns the actives on level.
 
const Container & getActivesOnLevel (index_t lvl) const
 Returns the actives on level.
 
Container getChildren () const
 Gives a hierarchical container with all the children of the boxes stored in this.
 
Container getParents () const
 Gives a hierarchical container with all the parents of the boxes stored in this.
 
 gsHBoxContainer (const Container &boxes)
 Takes a Container (which can have boxes with different levels) More...
 
void makeUnique ()
 Removes duplicate boxes.
 
void makeUnitBoxes ()
 Transforms/splits the boxes inside the container to unit boxes.
 
void markAdmissible (index_t m)
 Applies _markAdmissible on this.
 
void markHadmissible (index_t m)
 Applies _markHadmissible on this.
 
void markTadmissible (index_t m)
 Applies _markTadmissible on this.
 
index_t maxLevel ()
 Returns the maximum level in the container.
 
gsHNeighborhood NHtype () const
 Returns the basis of the underlying basis. More...
 
size_t nLevels () const
 Returns the number of levels stored in the container.
 
gsHBoxContainer< d, T > patch (const index_t patchID) const
 Returns all the boxes of patchID. More...
 
std::ostream & print (std::ostream &os) const
 Prints the container.
 
size_t size (index_t level) const
 Returns the size of the container on level.
 
RefBox toBoxes (const index_t patchID=-1) const
 Returns boxes representation of the object. More...
 
Container toContainer () const
 Returns a container representation of the object. More...
 
gsMatrix< T > toCoords (const index_t patchID=-1) const
 Returns box coordinate represenation of the object. More...
 
RefBox toCrsBoxes (const index_t patchID=-1) const
 Returns coarsening box representation of the object. More...
 
RefBox toRefBoxes (const index_t patchID=-1) const
 Returns refinement box representation of the object. More...
 
size_t totalSize () const
 Returns the total number of boxes.
 
Container toUnitBoxes () const
 Transforms the boxes in container as unit boxes. More...
 
HContainer toUnitHBoxes () const
 Transforms the boxes in container as unit boxes. More...
 

Protected Member Functions

bool _check (const HContainer &boxes)
 Checks the container. More...
 
void _makeLevel (index_t lvl)
 Takes the union of two gsHBoxContainer. More...
 
void _markAdmissible (HContainer &marked, index_t m) const
 Performs T/H-admissible refinement. More...
 
void _markHadmissible (HContainer &marked, index_t m) const
 Performs H-admissible refinement. More...
 
HContainer _markHrecursive (HContainer &marked, index_t lvl, index_t m) const
 Marks H-recursively. More...
 
void _markHrecursive (index_t lvl, index_t m)
 Applies markHrecursive on this.
 
HContainer _markRecursive (HContainer &marked, index_t lvl, index_t m) const
 Marks T-recursively. More...
 
void _markRecursive (index_t lvl, index_t m)
 Applies markTrecursive on this.
 
void _markTadmissible (HContainer &marked, index_t m) const
 Performs T-admissible refinement. More...
 
HContainer _markTrecursive (HContainer &marked, index_t lvl, index_t m) const
 Marks T-recursively. More...
 

Constructor & Destructor Documentation

gsHBoxContainer ( const Container &  boxes)

Takes a Container (which can have boxes with different levels)

Parameters
[in]boxThe box
Template Parameters
d{ description }
T{ description }

Member Function Documentation

bool _check ( const HContainer &  boxes)
protected

Checks the container.

Checks if the level of the boxes in the container matches the container level.

Template Parameters
d{ description }
T{ description }
void _makeLevel ( index_t  lvl)
protected

Takes the union of two gsHBoxContainer.

Parameters
[in]container1The container 1
[in]container2The container 2
Returns
The gsHBoxContainer with the union. Takes the union of two hierarchical containers
Parameters
[in]container1The container 1
[in]container2The container 2
Returns
The hierarchical container with the union.Constructs a new level
void _markAdmissible ( HContainer &  marked,
index_t  m 
) const
protected

Performs T/H-admissible refinement.

Parameters
markedThe marked boxes
[in]mThe jump parameter
Returns
The resulting hierarchical container.
void _markHadmissible ( HContainer &  marked,
index_t  m 
) const
protected

Performs H-admissible refinement.

Parameters
markedThe marked boxes
[in]mThe jump parameter
Returns
The resulting hierarchical container.
HContainer _markHrecursive ( HContainer &  marked,
index_t  lvl,
index_t  m 
) const
protected

Marks H-recursively.

Parameters
markedThe marked boxes
[in]lvlThe level
[in]mThe jump parameter
Returns
The resulting hierarchical container.
HContainer _markRecursive ( HContainer &  marked,
index_t  lvl,
index_t  m 
) const
protected

Marks T-recursively.

Parameters
markedThe marked boxes
[in]lvlThe level
[in]mThe jump parameter
Returns
The resulting hierarchical container.
void _markTadmissible ( HContainer &  marked,
index_t  m 
) const
protected

Performs T-admissible refinement.

Parameters
markedThe marked boxes
[in]mThe jump parameter
Returns
The resulting hierarchical container.
HContainer _markTrecursive ( HContainer &  marked,
index_t  lvl,
index_t  m 
) const
protected

Marks T-recursively.

Parameters
markedThe marked boxes
[in]lvlThe level
[in]mThe jump parameter
Returns
The resulting hierarchical container.
gsHNeighborhood NHtype ( ) const
inline

Returns the basis of the underlying basis.

NOTE: Assumes that the basis of all boxes is the same

Returns
{ description_of_the_return_value }
gsHBoxContainer< d, T > patch ( const index_t  patchID) const

Returns all the boxes of patchID.

Parameters
[in]patchIDThe patch id
Returns
container of boxes on patch patchID
gsHBoxContainer< d, T >::RefBox toBoxes ( const index_t  patchID = -1) const

Returns boxes representation of the object.

Returns
Boxes representation of the object.
Container toContainer ( ) const
inline

Returns a container representation of the object.

Returns
Container representation of the object.
gsMatrix< T > toCoords ( const index_t  patchID = -1) const

Returns box coordinate represenation of the object.

Returns
Box coordinate representation of the object
gsHBoxContainer< d, T >::RefBox toCrsBoxes ( const index_t  patchID = -1) const

Returns coarsening box representation of the object.

Returns
Coarsening box representation of the object.
gsHBoxContainer< d, T >::RefBox toRefBoxes ( const index_t  patchID = -1) const

Returns refinement box representation of the object.

Returns
Refinement box representation of the object.
Container toUnitBoxes ( ) const
inline

Transforms the boxes in container as unit boxes.

Returns
A hierarchical container containing the unit boxes.
HContainer toUnitHBoxes ( ) const
inline

Transforms the boxes in container as unit boxes.

Returns
A hierarchical container containing the unit boxes.