ug4
|
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 |
GridObjectCollection & | operator= (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< ContainerCollection > | ContainerVec |
Protected Member Functions | |
void | assign (const GridObjectCollection &goc) |
template<class TGeomObj > | |
ElementStorage< typename geometry_traits< TGeomObj >::grid_base_object >::SectionContainer * | get_container (size_t level) |
template<class TGeomObj > | |
const ElementStorage< typename geometry_traits< TGeomObj >::grid_base_object >::SectionContainer * | get_container (size_t level) const |
Protected Attributes | |
ContainerVec | m_levels |
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
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);
|
protected |
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.
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.
ug::GridObjectCollection::GridObjectCollection | ( | const GridObjectCollection & | mgoc | ) |
References assign().
void ug::GridObjectCollection::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
References m_levels.
Referenced by ug::MGSelector::get_grid_objects(), ug::GridSubsetHandler::get_grid_objects(), ug::MultiGridSubsetHandler::get_grid_objects_in_level(), ug::MultiGridSubsetHandler::get_grid_objects_in_subset(), and GridObjectCollection().
|
protected |
References m_levels, and num_levels().
Referenced by GridObjectCollection(), and operator=().
|
inline |
returns the begin iterator for the specified level. If no level is given iterators for level 0 are returned.
Referenced by ug::AssignSelectionToSubset(), ug::AssignSubsetsByElementType(), ug::PeriodicBoundaryManager::check_periodicity(), ug::CollectVerticesTouchingSelection(), ug::ConstructDualGraph(), ug::CopyGrid(), ug::CopyGridElements(), ug::CopyGridLevel(), ug::CopyGridLevelElements(), ug::CopySubsetIndicesToSides(), ug::GridWriterUGX::create_selector_element_node(), ug::GridWriterUGX::create_subset_element_node(), ug::GridDataSerializationHandler::deserialize(), ug::DeserializeSelector(), ug::DeserializeSubsetHandler(), ug::FaceArea(), ug::FindSubsetGroups(), ug::GetSelectedElementIndices(), ug::IdentifySubsets(), ug::MarkForRefinement_ElementsInSubset(), ug::ProjectVerticesToCloseEdges(), ug::AdaptionSurfaceGridFunction< TDomain >::prolongate(), ug::SaveGridToNCDF(), ug::SaveGridToOBJ(), ug::AdaptionSurfaceGridFunction< TDomain >::select_parents(), ug::SelectAssociatedElements(), ug::SelectLinkedElements(), ug::SelectSubset(), ug::SelectSubsetElements(), ug::GridDataSerializationHandler::serialize(), ug::SerializeGridElements(), ug::SerializeMultiGridElements(), ug::SerializeSelector(), ug::SerializeSubsetHandler(), and ug::WriteDebugValuesToFile().
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
returns the end iterator for the specified level. If no level is given iterators for level 0 are returned.
Referenced by ug::AssignSelectionToSubset(), ug::AssignSubsetsByElementType(), ug::PeriodicBoundaryManager::check_periodicity(), ug::CollectVerticesTouchingSelection(), ug::ConstructDualGraph(), ug::CopyGrid(), ug::CopyGridElements(), ug::CopyGridLevel(), ug::CopyGridLevelElements(), ug::CopySubsetIndicesToSides(), ug::GridWriterUGX::create_selector_element_node(), ug::GridWriterUGX::create_subset_element_node(), ug::GridDataSerializationHandler::deserialize(), ug::DeserializeSelector(), ug::DeserializeSubsetHandler(), ug::FaceArea(), ug::FindSubsetGroups(), ug::GetSelectedElementIndices(), ug::IdentifySubsets(), ug::MarkForRefinement_ElementsInSubset(), ug::ProjectVerticesToCloseEdges(), ug::AdaptionSurfaceGridFunction< TDomain >::prolongate(), ug::SaveGridToNCDF(), ug::SaveGridToOBJ(), ug::AdaptionSurfaceGridFunction< TDomain >::select_parents(), ug::SelectAssociatedElements(), ug::SelectLinkedElements(), ug::SelectSubset(), ug::SelectSubsetElements(), ug::GridDataSerializationHandler::serialize(), ug::SerializeGridElements(), ug::SerializeMultiGridElements(), ug::SerializeSelector(), ug::SerializeSubsetHandler(), and ug::WriteDebugValuesToFile().
|
inline |
|
inline |
Referenced by ug::FaceArea().
|
inline |
|
inline |
Referenced by ug::FaceArea().
|
inline |
|
inlineprotected |
References m_levels.
|
inlineprotected |
References m_levels.
size_t ug::GridObjectCollection::num |
|
inline |
|
inline |
Referenced by ug::ProjectionHandler::refinement_begins().
|
inline |
|
inline |
Referenced by ug::ProjectionHandler::refinement_begins().
|
inline |
|
inline |
returns the number of levels
Referenced by assign(), ug::AssignSelectionToSubset(), ug::PeriodicBoundaryManager::check_periodicity(), ug::CollectVerticesTouchingSelection(), ug::ConstructDualGraph(), ug::CopySubsetIndicesToSides(), ug::GridWriterUGX::create_selector_element_node(), ug::GridWriterUGX::create_subset_element_node(), ug::GridDataSerializationHandler::deserialize(), ug::DeserializeSelector(), ug::DeserializeSubsetHandler(), ug::FaceArea(), ug::GetSelectedElementIndices(), ug::IdentifySubsets(), ug::MarkForRefinement_ElementsInSubset(), ug::PrintElementNumbers(), ug::AdaptionSurfaceGridFunction< TDomain >::prolongate(), ug::SaveGridToNCDF(), ug::SaveGridToOBJ(), ug::AdaptionSurfaceGridFunction< TDomain >::select_parents(), ug::SelectAssociatedElements(), ug::SelectLinkedElements(), ug::SelectSubset(), ug::SelectSubsetElements(), ug::GridDataSerializationHandler::serialize(), ug::SerializeMultiGridElements(), ug::SerializeSelector(), ug::SerializeSubsetHandler(), and ug::WriteDebugValuesToFile().
|
inline |
Referenced by ug::ProjectionHandler::refinement_begins().
|
inline |
|
inline |
Referenced by ug::ProjectionHandler::refinement_begins().
|
inline |
GridObjectCollection & ug::GridObjectCollection::operator= | ( | const GridObjectCollection & | mgoc | ) |
References assign().
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
protected |
Referenced by add_level(), assign(), get_container(), GridObjectCollection(), and num().