ug4
ug::ISubsetHandler Class Referenceabstract

#include <subset_handler_interface.h>

+ Inheritance diagram for ug::ISubsetHandler:

Classes

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

Public Member Functions

virtual void assign_subset (Edge *elem, int subsetIndex)=0
 
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)
 
virtual void assign_subset (Vertex *elem, int subsetIndex)=0
 
virtual void assign_subset (Volume *elem, int subsetIndex)=0
 
void clear ()
 
void clear_subset (int subsetIndex)
 
void clear_subsets ()
 
virtual bool contains_edges (int subsetIndex) const =0
 returns true if the subset contains edges More...
 
virtual bool contains_faces (int subsetIndex) const =0
 returns true if the subset contains faces More...
 
virtual bool contains_vertices (int subsetIndex) const =0
 collects all vertices that are in the given subset. More...
 
virtual bool contains_volumes (int subsetIndex) const =0
 returns true if the subset contains volumes More...
 
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 ()
 
virtual GridObjectCollection get_grid_objects_in_subset (int subsetInd) const =0
 Returns the geometric object collection for the given subset. More...
 
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...
 
virtual void grid_to_be_destroyed (Grid *grid)
 
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 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

virtual void add_required_subset_lists (int maxIndex)=0
 add a subset if required - so that the subset with maxIndex exists. More...
 
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...
 
virtual void change_subset_indices (int indOld, int indNew)=0
 
virtual void clear_subset_lists (int index)=0
 
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...
 
virtual void erase_subset_lists ()=0
 
virtual void erase_subset_lists (int index)=0
 erase the subset-lists but do not touch the subset-indices. More...
 
virtual void join_subset_lists (int target, int src1, int src2)=0
 join the subset-lists but do not touch the subset-indices. More...
 
virtual void move_subset_lists (int indexFrom, int indexTo)=0
 move the subset-lists but do not touch the subset-indices. 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)
 
virtual void swap_subset_lists (int ind1, int ind2)=0
 swap the subset-lists but do not touch the subset-indices. More...
 

Protected Attributes

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
 

Private Member Functions

 ISubsetHandler (const ISubsetHandler &sh)
 this method is called by ISubsetHandler when attachment_support has been enabled. More...
 

Detailed Description

A derived class has to implement the following public methods: virtual void assign_subset(Vertex* elem, int subsetIndex) virtual void assign_subset(Edge* elem, int subsetIndex) virtual void assign_subset(Face* elem, int subsetIndex) virtual void assign_subset(Volume* elem, int subsetIndex)

In those methods Derived classes have to store the objects that are selected for a subset in a ISubsetHandler::SectionContainer. Note that multiple SectionContainers per subset may be used.

A SubsetHandler also supports subset-attachments. That means that you can attach data to the elements of a subset. Use attach_to_vertices, attach_to_edges, ... to attach data to the elements of the subset. use ISubsetHandler::VertexAttachmentAccessor, ... to access the attached data. Please note that you may only use a subset-attachment-accessor with elements that are contained in the subset for which the accessor has been created.

Subset-attachments currently do not support pass-on behaviours.

Member Typedef Documentation

◆ ASubsetIndex

◆ 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

◆ SubsetInfoVec

typedef std::vector<SubsetInfo> ug::ISubsetHandler::SubsetInfoVec
protected

◆ VertexSectionContainer

◆ VolumeSectionContainer

Constructor & Destructor Documentation

◆ ISubsetHandler() [1/3]

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

pass an or-combination of SubsetHandlerElements to supportedElements.

supportedElements define the elements on which the SubsetHandler works. Default is SHE_ALL (all element-types).

References ug::SubsetInfo::color, m_bStrictInheritanceEnabled, m_bSubsetInheritanceEnabled, m_defaultSubsetIndex, m_defaultSubsetInfo, m_pGrid, m_supportedElements, ug::SubsetInfo::materialIndex, ug::SubsetInfo::name, ug::SS_NONE, and ug::SubsetInfo::subsetState.

◆ ISubsetHandler() [2/3]

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

◆ ~ISubsetHandler()

ug::ISubsetHandler::~ISubsetHandler ( )
virtual

The destructor automatically unregisters the subset-handler from the grid. on deregistration erase_subset_lists of the derived class will be called.

References disable_element_support(), m_pGrid, m_subsetInfos, m_supportedElements, and ug::Grid::unregister_observer().

◆ ISubsetHandler() [3/3]

ug::ISubsetHandler::ISubsetHandler ( const ISubsetHandler sh)
inlineprivate

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

derived classes have to implement this method. during this method they have to call register_at_pipe for all elements that are contained in one of the subsets. WARNING: This method is crucial for the attachment system. You should never call it yourself. this method should be called during

See also
register_subset_elements_at_pipe. WARNING: This method is crucial for the attachment system. You should only call it during
register_subset_elements_at_pipe Only call this method for elements that are contained in a subset. this method should be called x
register_subset_elements_at_pipe. WARNING: This method is crucial for the attachment system. You should only call it during
register_subset_elements_at_pipe Only call this method for elements that are contained in a subset. this method should be called during
register_subset_elements_at_pipe. WARNING: This method is crucial for the attachment system. You should only call it during
register_subset_elements_at_pipe Only call this method for elements that are contained in a subset. this method should be called during
register_subset_elements_at_pipe. WARNING: This method is crucial for the attachment system. You should only call it during
register_subset_elements_at_pipe Only call this method for elements that are contained in a subset. attachment accessor grants access to data associated with elements of a subset. Valid types for TGeomObj are Vertex, Edge, Face and Volume the multi-subset-attachment-accessor allows to access an attachment that has been attached to multiple subsets. Note that this accessor is slower than the normal attachment-accessors. If subsets are added to the subset-handler or attachments are added/removed, you should not rely on the accessor to still work properly. Call access() in that case to re-validate him.

Member Function Documentation

◆ add_required_subset_lists()

virtual void ug::ISubsetHandler::add_required_subset_lists ( int  maxIndex)
protectedpure virtual

add a subset if required - so that the subset with maxIndex exists.

