ug4
|
Handles subsets on a per level basis. More...
#include <subset_handler_multi_grid.h>
Classes | |
struct | Subset |
Public Member Functions | |
void | assign_grid (MultiGrid &mg) |
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, int level) |
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, int level) 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... | |
template<class TElem > | |
void | clear_subset_elements (int subsetIndex, int level) |
removes all elements of type TElem from the specified subset on the given level. 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 > | |
geometry_traits< TElem >::iterator | end (int subsetIndex, int level) |
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, int level) const |
returns the end-iterator for the elements of type TElem in the given subset. More... | |
GridObjectCollection | get_grid_objects (int subsetIndex, int level) const |
returns a GridObjectCollection More... | |
GridObjectCollection | get_grid_objects_in_level (int level) const |
returns a GridObjectCollection with multiple levels - each representing a subset. More... | |
GridObjectCollection | get_grid_objects_in_subset (int subsetIndex) const |
returns a GridObjectCollection with multiple levels More... | |
template<class TGeomObj > | |
uint | get_level (TGeomObj *obj) const |
returns the level in which an element is located More... | |
virtual void | grid_to_be_destroyed (Grid *grid) |
perform cleanup More... | |
void | level_required (int level) |
creates the required levels, if they do not yet exist More... | |
MultiGrid * | multi_grid () |
const MultiGrid * | multi_grid () const |
MultiGridSubsetHandler (const MultiGridSubsetHandler &sh) | |
MultiGridSubsetHandler (MultiGrid &mg, uint supportedElements=SHE_ALL) | |
MultiGridSubsetHandler (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, int level) const |
returns the number of elements in the given subset on the given level More... | |
uint | num_levels () const |
returns the number of levels More... | |
virtual | ~MultiGridSubsetHandler () |
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... | |
Grid * | grid () 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... | |
ISubsetHandler & | operator= (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 () |
SubsetInfo & | subset_info (int subsetIndex) |
const SubsetInfo & | subset_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 Member Functions | |
void | add_level () |
void | add_required_subset_lists (int maxIndex) |
add a subset More... | |
void | add_subset_to_all_levels () |
increases m_numSubsets. 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... | |
void | change_subset_indices (int indOld, int indNew) |
changes the subset-indices of all elements int the subset. More... | |
void | cleanup () |
void | clear_subset_lists (int index) |
clears the element lists in the given subset. Does not alter any indices. More... | |
template<class TElem > | |
size_t | collect_subset_elements_impl (std::vector< TElem * > &elemsOut, int subsetIndex) const |
helper for collect_subset_elements 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... | |
virtual void | join_subset_lists (int target, int src1, int src2) |
join the subset-lists but do not touch the subset-indices. More... | |
void | level_required (int level) const |
Throws an error if the required level does not yet exist. More... | |
void | move_subset_lists (int indexFrom, int indexTo) |
moves the subset but does not touch the subset-indices. More... | |
void | multigrid_changed (const GridMessage_MultiGridChanged &gm) |
callback for multigrid messages More... | |
Subset * | new_subset () |
creates a new subset. Caller is responsible for deletion More... | |
uint | num_subsets_in_list () const |
returns the number of subsets in the local list More... | |
template<class TElem > | |
Grid::traits< TElem >::SectionContainer & | section_container (int si, int lvl) |
returns the section container for the given type, subset and level More... | |
template<class TElem > | |
const Grid::traits< TElem >::SectionContainer & | section_container (int si, int lvl) const |
returns the const section container for the given type, subset and level More... | |
Subset * | subset (int si, int level) |
returns the subset with index si on the given level More... | |
const Subset * | subset (int si, int level) const |
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) |
Handles subsets on a per level basis.
The MultiGridSubsetHandler is a specialization of ISubsetHandler for MultiGrids. It allows to access elements given a subset-index and a level index.
Note that the number of levels in the MultiGridSubsetHandler always matches the number of levels in the associated multigrid. This is guaranteed through a callback mechanism.
|
protected |
|
protected |
|
protected |
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);
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
References m_numSubsets, and m_pMG.
ug::MultiGridSubsetHandler::MultiGridSubsetHandler | ( | MultiGrid & | mg, |
uint | supportedElements = SHE_ALL |
||
) |
References assign_grid(), m_numSubsets, and m_pMG.
ug::MultiGridSubsetHandler::MultiGridSubsetHandler | ( | const MultiGridSubsetHandler & | 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 m_pMG.
|
virtual |
References detach_data(), erase_subset_lists_impl(), and ug::ISubsetHandler::m_pGrid.
|
protected |
References m_levels, new_subset(), and num_subsets_in_list().
Referenced by level_required().
|
protectedvirtual |
add a subset
Implements ug::ISubsetHandler.
References add_subset_to_all_levels(), and num_subsets_in_list().
|
protected |
increases m_numSubsets.
References m_levels, m_numSubsets, and new_subset().
Referenced by add_required_subset_lists().
void ug::MultiGridSubsetHandler::assign_grid | ( | MultiGrid & | mg | ) |
References ug::Grid::attach_to_edges(), ug::Grid::attach_to_faces(), ug::Grid::attach_to_vertices(), ug::Grid::attach_to_volumes(), cleanup(), ug::ISubsetHandler::elements_are_supported(), level_required(), m_aSharedEntryEDGE, m_aSharedEntryFACE, m_aSharedEntryVOL, m_aSharedEntryVRT, m_callbackId, ug::ISubsetHandler::m_pGrid, m_pMG, ug::Grid::message_hub(), multigrid_changed(), ug::MultiGrid::num_levels(), ug::ISubsetHandler::set_grid(), ug::SHE_EDGE, ug::SHE_FACE, ug::SHE_VERTEX, and ug::SHE_VOLUME.
Referenced by MultiGridSubsetHandler().
|
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.
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(...).
|
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.
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(...).
void ug::ISubsetHandler::assign_subset |
void ug::ISubsetHandler::assign_subset | ( | class TIterator | ) |
|
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::AssignSubset_VerticesInCube(), ug::AssignSubset_VerticesInSphere(), and ug::InitLinearManifoldSubsetHandler().
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(...).
|
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.
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(...).
|
protected |
this method is called by ISubsetHandler when attachment_support has been enabled.
a helper method for the public assign_subset methods.
References ug::MultiGrid::get_level(), get_list_iterator(), ug::ISubsetHandler::get_subset_index(), level_required(), ug::ISubsetHandler::m_pGrid, m_pMG, ug::ISubsetHandler::subset_assigned(), and ug::ISubsetHandler::subset_required().
Referenced by assign_subset().
geometry_traits< TElem >::iterator ug::MultiGridSubsetHandler::begin | ( | int | subsetIndex, |
int | level | ||
) |
returns the begin-iterator for the elements of type TElem in the given subset.
e.g. begin<Triangle>(0)
References level_required(), and num_subsets_in_list().
Referenced by ug::CollectSurfaceViewElements(), ug::DomainRayTracer::init(), ug::InitLinearManifoldSubsetHandler(), ug::OverlyingSubsetFinder< TDomain >::OverlyingSubsetFinder(), and ug::ZRayTracer< TDomain >::ZRayTracer().
geometry_traits< TElem >::const_iterator ug::MultiGridSubsetHandler::begin | ( | int | subsetIndex, |
int | level | ||
) | const |
returns the begin-iterator for the elements of type TElem in the given subset.
e.g. begin<Triangle>(0) Please note that in the const version level < num_levels() has to hold true.
References num_levels(), num_subsets_in_list(), and UG_ASSERT.
|
protected |
helper for change_subset_indices
References ug::ISubsetHandler::alter_subset_index(), and m_levels.
|
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.
|
protected |
References detach_data(), erase_subset_lists_impl(), m_callbackId, m_levels, ug::ISubsetHandler::m_pGrid, and m_pMG.
Referenced by assign_grid(), and grid_to_be_destroyed().
void ug::MultiGridSubsetHandler::clear_subset_elements | ( | int | subsetIndex | ) |
removes all elements of type TElem from the specified subset.
References num_levels().
void ug::MultiGridSubsetHandler::clear_subset_elements | ( | int | subsetIndex, |
int | level | ||
) |
removes all elements of type TElem from the specified subset on the given level.
References ug::ISubsetHandler::alter_subset_index(), ug::SectionContainer< TValue, TContainer >::erase(), ug::ISubsetHandler::m_pGrid, and num_subsets_in_list().
|
protectedvirtual |
clears the element lists in the given subset. Does not alter any indices.
Implements ug::ISubsetHandler.
References m_levels, and ug::ISubsetHandler::m_pGrid.
Referenced by join_subset_lists().
|
protected |
helper for collect_subset_elements
|
inlinevirtual |
returns true if the subset contains edges
Implements ug::ISubsetHandler.
|
inlinevirtual |
returns true if the subset contains faces
Implements ug::ISubsetHandler.
|
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.
Implements ug::ISubsetHandler.
|
inlinevirtual |
returns true if the subset contains volumes
Implements ug::ISubsetHandler.
|
protected |
detaches all attached data.
References ug::Grid::detach_from_edges(), ug::Grid::detach_from_faces(), ug::Grid::detach_from_vertices(), ug::Grid::detach_from_volumes(), ug::ISubsetHandler::elements_are_supported(), m_aSharedEntryEDGE, m_aSharedEntryFACE, m_aSharedEntryVOL, m_aSharedEntryVRT, ug::ISubsetHandler::m_pGrid, ug::SHE_EDGE, ug::SHE_FACE, ug::SHE_VERTEX, and ug::SHE_VOLUME.
Referenced by cleanup(), and ~MultiGridSubsetHandler().
geometry_traits< TElem >::iterator ug::MultiGridSubsetHandler::end | ( | int | subsetIndex, |
int | level | ||
) |
returns the end-iterator for the elements of type TElem in the given subset.
e.g. end<Triangle>(0)
References level_required(), and num_subsets_in_list().
Referenced by ug::CollectSurfaceViewElements(), ug::DomainRayTracer::init(), ug::InitLinearManifoldSubsetHandler(), ug::OverlyingSubsetFinder< TDomain >::OverlyingSubsetFinder(), and ug::ZRayTracer< TDomain >::ZRayTracer().
geometry_traits< TElem >::const_iterator ug::MultiGridSubsetHandler::end | ( | int | subsetIndex, |
int | level | ||
) | const |
returns the end-iterator for the elements of type TElem in the given subset.
e.g. end<Triangle>(0) Please note that in the const version level < num_levels() has to hold true.
References num_levels(), num_subsets_in_list(), and UG_ASSERT.
|
protectedvirtual |
erases the subsets. Doesn't alter any indices.
Implements ug::ISubsetHandler.
References erase_subset_lists_impl().
|
protectedvirtual |
erases the subset but does not touch the subset-indices.
Implements ug::ISubsetHandler.
References m_levels, m_numSubsets, and num_subsets_in_list().
|
protected |
non-virtual implementation of erase_subset_lists. Callable from destructor
References m_levels, and m_numSubsets.
Referenced by cleanup(), erase_subset_lists(), and ~MultiGridSubsetHandler().
GridObjectCollection ug::MultiGridSubsetHandler::get_grid_objects | ( | int | subsetIndex, |
int | level | ||
) | const |
returns a GridObjectCollection
the returned GridObjectCollection hold the elements of the specified subset on the given level.
References level_required(), m_levels, and ug::ISubsetHandler::subset_required().
GridObjectCollection ug::MultiGridSubsetHandler::get_grid_objects_in_level | ( | int | level | ) | const |
returns a GridObjectCollection with multiple levels - each representing a subset.
the returned GridObjectCollection hold the elements of the specified level, each level of the collection represents a subset.
References ug::GridObjectCollection::add_level(), level_required(), m_levels, and num_subsets_in_list().
|
virtual |
returns a GridObjectCollection with multiple levels
the returned GridObjectCollection hold the elements of the specified subset.
Implements ug::ISubsetHandler.
References ug::GridObjectCollection::add_level(), m_levels, and ug::ISubsetHandler::subset_required().
|
inline |
returns the level in which an element is located
Referenced by ug::PartitionWeighting::weigh(), ug::InterSubsetPartitionWeighting::weigh(), and ug::ProtectSubsetPartitionWeighting::weigh().
|
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.
|
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.
|
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().
|
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.
|
virtual |
perform cleanup
Reimplemented from ug::ISubsetHandler.
References cleanup(), ug::ISubsetHandler::grid(), ug::ISubsetHandler::grid_to_be_destroyed(), and ug::ISubsetHandler::m_pGrid.
|
protectedvirtual |
join the subset-lists but do not touch the subset-indices.
Implements ug::ISubsetHandler.
References ug::SectionContainer< TValue, TContainer >::append(), clear_subset_lists(), ug::MultiGridSubsetHandler::Subset::m_edges, ug::MultiGridSubsetHandler::Subset::m_faces, m_levels, ug::MultiGridSubsetHandler::Subset::m_vertices, ug::MultiGridSubsetHandler::Subset::m_volumes, and boost::target().
|
inline |
creates the required levels, if they do not yet exist
References add_level(), and m_levels.
Referenced by assign_grid(), assign_subset_impl(), begin(), end(), get_grid_objects(), get_grid_objects_in_level(), and multigrid_changed().
|
inlineprotected |
Throws an error if the required level does not yet exist.
References num_levels(), and UG_THROW.
|
protectedvirtual |
moves the subset but does not touch the subset-indices.
Implements ug::ISubsetHandler.
References m_levels.
|
inline |
|
inline |
|
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().
|
protected |
creates a new subset. Caller is responsible for deletion
References ug::ISubsetHandler::elements_are_supported(), ug::Grid::get_attachment_pipe(), ug::SectionContainer< TValue, TContainer >::get_container(), m_aSharedEntryEDGE, m_aSharedEntryFACE, m_aSharedEntryVOL, m_aSharedEntryVRT, ug::MultiGridSubsetHandler::Subset::m_edges, ug::MultiGridSubsetHandler::Subset::m_faces, ug::ISubsetHandler::m_pGrid, ug::MultiGridSubsetHandler::Subset::m_vertices, ug::MultiGridSubsetHandler::Subset::m_volumes, ug::AttachedElementList< TAttachmentPipe >::set_pipe(), ug::SHE_EDGE, ug::SHE_FACE, ug::SHE_VERTEX, and ug::SHE_VOLUME.
Referenced by add_level(), and add_subset_to_all_levels().
uint ug::MultiGridSubsetHandler::num |
returns the total number of elements
References num_subsets_in_list().
Referenced by ug::CreateSurfaceView(), and ug::SubsetIsRegularGrid().
uint ug::MultiGridSubsetHandler::num | ( | int | subsetIndex | ) | const |
returns the number of elements in the given subset
References m_levels, and num_subsets_in_list().
uint ug::MultiGridSubsetHandler::num | ( | int | subsetIndex, |
int | level | ||
) | const |
returns the number of elements in the given subset on the given level
References num_levels(), and num_subsets_in_list().
|
inline |
returns the number of levels
Referenced by ug::IteratorProvider< MGSubsetHandler >::begin(), begin(), clear_subset_elements(), ug::CollectSurfaceViewElements(), ug::IteratorProvider< MGSubsetHandler >::end(), end(), ug::DomainRayTracer::init(), level_required(), num(), and ug::ZRayTracer< TDomain >::ZRayTracer().
|
inlineprotected |
returns the number of subsets in the local list
Referenced by add_level(), add_required_subset_lists(), begin(), clear_subset_elements(), end(), erase_subset_lists(), get_grid_objects_in_level(), and num().
|
inlineprotected |
returns the section container for the given type, subset and level
References ug::MultiGridSubsetHandler::Subset::m_edges, ug::MultiGridSubsetHandler::Subset::m_faces, ug::MultiGridSubsetHandler::Subset::m_vertices, ug::MultiGridSubsetHandler::Subset::m_volumes, and subset().
Referenced by section_container().
|
inlineprotected |
returns the const section container for the given type, subset and level
References ug::MultiGridSubsetHandler::Subset::m_edges, ug::MultiGridSubsetHandler::Subset::m_faces, ug::MultiGridSubsetHandler::Subset::m_vertices, ug::MultiGridSubsetHandler::Subset::m_volumes, section_container(), and subset().
|
inlineprotected |
returns the subset with index si on the given level
Referenced by section_container().
|
inlineprotected |
|
protectedvirtual |
swaps the subsets but does not touch the subset-indices.
Implements ug::ISubsetHandler.
References m_levels.
|
protected |
Referenced by assign_grid(), detach_data(), and new_subset().
|
protected |
Referenced by assign_grid(), detach_data(), and new_subset().
|
protected |
Referenced by assign_grid(), detach_data(), and new_subset().
|
protected |
Referenced by assign_grid(), detach_data(), and new_subset().
|
protected |
Referenced by assign_grid(), and cleanup().
|
protected |
Referenced by add_level(), add_subset_to_all_levels(), change_elem_subset_indices(), cleanup(), clear_subset_lists(), erase_subset_lists(), erase_subset_lists_impl(), get_grid_objects(), get_grid_objects_in_level(), get_grid_objects_in_subset(), join_subset_lists(), level_required(), move_subset_lists(), num(), and swap_subset_lists().
|
protected |
Referenced by add_subset_to_all_levels(), erase_subset_lists(), erase_subset_lists_impl(), and MultiGridSubsetHandler().
|
protected |
Referenced by assign_grid(), assign_subset_impl(), cleanup(), and MultiGridSubsetHandler().