ug4
ug::GridSubsetHandler Class Reference

Partitions elements of a grid into several subsets. More...

#include <subset_handler_grid.h>

+ Inheritance diagram for ug::GridSubsetHandler:

Classes

struct  Subset
 

Public Member Functions

void assign_grid (Grid &grid)
 
void assign_grid (Grid *grid)
 
void assign_subset (Edge *elem, int subsetIndex)
 assigns an edge to a subset. More...
 
virtual void assign_subset (Edge *elem, int subsetIndex)=0
 
void assign_subset (Face *elem, int subsetIndex)
 assigns a face to a subset. More...
 
virtual void assign_subset (Face *elem, int subsetIndex)=0
 
virtual void assign_subset (GridObject *elem, int subsetIndex)
 
template<class TIterator >
void assign_subset (TIterator iterBegin, TIterator iterEnd, int subsetIndex)
 
void assign_subset (Vertex *elem, int subsetIndex)
 assigns a vertex to a subset. More...
 
virtual void assign_subset (Vertex *elem, int subsetIndex)=0
 
void assign_subset (Volume *elem, int subsetIndex)
 assigns a volume to a subset. More...
 
virtual void assign_subset (Volume *elem, int subsetIndex)=0
 
template<class TElem >
geometry_traits< TElem >::iterator begin (int subsetIndex)
 returns the begin-iterator for the elements of type TElem in the given subset. More...
 
template<class TElem >
geometry_traits< TElem >::const_iterator begin (int subsetIndex) const
 returns the begin-iterator for the elements of type TElem in the given subset. More...
 
template<class TElem >
geometry_traits< TElem >::const_iterator begin (int subsetIndex, size_t) const
 returns the begin-iterator for the elements of type TElem in the given subset. More...
 
template<class TElem >
void clear_subset_elements (int subsetIndex)
 removes all elements of type TElem from the specified subset. More...
 
virtual bool contains_edges (int subsetIndex) const
 returns true if the subset contains edges More...
 
virtual bool contains_faces (int subsetIndex) const
 returns true if the subset contains faces More...
 
virtual bool contains_vertices (int subsetIndex) const
 collects all vertices that are in the given subset. More...
 
virtual bool contains_volumes (int subsetIndex) const
 returns true if the subset contains volumes More...
 
template<class TElem >
bool empty () const
 returns true if the subset-handler contains no elements of the given type. More...
 
bool empty () const
 returns true if the subset-handler contains no elements at all. More...
 
template<class TElem >
bool empty (int subsetIndex) const
 
bool empty (int subsetIndex) const
 returns true if the subset-handler contains no elements at all. More...
 
template<class TElem >
geometry_traits< TElem >::iterator end (int subsetIndex)
 returns the end-iterator for the elements of type TElem in the given subset. More...
 
template<class TElem >
geometry_traits< TElem >::const_iterator end (int subsetIndex) const
 returns the end-iterator for the elements of type TElem in the given subset. More...
 
template<class TElem >
geometry_traits< TElem >::const_iterator end (int subsetIndex, size_t) const
 returns the end-iterator for the elements of type TElem in the given subset. More...
 
GridObjectCollection get_grid_objects () const
 
virtual GridObjectCollection get_grid_objects_in_subset (int subsetIndex) const
 Returns the geometric object collection for the given subset. More...
 
virtual void grid_to_be_destroyed (Grid *grid)
 perform cleanup More...
 
 GridSubsetHandler (const GridSubsetHandler &sh)
 
 GridSubsetHandler (Grid &grid, uint supportedElements=SHE_ALL)
 
 GridSubsetHandler (uint supportedElements=SHE_ALL)
 
template<class TElem >
uint num () const
 returns the total number of elements More...
 
template<class TElem >
uint num (int subsetIndex) const
 returns the number of elements in the given subset More...
 
template<class TElem >
uint num (int subsetIndex, size_t) const
 returns the number of elements in the given subset More...
 
template<class TElem >
uint num_elements (int subsetIndex) const
 returns the number of elements in the given subset More...
 
template<class TElem >
uint num_elements (int subsetIndex, size_t) const
 returns the number of elements in the given subset More...
 
uint num_levels () const
 returns number of levels (always 1) More...
 
GridSubsetHandleroperator= (const GridSubsetHandler &sh)
 
GridSubsetHandleroperator= (const ISubsetHandler &sh)
 
template<class TElem >
bool perform_self_tests ()
 only for debug purposes More...
 
 ~GridSubsetHandler ()
 