Implemented in ug::MultiGridSubsetHandler, and ug::GridSubsetHandler.

Referenced by create_required_subsets().

◆ alter_subset_index() [1/4]

void ug::ISubsetHandler::alter_subset_index ( Edge e,
int  subsetIndex 
)
inlineprotected

alters the subset index only. Suited as a helper for methods like change_subset_indices or reset_subset_indices. WARNING: This method only alters the index but does not actually move the element to another subset. Use assign_subset instead for this task.

◆ alter_subset_index() [2/4]

void ug::ISubsetHandler::alter_subset_index ( Face f,
int  subsetIndex 
)
inlineprotected

alters the subset index only. Suited as a helper for methods like change_subset_indices or reset_subset_indices. WARNING: This method only alters the index but does not actually move the element to another subset. Use assign_subset instead for this task.

◆ alter_subset_index() [3/4]

void ug::ISubsetHandler::alter_subset_index ( Vertex v,
int  subsetIndex 
)
inlineprotected

alters the subset index only. Suited as a helper for methods like change_subset_indices or reset_subset_indices. WARNING: This method only alters the index but does not actually move the element to another subset. Use assign_subset instead for this task.

Referenced by ug::GridSubsetHandler::change_elem_subset_indices(), ug::MultiGridSubsetHandler::change_elem_subset_indices(), ug::GridSubsetHandler::clear_subset_elements(), and ug::MultiGridSubsetHandler::clear_subset_elements().

◆ alter_subset_index() [4/4]

void ug::ISubsetHandler::alter_subset_index ( Volume v,
int  subsetIndex 
)
inlineprotected

alters the subset index only. Suited as a helper for methods like change_subset_indices or reset_subset_indices. WARNING: This method only alters the index but does not actually move the element to another subset. Use assign_subset instead for this task.

◆ assign_subset() [1/6]

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

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(...).

Implemented in ug::MultiGridSubsetHandler, and ug::GridSubsetHandler.

◆ assign_subset() [2/6]

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

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(...).

Implemented in ug::MultiGridSubsetHandler, and ug::GridSubsetHandler.

◆ assign_subset() [3/6]

void ug::ISubsetHandler::assign_subset ( GridObject elem,
int  subsetIndex 
)
virtual

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

References assign_subset(), ug::GridObject::base_object_id(), ug::EDGE, ug::FACE, UG_THROW, ug::VERTEX, and ug::VOLUME.

◆ assign_subset() [4/6]

template<class TIterator >
void ug::ISubsetHandler::assign_subset ( TIterator  iterBegin,
TIterator  iterEnd,
int  subsetIndex 
)

Referenced by assign_subset(), ug::AssignAssociatedVerticesToSubset(), ug::AssignGridToSubset(), ug::AssignInnerAndBoundarySubsets(), ug::AssignRegionToSubset(), ug::AssignSelectionToSubset(), ug::AssignSidesToSubsets(), ug::AssignSubsetsByElementType(), ug::CollectSurfaceViewElements(), ug::ColorControlVolume(), ug::ColorSubControlVolume(), ug::ColorSubControlVolumeFaces(), ug::Partitioner_DynamicBisection< TElem, dim >::control_bisection(), ug::Partitioner_DynamicBisection< TElem, dim >::copy_partitions_to_children(), ug::CopyGrid(), ug::CopyGridElements(), ug::CopyGridLevel(), ug::CopyGridLevelElements(), ug::CopySubsetFromHigherDimNbr(), ug::CopySubsetIndices(), ug::CopySubsetIndicesToSides(), ug::FileReaderSWC::create_grid(), ug::CreateSCV(), edge_created(), edge_to_be_erased(), elems_to_be_merged(), ug::ComPol_Subset< TLayout >::extract(), ug::ExtrudeLayers(), ug::ExtrudeLayersMixed(), face_created(), face_to_be_erased(), ug::ImportGridFromLGM(), ug::ImportGridFromNG(), ug::ImportGridFromTETGEN(), ug::LoadGrid3d_IMPL(), ug::LoadGridFrom2DF(), ug::LoadGridFromART(), ug::LoadGridFromMSH(), ug::LoadGridFromOBJ(), ug::LoadGridFromSMESH(), ug::LoadGridFromSTL(), ug::MarkCorners(), ug::MarkCreaseEdges(), ug::MergeGrids(), ug::PerformTetrahedralization(), ug::SubsetHandlerSerializer::read_data(), ug::GridReaderUGX::read_subset_handler_elements(), ug::ReadSubsetIndicesFromStream(), ug::GridReaderVTU::subset_handler(), vertex_created(), vertex_to_be_erased(), volume_created(), and volume_to_be_erased().

◆ assign_subset() [5/6]

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

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(...).

Implemented in ug::MultiGridSubsetHandler, and ug::GridSubsetHandler.

◆ assign_subset() [6/6]

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

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(...).

Implemented in ug::MultiGridSubsetHandler, and ug::GridSubsetHandler.

◆ assign_subset_handler()

◆ change_subset_indices()

virtual void ug::ISubsetHandler::change_subset_indices ( int  indOld,
int  indNew 
)
protectedpure virtual

◆ clear()

◆ clear_subset()

void ug::ISubsetHandler::clear_subset ( int  subsetIndex)

◆ clear_subset_lists()

virtual void ug::ISubsetHandler::clear_subset_lists ( int  index)
protectedpure virtual

◆ clear_subsets()

void ug::ISubsetHandler::clear_subsets ( )

References clear_subset(), and num_subsets().

◆ contains_edges()

virtual bool ug::ISubsetHandler::contains_edges ( int  subsetIndex) const
pure virtual

returns true if the subset contains edges

Implemented in ug::MultiGridSubsetHandler, and ug::GridSubsetHandler.

Referenced by ug::GridWriterUGX::add_subset_handler(), ug::EraseEmptySubsets(), and ug::GetFirstFreeSubset().

◆ contains_faces()

virtual bool ug::ISubsetHandler::contains_faces ( int  subsetIndex) const
pure virtual

returns true if the subset contains faces

Implemented in ug::MultiGridSubsetHandler, and ug::GridSubsetHandler.

