ug4
ug::GridObjectCollection Class Reference

a helper class that holds a collection of possibly unconnected geometric-objects. More...

#include <grid_object_collection.h>

Classes

struct  ContainerCollection
 
struct  traits
 The traits class holds some important types for each element-type. More...
 

Public Member Functions

void add_level (ElementStorage< Vertex >::SectionContainer *vrtCon, ElementStorage< Edge >::SectionContainer *edgeCon, ElementStorage< Face >::SectionContainer *faceCon, ElementStorage< Volume >::SectionContainer *volCon)
 only used during creation by the methods that create the collection More...
 
template<class TGeomObj >
geometry_traits< TGeomObj >::iterator begin (size_t level=0)
 
template<class TGeomObj >
geometry_traits< TGeomObj >::const_iterator begin (size_t level=0) const
 
EdgeIterator edges_begin (size_t level=0)
 
ConstEdgeIterator edges_begin (size_t level=0) const
 
EdgeIterator edges_end (size_t level=0)
 
ConstEdgeIterator edges_end (size_t level=0) const
 
template<class TGeomObj >
geometry_traits< TGeomObj >::iterator end (size_t level=0)
 
template<class TGeomObj >
geometry_traits< TGeomObj >::const_iterator end (size_t level=0) const
 
FaceIterator faces_begin (size_t level=0)
 
ConstFaceIterator faces_begin (size_t level=0) const
 
FaceIterator faces_end (size_t level=0)
 
ConstFaceIterator faces_end (size_t level=0) const
 
 GridObjectCollection (const GridObjectCollection &mgoc)
 
 GridObjectCollection (ElementStorage< Vertex >::SectionContainer *vrtCon, ElementStorage< Edge >::SectionContainer *edgeCon, ElementStorage< Face >::SectionContainer *faceCon, ElementStorage< Volume >::SectionContainer *volCon)
 initializes level 0 with the given sections. More...
 
 GridObjectCollection (size_t levelEstimate=1)
 initializes the instance with an estimate of the number of levels. More...
 
template<class TGeomObj >
size_t num () const
 
template<class TGeomObj >
size_t num (size_t level) const
 
size_t num_edges () const
 
size_t num_edges (size_t level) const
 
size_t num_faces () const
 
size_t num_faces (size_t level) const
 
size_t num_levels () const
 returns the number of levels More...
 
size_t num_vertices () const
 
size_t num_vertices (size_t level) const
 
size_t num_volumes () const
 
size_t num_volumes (size_t level) const
 
GridObjectCollectionoperator= (const GridObjectCollection &mgoc)
 
VertexIterator vertices_begin (size_t level=0)
 
ConstVertexIterator vertices_begin (size_t level=0) const
 
VertexIterator vertices_end (size_t level=0)
 
ConstVertexIterator vertices_end (size_t level=0) const
 
VolumeIterator volumes_begin (size_t level=0)
 
ConstVolumeIterator volumes_begin (size_t level=0) const
 
VolumeIterator volumes_end (size_t level=0)
 
ConstVolumeIterator volumes_end (size_t level=0) const
 

Protected Types

typedef std::vector< ContainerCollectionContainerVec
 

Protected Member Functions

void assign (const GridObjectCollection &goc)
 
template<class TGeomObj >
ElementStorage< typename geometry_traits< TGeomObj >::grid_base_object >::SectionContainerget_container (size_t level)
 
template<class TGeomObj >
const ElementStorage< typename geometry_traits< TGeomObj >::grid_base_object >::SectionContainerget_container (size_t level) const
 

Protected Attributes

ContainerVec m_levels
 

Detailed Description

a helper class that holds a collection of possibly unconnected geometric-objects.

This class is a simple helper class.. Its purpose is to make it easy to pass a collection of geometric-objects to a function while maintaining the possibility to iterate over different sub-types of geometric-objects seperatly.

In contrary to

See also
GridObjectCollection, the GridObjectCollection allows access to the elements through different levels.

Please note that a GridObjectCollection is only valid as long as the object from which you received the collection still exists.

A GridObjectCollection can only be queried for iterators and element-counts. You may not insert new elements or remove old ones (at least not directly).

Classes that you can query for their GridObjectCollection are for example ug::Grid, ug::MultiGrid, ug::SubsetHandler, ug::MGSubsetHandler, ug::Selector, ug::MGSelector.

As long as the object that provides the GridObjectCollection is still valid, the GridObjectCollection will always hold the current geometric objects of the source-object (i.e. a grid, a selector or a subset-handler), as long as new objects are inserted into existing subsets (SubsetHandler) or existing levels (MultiGrid). Insertion or removal of subsets or levels is not reflected by the goc and can lead to severe errors. Make sure to retrieve a new goc if such changes happened.

Please note that a GridObjectCollection does not necessarily represent a topological closed part of a grid. A Collection can for example hold faces without their associated vertices.