- Public Member Functions inherited from ug::ISubsetHandler
virtual void assign_subset (GridObject *elem, int subsetIndex)
 
template<class TIterator >
void assign_subset (TIterator iterBegin, TIterator iterEnd, int subsetIndex)
 
void clear ()
 
void clear_subset (int subsetIndex)
 
void clear_subsets ()
 
void disable_element_support (uint shElements)
 disable support for element-types. More...
 
virtual void edge_created (Grid *grid, Edge *e, GridObject *pParent=NULL, bool replacesParent=false)
 Notified whenever a new element of the given type is created in the given grid. More...
 
virtual void edge_to_be_erased (Grid *grid, Edge *e, Edge *replacedBy=NULL)
 Notified whenever an element of the given type is erased from the given grid. More...
 
virtual void edges_to_be_merged (Grid *grid, Edge *target, Edge *elem1, Edge *elem2)
 Notified when two elements of the same type are going to be merged. More...
 
bool elements_are_supported (uint shElements) const
 returns true if the given element-types are supported. More...
 
virtual void elements_to_be_cleared (Grid *grid)
 
void enable_element_support (uint shElements)
 enable support for element-types. Does not invalidate previous settings. More...
 
void enable_strict_inheritance (bool bEnable)
 
void enable_subset_inheritance (bool bEnable)
 
void erase_subset (int subsetIndex)
 erases the subset at the given index. Assigns -1 to all entries. Moves all other subsets 1 index up. More...
 
virtual void face_created (Grid *grid, Face *f, GridObject *pParent=NULL, bool replacesParent=false)
 Notified whenever a new element of the given type is created in the given grid. More...
 
virtual void face_to_be_erased (Grid *grid, Face *f, Face *replacedBy=NULL)
 Notified whenever an element of the given type is erased from the given grid. More...
 
virtual void faces_to_be_merged (Grid *grid, Face *target, Face *elem1, Face *elem2)
 Notified when two elements of the same type are going to be merged. More...
 
int get_default_subset_index ()
 
int get_subset_index (const char *name) const
 returns the index of the first subset with the given name. More...
 
int get_subset_index (Edge *elem) const
 
int get_subset_index (Face *elem) const
 
int get_subset_index (GridObject *elem) const
 
int get_subset_index (Vertex *elem) const
 
int get_subset_index (Volume *elem) const
 
const char * get_subset_name (int subsetIndex) const
 returns the name of a subset More...
 
Gridgrid () const
 returns a pointer to the grid on which the subset-handler works. More...
 
void insert_subset (int subsetIndex)
 inserts a subset at the given index. Moves all other subsets 1 index higher. More...
 
 ISubsetHandler (Grid &grid, uint supportedElements=SHE_ALL)
 pass a grid and an or-combination of SubsetHandlerElements to supportedElements. More...
 
 ISubsetHandler (uint supportedElements=SHE_ALL)
 pass an or-combination of SubsetHandlerElements to supportedElements. More...
 
void join_subsets (int targetSub, int sub1, int sub2, bool eraseUnusedSubs)
 Joins two subsets into a new one. Optionally erases the old subsets, if they are no longer used. More...
 
void move_subset (int indexFrom, int indexTo)
 Moves the subset from index From to index To. Moves all subsets between indexFrom+1 and indexTo in the opposite direction. More...
 
int num_subsets () const
 returns the number of subset-infos (return value is int, since SubsetIndices are of type int) More...
 
ISubsetHandleroperator= (const ISubsetHandler &sh)
 assigns subsets based on the subsets in the given subset-handler More...
 
void set_default_subset_index (int subsetIndex)
 
void set_default_subset_info (const SubsetInfo &defSI)
 sets the default subset-info. Used when initializing new subset-infos. More...
 
void set_subset_info (int subsetIndex, const SubsetInfo &subsetInfo)
 
void set_subset_name (const char *name, int subsetIndex)
 sets the name of a subset More...
 
void set_supported_elements (uint shElements)
 set the type of elements that shall be handled by the SubsetHandler. More...
 
bool strict_inheritance_enabled ()
 
SubsetInfosubset_info (int subsetIndex)
 
const SubsetInfosubset_info (int subsetIndex) const
 
bool subset_inheritance_enabled ()
 
void subset_required (int index)
 if the subset with the given index does not yet exist, it will be created. More...
 
void subset_required (int index) const
 throws an error if the given index is equal or higher than num_subsets. More...
 