Referenced by ug::GridWriterUGX::add_subset_handler(), ug::EraseEmptySubsets(), and ug::GetFirstFreeSubset().

◆ contains_vertices()

virtual bool ug::ISubsetHandler::contains_vertices ( int  subsetIndex) const
pure virtual

collects all vertices that are in the given subset.

Please note: This method should only be used, if the begin and end methods of derived classes are not available. collects all edges that are in the given subset. Please note: This method should only be used, if the begin and end methods of derived classes are not available. collects all faces that are in the given subset. Please note: This method should only be used, if the begin and end methods of derived classes are not available. collects all volumes that are in the given subset. Please note: This method should only be used, if the begin and end methods of derived classes are not available. returns true if the subset contains vertices

Implemented in ug::MultiGridSubsetHandler, and ug::GridSubsetHandler.

Referenced by ug::GridWriterUGX::add_subset_handler(), ug::EraseEmptySubsets(), and ug::GetFirstFreeSubset().

◆ contains_volumes()

virtual bool ug::ISubsetHandler::contains_volumes ( int  subsetIndex) const
pure virtual

returns true if the subset contains volumes

Implemented in ug::MultiGridSubsetHandler, and ug::GridSubsetHandler.

Referenced by ug::GridWriterUGX::add_subset_handler(), ug::EraseEmptySubsets(), and ug::GetFirstFreeSubset().

◆ create_required_subsets()

void ug::ISubsetHandler::create_required_subsets ( int  index)
protected

creates all required infos (and pipes) up to the given index.

References add_required_subset_lists(), m_defaultSubsetInfo, and m_subsetInfos.

Referenced by subset_required().

◆ disable_element_support()

void ug::ISubsetHandler::disable_element_support ( uint  shElements)

◆ edge_created()

void ug::ISubsetHandler::edge_created ( Grid grid,
Edge e,
GridObject pParent = NULL,
bool  replacesParent = false 
)
virtual

Notified whenever a new element of the given type is created in the given grid.

Creation callbacks are called in the order in which the GridObservers were registered at the given grid.

If replacesParent is true, then pParent is of the same base type as the created object (e.g. in case of edge_created, the parent is an Edge*). This case usually appears, when a contraining object is replaced by a regular grid object if the same base type during refinement. The method is called with replacesParent == true by Grid::create_and_replace methods.

Please note: If replacesParent == true, then a call to OBJECT_to_be_erased(grid, pParent, obj) will follow (OBJECT and obj are pseudonyms for the concrete type).

TODO: see vertex_created

Reimplemented from ug::GridObserver.

References assign_subset(), ug::GridObject::base_object_id(), ug::EDGE, elements_are_supported(), get_subset_index(), grid(), m_aaSubsetIndexEDGE, m_bStrictInheritanceEnabled, m_bSubsetInheritanceEnabled, m_defaultSubsetIndex, m_pGrid, and ug::SHE_EDGE.

◆ edge_to_be_erased()

void ug::ISubsetHandler::edge_to_be_erased ( Grid grid,
Edge e,
Edge replacedBy = NULL 
)
virtual

Notified whenever an element of the given type is erased from the given grid.

Erase callbacks are called in reverse order in which the GridObservers were registered at the given grid.

if replacedBy != NULL the erased object is only replaced by another grid object of the same base type. This usually happens when constraining objects are replaced by regular objects in refinements. (E.g. a constraining edge by become a regular Edge; note that both objects are of type Edge*).

TODO: see vertex_created

Reimplemented from ug::GridObserver.

References assign_subset(), elements_are_supported(), grid(), m_aaSubsetIndexEDGE, m_pGrid, and ug::SHE_EDGE.

◆ edges_to_be_merged()

void ug::ISubsetHandler::edges_to_be_merged ( Grid grid,
Edge target,
Edge elem1,
Edge elem2 
)
virtual

Notified when two elements of the same type are going to be merged.

Note that this method is invoked by Grid::objects_will_be_merged, which is called from outside the grid class. Implementors of algorithms in which objects are merged are thus responsible to call Grid::objects_will_be_merged.

This callback is called in addition to ..._created and ..._to_be_erased callbacks and should thus only be used if small adjustments have to be made during a merge.

Note that target may be identical to elem1 or elem2.

Reimplemented from ug::GridObserver.

References elements_are_supported(), elems_to_be_merged(), grid(), ug::SHE_EDGE, and boost::target().

◆ elements_are_supported()

◆ elements_to_be_cleared()

void ug::ISubsetHandler::elements_to_be_cleared ( Grid grid)
virtual

Reimplemented from ug::GridObserver.

References clear_subset_lists(), and num_subsets().

◆ elems_to_be_merged()

template<class TElem >
void ug::ISubsetHandler::elems_to_be_merged ( Grid grid,
TElem *  target,
TElem *  elem1,
TElem *  elem2 
)
protected

◆ enable_element_support()

void ug::ISubsetHandler::enable_element_support ( uint  shElements)

◆ enable_strict_inheritance()

void ug::ISubsetHandler::enable_strict_inheritance ( bool  bEnable)

restricts subset inheritance so that new elements derive their subset index only from parents with the same base-type. Disabled by default. NOTE: strict inheritance only has an effect if subset inheritance is enabled.

References m_bStrictInheritanceEnabled.

◆ enable_subset_inheritance()

void ug::ISubsetHandler::enable_subset_inheritance ( bool  bEnable)

if enabled, newly created elements derive their subset-index from their parents. Enabled by default. If enabled, the default subset index will be ignored if a parent is specified on element creation.

References m_bSubsetInheritanceEnabled.

Referenced by assign_subset_handler(), ug::ExtrudeCylinder(), and ug::MultiGrid::init().

◆ erase_subset()

void ug::ISubsetHandler::erase_subset ( int  subsetIndex)

erases the subset at the given index. Assigns -1 to all entries. Moves all other subsets 1 index up.

changes subset-indices of other subsets.

References change_subset_indices(), erase_subset_lists(), m_subsetInfos, num_subsets(), and UG_THROW.

Referenced by ug::EraseEmptySubsets(), ug::ExtrudeLayers(), and join_subsets().