How to use GridObjectCollection: Once you retrieved an instance (let's call it goc) you can query it for iterators like this: VertexIterator iter = goc.vertices_begin(0); or if you want to iterate over triangles of level 1 type the following: TriangleIterator iter = goc.begin<Triangle>(1);

if you want to get the number of hexahedrons in level 0 you would go like this: uint numHexas = goc.num<Hexahedron>(0);

Member Typedef Documentation

◆ ContainerVec

Constructor & Destructor Documentation

◆ GridObjectCollection() [1/3]

ug::GridObjectCollection::GridObjectCollection ( size_t  levelEstimate = 1)

initializes the instance with an estimate of the number of levels.

The estimate does not have to match exactly. However, if it does it makes things faster.

References m_levels.

◆ GridObjectCollection() [2/3]

ug::GridObjectCollection::GridObjectCollection ( ElementStorage< Vertex >::SectionContainer vrtCon,
ElementStorage< Edge >::SectionContainer edgeCon,
ElementStorage< Face >::SectionContainer faceCon,
ElementStorage< Volume >::SectionContainer volCon 
)

initializes level 0 with the given sections.

References add_level(), and m_levels.

◆ GridObjectCollection() [3/3]

ug::GridObjectCollection::GridObjectCollection ( const GridObjectCollection mgoc)

References assign().

Member Function Documentation

◆ add_level()

◆ assign()

void ug::GridObjectCollection::assign ( const GridObjectCollection goc)
protected

References m_levels, and num_levels().

Referenced by GridObjectCollection(), and operator=().

◆ begin() [1/2]

◆ begin() [2/2]

template<class TGeomObj >
geometry_traits< TGeomObj >::const_iterator ug::GridObjectCollection::begin ( size_t  level = 0) const
inline

◆ edges_begin() [1/2]

EdgeIterator ug::GridObjectCollection::edges_begin ( size_t  level = 0)
inline

◆ edges_begin() [2/2]

ConstEdgeIterator ug::GridObjectCollection::edges_begin ( size_t  level = 0) const
inline

◆ edges_end() [1/2]

EdgeIterator ug::GridObjectCollection::edges_end ( size_t  level = 0)
inline

◆ edges_end() [2/2]

ConstEdgeIterator ug::GridObjectCollection::edges_end ( size_t  level = 0) const
inline

◆ end() [1/2]

◆ end() [2/2]

template<class TGeomObj >
geometry_traits< TGeomObj >::const_iterator ug::GridObjectCollection::end ( size_t  level = 0) const
inline

◆ faces_begin() [1/2]

FaceIterator ug::GridObjectCollection::faces_begin ( size_t  level = 0)
inline

Referenced by ug::FaceArea().

◆ faces_begin() [2/2]

ConstFaceIterator ug::GridObjectCollection::faces_begin ( size_t  level = 0) const
inline

◆ faces_end() [1/2]

FaceIterator ug::GridObjectCollection::faces_end ( size_t  level = 0)
inline

Referenced by ug::FaceArea().

◆ faces_end() [2/2]

ConstFaceIterator ug::GridObjectCollection::faces_end ( size_t  level = 0) const
inline

◆ get_container() [1/2]

template<class TGeomObj >
ElementStorage< typename geometry_traits< TGeomObj >::grid_base_object >::SectionContainer * ug::GridObjectCollection::get_container ( size_t  level)
inlineprotected

References m_levels.

◆ get_container() [2/2]

template<class TGeomObj >
const ElementStorage< typename geometry_traits< TGeomObj >::grid_base_object >::SectionContainer * ug::GridObjectCollection::get_container ( size_t  level) const
inlineprotected

References m_levels.

◆ num() [1/2]

◆ num() [2/2]

template<class TGeomObj >
size_t ug::GridObjectCollection::num ( size_t  level) const
inline

◆ num_edges() [1/2]

size_t ug::GridObjectCollection::num_edges ( ) const
inline

◆ num_edges() [2/2]

size_t ug::GridObjectCollection::num_edges ( size_t  level) const
inline

◆ num_faces() [1/2]

size_t ug::GridObjectCollection::num_faces ( ) const
inline

◆ num_faces() [2/2]

size_t ug::GridObjectCollection::num_faces ( size_t  level) const
inline

◆ num_levels()

◆ num_vertices() [1/2]

size_t ug::GridObjectCollection::num_vertices ( ) const
inline

◆ num_vertices() [2/2]

size_t ug::GridObjectCollection::num_vertices ( size_t  level) const
inline

◆ num_volumes() [1/2]

size_t ug::GridObjectCollection::num_volumes ( ) const
inline

◆ num_volumes() [2/2]

size_t ug::GridObjectCollection::num_volumes ( size_t  level) const
inline

◆ operator=()

GridObjectCollection & ug::GridObjectCollection::operator= ( const GridObjectCollection mgoc)

References assign().

◆ vertices_begin() [1/2]

VertexIterator ug::GridObjectCollection::vertices_begin ( size_t  level = 0)
inline

◆ vertices_begin() [2/2]

ConstVertexIterator ug::GridObjectCollection::vertices_begin ( size_t  level = 0) const
inline

◆ vertices_end() [1/2]

VertexIterator ug::GridObjectCollection::vertices_end ( size_t  level = 0)
inline

◆ vertices_end() [2/2]

ConstVertexIterator ug::GridObjectCollection::vertices_end ( size_t  level = 0) const
inline

◆ volumes_begin() [1/2]

VolumeIterator ug::GridObjectCollection::volumes_begin ( size_t  level = 0)
inline

◆ volumes_begin() [2/2]

ConstVolumeIterator ug::GridObjectCollection::volumes_begin ( size_t  level = 0) const
inline

◆ volumes_end() [1/2]

VolumeIterator ug::GridObjectCollection::volumes_end ( size_t  level = 0)
inline

◆ volumes_end() [2/2]

ConstVolumeIterator ug::GridObjectCollection::volumes_end ( size_t  level = 0) const
inline

Member Data Documentation

◆ m_levels

ContainerVec ug::GridObjectCollection::m_levels
protected

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