void swap_subsets (int subsetIndex1, int subsetIndex2)
 Swaps the given subsets,. More...
 
virtual void vertex_created (Grid *grid, Vertex *vrt, GridObject *pParent=NULL, bool replacesParent=false)
 Notified whenever a new element of the given type is created in the given grid. More...
 
virtual void vertex_to_be_erased (Grid *grid, Vertex *vrt, Vertex *replacedBy=NULL)
 Notified whenever an element of the given type is erased from the given grid. More...
 
virtual void vertices_to_be_merged (Grid *grid, Vertex *target, Vertex *elem1, Vertex *elem2)
 Notified when two elements of the same type are going to be merged. More...
 
virtual void volume_created (Grid *grid, Volume *vol, GridObject *pParent=NULL, bool replacesParent=false)
 Notified whenever a new element of the given type is created in the given grid. More...
 
virtual void volume_to_be_erased (Grid *grid, Volume *vol, Volume *replacedBy=NULL)
 Notified whenever an element of the given type is erased from the given grid. More...
 
virtual void volumes_to_be_merged (Grid *grid, Volume *target, Volume *elem1, Volume *elem2)
 Notified when two elements of the same type are going to be merged. More...
 
virtual ~ISubsetHandler ()
 
- Public Member Functions inherited from ug::GridObserver
virtual ~GridObserver ()
 

Protected Types

typedef Grid::traits< Edge >::AttachedElementList AttachedEdgeList
 
typedef Grid::traits< Face >::AttachedElementList AttachedFaceList
 
typedef Grid::traits< Vertex >::AttachedElementList AttachedVertexList
 enable subset-attachment support More...
 
typedef Grid::traits< Volume >::AttachedElementList AttachedVolumeList
 
typedef Grid::traits< Edge >::SectionContainer EdgeSectionContainer
 
typedef Grid::traits< Face >::SectionContainer FaceSectionContainer
 
typedef std::vector< Subset * > SubsetVec
 
typedef Grid::traits< Vertex >::SectionContainer VertexSectionContainer
 
typedef Grid::traits< Volume >::SectionContainer VolumeSectionContainer
 
- Protected Types inherited from ug::ISubsetHandler
typedef AInt ASubsetIndex
 
typedef Grid::traits< Edge >::AttachedElementList AttachedEdgeList
 
typedef Grid::traits< Face >::AttachedElementList AttachedFaceList
 
typedef Grid::traits< Vertex >::AttachedElementList AttachedVertexList
 enable subset-attachment support More...
 
typedef Grid::traits< Volume >::AttachedElementList AttachedVolumeList
 
typedef Grid::traits< Edge >::SectionContainer EdgeSectionContainer
 
typedef Grid::traits< Face >::SectionContainer FaceSectionContainer
 
typedef std::vector< SubsetInfoSubsetInfoVec
 
typedef Grid::traits< Vertex >::SectionContainer VertexSectionContainer
 
typedef Grid::traits< Volume >::SectionContainer VolumeSectionContainer
 

Protected Member Functions

void add_required_subset_lists (int maxIndex)
 add a subset More...
 
template<class TElem >
void assign_subset_impl (TElem *elem, int subsetIndex)
 this method is called by ISubsetHandler when attachment_support has been enabled. More...
 
template<class TElem >
void change_elem_subset_indices (int indOld, int indNew)
 helper for change_subset_indices More...
 
virtual void change_subset_indices (int indOld, int indNew)
 changes the subset-indices of all elements int the subset. More...
 
void cleanup ()
 helper for collect_subset_elements More...
 
virtual void clear_subset_lists (int index)
 clears the element lists in the given subset. Does not alter any indices. More...
 
void detach_data ()
 detaches all attached data. More...
 
virtual void erase_subset_lists ()
 erases the subsets. Doesn't alter any indices. More...
 
void erase_subset_lists (int index)
 erases the subset but does not touch the subset-indices. More...
 
void erase_subset_lists_impl ()
 non-virtual implementation of erase_subset_lists. Callable from destructor More...
 
void join_subset_lists (int target, int src1, int src2)
 join the subset-lists but do not touch the subset-indices. More...
 
void move_subset_lists (int indexFrom, int indexTo)
 moves the subset but does not touch the subset-indices. More...
 
uint num_subsets_in_list () const
 returns the number of subsets in the local list More...
 
template<class TElem >
Grid::traits< TElem >::SectionContainersection_container (int si)
 returns the section container for the given type, subset and level More...
 