◆ erase_subset_lists() [1/2]

virtual void ug::ISubsetHandler::erase_subset_lists ( )
protectedpure virtual

Implemented in ug::MultiGridSubsetHandler, and ug::GridSubsetHandler.

Referenced by clear(), and erase_subset().

◆ erase_subset_lists() [2/2]

virtual void ug::ISubsetHandler::erase_subset_lists ( int  index)
protectedpure virtual

erase the subset-lists but do not touch the subset-indices.

Implemented in ug::MultiGridSubsetHandler, and ug::GridSubsetHandler.

◆ face_created()

void ug::ISubsetHandler::face_created ( Grid grid,
Face f,
GridObject pParent = NULL,
bool  replacesParent = false 
)
virtual

Notified whenever a new element of the given type is created in the given grid.

Creation callbacks are called in the order in which the GridObservers were registered at the given grid.

If replacesParent is true, then pParent is of the same base type as the created object (e.g. in case of edge_created, the parent is an Edge*). This case usually appears, when a contraining object is replaced by a regular grid object if the same base type during refinement. The method is called with replacesParent == true by Grid::create_and_replace methods.

Please note: If replacesParent == true, then a call to OBJECT_to_be_erased(grid, pParent, obj) will follow (OBJECT and obj are pseudonyms for the concrete type).

TODO: see vertex_created

Reimplemented from ug::GridObserver.

References assign_subset(), ug::GridObject::base_object_id(), elements_are_supported(), ug::FACE, get_subset_index(), grid(), m_aaSubsetIndexFACE, m_bStrictInheritanceEnabled, m_bSubsetInheritanceEnabled, m_defaultSubsetIndex, m_pGrid, and ug::SHE_FACE.

◆ face_to_be_erased()

void ug::ISubsetHandler::face_to_be_erased ( Grid grid,
Face f,
Face replacedBy = NULL 
)
virtual

Notified whenever an element of the given type is erased from the given grid.

Erase callbacks are called in reverse order in which the GridObservers were registered at the given grid.

if replacedBy != NULL the erased object is only replaced by another grid object of the same base type. This usually happens when constraining objects are replaced by regular objects in refinements. (E.g. a constraining edge by become a regular Edge; note that both objects are of type Edge*).

TODO: see vertex_created

Reimplemented from ug::GridObserver.

References assign_subset(), elements_are_supported(), grid(), m_aaSubsetIndexFACE, m_pGrid, and ug::SHE_FACE.

◆ faces_to_be_merged()

void ug::ISubsetHandler::faces_to_be_merged ( Grid grid,
Face target,
Face elem1,
Face elem2 
)
virtual

Notified when two elements of the same type are going to be merged.

Note that this method is invoked by Grid::objects_will_be_merged, which is called from outside the grid class. Implementors of algorithms in which objects are merged are thus responsible to call Grid::objects_will_be_merged.

This callback is called in addition to ..._created and ..._to_be_erased callbacks and should thus only be used if small adjustments have to be made during a merge.

Note that target may be identical to elem1 or elem2.

Reimplemented from ug::GridObserver.

References elements_are_supported(), elems_to_be_merged(), grid(), ug::SHE_FACE, and boost::target().

◆ get_default_subset_index()

int ug::ISubsetHandler::get_default_subset_index ( )
inline

◆ get_grid_objects_in_subset()

virtual GridObjectCollection ug::ISubsetHandler::get_grid_objects_in_subset ( int  subsetInd) const
pure virtual

Returns the geometric object collection for the given subset.

Note that the GOC may contain multiple levels.

Implemented in ug::MultiGridSubsetHandler, and ug::GridSubsetHandler.

Referenced by ug::GridWriterUGX::create_subset_element_node(), ug::FaceArea(), ug::FindSubsetGroups(), ug::ProjectionHandler::refinement_begins(), ug::SaveGridToNCDF(), ug::SelectSubset(), and ug::SelectSubsetElements().

◆ get_subset_index() [1/6]

int ug::ISubsetHandler::get_subset_index ( const char *  name) const

returns the index of the first subset with the given name.

If no subset with the given name exists, -1 is returned.

This method takes O(NumSubsets) time.

References name, ug::SubsetInfo::name, num_subsets(), and subset_info().

◆ get_subset_index() [2/6]

int ug::ISubsetHandler::get_subset_index ( Edge elem) const
inline

◆ get_subset_index() [3/6]

int ug::ISubsetHandler::get_subset_index ( Face elem) const
inline

◆ get_subset_index() [4/6]

int ug::ISubsetHandler::get_subset_index ( GridObject elem) const

References ug::GridObject::base_object_id(), ug::EDGE, ug::FACE, ug::VERTEX, and ug::VOLUME.

