ug4
|
manages the layouts and interfaces which are associated with a distributed grid. More...
#include <distributed_grid.h>
Classes | |
class | ElementInfo |
Be careful when creating copies of ElementInfo. More... | |
struct | ScheduledElement |
Used to schedule an element for insertion during ordered-insertion-mode. More... | |
Public Member Functions | |
void | assign (MultiGrid &grid) |
void | begin_element_deletion () |
call this method before you start deleting elements in the associated grid More... | |
void | begin_ordered_element_insertion () |
call this method before you start creating new elements in the associated grid. More... | |
template<class TElem > | |
void | collect_interface_entries (std::vector< std::pair< int, size_t > > &vEntriesOut, TElem *elem, byte statusType, bool clearContainer=true) |
template<class TGeomObj > | |
bool | contains_status (TGeomObj *o, byte status) const |
returns true if the status of the given object contains the given status. More... | |
DistributedGridManager () | |
DistributedGridManager (MultiGrid &grid) | |
SmartPtr< DistroAdjuster > | distro_adjuster () |
get the distribution adjuster 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... | |
void | enable_interface_management (bool bEnable) |
Enables or disables interface managment. Use with care! More... | |
void | end_element_deletion () |
call this method after you're done deleting elements from the associated grid More... | |
void | end_ordered_element_insertion () |
call this method when you're done with element creation. 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... | |
MultiGrid * | get_assigned_grid () |
const MultiGrid * | get_assigned_grid () const |
GridLayoutMap & | grid_layout_map () |
const GridLayoutMap & | grid_layout_map () const |
void | grid_layouts_changed (bool addedElemsOnly=false) |
call this method if you altered the layout externally. More... | |
virtual void | grid_to_be_destroyed (Grid *grid) |
template<class TElem > | |
bool | is_ghost (TElem *elem) const |
returns true if the element is a ghost More... | |
template<class TElem > | |
bool | is_in_horizontal_interface (TElem *elem) const |
returns true if the element is contained in a horizontal interface More... | |
template<class TElem > | |
bool | is_in_vertical_interface (TElem *elem) const |
returns true if the element is contained in a vertical interface More... | |
template<class TElem > | |
bool | is_interface_element (TElem *elem) |
returns true if an element is in one or more interfaces More... | |
void | set_distro_adjuster (SmartPtr< DistroAdjuster > adj) |
set a global distribution adjuster 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 | volume_created (Grid *grid, Volume *v, 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 | ~DistributedGridManager () |
byte | get_status (GridObject *go) const |
returns the status of the given object. More... | |
byte | get_status (Vertex *vrt) const |
returns the status of the given object. More... | |
byte | get_status (Edge *edge) const |
returns the status of the given object. More... | |
byte | get_status (Face *face) const |
returns the status of the given object. More... | |
byte | get_status (Volume *vol) const |
returns the status of the given object. More... | |
Public Member Functions inherited from ug::GridObserver | |
virtual void | elements_to_be_cleared (Grid *grid) |
virtual | ~GridObserver () |
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 | 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... | |
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... | |
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... | |
Protected Types | |
typedef Attachment< ElemInfoEdge > | AElemInfoEdge |
typedef Attachment< ElemInfoFace > | AElemInfoFace |
typedef Attachment< ElemInfoVol > | AElemInfoVol |
typedef Attachment< ElemInfoVrt > | AElemInfoVrt |
typedef ElementInfo< Edge > | ElemInfoEdge |
typedef ElementInfo< Face > | ElemInfoFace |
typedef ElementInfo< Volume > | ElemInfoVol |
typedef ElementInfo< Vertex > | ElemInfoVrt |
typedef std::multimap< size_t, ScheduledElement > | ScheduledElemMap |
Protected Member Functions | |
template<class TElem > | |
void | add_element_to_interface (TElem *pElem, int procID) |
void | clear_scheduled_elements () |
template<class TElem > | |
void | create_missing_constrained_h_interfaces (std::vector< TElem * > &newConstrainedElems) |
ElemInfoEdge & | elem_info (Edge *ele) |
const ElemInfoEdge & | elem_info (Edge *ele) const |
ElemInfoFace & | elem_info (Face *ele) |
const ElemInfoFace & | elem_info (Face *ele) const |
ElemInfoVrt & | elem_info (Vertex *ele) |
const ElemInfoVrt & | elem_info (Vertex *ele) const |
ElemInfoVol & | elem_info (Volume *ele) |
const ElemInfoVol & | elem_info (Volume *ele) const |
template<class TElem > | |
void | element_to_be_erased (TElem *elem) |
void | free_grid_data () |
free's all grid related data More... | |
void | got_new_constrained_vertical (Edge *e) |
void | got_new_constrained_vertical (Face *f) |
void | got_new_constrained_vertical (Vertex *v) |
void | got_new_constrained_vertical (Volume *) |
template<class TElem > | |
void | handle_created_element (TElem *pElem, GridObject *pParent, bool replacesParent) |
vertex_created, edge_created, ... callbacks call this method. More... | |
template<class TScheduledElemMap > | |
void | perform_ordered_element_insertion (TScheduledElemMap &elemMap) |
template<class TGeomObj > | |
void | reset_elem_infos () |
template<class TElem , class TScheduledElemMap , class TParent > | |
void | schedule_element_for_insertion (TScheduledElemMap &elemMap, TElem *elem, TParent *pParent) |
void | set_grid (Grid *grid) |
performs registration and deregistration at a grid. More... | |
template<class TGeomObj > | |
void | update_all_elem_infos () |
template<class TGeomObj , class TLayoutMap > | |
void | update_elem_info (TLayoutMap &layoutMap, int nodeType, byte newStatus, bool addStatus=false) |
manages the layouts and interfaces which are associated with a distributed grid.
The DistributedGridManager is a grid observer, which manages the GridLayoutMap of a distributed grid. New elements are automatically added to interfaces as required and erased elements are automatically removed from interfaces.
Note that while a DistributedGridManager observes a grid, one may only create new elements in the associated grid between calls to begin_ordered_element_insertion() and end_ordered_element_insertion().
Similarly elements of the associated grid may only be erased during calls to begin_element_deletion() and end_element_deletion().
Those barriers are important, so that distributed grid managers can insert associated elements on different processes in the same order without communicating.
Note that only one layer of elements may be created / erased between calls to begin_ordered_element_insertion / end_ordered_... etc...
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
ug::DistributedGridManager::DistributedGridManager | ( | ) |
References m_bElementDeletionMode, m_bOrderedInsertionMode, m_interfaceManagementEnabled, and m_pGrid.
ug::DistributedGridManager::DistributedGridManager | ( | MultiGrid & | grid | ) |
References assign(), m_bElementDeletionMode, m_bOrderedInsertionMode, m_interfaceManagementEnabled, and m_pGrid.
|
virtual |
|
protected |
References ug::DistributedGridManager::ElementInfo< TGeomObj >::add_entry(), elem_info(), ug::ES_H_MASTER, ug::ES_H_SLAVE, ug::ES_IN_INTERFACE, ug::ES_NONE, ug::ES_SCHEDULED_FOR_INTERFACE, ug::GridLayoutMap::get_layout(), ug::MultiGrid::get_level(), get_status(), ug::INT_H_MASTER, ug::INT_H_SLAVE, m_gridLayoutMap, m_pGrid, pcl::OrderedInterface< TType, TContainer, TAlloc >::push_back(), s, ug::DistributedGridManager::ElementInfo< TGeomObj >::set_status(), and UG_ASSERT.
Referenced by perform_ordered_element_insertion().
void ug::DistributedGridManager::assign | ( | MultiGrid & | grid | ) |
References set_grid().
Referenced by DistributedGridManager(), and ug::Grid::set_parallel().
void ug::DistributedGridManager::begin_element_deletion | ( | ) |
call this method before you start deleting elements in the associated grid
References m_bElementDeletionMode, m_bOrderedInsertionMode, m_newConstrainedVerticalEdges, m_newConstrainedVerticalFaces, and m_newConstrainedVerticalVrts.
Referenced by ug::ParallelHangingNodeRefiner_MultiGrid::pre_coarsen().
void ug::DistributedGridManager::begin_ordered_element_insertion | ( | ) |
call this method before you start creating new elements in the associated grid.
You shouldn't add new interfaces to the associated communication-set between begin_ and end_element_creation.
References m_bElementDeletionMode, and m_bOrderedInsertionMode.
Referenced by ug::ParallelHangingNodeRefiner_MultiGrid::pre_refine(), and ug::ParallelGlobalFracturedMediaRefiner::refinement_step_begins().
|
protected |
References m_edgeMap, m_faceMap, m_volMap, and m_vrtMap.
Referenced by end_ordered_element_insertion().
void ug::DistributedGridManager::collect_interface_entries | ( | std::vector< std::pair< int, size_t > > & | vEntriesOut, |
TElem * | elem, | ||
byte | statusType, | ||
bool | clearContainer = true |
||
) |
returns a list of pairs (procID, index) that tells for each element where in which interfaces it lies.
statusType | may be any or-combination of values enumerated in ElementStatusTypes. |
References elem_info().
Referenced by ug::ComPol_NewConstrainedVerticals< TLayout >::collect(), ug::ComPol_NewConstrainedVerticals< TLayout >::create_initial_hash_entry(), and create_missing_constrained_h_interfaces().
|
inline |
returns true if the status of the given object contains the given status.
status can be an or-combination of constants enumerated in InterfaceNodeTypes and ElementStatusTypes.
References get_status().
Referenced by ug::AssignVerticalMasterAndSlaveStates(), ug::CalculateNumManifoldEdgesVertexAttachmentInParentLevel(), ug::CalculateSmoothCreaseManifoldPosInParentLevelLoopScheme(), ug::CalculateSmoothManifoldPosInParentLevelButterflyScheme(), ug::CalculateSmoothManifoldPosInParentLevelLoopScheme(), ug::CheckMultiGridConsistencyImpl(), ug::bridge::Evaluate::CloseVertexExists(), ug::ComPol_NewConstrainedVerticals< TLayout >::collect(), ug::ComPol_InterfaceStatus< TLayout >::collect(), ug::IDomain< TGrid, TSubsetHandler >::count_local_unique_surface_elements(), ug::ComPol_NewConstrainedVerticals< TLayout >::create_initial_hash_entry(), create_missing_constrained_h_interfaces(), ug::bridge::Evaluate::EvaluateAtVertex(), ug::ComPol_NewConstrainedVerticals< TLayout >::exchange_data(), ug::ComPol_NewConstrainedVerticals< TLayout >::extract(), ug::ComPol_InterfaceStatus< TLayout >::extract(), ug::SurfaceView::is_vmaster(), ug::MarkAllElemsForAssemblyButHSlaves(), ug::SelectSelectedRootElementsAsVSlaves(), ug::SelectUnselectedRootElementsAsVMasters(), and ug::TetrahedralizeHybridTetOctGrid().
|
protected |
Note that the content of the given vector may be extended during this method.
References collect_interface_entries(), contains_status(), ug::Grid::distributed_grid_manager(), elem_info(), ug::ES_H_MASTER, ug::ES_H_SLAVE, ug::ES_SCHEDULED_FOR_INTERFACE, ug::ES_V_MASTER, ug::ES_V_SLAVE, ug::ComPol_NewConstrainedVerticals< TLayout >::exchange_data(), ug::ComPol_NewConstrainedVerticals< TLayout >::get_h_master_info(), get_status(), m_pGrid, ug::ComPol_NewConstrainedVerticals< TLayout >::other_v_masters(), perform_ordered_element_insertion(), pcl::ProcRank(), ug::DistributedGridManager::ElementInfo< TGeomObj >::set_status(), and UG_ASSERT.
Referenced by end_element_deletion().
|
inline |
get the distribution adjuster
References m_spDistroAdjuster.
Referenced by ug::SelectElementsForTargetPartition().
|
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 handle_created_element().
|
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*).
Reimplemented from ug::GridObserver.
References element_to_be_erased().
|
inlineprotected |
References m_aaElemInfoEDGE.
|
inlineprotected |
References m_aaElemInfoEDGE.
|
inlineprotected |
References m_aaElemInfoFACE.
|
inlineprotected |
References m_aaElemInfoFACE.
|
inlineprotected |
References m_aaElemInfoVRT.
Referenced by add_element_to_interface(), collect_interface_entries(), create_missing_constrained_h_interfaces(), element_to_be_erased(), get_status(), handle_created_element(), is_interface_element(), reset_elem_infos(), schedule_element_for_insertion(), and update_elem_info().
|
inlineprotected |
References m_aaElemInfoVRT.
|
inlineprotected |
References m_aaElemInfoVOL.
|
inlineprotected |
References m_aaElemInfoVOL.
|
protected |
References elem_info(), ug::DistributedGridManager::ElementInfo< TGeomObj >::entries_begin(), ug::DistributedGridManager::ElementInfo< TGeomObj >::entries_end(), ug::DistributedGridManager::ElementInfo< TGeomObj >::is_interface_element(), m_bElementDeletionMode, ug::DistributedGridManager::ElementInfo< TGeomObj >::Entry::m_interface, ug::DistributedGridManager::ElementInfo< TGeomObj >::Entry::m_interfaceElemIter, m_interfaceManagementEnabled, and UG_ASSERT.
Referenced by edge_to_be_erased(), face_to_be_erased(), vertex_to_be_erased(), and volume_to_be_erased().
|
inline |
Enables or disables interface managment. Use with care!
Interface managment is enabled by default. If you intend to completly restructure the grid and its interfaces, it may be beneficial to disable interface management before doing so. You should then use the method grid_layouts_changed to inform the DistributedGridManager that you modified the interfaces externally.
References m_interfaceManagementEnabled.
Referenced by ug::DistributeGrid().
void ug::DistributedGridManager::end_element_deletion | ( | ) |
call this method after you're done deleting elements from the associated grid
References ug::Grid::begin_marking(), ug::CollectAssociated(), create_missing_constrained_h_interfaces(), ug::Grid::end_marking(), ug::Grid::is_marked(), ug::LIB_GRID, m_bElementDeletionMode, m_newConstrainedVerticalEdges, m_newConstrainedVerticalFaces, m_newConstrainedVerticalVrts, m_pGrid, ug::Grid::mark(), UG_DLOG, and ug::EdgeVertices::vertex().
Referenced by ug::ParallelHangingNodeRefiner_MultiGrid::post_coarsen().
void ug::DistributedGridManager::end_ordered_element_insertion | ( | ) |
call this method when you're done with element creation.
Elements will not be added to the associated
References clear_scheduled_elements(), m_bOrderedInsertionMode, m_edgeMap, m_faceMap, m_interfaceManagementEnabled, m_volMap, m_vrtMap, and perform_ordered_element_insertion().
Referenced by ug::ParallelHangingNodeRefiner_MultiGrid::post_refine(), and ug::ParallelGlobalFracturedMediaRefiner::refinement_step_ends().
|
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 handle_created_element().
|
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*).
Reimplemented from ug::GridObserver.
References element_to_be_erased().
|
protected |
free's all grid related data
References ug::Grid::detach_from_edges(), ug::Grid::detach_from_faces(), ug::Grid::detach_from_vertices(), ug::Grid::detach_from_volumes(), m_aElemInfoEdge, m_aElemInfoFace, m_aElemInfoVol, m_aElemInfoVrt, m_gridLayoutMap, and m_pGrid.
Referenced by grid_to_be_destroyed(), and set_grid().
|
inline |
References m_pGrid.
Referenced by ug::ComPol_AdjustType< TLayout >::collect(), ug::CollectSurfaceViewElements(), ug::ComPol_NewConstrainedVerticals< TLayout >::create_initial_hash_entry(), ug::CreateSurfaceView(), ug::ComPol_NewConstrainedVerticals< TLayout >::extract(), ug::ComPol_AdjustType< TLayout >::extract(), and ug::ParallelHangingNodeRefiner_MultiGrid::set_distributed_grid_manager().
returns the status of the given object.
The status gives information about the type of interfaces in which a node lies. The returned value is an or combination of the constants enumerated in InterfaceNodeTypes and ElementStatusTypes.
References elem_info(), and ug::DistributedGridManager::ElementInfo< TGeomObj >::get_status().
returns the status of the given object.
The status gives information about the type of interfaces in which a node lies. The returned value is an or combination of the constants enumerated in InterfaceNodeTypes and ElementStatusTypes.
References elem_info(), and ug::DistributedGridManager::ElementInfo< TGeomObj >::get_status().
byte ug::DistributedGridManager::get_status | ( | GridObject * | go | ) | const |
returns the status of the given object.
The status gives information about the type of interfaces in which a node lies. The returned value is an or combination of the constants enumerated in InterfaceNodeTypes and ElementStatusTypes.
References ug::GridObject::base_object_id(), ug::EDGE, ug::FACE, ug::VERTEX, and ug::VOLUME.
Referenced by add_element_to_interface(), ug::AssignSubsetsByInterfaceType(), contains_status(), create_missing_constrained_h_interfaces(), handle_created_element(), is_ghost(), is_in_horizontal_interface(), is_in_vertical_interface(), ug::FV1InnerBoundaryElemDisc< TImpl, TDomain >::prep_elem(), ug::FV1InnerBoundaryElemDisc< TImpl, TDomain >::prep_err_est_elem(), and ug::DoFDistribution::sum_dof_count().
returns the status of the given object.
The status gives information about the type of interfaces in which a node lies. The returned value is an or combination of the constants enumerated in InterfaceNodeTypes and ElementStatusTypes.
References elem_info(), and ug::DistributedGridManager::ElementInfo< TGeomObj >::get_status().
returns the status of the given object.
The status gives information about the type of interfaces in which a node lies. The returned value is an or combination of the constants enumerated in InterfaceNodeTypes and ElementStatusTypes.
References elem_info(), and ug::DistributedGridManager::ElementInfo< TGeomObj >::get_status().
|
inlineprotected |
References m_newConstrainedVerticalEdges.
|
inlineprotected |
References m_newConstrainedVerticalFaces.
|
inlineprotected |
References m_newConstrainedVerticalVrts.
Referenced by handle_created_element().
|
inlineprotected |
References UG_THROW.
|
inline |
if you change the layout externally, be sure to call DistributedGrid::layout_changed() afterwards.
References m_gridLayoutMap.
Referenced by ug::ApplySmoothManifoldPosToTopLevelAveragingScheme(), ug::ApplySmoothManifoldPosToTopLevelButterflyScheme(), ug::ApplySmoothManifoldPosToTopLevelLoopScheme(), ug::ApplySmoothVolumePosToTopLevel(), ug::ParallelHangingNodeRefiner_MultiGrid::assign_hnode_marks(), ug::AttachmentAllReduce(), ug::ParallelHangingNodeRefiner_MultiGrid::broadcast_marks_horizontally(), ug::ParallelHangingNodeRefiner_MultiGrid::broadcast_marks_vertically(), ug::ISelector::broadcast_selection_states(), ug::CalculateNumElemsVertexAttachmentInTopLevel(), ug::CalculateNumManifoldEdgesVertexAttachmentInParentLevel(), ug::CalculateNumManifoldFacesVertexAttachmentInTopLevel(), ug::CheckDistributedObjectConstraintTypes(), ug::ParallelGlobalFracturedMediaRefiner::communicate_marks(), ug::ParallelHangingNodeRefiner_MultiGrid::copy_marks_to_vmasters(), ug::ParallelHangingNodeRefiner_MultiGrid::copy_marks_to_vslaves(), ug::Partitioner_DynamicBisection< TElem, dim >::copy_partitions_to_children(), ug::IDomain< TGrid, TSubsetHandler >::count_ghosts(), ug::CreateSurfaceView(), ug::DistributeGrid(), ug::ComPol_NewConstrainedVerticals< TLayout >::exchange_data(), ug::ExchangeAndAdjustSideErrors(), ug::Partitioner_DynamicBisection< TElem, dim >::gather_weights_from_level(), ug::ParallelDualGraph< TGeomBaseObj, TIndexType, TConnectingObj >::generate_graph(), ug::GridFunction< TDomain, TAlgebra >::grid_changed_callback(), ug::GridFunction< TDomain, TAlgebra >::grid_distribution_callback(), ug::MarkForAdaption_GradientAverage(), ug::IApproximationSpace::might_contain_ghosts(), ug::PartitionMultiGridLevel_ParmetisKway(), ug::Partitioner_DynamicBisection< TElem, dim >::perform_bisection(), ug::ProjectHierarchyToSubdivisionLimit(), ug::CopyAttachmentHandler< TElem, TAttachment >::propagate_to_level(), ug::ParallelHNodeAdjuster::ref_marks_changed(), ug::SideAndElemErrEstData< TDomain >::summarize_err_est_data(), and ug::SynchronizeDistInfos().
|
inline |
References m_gridLayoutMap.
void ug::DistributedGridManager::grid_layouts_changed | ( | bool | addedElemsOnly = false | ) |
call this method if you altered the layout externally.
This should be done as seldom as possible. If you only added elements you may set addedElemsOnly to true. The complexity in this case is proportional to the number of elements in the layout. If you removed elements or if you are unsure what operations have been performed on the layout, you have to set addedElemsOnly to false (the default value). Complexity in this case is proportional to the number of elements in the underlying grid (or numer of elements in the layout - whichever is higher).
Referenced by ug::DistributeGrid(), and set_grid().
|
virtual |
Reimplemented from ug::GridObserver.
References free_grid_data(), and m_pGrid.
|
protected |
vertex_created, edge_created, ... callbacks call this method.
References ug::GridObject::base_object_id(), ug::EDGE, elem_info(), ug::DistributedGridManager::ElementInfo< TGeomObj >::entries_begin(), ug::DistributedGridManager::ElementInfo< TGeomObj >::entries_end(), ug::ES_IN_INTERFACE, ug::ES_NONE, ug::ES_SCHEDULED_FOR_INTERFACE, ug::FACE, get_status(), got_new_constrained_vertical(), ug::GridObject::is_constrained(), is_in_vertical_interface(), ug::DistributedGridManager::ElementInfo< TGeomObj >::is_interface_element(), m_bElementDeletionMode, m_bOrderedInsertionMode, m_edgeMap, m_faceMap, ug::DistributedGridManager::ElementInfo< TGeomObj >::Entry::m_interface, ug::DistributedGridManager::ElementInfo< TGeomObj >::Entry::m_interfaceElemIter, m_interfaceManagementEnabled, m_volMap, m_vrtMap, ug::DistributedGridManager::ElementInfo< TGeomObj >::reset(), schedule_element_for_insertion(), ug::DistributedGridManager::ElementInfo< TGeomObj >::set_status(), ug::VERTEX, and ug::VOLUME.
Referenced by edge_created(), face_created(), vertex_created(), and volume_created().
|
inline |
returns true if the element is a ghost
ghost elements are vertical masters that are in no other interfaces. Those elements shouldn't be refined.
References ug::ES_H_MASTER, ug::ES_H_SLAVE, ug::ES_V_MASTER, and get_status().
Referenced by ug::AddEntriesToSurfaceIndexLayout(), ug::CalculateConstrainedSmoothVolumePosInTopLevel(), ug::CalculateNumElemsVertexAttachmentInTopLevel(), ug::CalculateNumManifoldEdgesVertexAttachmentInParentLevel(), ug::CalculateNumManifoldFacesVertexAttachmentInTopLevel(), ug::CalculateSmoothCreaseManifoldPosInParentLevelLoopScheme(), ug::CalculateSmoothManifoldPosInParentLevelButterflyScheme(), ug::CalculateSmoothManifoldPosInParentLevelLoopScheme(), ug::CalculateSmoothManifoldPosInTopLevelAveragingScheme(), ug::CalculateSmoothVolumePosInTopLevel(), ug::bridge::Evaluate::CloseVertexExists(), ug::CollectSurfaceViewElements(), ug::ConstructParallelDualGraphMGLevel(), ug::IDomain< TGrid, TSubsetHandler >::count_ghosts(), ug::IDomain< TGrid, TSubsetHandler >::count_local_unique_surface_elements(), ug::LoadBalancer::estimate_distribution_quality_impl(), ug::bridge::Evaluate::EvaluateAtVertex(), ug::Partitioner_DynamicBisection< TElem, dim >::gather_weights_from_level(), ug::ParallelDualGraph< TGeomBaseObj, TIndexType, TConnectingObj >::generate_graph(), ug::SurfaceView::is_ghost(), ug::IsRegularSurfaceElem::is_ok(), ug::PartitionMultiGridLevel_ParmetisKway(), ug::Partitioner_DynamicBisection< TElem, dim >::perform_bisection(), ug::PrintElementEdgeRatios(), ug::ParallelGlobalFracturedMediaRefiner::refinement_is_allowed(), ug::ParallelHangingNodeRefiner_MultiGrid::refinement_is_allowed(), ug::SelectChildrenOfSelectedShadowRimEdges(), ug::SelectChildrenOfSelectedShadowRimFaces(), ug::SelectChildrenOfSelectedShadowVertices(), and ug::ZRayTracer< TDomain >::ZRayTracer().
|
inline |
returns true if the element is contained in a horizontal interface
References ug::ES_H_MASTER, ug::ES_H_SLAVE, and get_status().
Referenced by ug::ComPol_AdjustType< TLayout >::extract().
|
inline |
returns true if the element is contained in a vertical interface
References ug::ES_V_MASTER, ug::ES_V_SLAVE, and get_status().
Referenced by handle_created_element().
bool ug::DistributedGridManager::is_interface_element | ( | TElem * | elem | ) |
returns true if an element is in one or more interfaces
References elem_info(), ug::ES_IN_INTERFACE, and ug::DistributedGridManager::ElementInfo< TGeomObj >::get_status().
Referenced by ug::ContainsInterfaceElem().
|
protected |
References add_element_to_interface(), ug::GridObject::base_object_id(), ug::DistributedGridManager::ScheduledElement::connectedProcID, ug::EDGE, ug::FACE, ug::DistributedGridManager::ScheduledElement::geomObj, ug::VERTEX, and ug::VOLUME.
Referenced by create_missing_constrained_h_interfaces(), and end_ordered_element_insertion().
|
protected |
|
protected |
References elem_info(), ug::DistributedGridManager::ElementInfo< TGeomObj >::entries_begin(), ug::DistributedGridManager::ElementInfo< TGeomObj >::entries_end(), ug::ES_H_MASTER, ug::ES_H_SLAVE, ug::ES_SCHEDULED_FOR_INTERFACE, ug::ES_V_MASTER, ug::ES_V_SLAVE, ug::DistributedGridManager::ElementInfo< TGeomObj >::get_interface_type(), ug::DistributedGridManager::ElementInfo< TGeomObj >::get_local_id(), ug::DistributedGridManager::ElementInfo< TGeomObj >::get_status(), ug::DistributedGridManager::ElementInfo< TGeomObj >::get_target_proc(), ug::DistributedGridManager::ElementInfo< TGeomObj >::is_interface_element(), ug::DistributedGridManager::ElementInfo< TGeomObj >::set_status(), and UG_ASSERT.
Referenced by handle_created_element().
|
inline |
set a global distribution adjuster
A distribution adjuster may be used to manually adjust how elements are distributed by the domain distribution. For example, in the circumstances that led to the implementation of this feature, it was necessary to distribute certain vertices to all processes which held elements of a specific subset (regardless of whether those processes had any elements connected to these vertices or not). During the distribution process, the adjuster's adjust() method is called at the end of SelectElementsForTargetPartition() in distribution.cpp.
References m_spDistroAdjuster.
|
protected |
performs registration and deregistration at a grid.
call set_grid(NULL) to unregister the observer from a grid.
References ug::Grid::attach_to_edges(), ug::Grid::attach_to_faces(), ug::Grid::attach_to_vertices(), ug::Grid::attach_to_volumes(), free_grid_data(), grid_layouts_changed(), m_aaElemInfoEDGE, m_aaElemInfoFACE, m_aaElemInfoVOL, m_aaElemInfoVRT, m_aElemInfoEdge, m_aElemInfoFace, m_aElemInfoVol, m_aElemInfoVrt, m_pGrid, ug::OT_FULL_OBSERVER, ug::Grid::register_observer(), UG_ASSERT, and ug::Grid::unregister_observer().
Referenced by assign().
|
protected |
|
protected |
iterate through the elements of the interface
References ug::DistributedGridManager::ElementInfo< TGeomObj >::add_entry(), elem_info(), ug::DistributedGridManager::ElementInfo< TGeomObj >::get_status(), and ug::DistributedGridManager::ElementInfo< TGeomObj >::set_status().
|
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 handle_created_element().
|
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*).
Reimplemented from ug::GridObserver.
References element_to_be_erased().
|
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 handle_created_element().
|
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*).
Reimplemented from ug::GridObserver.
References element_to_be_erased().
|
protected |
Referenced by elem_info(), and set_grid().
|
protected |
Referenced by elem_info(), and set_grid().
|
protected |
Referenced by elem_info(), and set_grid().
|
protected |
Referenced by elem_info(), and set_grid().
|
protected |
Referenced by free_grid_data(), set_grid(), and ~DistributedGridManager().
|
protected |
Referenced by free_grid_data(), set_grid(), and ~DistributedGridManager().
|
protected |
Referenced by free_grid_data(), set_grid(), and ~DistributedGridManager().
|
protected |
Referenced by free_grid_data(), set_grid(), and ~DistributedGridManager().
|
protected |
|
protected |
|
protected |
holds all elements that were scheduled by edges
Referenced by clear_scheduled_elements(), end_ordered_element_insertion(), and handle_created_element().
|
protected |
holds all elements that were scheduled by faces
Referenced by clear_scheduled_elements(), end_ordered_element_insertion(), and handle_created_element().
|
protected |
Referenced by add_element_to_interface(), free_grid_data(), grid_layout_map(), and update_all_elem_infos().
|
protected |
only for debug purposes
Referenced by DistributedGridManager(), element_to_be_erased(), enable_interface_management(), end_ordered_element_insertion(), and handle_created_element().
|
protected |
Referenced by begin_element_deletion(), end_element_deletion(), and got_new_constrained_vertical().
|
protected |
Referenced by begin_element_deletion(), end_element_deletion(), and got_new_constrained_vertical().
|
protected |
Referenced by begin_element_deletion(), end_element_deletion(), and got_new_constrained_vertical().
|
protected |
|
protected |
Referenced by distro_adjuster(), and set_distro_adjuster().
|
protected |
holds all elements that were scheduled by volumes
Referenced by clear_scheduled_elements(), end_ordered_element_insertion(), and handle_created_element().
|
protected |
holds all elements that were scheduled by vertices
Referenced by clear_scheduled_elements(), end_ordered_element_insertion(), and handle_created_element().