template<class TElem >
const Grid::traits< TElem >::SectionContainersection_container (int si) const
 returns the const section container for the given type, subset and level More...
 
void swap_subset_lists (int ind1, int ind2)
 swaps the subsets but does not touch the subset-indices. More...
 
VertexSectionContainer::iterator get_list_iterator (Vertex *o)
 returns the iterator at which the given element lies in the section container More...
 
EdgeSectionContainer::iterator get_list_iterator (Edge *o)
 returns the iterator at which the given element lies in the section container More...
 
FaceSectionContainer::iterator get_list_iterator (Face *o)
 returns the iterator at which the given element lies in the section container More...
 
VolumeSectionContainer::iterator get_list_iterator (Volume *o)
 returns the iterator at which the given element lies in the section container More...
 
- Protected Member Functions inherited from ug::ISubsetHandler
void alter_subset_index (Edge *e, int subsetIndex)
 
void alter_subset_index (Face *f, int subsetIndex)
 
void alter_subset_index (Vertex *v, int subsetIndex)
 
void alter_subset_index (Volume *v, int subsetIndex)
 
void assign_subset_handler (const ISubsetHandler &sh)
 selects elements based on the selection in the srcHandler More...
 
void create_required_subsets (int index)
 creates all required infos (and pipes) up to the given index. More...
 
template<class TElem >
void elems_to_be_merged (Grid *grid, TElem *target, TElem *elem1, TElem *elem2)
 helper for GridObserver callbacks. More...
 
void reset_subset_indices (uint shElements=SHE_ALL)
 sets the subset-indices of all elements of m_pGrid to -1. More...
 
void set_grid (Grid *grid)
 set the grid on which the subset-handler shall work. More...
 
void subset_assigned (Edge *e, int subsetIndex)
 
void subset_assigned (Face *f, int subsetIndex)
 
void subset_assigned (Vertex *v, int subsetIndex)
 
void subset_assigned (Volume *v, int subsetIndex)
 

Protected Attributes

AttachedEdgeList::AEntry m_aSharedEntryEDGE
 
AttachedFaceList::AEntry m_aSharedEntryFACE
 
AttachedVolumeList::AEntry m_aSharedEntryVOL
 
AttachedVertexList::AEntry m_aSharedEntryVRT
 
SubsetVec m_subsets
 
- Protected Attributes inherited from ug::ISubsetHandler
Grid::EdgeAttachmentAccessor< ASubsetIndexm_aaSubsetIndexEDGE
 
Grid::FaceAttachmentAccessor< ASubsetIndexm_aaSubsetIndexFACE
 
Grid::VolumeAttachmentAccessor< ASubsetIndexm_aaSubsetIndexVOL
 
Grid::VertexAttachmentAccessor< ASubsetIndexm_aaSubsetIndexVRT
 
ASubsetIndex m_aSubsetIndex
 
bool m_bStrictInheritanceEnabled
 
bool m_bSubsetInheritanceEnabled
 
int m_defaultSubsetIndex
 
SubsetInfo m_defaultSubsetInfo
 
Gridm_pGrid
 
SubsetInfoVec m_subsetInfos
 
uint m_supportedElements
 

Detailed Description

Partitions elements of a grid into several subsets.

The user can iterate over elements of grid subset-wise.

Member Typedef Documentation

◆ AttachedEdgeList

◆ AttachedFaceList

◆ AttachedVertexList

enable subset-attachment support

if subset-attachments are enabled you may attach data to the elements of a subset. This is useful if you want to store different data in the elements of different subsets. returns true if subset-attachments are enabled. attach with unspecified default value. Pass either Vertex, Edge, Face or Volume as TGeomObjClass. attach with specified default value Pass either Vertex, Edge, Face or Volume as TGeomObjClass. Pass either Vertex, Edge, Face or Volume as TGeomObjClass. returns the attachment data container for elements of type TGeomObj for the given subset. Use the data-container with care! You should never clear or resize it.

Valid types for TGeomObj are Vertex, Edge, Face and Volume. call it like this (let sh be an instance of ISubsetHandler): sh.get_attachment_data_container<Vertex>(aSomeAttachment, someSubsetIndex);

◆ AttachedVolumeList

◆ EdgeSectionContainer

◆ FaceSectionContainer

◆ SubsetVec

typedef std::vector<Subset*> ug::GridSubsetHandler::SubsetVec
protected

◆ VertexSectionContainer

◆ VolumeSectionContainer

Constructor & Destructor Documentation