Referenced by ug::AdjustEdgeLength(), ug::AdjustSubsetsForLgmNg(), ug::ApplySmoothManifoldPosToTopLevelAveragingScheme(), ug::ApplySmoothManifoldPosToTopLevelButterflyScheme(), ug::ApplySmoothManifoldPosToTopLevelLoopScheme(), ug::ApplySmoothVolumePosToTopLevel(), ug::GridSubsetHandler::assign_subset_impl(), ug::MultiGridSubsetHandler::assign_subset_impl(), ug::AssignAssociatedEdgesToSubsets(), ug::AssignAssociatedFacesToSubsets(), ug::AssignAssociatedVerticesToSubsets(), ug::AssignCreaseVertices(), ug::AssignFaceInterfaceEdgesToSubsets(), ug::assignFaceSubsetToClosedFace(), ug::AssignFixedVertices(), ug::AssignInnerAndBoundarySubsets(), ug::AssignRegionToSubset(), ug::AssignSidesToSubsets(), ug::AssignVolumeInterfaceFacesToSubsets(), ug::CalculateConstrainedSmoothVolumePosInTopLevel(), ug::CalculateNumManifoldEdgesVertexAttachmentInParentLevel(), ug::CalculateNumManifoldFacesVertexAttachmentInTopLevel(), ug::CalculateSmoothCreaseManifoldPosInParentLevelLoopScheme(), ug::CalculateSmoothManifoldPosInParentLevelButterflyScheme(), ug::CalculateSmoothManifoldPosInParentLevelLoopScheme(), ug::CalculateSmoothManifoldPosInTopLevelAveragingScheme(), ug::CalculateSmoothVolumePosInTopLevel(), ug::IsInSubset::callback(), ug::IsNotInSubset::callback(), ug::PeriodicBoundaryManager::check_elements_periodicity(), ug::CheckValences(), ug::ComPol_Subset< TLayout >::collect(), ug::AssemblingTuner< TAlgebra >::collect_selected_elements(), ug::CollectLines(), ug::CollectSurfaceVertices(), ug::ColorControlVolume(), ug::computeDiamondPointXCrossType(), ug::ComputeLocalSubsetDimensions(), ug::Partitioner_DynamicBisection< TElem, dim >::copy_partitions_to_children(), ug::CopyGrid(), ug::CopyGridElements(), ug::CopyGridLevel(), ug::CopyGridLevelElements(), ug::CopySubsetFromHigherDimNbr(), ug::CopySubsetIndices(), ug::CopySubsetIndicesToSides(), ug::ArteExpandFracs3D::countAndSelectFracBaseNums(), ug::ArteExpandFracs3D::createNewElements(), ug::createNewFacesForExtXCrossFracs(), edge_created(), elems_to_be_merged(), ug::GridWriterVTU::end_cell_data(), ug::ExpandFractures2d(), ug::ExpandFractures2dArte(), ug::ExpandFractures3d(), ug::expandSingleFractureAtGivenSide(), ug::expandSingleFractureAtGivenSide< VecVertexOfFaceInfo >(), ug::ExportGridToSMESH(), ug::ExportGridToSWC(), ug::ExportGridToTIKZ(), ug::ExportGridToUG_2D(), ug::ComPol_Subset< TLayout >::extract(), ug::ExtrudeLayers(), face_created(), ug::FindSubsetGroups(), ug::ArteExpandFracs3D::generateVertexInfos(), ug::MultiGrid::get_level(), ug::GetFirstRegularVertex(), ug::GetRightLeftUnitIndex(), ug::ProjectionHandler::handle_new_vertex(), ug::InitLinearManifoldSubsetHandler(), ug::IntegralNormalComponentOnManifoldGeneral(), ug::GlobalFracturedMediaRefiner::is_fracture_element(), ug::MarkAlongSurface(), ug::MarkFixedCreaseVertices(), ug::MarkForAdaption_ElementsTouchingSubset(), ug::MarkForAdaption_ElementsTouchingSubsets(), ug::MarkForRefinement_SubsetInterfaceElements(), ug::MarkSubsets(), ug::MergeGrids(), ug::NbrIsInSubset(), ug::PartitionMultiGridLevel_MetisKway(), ug::PartitionMultiGridLevel_ParmetisKway(), ug::Partitioner_DynamicBisection< TElem, dim >::perform_bisection(), ug::GridSubsetHandler::perform_self_tests(), ug::PerformRetetrahedralization(), ug::PerformTetrahedralization(), ug::ClusterElementStacks< elem_t, vector_t >::post_process(), ug::SmoothPartitionBounds< elem_t >::post_process(), ug::ProjectionHandler::refinement_begins(), ug::SaveGridTo2DF(), ug::SaveGridToART(), ug::SaveGridToELE(), ug::SelectInterfaceElements(), ug::ProjectionHandler::set_projector(), ug::SplitIrregularManifoldSubset(), ug::SplitIrregularPolyChain(), ug::TryCollapse(), ug::FV1Geometry_gen< TElem, TWorldDim, false >::update_boundary_faces(), ug::DimFV1Geometry< TDim, TWorldDim >::update_boundary_faces(), ug::FV1IBGeometry< TElem, TWorldDim >::update_boundary_faces(), ug::DimFV1IBGeometry< TDim, TWorldDim >::update_boundary_faces(), ug::DimCRFVGeometry< TDim, TWorldDim >::update_boundary_faces(), ug::CRFVGeometry< TElem, TWorldDim >::update_boundary_faces(), ug::FVGeometry< TOrder, TElem, TWorldDim, TQuadOrder >::update_boundary_faces(), ug::DimFVGeometry< TWorldDim, TDim >::update_boundary_faces(), ug::DimFEGeometry< TWorldDim, TRefDim >::update_boundary_faces(), vertex_created(), volume_created(), ug::InterSubsetPartitionWeighting::weigh(), ug::ProtectSubsetPartitionWeighting::weigh(), ug::VTKOutput< TDim >::write_cell_subsets(), ug::SubsetHandlerSerializer::write_data(), ug::WriteNG(), and ug::WriteSubsetIndicesToStream().

◆ get_subset_index() [5/6]

int ug::ISubsetHandler::get_subset_index ( Vertex elem) const
inline

◆ get_subset_index() [6/6]

int ug::ISubsetHandler::get_subset_index ( Volume elem) const
inline

◆ get_subset_name()

const char * ug::ISubsetHandler::get_subset_name ( int  subsetIndex) const

◆ grid()

Grid * ug::ISubsetHandler::grid ( ) const

returns a pointer to the grid on which the subset-handler works.

returns NULL if no grid is assigned.

References m_pGrid.

