ug4
|
specialization of ISelector for grids of class MultiGrid. More...
#include <selector_multi_grid.h>
Classes | |
struct | Level |
class | MGSelectionIterator |
struct | traits |
The traits class holds some important types for each element-type. More... | |
Public Types | |
typedef ISelector | BaseClass |
typedef MultiGrid | grid_type |
Public Types inherited from ug::ISelector | |
enum | { DESELECTED = 0 , SELECTED = 1 } |
typedef byte | status_t |
Public Member Functions | |
void | assign_grid (MultiGrid &grid) |
void | assign_grid (MultiGrid *grid) |
template<class TElem > | |
TElem * | back (int level) |
returns the last selected element of the given type on the specified level. More... | |
template<class TElem > | |
traits< TElem >::iterator | begin () |
template<class TElem > | |
traits< TElem >::const_iterator | begin () const |
template<class TElem > | |
traits< TElem >::level_iterator | begin (int level) |
template<class TElem > | |
traits< TElem >::const_level_iterator | begin (int level) const |
virtual void | clear () |
template<class TElem > | |
void | clear () |
void | clear (int level) |
template<class TElem > | |
void | clear (int level) |
virtual bool | contains_edges () const |
returns true if the selector contains edges More... | |
virtual bool | contains_faces () const |
returns true if the selector contains faces More... | |
virtual bool | contains_vertices () const |
returns true if the selector contains vertices More... | |
virtual bool | contains_volumes () const |
returns true if the selector contains volumes More... | |
void | disable_element_support (uint shElements) |
disable support for element-types. More... | |
traits< Edge >::level_iterator | edges_begin (int level) |
traits< Edge >::level_iterator | edges_end (int level) |
bool | empty () const |
template<class TElem > | |
bool | empty () const |
bool | empty (int level) const |
template<class TElem > | |
bool | empty (int level) const |
void | enable_element_support (uint shElements) |
enable support for element-types. Does not invalidate previous settings. More... | |
template<class TElem > | |
traits< TElem >::iterator | end () |
template<class TElem > | |
traits< TElem >::const_iterator | end () const |
template<class TElem > | |
traits< TElem >::level_iterator | end (int level) |
template<class TElem > | |
traits< TElem >::const_level_iterator | end (int level) const |
traits< Face >::level_iterator | faces_begin (int level) |
traits< Face >::level_iterator | faces_end (int level) |
template<class TElem > | |
TElem * | front (int level) |
returns the first selected element of the given type on the specified level. More... | |
virtual GridObjectCollection | get_grid_objects () const |
returns a geometric object collection, containing all selected objects More... | |
virtual void | grid_to_be_destroyed (Grid *grid) |
MGSelector (MultiGrid &grid, uint supportedElements=SE_ALL) | |
MGSelector (uint supportedElements=SE_ALL) | |
MultiGrid * | multi_grid () |
template<class TElem > | |
size_t | num () const |
size_t | num () const |
template<class TElem > | |
size_t | num (int level) const |
size_t | num (int level) const |
size_t | num_levels () const |
void | set_supported_elements (uint shElements) |
set the type of elements that shall be handled by the Selector. More... | |
size_t | top_level () const |
traits< Vertex >::level_iterator | vertices_begin (int level) |
traits< Vertex >::level_iterator | vertices_end (int level) |
traits< Volume >::level_iterator | volumes_begin (int level) |
traits< Volume >::level_iterator | volumes_end (int level) |
virtual | ~MGSelector () |
Public Member Functions inherited from ug::ISelector | |
bool | autoselection_enabled () |
virtual void | broadcast_selection_states (bool deselect=false, bool includeGhosts=false) |
broadcasts the current selection More... | |
void | deselect (GridObject *elem) |
template<class TElem > | |
void | deselect (TElem *elem) |
template<class TIterator > | |
void | deselect (TIterator iterBegin, TIterator iterEnd) |
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_autoselection (bool bEnable) |
void | enable_selection_inheritance (bool bEnable) |
void | enable_strict_inheritance (bool bEnable) |
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... | |
template<class TElem > | |
byte | get_mark (TElem *elem) const |
returns the selection state of the specified elelent More... | |
Grid * | grid () const |
template<class TElem > | |
bool | is_selected (TElem *elem) const |
returns true if an element is selected More... | |
ISelector (Grid &grid, uint supportedElements=SE_ALL) | |
ISelector (uint supportedElements=SE_ALL) | |
bool | selection_inheritance_enabled () |
bool | strict_inheritance_enabled () |
template<class TElem > | |
void | unmark (TElem *elem) |
deselects an element 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 | ~ISelector () |
void | select (GridObject *elem, byte status) |
selects an element More... | |
void | select (GridObject *elem) |
selects an element More... | |
template<class TElem > | |
void | select (TElem *elem, byte status) |
selects an element More... | |
template<class TElem > | |
void | select (TElem *elem) |
selects an element More... | |
template<class TIterator > | |
void | select (TIterator iterBegin, TIterator iterEnd, byte status=1) |
selects an element More... | |
template<class TElem > | |
void | mark (TElem *elem) |
selects an element More... | |
template<class TElem > | |
void | mark (TElem *elem, byte status) |
selects an element More... | |
byte | get_selection_status (GridObject *elem) const |
returns the selection state of the specified elelent More... | |
byte | get_selection_status (Vertex *vrt) const |
returns the selection state of the specified elelent More... | |
byte | get_selection_status (Edge *edge) const |
returns the selection state of the specified elelent More... | |
byte | get_selection_status (Face *face) const |
returns the selection state of the specified elelent More... | |
byte | get_selection_status (Volume *vol) const |
returns the selection state of the specified elelent More... | |
Public Member Functions inherited from ug::GridObserver | |
virtual | ~GridObserver () |
Protected Member Functions | |
void | add_level () |
virtual void | add_to_list (Edge *elem) |
virtual void | add_to_list (Face *elem) |
virtual void | add_to_list (Vertex *elem) |
virtual void | add_to_list (Volume *elem) |
void | cleanup () |
This method should only be called if a complete cleanup is required. More... | |
void | clear_lists () |
virtual void | erase_from_list (Edge *elem) |
virtual void | erase_from_list (Face *elem) |
virtual void | erase_from_list (Vertex *elem) |
virtual void | erase_from_list (Volume *elem) |
template<class TElem > | |
int | get_section_index () const |
void | level_required (int newSize) |
void | multigrid_changed (const GridMessage_MultiGridChanged &gm) |
callback for multigrid messages More... | |
template<class TElem > | |
Grid::traits< TElem >::SectionContainer & | section_container (int level) |
returns the section container for the given type, subset and level More... | |
template<class TElem > | |
const Grid::traits< TElem >::SectionContainer & | section_container (int level) const |
returns the const section container for the given type, subset and level More... | |
VertexSectionContainer::iterator | get_level_iterator (Vertex *o) |
returns the iterator at which the given element lies in the section container More... | |
EdgeSectionContainer::iterator | get_level_iterator (Edge *o) |
returns the iterator at which the given element lies in the section container More... | |
FaceSectionContainer::iterator | get_level_iterator (Face *o) |
returns the iterator at which the given element lies in the section container More... | |
VolumeSectionContainer::iterator | get_level_iterator (Volume *o) |
returns the iterator at which the given element lies in the section container More... | |
Protected Member Functions inherited from ug::ISelector | |
void | disable_element_support (uint shElements) |
disable support for element-types. More... | |
template<class TElem > | |
void | elems_to_be_merged (Grid *grid, TElem *target, TElem *elem1, TElem *elem2) |
helper for GridObserver callbacks. More... | |
void | enable_element_support (uint shElements) |
enable support for element-types. Does not invalidate previous settings. More... | |
void | mark_deselected (Edge *elem) |
void | mark_deselected (Face *elem) |
void | mark_deselected (Vertex *elem) |
void | mark_deselected (Volume *elem) |
void | mark_selected (Edge *elem, byte status) |
void | mark_selected (Face *elem, byte status) |
void | mark_selected (Vertex *elem, byte status) |
void | mark_selected (Volume *elem, byte status) |
void | set_grid (Grid *grid) |
performs grid registration / deregistration and initialisation of the observer. More... | |
void | set_supported_elements (uint shElements) |
set the type of elements that shall be handled by the SubsetHandler. More... | |
Private Member Functions | |
MGSelector (const MGSelector &sel) | |
specialization of ISelector for grids of class MultiGrid.
A selector is a useful class, that allows the user to mark elements of a grid as selected or deselected. The selection status is maintained even if new elements are created or old ones deleted. Features like autoselection and selection_inheritance allow users to follow the creation and removal of elements in all kind of algorithms.
Please note that the selector has to be registered at a grid before it may be used. You may register it using the constructor or the method assign_grid.
This is a specialization of ISelector for the MultiGrid class.
The following methods are the most used:
Note that the number of levels in the MGSelector always matches the number of levels in the associated multigrid. This is guaranteed through a callback mechanism.
You may specify the element-type on which begin, end, num and clear operate via a template parameter, and the level via a normal int-parameter:
|
protected |
|
protected |
|
protected |
|
protected |
typedef ISelector ug::MGSelector::BaseClass |
|
protected |
|
protected |
typedef MultiGrid ug::MGSelector::grid_type |
|
protected |
|
protected |
|
protected |
References m_pMultiGrid.
References assign_grid(), and ug::ISelector::grid().
|
virtual |
References cleanup().
|
inlineprivate |
|
protected |
References ug::ISelector::elements_are_supported(), ug::Grid::get_attachment_pipe(), ug::SectionContainer< TValue, TContainer >::get_container(), m_aSharedEntryEDGE, m_aSharedEntryFACE, m_aSharedEntryVOL, m_aSharedEntryVRT, ug::MGSelector::Level::m_edges, ug::MGSelector::Level::m_faces, m_levels, ug::ISelector::m_pGrid, ug::MGSelector::Level::m_vertices, ug::MGSelector::Level::m_volumes, ug::SE_EDGE, ug::SE_FACE, ug::SE_VERTEX, ug::SE_VOLUME, and ug::AttachedElementList< TAttachmentPipe >::set_pipe().
Referenced by level_required().
|
protectedvirtual |
Implements ug::ISelector.
References ug::Edge::container_section(), ug::MultiGrid::get_level(), and m_pMultiGrid.
|
protectedvirtual |
Implements ug::ISelector.
References ug::Face::container_section(), ug::MultiGrid::get_level(), and m_pMultiGrid.
|
protectedvirtual |
Implements ug::ISelector.
References ug::Vertex::container_section(), ug::MultiGrid::get_level(), and m_pMultiGrid.
|
protectedvirtual |
Implements ug::ISelector.
References ug::Volume::container_section(), ug::MultiGrid::get_level(), and m_pMultiGrid.
void ug::MGSelector::assign_grid | ( | MultiGrid & | grid | ) |
References ug::ISelector::grid().
Referenced by MGSelector().
void ug::MGSelector::assign_grid | ( | MultiGrid * | grid | ) |
TElem * ug::MGSelector::back | ( | int | level | ) |
returns the last selected element of the given type on the specified level.
Make sure that elements of the given type exist! Behaviour is undefined, if not.
|
inline |
References top_level().
Referenced by ug::AddTargetProcToDistInfos(), ug::AssignVerticalMasterAndSlaveStates(), ug::HangingNodeRefiner_MultiGrid::collect_objects_for_coarsen(), ug::AdaptionSurfaceGridFunction< TDomain >::do_restrict(), ug::AdaptiveRegularRefiner_MultiGrid::get_parents_of_marked_closure_elements(), ug::HangingNodeRefiner_MultiGrid::perform_coarsening(), ug::HangingNodeRefiner_MultiGrid::pre_refine(), ug::HangingNodeRefiner_MultiGrid::restrict_selection_to_coarsen_families(), ug::SelectAssociatedConstrainedElements(), ug::SelectAssociatedGenealogy(), ug::SelectChildrenOfSelectedShadowRimEdges(), ug::SelectChildrenOfSelectedShadowRimFaces(), ug::SelectChildrenOfSelectedShadowVertices(), and ug::SelectSelectedRootElementsAsVSlaves().
|
inline |
References top_level().
|
inline |
|
inline |
|
protected |
This method should only be called if a complete cleanup is required.
References disable_element_support(), m_callbackId, m_levels, m_pMultiGrid, ug::ISelector::m_supportedElements, and ug::ISelector::set_grid().
Referenced by assign_grid(), and ~MGSelector().
|
virtual |
Implements ug::ISelector.
Referenced by ug::HangingNodeRefiner_MultiGrid::collect_objects_for_coarsen(), ug::DistributeGrid(), and ug::FillDistInfos().
|
inlinevirtual |
Implements ug::ISelector.
References ug::ISelector::m_pGrid, and num_levels().
void ug::MGSelector::clear | ( | int | level | ) |
|
inline |
References ug::ISelector::m_pGrid, and ug::ISelector::mark_deselected().
|
protected |
References m_levels.
Referenced by grid_to_be_destroyed().
|
inlinevirtual |
returns true if the selector contains edges
Implements ug::ISelector.
|
inlinevirtual |
returns true if the selector contains faces
Implements ug::ISelector.
|
inlinevirtual |
returns true if the selector contains vertices
Implements ug::ISelector.
|
inlinevirtual |
returns true if the selector contains volumes
Implements ug::ISelector.
void ug::MGSelector::disable_element_support | ( | uint | shElements | ) |
disable support for element-types.
pass an or-combination of constants enumerated in SelectorElements.
References ug::Grid::detach_from_edges(), ug::Grid::detach_from_faces(), ug::Grid::detach_from_vertices(), ug::Grid::detach_from_volumes(), ug::ISelector::disable_element_support(), ug::ISelector::elements_are_supported(), ug::SectionContainer< TValue, TContainer >::get_container(), m_aSharedEntryEDGE, m_aSharedEntryFACE, m_aSharedEntryVOL, m_aSharedEntryVRT, ug::MGSelector::Level::m_edges, ug::MGSelector::Level::m_faces, m_levels, m_pMultiGrid, ug::MGSelector::Level::m_vertices, ug::MGSelector::Level::m_volumes, ug::SE_EDGE, ug::SE_FACE, ug::SE_VERTEX, ug::SE_VOLUME, and ug::AttachedElementList< TAttachmentPipe >::set_pipe().
Referenced by cleanup(), and set_supported_elements().
Referenced by ug::SelectAssociatedGenealogy().
Referenced by ug::SelectAssociatedGenealogy().
|
inline |
References num().
|
inline |
|
inline |
References num().
Referenced by ug::FillDistInfos().
|
inline |
|
inline |
enable support for element-types. Does not invalidate previous settings.
pass an or-combination of constants enumerated in SelectorElements.
References ug::Grid::attach_to_edges(), ug::Grid::attach_to_faces(), ug::Grid::attach_to_vertices(), ug::Grid::attach_to_volumes(), ug::ISelector::elements_are_supported(), ug::ISelector::enable_element_support(), ug::Grid::get_attachment_pipe(), ug::SectionContainer< TValue, TContainer >::get_container(), m_aSharedEntryEDGE, m_aSharedEntryFACE, m_aSharedEntryVOL, m_aSharedEntryVRT, ug::MGSelector::Level::m_edges, ug::MGSelector::Level::m_faces, m_levels, ug::ISelector::m_pGrid, m_pMultiGrid, ug::MGSelector::Level::m_vertices, ug::MGSelector::Level::m_volumes, ug::SE_EDGE, ug::SE_FACE, ug::SE_VERTEX, ug::SE_VOLUME, and ug::AttachedElementList< TAttachmentPipe >::set_pipe().
Referenced by assign_grid(), and set_supported_elements().
|
inline |
References top_level().
Referenced by ug::AddTargetProcToDistInfos(), ug::AssignVerticalMasterAndSlaveStates(), ug::HangingNodeRefiner_MultiGrid::collect_objects_for_coarsen(), ug::AdaptionSurfaceGridFunction< TDomain >::do_restrict(), ug::AdaptiveRegularRefiner_MultiGrid::get_parents_of_marked_closure_elements(), ug::HangingNodeRefiner_MultiGrid::perform_coarsening(), ug::HangingNodeRefiner_MultiGrid::pre_refine(), ug::HangingNodeRefiner_MultiGrid::restrict_selection_to_coarsen_families(), ug::SelectAssociatedConstrainedElements(), ug::SelectAssociatedGenealogy(), ug::SelectChildrenOfSelectedShadowRimEdges(), ug::SelectChildrenOfSelectedShadowRimFaces(), ug::SelectChildrenOfSelectedShadowVertices(), and ug::SelectSelectedRootElementsAsVSlaves().
|
inline |
References top_level().
|
inline |
|
inline |
|
protectedvirtual |
Implements ug::ISelector.
References ug::Edge::container_section(), ug::MultiGrid::get_level(), get_level_iterator(), and m_pMultiGrid.
|
protectedvirtual |
Implements ug::ISelector.
References ug::Face::container_section(), ug::MultiGrid::get_level(), get_level_iterator(), and m_pMultiGrid.
|
protectedvirtual |
Implements ug::ISelector.
References ug::Vertex::container_section(), ug::MultiGrid::get_level(), get_level_iterator(), and m_pMultiGrid.
|
protectedvirtual |
Implements ug::ISelector.
References ug::Volume::container_section(), ug::MultiGrid::get_level(), get_level_iterator(), and m_pMultiGrid.
Referenced by ug::SelectAssociatedGenealogy().
Referenced by ug::SelectAssociatedGenealogy().
TElem * ug::MGSelector::front | ( | int | level | ) |
returns the first selected element of the given type on the specified level.
Make sure that elements of the given type exist! Behaviour is undefined, if not.
|
virtual |
returns a geometric object collection, containing all selected objects
Implements ug::ISelector.
References ug::GridObjectCollection::add_level(), m_levels, and num_levels().
Referenced by ug::HangingNodeRefiner_MultiGrid::collect_objects_for_coarsen(), and ug::DistributeGrid().
|
inlineprotected |
returns the iterator at which the given element lies in the section container
This method may only be called if the element is indeed selected
|
inlineprotected |
returns the iterator at which the given element lies in the section container
This method may only be called if the element is indeed selected
|
inlineprotected |
returns the iterator at which the given element lies in the section container
This method may only be called if the element is indeed selected
Referenced by erase_from_list().
|
inlineprotected |
returns the iterator at which the given element lies in the section container
This method may only be called if the element is indeed selected
|
inlineprotected |
|
virtual |
Reimplemented from ug::ISelector.
References clear_lists(), ug::ISelector::grid(), ug::ISelector::grid_to_be_destroyed(), and m_pMultiGrid.
|
inlineprotected |
References add_level(), and m_levels.
Referenced by assign_grid(), multigrid_changed(), and section_container().
|
inline |
Referenced by ug::AssignVerticalMasterAndSlaveStates(), ug::AdaptionSurfaceGridFunction< TDomain >::select_parents(), ug::SelectAssociatedGenealogy(), ug::SelectAssociatedSides(), ug::SelectChildrenOfSelectedShadowRimEdges(), ug::SelectChildrenOfSelectedShadowRimFaces(), ug::SelectChildrenOfSelectedShadowVertices(), ug::SelectElementsForTargetPartition(), ug::SelectSelectedRootElementsAsVSlaves(), and ug::SelectUnselectedRootElementsAsVMasters().
|
protected |
callback for multigrid messages
References ug::GMMGCT_LEVEL_ADDED, level_required(), ug::GridMessage_MultiGridChanged::message_type(), and ug::GridMessage_MultiGridChanged::num_levels_in_grid().
Referenced by assign_grid().
|
inline |
References num_levels().
Referenced by empty().
|
inline |
|
inline |
References num_levels().
Referenced by ug::HangingNodeRefiner_MultiGrid::num_marked_elems(), and ug::HangingNodeRefiner_MultiGrid::pre_refine().
|
inline |
|
inline |
Referenced by ug::AddTargetProcToDistInfos(), ug::AssignVerticalMasterAndSlaveStates(), clear(), ug::AdaptionSurfaceGridFunction< TDomain >::do_restrict(), get_grid_objects(), num(), ug::HangingNodeRefiner_MultiGrid::num_marked_elems(), ug::SelectAssociatedConstrainedElements(), ug::SelectAssociatedGenealogy(), ug::SelectChildrenOfSelectedShadowRimEdges(), ug::SelectChildrenOfSelectedShadowRimFaces(), and ug::SelectChildrenOfSelectedShadowVertices().
|
inlineprotected |
returns the section container for the given type, subset and level
References level_required(), ug::MGSelector::Level::m_edges, ug::MGSelector::Level::m_faces, m_levels, ug::MGSelector::Level::m_vertices, and ug::MGSelector::Level::m_volumes.
Referenced by section_container().
|
inlineprotected |
returns the const section container for the given type, subset and level
References ug::MGSelector::Level::m_edges, ug::MGSelector::Level::m_faces, m_levels, ug::MGSelector::Level::m_vertices, ug::MGSelector::Level::m_volumes, and section_container().
|
inline |
set the type of elements that shall be handled by the Selector.
Pass an or-combination of constants enumerated in SelectorElements.
References disable_element_support(), enable_element_support(), and ug::ISelector::m_supportedElements.
Referenced by ug::SelectAssociatedGenealogy().
Referenced by ug::SelectAssociatedGenealogy().
Referenced by ug::SelectAssociatedGenealogy().
Referenced by ug::SelectAssociatedGenealogy().
|
protected |
Referenced by add_level(), disable_element_support(), and enable_element_support().
|
protected |
Referenced by add_level(), disable_element_support(), and enable_element_support().
|
protected |
Referenced by add_level(), disable_element_support(), and enable_element_support().
|
protected |
Referenced by add_level(), disable_element_support(), and enable_element_support().
|
protected |
Referenced by assign_grid(), and cleanup().
|
protected |
|
protected |
Copy Constructor not yet implemented!
Referenced by add_to_list(), assign_grid(), cleanup(), disable_element_support(), enable_element_support(), erase_from_list(), grid_to_be_destroyed(), and MGSelector().
|
protected |
|
protected |