◆ GridSubsetHandler() [1/3]

ug::GridSubsetHandler::GridSubsetHandler ( uint  supportedElements = SHE_ALL)

◆ GridSubsetHandler() [2/3]

ug::GridSubsetHandler::GridSubsetHandler ( Grid grid,
uint  supportedElements = SHE_ALL 
)

◆ GridSubsetHandler() [3/3]

ug::GridSubsetHandler::GridSubsetHandler ( const GridSubsetHandler sh)

WARNING: Don't call the copy-constructor from derived classes, Since it calls virtual methods.

References assign_grid(), ug::ISubsetHandler::assign_subset_handler(), and ug::ISubsetHandler::grid().

◆ ~GridSubsetHandler()

ug::GridSubsetHandler::~GridSubsetHandler ( )

Member Function Documentation

◆ add_required_subset_lists()

◆ assign_grid() [1/2]

void ug::GridSubsetHandler::assign_grid ( Grid grid)

◆ assign_grid() [2/2]

◆ assign_subset() [1/10]

void ug::GridSubsetHandler::assign_subset ( Edge elem,
int  subsetIndex 
)
virtual

assigns an edge to a subset.

If the subset doesn't already exist, it will be created.

Implements ug::ISubsetHandler.

References assign_subset_impl(), ug::ISubsetHandler::elements_are_supported(), and ug::SHE_EDGE.

◆ assign_subset() [2/10]

virtual void ug::ISubsetHandler::assign_subset

The implementation in a derived class should store the element in a list and call subset_assigned with the iterators position and the subset-index. The iterator can later be retrieved with get_list_iterator(...). The index can be retrieved with get_subset_index(...).

◆ assign_subset() [3/10]

void ug::GridSubsetHandler::assign_subset ( Face elem,
int  subsetIndex 
)
virtual

assigns a face to a subset.

If the subset doesn't already exist, it will be created.

Implements ug::ISubsetHandler.

References assign_subset_impl(), ug::ISubsetHandler::elements_are_supported(), and ug::SHE_FACE.

◆ assign_subset() [4/10]

virtual void ug::ISubsetHandler::assign_subset

The implementation in a derived class should store the element in a list and call subset_assigned with the iterators position and the subset-index. The iterator can later be retrieved with get_list_iterator(...). The index can be retrieved with get_subset_index(...).

◆ assign_subset() [5/10]

void ug::ISubsetHandler::assign_subset

Forwards the call to the assign_subset method for the specific type (e.g. Vertex, Edge, Face, Volume).

◆ assign_subset() [6/10]

template<class TIterator >
void ug::ISubsetHandler::assign_subset ( class TIterator  )

◆ assign_subset() [7/10]

void ug::GridSubsetHandler::assign_subset ( Vertex elem,
int  subsetIndex 
)
virtual

assigns a vertex to a subset.

If the subset doesn't already exist, it will be created.

Implements ug::ISubsetHandler.

References assign_subset_impl(), ug::ISubsetHandler::elements_are_supported(), and ug::SHE_VERTEX.

Referenced by ug::AdjustSubsetsForLgmNg(), ug::AssignCreaseVertices(), ug::AssignFaceInterfaceEdgesToSubsets(), ug::AssignFixedVertices(), ug::AssignSubsetsByInterfaceType(), ug::AssignSubsetsByLevel(), ug::AssignSubsetsByQuality(), ug::AssignSubsetsBySurfaceViewState(), ug::AssignTetrahedronAttributesByAspectRatio(), ug::AssignVolumeInterfaceFacesToSubsets(), ug::CheckValences(), ug::MultiGrid::create(), ug::MultiGrid::create_by_cloning(), ug::MultiGrid::element_created(), ug::ExpandFractures2d(), ug::ExpandFractures3d(), ug::ExtrudeCylinder(), ug::MarkFixedCreaseVertices(), ug::Partitioner_DynamicBisection< TElem, dim >::partition(), ug::PartitionDomain_MetisKWay(), ug::PartitionElements_RegularGrid(), ug::PartitionGrid_MetisKway(), ug::PartitionMultiGrid_MetisKway(), ug::PartitionMultiGridLevel_MetisKway(), ug::PartitionMultiGridLevel_ParmetisKway(), ug::Partitioner_DynamicBisection< TElem, dim >::perform_bisection(), ug::PerformRetetrahedralization(), ug::ClusterElementStacks< elem_t, vector_t >::post_process(), ug::SmoothPartitionBounds< elem_t >::post_process(), ug::DelaunayDebugSaver::save(), ug::GlobalFracturedMediaRefiner::save_marks_to_file(), ug::GlobalMultiGridRefiner::save_marks_to_file(), ug::HangingNodeRefinerBase< TSelector >::save_marks_to_file(), ug::SaveCoarsenMarksToFile(), ug::SavePartitionMapToFile(), ug::SeparateFaceSubsetsByNormal(), ug::SeparateSubsetsByLowerDimSeparators(), ug::SplitIrregularManifoldSubset(), ug::SplitIrregularPolyChain(), and ug::TriangleFill_SweepLine().