Referenced by ug::GridSubsetHandler::assign_grid(), assign_subset_handler(), ug::AssignGridToSubset(), ug::AssignSelectionToSubset(), ug::AssignSidesToSubsets(), ug::AssignSubsetsByElementType(), ug::ColorControlVolume(), ug::ColorSubControlVolume(), ug::ColorSubControlVolumeFaces(), ug::ComputeLocalSubsetDimensions(), ug::CopySubsetFromHigherDimNbr(), ug::CopySubsetIndicesToSides(), ug::GridWriterUGX::create_subset_element_node(), ug::CreateGridOfControlVolumes(), ug::CreateSCV(), ug::CreateSCVF(), ug::DistributeDomain(), edge_created(), edge_to_be_erased(), edges_to_be_merged(), face_created(), face_to_be_erased(), faces_to_be_merged(), ug::FindSubsetGroups(), ug::GridSubsetHandler::grid_to_be_destroyed(), grid_to_be_destroyed(), ug::MultiGridSubsetHandler::grid_to_be_destroyed(), ug::GridSubsetHandler::GridSubsetHandler(), ISubsetHandler(), ug::MarkForRefinement_SubsetInterfaceElements(), ug::PartitionElements_RegularGrid(), ug::SavePartitionMapToFile(), set_grid(), ug::SplitIrregularManifoldSubset(), ug::SplitIrregularPolyChain(), ug::HFV1ManifoldGeometry< TElem, TWorldDim >::update(), ug::HCRFVGeometry< TElem, TWorldDim >::update(), ug::HFV1Geometry< TElem, TWorldDim >::update(), ug::DimHFV1Geometry< TDim, TWorldDim >::update(), ug::DimFV1Geometry< TDim, TWorldDim >::update_boundary_faces(), ug::FV1IBGeometry< TElem, TWorldDim >::update_boundary_faces(), ug::DimFV1IBGeometry< TDim, TWorldDim >::update_boundary_faces(), ug::DimCRFVGeometry< TDim, TWorldDim >::update_boundary_faces(), ug::CRFVGeometry< TElem, TWorldDim >::update_boundary_faces(), ug::FVGeometry< TOrder, TElem, TWorldDim, TQuadOrder >::update_boundary_faces(), ug::DimFVGeometry< TWorldDim, TDim >::update_boundary_faces(), ug::DimFEGeometry< TWorldDim, TRefDim >::update_boundary_faces(), ug::DimCRFVGeometry< TDim, TWorldDim >::update_hanging(), vertex_created(), vertex_to_be_erased(), vertices_to_be_merged(), volume_created(), volume_to_be_erased(), volumes_to_be_merged(), and ug::ProtectSubsetPartitionWeighting::weigh().

◆ grid_to_be_destroyed()

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

◆ insert_subset()

void ug::ISubsetHandler::insert_subset ( int  subsetIndex)

inserts a subset at the given index. Moves all other subsets 1 index higher.

changes subset-indices of other subsets.

References move_subset(), num_subsets(), and subset_required().

◆ join_subset_lists()

virtual void ug::ISubsetHandler::join_subset_lists ( int  target,
int  src1,
int  src2 
)
protectedpure virtual

join the subset-lists but do not touch the subset-indices.

Implemented in ug::MultiGridSubsetHandler, and ug::GridSubsetHandler.

Referenced by join_subsets().

◆ join_subsets()

void ug::ISubsetHandler::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.

References change_subset_indices(), erase_subset(), join_subset_lists(), num_subsets(), subset_required(), and UG_THROW.

◆ move_subset()

void ug::ISubsetHandler::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.

changes subset indices of other subsets.

References change_subset_indices(), m_subsetInfos, move_subset_lists(), num_subsets(), subset_required(), and UG_THROW.

Referenced by insert_subset(), and ug::MakeSubsetsConsecutive().

◆ move_subset_lists()

virtual void ug::ISubsetHandler::move_subset_lists ( int  indexFrom,
int  indexTo 
)
protectedpure virtual

move the subset-lists but do not touch the subset-indices.

Implemented in ug::MultiGridSubsetHandler, and ug::GridSubsetHandler.

Referenced by move_subset().

◆ num_subsets()

int ug::ISubsetHandler::num_subsets ( ) const
inline

returns the number of subset-infos (return value is int, since SubsetIndices are of type int)

Referenced by ug::GridWriterUGX::add_subset_handler(), ug::AdjustSubsetsForLgmNg(), assign_subset_handler(), ug::AssignCreaseVertices(), ug::AssignDefaultSubsetColors(), ug::AssignFaceInterfaceEdgesToSubsets(), ug::ArteExpandFracs3D::assignOrigFracInfos(), ug::AssignSidesToSubsets(), ug::AssignSubsetColorsBlueToGreen(), ug::AssignSubsetColorsRedToGreen(), ug::AssignSubsetsBySurfaceViewState(), ug::AssignVolumeInterfaceFacesToSubsets(), clear_subset(), clear_subsets(), ug::CollectSurfaceViewElements(), ug::CopyGrid(), ug::CopyGridLevel(), ug::CopySubsetFromHigherDimNbr(), ug::CreateGridOfControlVolumes(), ug::CreateGridOfSubControlVolumeFaces(), ug::CreateGridOfSubControlVolumes(), ug::CreateSurfaceView(), ug::determineOrderOfFaces(), ug::DimensionOfSubsets(), ug::DistributeGrid(), elements_to_be_cleared(), ug::GridWriterVTU::end_cell_data(), erase_subset(), ug::EraseEmptySubsets(), ug::ExpandFractures2d(), ug::ExpandFractures2dArte(), ug::ExpandFractures3d(), ug::expandSingleFractureAtGivenSide(), ug::ExportGridToSWC(), ug::ExportGridToTIKZ(), ug::ExportGridToUG(), ug::ExportGridToUG_2D(), ug::ExtrudeLayers(), ug::FillDistInfos(), ug::FindSubsetGroups(), get_subset_index(), get_subset_name(), ug::GetFirstFreeSubset(), ug::GetMaxSubsetIndex(), ug::ArteExpandFracs3D::initialize(), insert_subset(), join_subsets(), ug::MultiGrid::level_required(), ug::MakeSubsetsConsecutive(), ug::MarkFixedCreaseVertices(), ug::MarkSubsets(), ug::MergeGrids(), move_subset(), ug::MultiGrid::num_levels(), ug::Partitioner_DynamicBisection< TElem, dim >::partition(), ug::PerformRetetrahedralization(), ug::VTKOutput< TDim >::print(), ug::ProjectionHandler::refinement_begins(), ug::SaveGridToNCDF(), ug::SaveGridToOBJ(), ug::SavePartitionMapToFile(), ug::SeparateSubsetsByLowerDimSeparators(), ug::SerializeSubsetHandler(), subset_info(), subset_required(), swap_subsets(), ug::MultiGrid::top_level(), ug::VTKOutput< TDim >::write_cell_subset_names(), ug::SubsetHandlerSerializer::write_info(), ug::WriteLGM(), and ug::WriteNG().