◆ assign_subset() [8/10]

virtual void ug::ISubsetHandler::assign_subset

The implementation in a derived class should store the element in a list and call subset_assigned with the iterators position and the subset-index. The iterator can later be retrieved with get_list_iterator(...). The index can be retrieved with get_subset_index(...).

◆ assign_subset() [9/10]

void ug::GridSubsetHandler::assign_subset ( Volume elem,
int  subsetIndex 
)
virtual

assigns a volume to a subset.

If the subset doesn't already exist, it will be created.

Implements ug::ISubsetHandler.

References assign_subset_impl(), ug::ISubsetHandler::elements_are_supported(), and ug::SHE_VOLUME.

◆ assign_subset() [10/10]

virtual void ug::ISubsetHandler::assign_subset

The implementation in a derived class should store the element in a list and call subset_assigned with the iterators position and the subset-index. The iterator can later be retrieved with get_list_iterator(...). The index can be retrieved with get_subset_index(...).

◆ assign_subset_impl()

template<class TElem >
void ug::GridSubsetHandler::assign_subset_impl ( TElem *  elem,
int  subsetIndex 
)
inlineprotected

this method is called by ISubsetHandler when attachment_support has been enabled.

a helper method for the public assign_subset methods.

References get_list_iterator(), ug::ISubsetHandler::get_subset_index(), ug::ISubsetHandler::m_pGrid, ug::ISubsetHandler::subset_assigned(), and ug::ISubsetHandler::subset_required().

Referenced by assign_subset().

◆ begin() [1/3]

◆ begin() [2/3]

template<class TElem >
geometry_traits< TElem >::const_iterator ug::GridSubsetHandler::begin ( int  subsetIndex) const

returns the begin-iterator for the elements of type TElem in the given subset.

e.g. begin<Triangle>(0)

References num_subsets_in_list().

◆ begin() [3/3]

template<class TElem >
geometry_traits<TElem>::const_iterator ug::GridSubsetHandler::begin ( int  subsetIndex,
size_t   
) const
inline

returns the begin-iterator for the elements of type TElem in the given subset.

only for compatibility reasons with MGSubsetHandler. second argument is ignored. use i.e. as follows: begin<Triangle>(0, 0)

◆ change_elem_subset_indices()

template<class TElem >
void ug::GridSubsetHandler::change_elem_subset_indices ( int  indOld,
int  indNew 
)
protected

helper for change_subset_indices

References ug::ISubsetHandler::alter_subset_index().

◆ change_subset_indices()

void ug::GridSubsetHandler::change_subset_indices ( int  indOld,
int  indNew 
)
protectedvirtual

changes the subset-indices of all elements int the subset.

WARNING: subsets are not automatically changed accordingly. After termination Subset-Indices and Subset-Infos/iterators are asynchronous. Make sure to change subset-infos and iterators accordingly.

Implements ug::ISubsetHandler.

References ug::ISubsetHandler::elements_are_supported(), ug::ISubsetHandler::m_pGrid, ug::SHE_EDGE, ug::SHE_FACE, ug::SHE_VERTEX, and ug::SHE_VOLUME.

◆ cleanup()

void ug::GridSubsetHandler::cleanup ( )
protected

helper for collect_subset_elements

removes attachments

References detach_data(), and erase_subset_lists_impl().

Referenced by assign_grid(), and grid_to_be_destroyed().

◆ clear_subset_elements()

template<class TElem >
void ug::GridSubsetHandler::clear_subset_elements ( int  subsetIndex)

◆ clear_subset_lists()

void ug::GridSubsetHandler::clear_subset_lists ( int  index)
protectedvirtual

clears the element lists in the given subset. Does not alter any indices.

Implements ug::ISubsetHandler.

References ug::ISubsetHandler::m_pGrid.

◆ contains_edges()

virtual bool ug::GridSubsetHandler::contains_edges ( int  subsetIndex) const
inlinevirtual