◆ operator=()

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

assigns subsets based on the subsets in the given subset-handler

Elements of this handler will be assigned to subsets based on their order in the underlying grids. The underlying grid of this handler will not be changed. This is particularly useful if you just copied a grid and if you now want to copy the subsets in the associated subset-handlers.

Please note, that attachments are not copied in the current version.

References assign_subset_handler(), and clear().

Referenced by ug::GridSubsetHandler::operator=().

◆ reset_subset_indices()

void ug::ISubsetHandler::reset_subset_indices ( uint  shElements = SHE_ALL)
protected

sets the subset-indices of all elements of m_pGrid to -1.

Use with care! Only indices are affected. The elements are not removed from any lists. pass an or-combination of constants enumerated in SubsetHandlerElements.

References elements_are_supported(), m_aaSubsetIndexEDGE, m_aaSubsetIndexFACE, m_aaSubsetIndexVOL, m_aaSubsetIndexVRT, m_pGrid, ug::SHE_EDGE, ug::SHE_FACE, ug::SHE_VERTEX, and ug::SHE_VOLUME.

Referenced by clear(), and enable_element_support().

◆ set_default_subset_index()

void ug::ISubsetHandler::set_default_subset_index ( int  subsetIndex)

new elements will be automatically assigned to this subset. set this to a negative value to avoid automatic assignment (-1 by default). only used if subset_inheritance is disabled or if no parent is specified.

References m_defaultSubsetIndex.

Referenced by assign_subset_handler(), ug::ExtrudeCylinder(), ug::LoadGridFromDUMP(), ug::MeshLayerBoundaries(), and ug::MeshLayers().

◆ set_default_subset_info()

void ug::ISubsetHandler::set_default_subset_info ( const SubsetInfo defSI)

sets the default subset-info. Used when initializing new subset-infos.

References m_defaultSubsetInfo.

Referenced by assign_subset_handler().

◆ set_grid()

void ug::ISubsetHandler::set_grid ( Grid grid)
protected

set the grid on which the subset-handler shall work.

The subset-handler can only work on one grid at a time. It is crucial that assign_grid methods of derived classes call this method.

Please note: sine set_grid calls virtual methods it shouldn't be invoked from any constructors / destructors.

References clear(), disable_element_support(), enable_element_support(), grid(), m_pGrid, m_supportedElements, ug::OT_EDGE_OBSERVER, ug::OT_FACE_OBSERVER, ug::OT_GRID_OBSERVER, ug::OT_VERTEX_OBSERVER, ug::OT_VOLUME_OBSERVER, ug::Grid::register_observer(), ug::SHE_NONE, and ug::Grid::unregister_observer().

Referenced by ug::GridSubsetHandler::assign_grid(), ug::MultiGridSubsetHandler::assign_grid(), and grid_to_be_destroyed().

◆ set_subset_info()

void ug::ISubsetHandler::set_subset_info ( int  subsetIndex,
const SubsetInfo subsetInfo 
)

if the subset at subsetIndex does not yet exist, it will be created.

References m_subsetInfos, and subset_required().

Referenced by assign_subset_handler(), ug::LoadGridFromOBJ(), and ug::GridReaderUGX::subset_handler().

◆ set_subset_name()

void ug::ISubsetHandler::set_subset_name ( const char *  name,
int  subsetIndex 
)

◆ set_supported_elements()

void ug::ISubsetHandler::set_supported_elements ( uint  shElements)

set the type of elements that shall be handled by the SubsetHandler.

Pass an or-combination of constants enumerated in SubsetHandlerElements.

See also
SubsetHandler::enable_element_support

References disable_element_support(), enable_element_support(), and m_supportedElements.

Referenced by assign_subset_handler().

◆ strict_inheritance_enabled()

bool ug::ISubsetHandler::strict_inheritance_enabled ( )
inline

◆ subset_assigned() [1/4]

void ug::ISubsetHandler::subset_assigned ( Edge e,
int  subsetIndex 
)
inlineprotected

References m_aaSubsetIndexEDGE.

◆ subset_assigned() [2/4]

void ug::ISubsetHandler::subset_assigned ( Face f,
int  subsetIndex 
)
inlineprotected

References m_aaSubsetIndexFACE.

◆ subset_assigned() [3/4]

void ug::ISubsetHandler::subset_assigned ( Vertex v,
int  subsetIndex 
)
inlineprotected

◆ subset_assigned() [4/4]

void ug::ISubsetHandler::subset_assigned ( Volume v,
int  subsetIndex 
)
inlineprotected

References m_aaSubsetIndexVOL.

◆ subset_info() [1/2]

◆ subset_info() [2/2]

const SubsetInfo & ug::ISubsetHandler::subset_info ( int  subsetIndex) const

Be careful: queried subset has to exist! Check with num_subsets()

References m_subsetInfos, num_subsets(), and UG_THROW.

◆ subset_inheritance_enabled()

bool ug::ISubsetHandler::subset_inheritance_enabled ( )
inline

Referenced by ug::ExtrudeCylinder().

◆ subset_required() [1/2]

◆ subset_required() [2/2]

void ug::ISubsetHandler::subset_required ( int  index) const
inline

throws an error if the given index is equal or higher than num_subsets.

References num_subsets(), and UG_THROW.

◆ swap_subset_lists()

virtual void ug::ISubsetHandler::swap_subset_lists ( int  ind1,
int  ind2 
)
protectedpure virtual

swap the subset-lists but do not touch the subset-indices.

Implemented in ug::MultiGridSubsetHandler, and ug::GridSubsetHandler.

Referenced by swap_subsets().

◆ swap_subsets()

void ug::ISubsetHandler::swap_subsets ( int  subsetIndex1,
int  subsetIndex2 
)

Swaps the given subsets,.

References change_subset_indices(), m_subsetInfos, num_subsets(), swap_subset_lists(), and UG_THROW.

◆ vertex_created()

void ug::ISubsetHandler::vertex_created ( Grid grid,
Vertex vrt,
GridObject pParent = NULL,
bool  replacesParent = false 
)
virtual