returns true if the subset contains edges

Implements ug::ISubsetHandler.

◆ contains_faces()

virtual bool ug::GridSubsetHandler::contains_faces ( int  subsetIndex) const
inlinevirtual

returns true if the subset contains faces

Implements ug::ISubsetHandler.

◆ contains_vertices()

virtual bool ug::GridSubsetHandler::contains_vertices ( int  subsetIndex) const
inlinevirtual

collects all vertices that are in the given subset.

Please consider using begin and end methods instead. If subset -1 is specified, the method has compexity O(n), where n is the number of vertices in the underlying grid.

Returns
number of collected elements.
See also
begin, end collects all edges that are in the given subset. Please consider using begin and end methods instead. If subset -1 is specified, the method has compexity O(n), where n is the number of edges in the underlying grid.
Returns
number of collected elements.
See also
begin, end collects all faces that are in the given subset. Please consider using begin and end methods instead. If subset -1 is specified, the method has compexity O(n), where n is the number of faces in the underlying grid.
Returns
number of collected elements.
See also
begin, end collects all volumes that are in the given subset. Please consider using begin and end methods instead. If subset -1 is specified, the method has compexity O(n), where n is the number of volumes in the underlying grid.
Returns
number of collected elements.
See also
begin, end returns true if the subset contains vertices

Implements ug::ISubsetHandler.

◆ contains_volumes()

virtual bool ug::GridSubsetHandler::contains_volumes ( int  subsetIndex) const
inlinevirtual

returns true if the subset contains volumes

Implements ug::ISubsetHandler.

◆ detach_data()

◆ empty() [1/4]

template<class TElem >
bool ug::GridSubsetHandler::empty
inline

returns true if the subset-handler contains no elements of the given type.

Referenced by ug::ExportGridToUG_2D(), ug::PartitionDomain_MetisKWay(), ug::PartitionDomain_RegularGrid(), and ug::SplitIrregularManifoldSubset().

◆ empty() [2/4]

bool ug::GridSubsetHandler::empty ( ) const
inline

returns true if the subset-handler contains no elements at all.

◆ empty() [3/4]

template<class TElem >
bool ug::GridSubsetHandler::empty ( int  subsetIndex) const
inline

◆ empty() [4/4]

bool ug::GridSubsetHandler::empty ( int  subsetIndex) const
inline

returns true if the subset-handler contains no elements at all.

◆ end() [1/3]

◆ end() [2/3]

template<class TElem >
geometry_traits< TElem >::const_iterator ug::GridSubsetHandler::end ( int  subsetIndex) const

returns the end-iterator for the elements of type TElem in the given subset.

e.g. end<Triangle>(0)

References num_subsets_in_list().

◆ end() [3/3]

template<class TElem >
geometry_traits<TElem>::const_iterator ug::GridSubsetHandler::end ( int  subsetIndex,
size_t   
) const
inline

returns the end-iterator for the elements of type TElem in the given subset.

only for compatibility reasons with MGSubsetHandler. second argument is ignored. use i.e. as follows: end<Triangle>(0, 0)

◆ erase_subset_lists() [1/2]

void ug::GridSubsetHandler::erase_subset_lists ( )
protectedvirtual

erases the subsets. Doesn't alter any indices.

Implements ug::ISubsetHandler.

References erase_subset_lists_impl().

◆ erase_subset_lists() [2/2]

void ug::GridSubsetHandler::erase_subset_lists ( int  index)
protectedvirtual

erases the subset but does not touch the subset-indices.

Implements ug::ISubsetHandler.

References m_subsets, and num_subsets_in_list().

◆ erase_subset_lists_impl()

void ug::GridSubsetHandler::erase_subset_lists_impl ( )
protected

non-virtual implementation of erase_subset_lists. Callable from destructor

References m_subsets.

Referenced by cleanup(), erase_subset_lists(), and ~GridSubsetHandler().

◆ get_grid_objects()

◆ get_grid_objects_in_subset()

GridObjectCollection ug::GridSubsetHandler::get_grid_objects_in_subset ( int  subsetInd) const
virtual

Returns the geometric object collection for the given subset.

Note that the GOC may contain multiple levels.

Implements ug::ISubsetHandler.

References m_subsets, num_subsets_in_list(), and ug::ISubsetHandler::subset_required().

Referenced by ug::MultiGrid::get_grid_objects().

◆ get_list_iterator() [1/4]

EdgeSectionContainer::iterator ug::GridSubsetHandler::get_list_iterator ( Edge o)
inlineprotected

returns the iterator at which the given element lies in the section container

This method may only be called if the element is in a subset != -1.

◆ get_list_iterator() [2/4]

FaceSectionContainer::iterator ug::GridSubsetHandler::get_list_iterator ( Face o)
inlineprotected

returns the iterator at which the given element lies in the section container

This method may only be called if the element is in a subset != -1.

◆ get_list_iterator() [3/4]

VertexSectionContainer::iterator ug::GridSubsetHandler::get_list_iterator ( Vertex o)
inlineprotected

returns the iterator at which the given element lies in the section container

This method may only be called if the element is in a subset != -1.

Referenced by assign_subset_impl().

◆ get_list_iterator() [4/4]

VolumeSectionContainer::iterator ug::GridSubsetHandler::get_list_iterator ( Volume o)
inlineprotected

returns the iterator at which the given element lies in the section container

This method may only be called if the element is in a subset != -1.

◆ grid_to_be_destroyed()

void ug::GridSubsetHandler::grid_to_be_destroyed ( Grid grid)
virtual

◆ join_subset_lists()

void ug::GridSubsetHandler::join_subset_lists ( int  target,
int  src1,
int  src2 
)
protectedvirtual

◆ move_subset_lists()

void ug::GridSubsetHandler::move_subset_lists ( int  indexFrom,
int  indexTo 
)
protectedvirtual

moves the subset but does not touch the subset-indices.

Implements ug::ISubsetHandler.

References m_subsets.

◆ num() [1/3]

◆ num() [2/3]

template<class TElem >
uint ug::GridSubsetHandler::num ( int  subsetIndex) const

returns the number of elements in the given subset

References num_subsets_in_list().

◆ num() [3/3]

template<class TElem >
uint ug::GridSubsetHandler::num ( int  subsetIndex,
size_t   
) const
inline

returns the number of elements in the given subset

only for compatibility reasons with MGSubsetHandler. second argument is ignored.

◆ num_elements() [1/2]

template<class TElem >
uint ug::GridSubsetHandler::num_elements ( int  subsetIndex) const

◆ num_elements() [2/2]

template<class TElem >
uint ug::GridSubsetHandler::num_elements ( int  subsetIndex,
size_t   
) const
inline

returns the number of elements in the given subset

only for compatibility reasons with MGSubsetHandler. second argument is ignored.

◆ num_levels()

uint ug::GridSubsetHandler::num_levels ( ) const
inline

returns number of levels (always 1)

only for compatibility reasons with MGSubsetHandler.

◆ num_subsets_in_list()

uint ug::GridSubsetHandler::num_subsets_in_list ( ) const
inlineprotected

◆ operator=() [1/2]

GridSubsetHandler & ug::GridSubsetHandler::operator= ( const GridSubsetHandler sh)

◆ operator=() [2/2]

GridSubsetHandler & ug::GridSubsetHandler::operator= ( const ISubsetHandler sh)

◆ perform_self_tests()

template<class TElem >
bool ug::GridSubsetHandler::perform_self_tests

only for debug purposes

References ug::ISubsetHandler::get_subset_index(), LOG, and num_subsets_in_list().

◆ section_container() [1/2]

template<class TElem >
Grid::traits< TElem >::SectionContainer & ug::GridSubsetHandler::section_container ( int  si)
inlineprotected

◆ section_container() [2/2]

template<class TElem >
const Grid::traits< TElem >::SectionContainer & ug::GridSubsetHandler::section_container ( int  si) const
inlineprotected

◆ swap_subset_lists()

void ug::GridSubsetHandler::swap_subset_lists ( int  ind1,
int  ind2 
)
protectedvirtual

swaps the subsets but does not touch the subset-indices.

Implements ug::ISubsetHandler.

References m_subsets.

Member Data Documentation

◆ m_aSharedEntryEDGE

AttachedEdgeList::AEntry ug::GridSubsetHandler::m_aSharedEntryEDGE
protected

◆ m_aSharedEntryFACE

AttachedFaceList::AEntry ug::GridSubsetHandler::m_aSharedEntryFACE
protected

◆ m_aSharedEntryVOL

AttachedVolumeList::AEntry ug::GridSubsetHandler::m_aSharedEntryVOL
protected

◆ m_aSharedEntryVRT

AttachedVertexList::AEntry ug::GridSubsetHandler::m_aSharedEntryVRT
protected

◆ m_subsets


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