Notified whenever a new element of the given type is created in the given grid.

Creation callbacks are called in the order in which the GridObservers were registered at the given grid.

If replacesParent is true, then pParent is of the same base type as the created object (e.g. in case of edge_created, the parent is an Edge*). This case usually appears, when a contraining object is replaced by a regular grid object if the same base type during refinement. The method is called with replacesParent == true by Grid::create_and_replace methods.

Please note: If replacesParent == true, then a call to OBJECT_to_be_erased(grid, pParent, obj) will follow (OBJECT and obj are pseudonyms for the concrete type).

Reimplemented from ug::GridObserver.

References assign_subset(), ug::GridObject::base_object_id(), elements_are_supported(), get_subset_index(), grid(), m_aaSubsetIndexVRT, m_bStrictInheritanceEnabled, m_bSubsetInheritanceEnabled, m_defaultSubsetIndex, m_pGrid, ug::SHE_VERTEX, and ug::VERTEX.

◆ vertex_to_be_erased()

void ug::ISubsetHandler::vertex_to_be_erased ( Grid grid,
Vertex vrt,
Vertex replacedBy = NULL 
)
virtual

Notified whenever an element of the given type is erased from the given grid.

Erase callbacks are called in reverse order in which the GridObservers were registered at the given grid.

if replacedBy != NULL the erased object is only replaced by another grid object of the same base type. This usually happens when constraining objects are replaced by regular objects in refinements. (E.g. a constraining edge by become a regular Edge; note that both objects are of type Edge*).

TODO: see vertex_created

Reimplemented from ug::GridObserver.

References assign_subset(), elements_are_supported(), grid(), m_aaSubsetIndexVRT, m_pGrid, and ug::SHE_VERTEX.

◆ vertices_to_be_merged()

void ug::ISubsetHandler::vertices_to_be_merged ( Grid grid,
Vertex target,
Vertex elem1,
Vertex elem2 
)
virtual

Notified when two elements of the same type are going to be merged.

Note that this method is invoked by Grid::objects_will_be_merged, which is called from outside the grid class. Implementors of algorithms in which objects are merged are thus responsible to call Grid::objects_will_be_merged.

This callback is called in addition to ..._created and ..._to_be_erased callbacks and should thus only be used if small adjustments have to be made during a merge.

Note that target may be identical to elem1 or elem2.

Reimplemented from ug::GridObserver.

References elements_are_supported(), elems_to_be_merged(), grid(), ug::SHE_VERTEX, and boost::target().

◆ volume_created()

void ug::ISubsetHandler::volume_created ( Grid grid,
Volume vol,
GridObject pParent = NULL,
bool  replacesParent = false 
)
virtual

Notified whenever a new element of the given type is created in the given grid.

Creation callbacks are called in the order in which the GridObservers were registered at the given grid.

If replacesParent is true, then pParent is of the same base type as the created object (e.g. in case of edge_created, the parent is an Edge*). This case usually appears, when a contraining object is replaced by a regular grid object if the same base type during refinement. The method is called with replacesParent == true by Grid::create_and_replace methods.

Please note: If replacesParent == true, then a call to OBJECT_to_be_erased(grid, pParent, obj) will follow (OBJECT and obj are pseudonyms for the concrete type).

TODO: see vertex_created

Reimplemented from ug::GridObserver.

References assign_subset(), ug::GridObject::base_object_id(), elements_are_supported(), get_subset_index(), grid(), m_aaSubsetIndexVOL, m_bStrictInheritanceEnabled, m_bSubsetInheritanceEnabled, m_defaultSubsetIndex, m_pGrid, ug::SHE_VOLUME, and ug::VOLUME.

◆ volume_to_be_erased()

void ug::ISubsetHandler::volume_to_be_erased ( Grid grid,
Volume vol,
Volume replacedBy = NULL 
)
virtual

Notified whenever an element of the given type is erased from the given grid.

Erase callbacks are called in reverse order in which the GridObservers were registered at the given grid.

if replacedBy != NULL the erased object is only replaced by another grid object of the same base type. This usually happens when constraining objects are replaced by regular objects in refinements. (E.g. a constraining edge by become a regular Edge; note that both objects are of type Edge*).

TODO: see vertex_created

Reimplemented from ug::GridObserver.

References assign_subset(), elements_are_supported(), grid(), m_aaSubsetIndexVOL, m_pGrid, and ug::SHE_VOLUME.

◆ volumes_to_be_merged()

void ug::ISubsetHandler::volumes_to_be_merged ( Grid grid,
Volume target,
Volume elem1,
Volume elem2 
)
virtual

Notified when two elements of the same type are going to be merged.

Note that this method is invoked by Grid::objects_will_be_merged, which is called from outside the grid class. Implementors of algorithms in which objects are merged are thus responsible to call Grid::objects_will_be_merged.

This callback is called in addition to ..._created and ..._to_be_erased callbacks and should thus only be used if small adjustments have to be made during a merge.

Note that target may be identical to elem1 or elem2.

Reimplemented from ug::GridObserver.

References elements_are_supported(), elems_to_be_merged(), grid(), ug::SHE_VOLUME, and boost::target().

Member Data Documentation

◆ m_aaSubsetIndexEDGE

◆ m_aaSubsetIndexFACE

◆ m_aaSubsetIndexVOL

◆ m_aaSubsetIndexVRT

◆ m_aSubsetIndex

ASubsetIndex ug::ISubsetHandler::m_aSubsetIndex
protected

◆ m_bStrictInheritanceEnabled

bool ug::ISubsetHandler::m_bStrictInheritanceEnabled
protected

◆ m_bSubsetInheritanceEnabled

bool ug::ISubsetHandler::m_bSubsetInheritanceEnabled
protected

◆ m_defaultSubsetIndex

int ug::ISubsetHandler::m_defaultSubsetIndex
protected

◆ m_defaultSubsetInfo

SubsetInfo ug::ISubsetHandler::m_defaultSubsetInfo
protected

◆ m_pGrid

◆ m_subsetInfos

◆ m_supportedElements


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