ug4
ug::HangingNodeRefinerBase< TSelector > Class Template Referenceabstract

Base class for a hanging-node refiner. More...

#include <hanging_node_refiner_base.h>

+ Inheritance diagram for ug::HangingNodeRefinerBase< TSelector >:

Public Types

enum  HNodeRefMarks { HNRM_TO_NORMAL = 1 << 5 , HNRM_TO_CONSTRAINED = 1 << 6 , HNRM_TO_CONSTRAINING = 1 << 7 , HNRM_MAX }
 
typedef TSelector selector_t
 

Public Member Functions

void add_ref_mark_adjuster (SPIRefMarkAdjuster adjuster)
 Add a refmark adjuster, which will be called while marks are adjusted during refinement / coarsening. More...
 
virtual void clear_marks ()
 clears all marks. Default implementation is empty More...
 
virtual void grid_to_be_destroyed (Grid *grid)
 
 HangingNodeRefinerBase (SPRefinementProjector projector=SPNULL)
 
template<class TIterator >
void mark (const TIterator &iterBegin, const TIterator &iterEnd, RefinementMark refMark=RM_REFINE)
 marks all elements between iterBegin and iterEnd. More...
 
virtual bool mark (Edge *e, RefinementMark refMark=RM_REFINE)
 
virtual bool mark (Face *f, RefinementMark refMark=RM_REFINE)
 
virtual bool mark (GridObject *o, RefinementMark refMark=RM_REFINE)
 marks the specified geometric object More...
 
virtual bool mark (Vertex *v, RefinementMark refMark=RM_REFINE)
 Marks an element for refinement. Default implementation is empty. More...
 
virtual bool mark (Volume *v, RefinementMark refMark=RM_REFINE)
 
virtual void mark_neighborhood (size_t numIterations, RefinementMark refMark, bool sideNbrsOnly)
 Marks the neighborhood of the current selection. More...
 
template<class TElem >
bool marked_adaptive (TElem *elem) const
 
template<class TElem >
bool marked_coarsen (TElem *elem) const
 
bool marked_refine (Edge *elem) const
 
template<class TElem >
bool marked_refine (TElem *elem) const
 
template<class TElem >
bool marked_regular (TElem *elem) const
 
virtual bool save_marks_to_file (const char *filename)
 Writes the associated grid and marks to a file. Pure virtual. More...
 
virtual ~HangingNodeRefinerBase ()
 
void enable_node_dependency_order_1 (bool bEnable)
 enables or disables node-dependency-order-1. More...
 
bool node_dependency_order_1_enabled ()
 enables or disables node-dependency-order-1. More...
 
virtual bool mark (Vertex *v, RefinementMark refMark=RM_REFINE)
 Marks a element for refinement. More...
 
virtual bool mark (Edge *e, RefinementMark refMark=RM_REFINE)
 Marks a element for refinement. More...
 
virtual bool mark (Face *f, RefinementMark refMark=RM_REFINE)
 Marks a element for refinement. More...
 
virtual bool mark (Volume *v, RefinementMark refMark=RM_REFINE)
 Marks a element for refinement. More...
 
virtual RefinementMark get_mark (Vertex *v) const
 Returns the mark of a given element. More...
 
virtual RefinementMark get_mark (Edge *e) const
 Returns the mark of a given element. More...
 
virtual RefinementMark get_mark (Face *f) const
 Returns the mark of a given element. More...
 
virtual RefinementMark get_mark (Volume *v) const
 Returns the mark of a given element. More...
 
- Public Member Functions inherited from ug::IRefiner
virtual bool adaptivity_supported () const =0
 returns whether the refiner is able to perform adaptive refinement More...
 
bool coarsen ()
 Performs coarsening on the elements marked RM_COARSEN. More...
 
virtual bool coarsening_supported () const =0
 returns true, if the refiner supports coarsening. More...
 
bool debugging_enabled () const
 
void enable_debugging (bool enable)
 
virtual Gridget_associated_grid ()=0
 DEPRECIATED! Use grid(). Has to return the associated grid. Pure virtual. More...
 
int get_local_edge_mark (Face *f, Edge *e) const
 returns the local mark of the specified edge of the given face More...
 
int get_local_edge_mark (Volume *vol, Edge *e) const
 returns the local mark of the specified edge of the given volume More...
 
int get_local_face_mark (Volume *vol, Face *f) const
 returns the local mark of the specified face of the given volume More...
 
virtual RefinementMark get_mark (GridObject *o) const
 returns the mark of the specified geometric object More...
 
virtual Gridgrid ()=0
 Returns the grid associated with the refiner. More...
 
 IRefiner (SPRefinementProjector projector=SPNULL)
 
virtual bool local_marks_supported () const
 returns true, if the refiner supports local marks. More...
 
template<class TIterator >
void mark (const TIterator &iterBegin, const TIterator &iterEnd, RefinementMark refMark=RM_REFINE)
 marks all elements between iterBegin and iterEnd. More...
 
virtual bool mark (GridObject *o, RefinementMark refMark=RM_REFINE)
 marks the specified geometric object More...
 
void mark_neighborhood (size_t numIterations)
 marks the neighborhood of currently marked elements. More...
 
template<class TElem >
bool marked_closure (TElem *elem) const
 
template<class TElem >
bool marked_full (TElem *elem) const
 
template<class TElem >
bool marked_local (TElem *elem) const
 
size_t num_marked_edges ()
 returns the number of (globally) marked edges on all levels of the hierarchy More...
 
size_t num_marked_edges (std::vector< int > &numMarkedEdgesOut)
 returns the number of (globally) marked edges on all levels of the hierarchy More...
 
size_t num_marked_elements ()
 returns the number of (globally) marked grid-objects of highest dimension More...
 
size_t num_marked_elements (std::vector< int > &numMarkedElemsOut)
 returns the number of (globally) marked grid-objects of highest dimension More...
 
size_t num_marked_faces ()
 returns the number of (globally) marked faces on all levels of the hierarchy More...
 
size_t num_marked_faces (std::vector< int > &numMarkedFacesOut)
 returns the number of (globally) marked faces on all levels of the hierarchy More...
 
size_t num_marked_volumes ()
 returns the number of (globally) marked volumes on all levels of the hierarchy More...
 
size_t num_marked_volumes (std::vector< int > &numMarkedVolsOut)
 returns the number of (globally) marked volumes on all levels of the hierarchy More...
 
SPRefinementProjector projector ()
 
void refine ()
 Performs refinement on the marked elements. More...
 
void set_adjusted_marks_debug_filename (const char *filename)
 sets a filename to which adjusted marks are saved during refinement / coarsening More...
 
void set_projector (SPRefinementProjector projector)
 
virtual ~IRefiner ()
 
virtual void mark_local (Face *e, int mark)
 Marks a face or volume for local refinement. More...
 
virtual void mark_local (Volume *e, int mark)
 Marks a face or volume for local refinement. More...
 
virtual int get_local_mark (Face *e) const
 returns the local mark of the specified face or volume. More...
 
virtual int get_local_mark (Volume *e) const
 returns the local mark of the specified face or volume. More...
 
void adaption_begins ()
 notifies all listeners of the associated message-hub, that adaption begins / ends. More...
 
void adaption_ends ()
 notifies all listeners of the associated message-hub, that adaption begins / ends. More...
 
- Public Member Functions inherited from ug::GridObserver
virtual void elements_to_be_cleared (Grid *grid)
 
virtual ~GridObserver ()
 
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 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 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 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 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 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 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 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 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 TSelector::template traits< Edge >::iterator sel_edge_iter
 
typedef TSelector::template traits< Face >::iterator sel_face_iter
 
typedef TSelector::template traits< Volume >::iterator sel_vol_iter
 
typedef TSelector::template traits< Vertex >::iterator sel_vrt_iter
 

Protected Member Functions

template<class TElem >
void add_hmark (TElem *elem, HNodeRefMarks mark)
 
bool adjusting_ref_marks () const
 
virtual void assign_hnode_marks ()
 
virtual void collect_objects_for_refine ()
 marks unmarked elements that have to be refined due to marked neighbors. More...
 
virtual bool continue_collect_objects_for_refine (bool continueRequired)
 
virtual Vertexget_center_vertex (Edge *e)=0
 Returns the vertex associated with the edge. More...
 
virtual Vertexget_center_vertex (Face *f)=0
 Returns the vertex associated with the face. More...
 
TSelector & get_refmark_selector ()
 returns the selector which is internally used to mark elements. More...
 
bool is_marked (Edge *e)
 
bool is_marked (Face *f)
 
bool is_marked (Vertex *v)
 
bool is_marked (Volume *v)
 
template<class TElem >
bool marked_to_constrained (TElem *elem) const
 
template<class TElem >
bool marked_to_constraining (TElem *elem) const
 
template<class TElem >
bool marked_to_normal (TElem *elem) const
 
void perform_refinement ()
 performs refinement on the marked elements. More...
 
virtual void post_refine ()
 
virtual void pre_refine ()
 
virtual bool refinement_is_allowed (Edge *elem)
 a callback that allows to deny refinement of special edges More...
 
virtual bool refinement_is_allowed (Face *elem)
 a callback that allows to deny refinement of special faces More...
 
virtual bool refinement_is_allowed (Vertex *elem)
 a callback that allows to deny refinement of special vertices More...
 
virtual bool refinement_is_allowed (Volume *elem)
 a callback that allows to deny refinement of special volumes More...
 
template<class TElem >
bool remove_coarsen_marks ()
 removes coarsen marks from the selection More...
 
template<class TElem >
void remove_hmark (TElem *elem, uint mark)
 
virtual void set_center_vertex (Edge *e, Vertex *v)=0
 Associates a vertex with the edge (pure virtual). More...
 
virtual void set_center_vertex (Face *f, Vertex *v)=0
 Associates a vertex with the face (pure virtual). More...
 
void set_grid (typename TSelector::grid_type *grid)
 performs registration and deregistration at a grid. More...
 
virtual void process_constrained_vertex (ConstrainedVertex *cdv)
 called to refine the specified element. More...
 
virtual void process_constrained_edge (ConstrainedEdge *cde)
 called to refine the specified element. More...
 
virtual void process_constraining_edge (ConstrainingEdge *cge)
 called to refine the specified element. More...
 
virtual void refine_edge_with_normal_vertex (Edge *e, Vertex **newCornerVrts=NULL)
 called to refine the specified element. More...
 
virtual void refine_edge_with_hanging_vertex (Edge *e, Vertex **newCornerVrts=NULL)
 called to refine the specified element. More...
 
virtual void process_constrained_face (ConstrainedFace *cdf)
 called to refine the specified element. More...
 
virtual void process_constraining_face (ConstrainingFace *cgf)
 called to refine the specified element. More...
 
virtual void refine_face_with_normal_vertex (Face *f, Vertex **newCornerVrts=NULL)
 called to refine the specified element. More...
 
virtual void refine_face_with_hanging_vertex (Face *f, Vertex **newCornerVrts=NULL)
 called to refine the specified element. More...
 
virtual void refine_volume_with_normal_vertex (Volume *v, Vertex **newVolumeVrts=NULL)
 called to refine the specified element. More...
 
- Protected Member Functions inherited from ug::IRefiner
virtual void num_marked_edges_local (std::vector< int > &numMarkedEdgesOut)=0
 returns the number of locally marked edges on all levels of the hierarchy More...
 
virtual void num_marked_faces_local (std::vector< int > &numMarkedFacesOut)=0
 returns the number of locally marked faces on all levels of the hierarchy More...
 
virtual void num_marked_volumes_local (std::vector< int > &numMarkedVolsOut)=0
 returns the number of locally marked volumes on all levels of the hierarchy More...
 
virtual bool perform_coarsening ()
 Called by coarsen(). Derived classes sould implement their coarsen algorithm here. More...
 
void set_message_hub (SPMessageHub msgHub)
 sets the message hub. More...
 

Protected Attributes

std::vector< SPIRefMarkAdjusterm_refMarkAdjusters
 
TSelector m_selMarkedElements
 
- Protected Attributes inherited from ug::IRefiner
bool m_adaptionIsActive
 
std::string m_adjustedMarksDebugFilename
 
bool m_debuggingEnabled
 
SPMessageHub m_messageHub
 
int m_msgIdAdaption
 
SPRefinementProjector m_projector
 

Private Member Functions

 HangingNodeRefinerBase (const HangingNodeRefinerBase &)
 private copy constructor to avoid copy construction More...
 

Private Attributes

bool m_adjustingRefMarks
 true during collect_objects_for_refine More...
 
std::vector< Edge * > m_newlyMarkedRefEdges
 
std::vector< Face * > m_newlyMarkedRefFaces
 
std::vector< Volume * > m_newlyMarkedRefVols
 
std::vector< Vertex * > m_newlyMarkedRefVrts
 
bool m_nodeDependencyOrder1
 
Gridm_pGrid
 

Detailed Description

template<class TSelector>
class ug::HangingNodeRefinerBase< TSelector >

Base class for a hanging-node refiner.

A hanging node refiner allows to adaptively refine grid elements by inserting hanging nodes at points where T-junctions would occur (ug::HangingVertex). If further refinement is performed, the refiner automatically takes care to adjust the refined area, so that no more than 1 hanging vertex resides on any edge.

Each edge on which a hanging node lies is replaced by a ug::ConstrainingEdge. Child-edges of a constraining edge have the type ug::ConstrainedEdge.

If volumes exist, the refiner may also create elements of type ug::ConstrainingTriangle or ug::ConstrainingQuadrilateral, as well as ug::ConstrainedTriangle and ug::ConstrainedQuadrilateral.

Use the mark methods to mark elements which shall be refined. A call to refine will then perform the refinement and clear all marks.

Please note: If you're using a hanging node refiner, you have to be careful to not destroy the connections between hanging-vertices, and constrained / constraining objects.

Specializations of this class exist to support hanging node refinement on flat and on hierarchical grids.

Note that you may set a refinement callback, which will be responsible to calculate new positions of newly created vertices. By default a linear refinement callback is created for one of the standard position attachments (ug::aPosition, ug::aPosition2, ug::aPosition1 - whichever is present).

This class can't be instantiated directly. Use one of its specializations instead.

For Developers: Note that HangingNodeRefinerBase stores flags together with the refinement marks. Precisely the value 128 is used to flag whether an element has to be refined using hanging-node-rules.

See also
ug::HangingNodeRefiner_Grid, ug::HangingNodeRefiner_MultiGrid

Member Typedef Documentation

◆ sel_edge_iter

template<class TSelector >
typedef TSelector::template traits<Edge>::iterator ug::HangingNodeRefinerBase< TSelector >::sel_edge_iter
protected

◆ sel_face_iter

template<class TSelector >
typedef TSelector::template traits<Face>::iterator ug::HangingNodeRefinerBase< TSelector >::sel_face_iter
protected

◆ sel_vol_iter

template<class TSelector >
typedef TSelector::template traits<Volume>::iterator ug::HangingNodeRefinerBase< TSelector >::sel_vol_iter
protected

◆ sel_vrt_iter

template<class TSelector >
typedef TSelector::template traits<Vertex>::iterator ug::HangingNodeRefinerBase< TSelector >::sel_vrt_iter
protected

◆ selector_t

template<class TSelector >
typedef TSelector ug::HangingNodeRefinerBase< TSelector >::selector_t

Member Enumeration Documentation

◆ HNodeRefMarks

template<class TSelector >
enum ug::HangingNodeRefinerBase::HNodeRefMarks

additional mark to RefinementMarks. Used to flag whether an element will be refined with constraining.

Enumerator
HNRM_TO_NORMAL 
HNRM_TO_CONSTRAINED 
HNRM_TO_CONSTRAINING 
HNRM_MAX 

Constructor & Destructor Documentation

◆ HangingNodeRefinerBase() [1/2]

◆ ~HangingNodeRefinerBase()

template<class TSelector >
ug::HangingNodeRefinerBase< TSelector >::~HangingNodeRefinerBase
virtual

◆ HangingNodeRefinerBase() [2/2]

template<class TSelector >
ug::HangingNodeRefinerBase< TSelector >::HangingNodeRefinerBase ( const HangingNodeRefinerBase< TSelector > &  )
private

private copy constructor to avoid copy construction

Member Function Documentation

◆ add_hmark()

template<class TSelector >
template<class TElem >
template void ug::HangingNodeRefinerBase< TSelector >::add_hmark ( TElem *  elem,
HNodeRefMarks  mark 
)
protected

◆ add_ref_mark_adjuster()

template<class TSelector >
void ug::HangingNodeRefinerBase< TSelector >::add_ref_mark_adjuster ( SPIRefMarkAdjuster  adjuster)
inline

Add a refmark adjuster, which will be called while marks are adjusted during refinement / coarsening.

References ug::HangingNodeRefinerBase< TSelector >::m_refMarkAdjusters.

Referenced by ug::AddHorizontalAnisotropyAdjuster(), ug::AddShadowCopyAdjuster(), and ug::HangingNodeRefinerBase< TSelector >::HangingNodeRefinerBase().

◆ adjusting_ref_marks()

template<class TSelector >
bool ug::HangingNodeRefinerBase< TSelector >::adjusting_ref_marks ( ) const
inlineprotected

◆ assign_hnode_marks()

template<class TSelector >
void ug::HangingNodeRefinerBase< TSelector >::assign_hnode_marks
protectedvirtual

◆ clear_marks()

template<class TSelector >
void ug::HangingNodeRefinerBase< TSelector >::clear_marks
virtual

clears all marks. Default implementation is empty

Reimplemented from ug::IRefiner.

◆ collect_objects_for_refine()

template<class TSelector >
void ug::HangingNodeRefinerBase< TSelector >::collect_objects_for_refine
protectedvirtual

marks unmarked elements that have to be refined due to marked neighbors.

all elements that have to be refined will be written to the passed queues. Note that this will most likely be more elements than just the marked ones.

This method is virtual to allow derivates to mark additional elements as required. Normally a a derived class will first call the method of its this class and the perform its own operations.

Reimplemented in ug::HangingNodeRefiner_Grid.

References HNODE_PROFILE_FUNC, ug::LIB_GRID, UG_DLOG, and UG_LOG.

◆ continue_collect_objects_for_refine()

template<class TSelector >
virtual bool ug::HangingNodeRefinerBase< TSelector >::continue_collect_objects_for_refine ( bool  continueRequired)
inlineprotectedvirtual

after each iteration in collet_objects_for_refine, this method determines whether the iteration shall be continued. Important for parallel refiners. The default implementation simply returns the specified value. This is fine for serial environments.

Reimplemented in ug::ParallelHangingNodeRefiner_MultiGrid.

◆ enable_node_dependency_order_1()

template<class TSelector >
void ug::HangingNodeRefinerBase< TSelector >::enable_node_dependency_order_1 ( bool  bEnable)

enables or disables node-dependency-order-1.

If enabled, hanging nodes may only depend on non-hanging nodes. An edge containing a hanging node thus will not have a hanging-node as a corner vertex.

Enabled by default.

◆ get_center_vertex() [1/2]

template<class TSelector >
virtual Vertex* ug::HangingNodeRefinerBase< TSelector >::get_center_vertex ( Edge e)
protectedpure virtual

Returns the vertex associated with the edge.

pure virtual method. Has to return the center vertex which was set to the edge via set_center_vertex. If no vertex was set, NULL has to be returned.

Implemented in ug::HangingNodeRefiner_MultiGrid, and ug::HangingNodeRefiner_Grid.

◆ get_center_vertex() [2/2]

template<class TSelector >
virtual Vertex* ug::HangingNodeRefinerBase< TSelector >::get_center_vertex ( Face f)
protectedpure virtual

Returns the vertex associated with the face.

pure virtual method. Has to return the center vertex which was set to the face via set_center_vertex. If no vertex was set, NULL has to be returned.

Implemented in ug::HangingNodeRefiner_MultiGrid, and ug::HangingNodeRefiner_Grid.

◆ get_mark() [1/4]

template<class TSelector >
RefinementMark ug::HangingNodeRefinerBase< TSelector >::get_mark ( Edge e) const
virtual

Returns the mark of a given element.

Reimplemented from ug::IRefiner.

References ug::RM_CLOSURE, ug::RM_COARSEN, ug::RM_DUMMY, ug::RM_LOCAL, and ug::RM_REFINE.

◆ get_mark() [2/4]

template<class TSelector >
RefinementMark ug::HangingNodeRefinerBase< TSelector >::get_mark ( Face f) const
virtual

Returns the mark of a given element.

Reimplemented from ug::IRefiner.

References ug::RM_CLOSURE, ug::RM_COARSEN, ug::RM_DUMMY, ug::RM_LOCAL, and ug::RM_REFINE.

◆ get_mark() [3/4]

template<class TSelector >
RefinementMark ug::HangingNodeRefinerBase< TSelector >::get_mark ( Vertex v) const
virtual

Returns the mark of a given element.

Reimplemented from ug::IRefiner.

References ug::RM_CLOSURE, ug::RM_COARSEN, ug::RM_DUMMY, ug::RM_LOCAL, and ug::RM_REFINE.

◆ get_mark() [4/4]

template<class TSelector >
RefinementMark ug::HangingNodeRefinerBase< TSelector >::get_mark ( Volume v) const
virtual

Returns the mark of a given element.

Reimplemented from ug::IRefiner.

References ug::RM_CLOSURE, ug::RM_COARSEN, ug::RM_DUMMY, ug::RM_LOCAL, and ug::RM_REFINE.

◆ get_refmark_selector()

template<class TSelector >
TSelector& ug::HangingNodeRefinerBase< TSelector >::get_refmark_selector ( )
inlineprotected

returns the selector which is internally used to mark elements.

Be sure to use it carefully!

References ug::HangingNodeRefinerBase< TSelector >::m_selMarkedElements.

◆ grid_to_be_destroyed()

template<class TSelector >
void ug::HangingNodeRefinerBase< TSelector >::grid_to_be_destroyed ( Grid grid)
virtual

◆ is_marked() [1/4]

template<class TSelector >
bool ug::HangingNodeRefinerBase< TSelector >::is_marked ( Edge e)
inlineprotected

◆ is_marked() [2/4]

template<class TSelector >
bool ug::HangingNodeRefinerBase< TSelector >::is_marked ( Face f)
inlineprotected

◆ is_marked() [3/4]

template<class TSelector >
bool ug::HangingNodeRefinerBase< TSelector >::is_marked ( Vertex v)
inlineprotected

◆ is_marked() [4/4]

template<class TSelector >
bool ug::HangingNodeRefinerBase< TSelector >::is_marked ( Volume v)
inlineprotected

◆ mark() [1/10]

template<class TSelector >
template<class TIterator >
void ug::IRefiner::mark ( class TIterator  )
inline

marks all elements between iterBegin and iterEnd.

the value-type of TIterator has to be a pointer to a type derived from either Edge, Face or Volume.

◆ mark() [2/10]

template<class TSelector >
virtual bool ug::IRefiner::mark
inline

◆ mark() [3/10]

template<class TSelector >
bool ug::HangingNodeRefinerBase< TSelector >::mark ( Edge e,
RefinementMark  refMark = RM_REFINE 
)
virtual

Marks a element for refinement.

Reimplemented from ug::IRefiner.

Reimplemented in ug::HangingNodeRefiner_Grid.

◆ mark() [4/10]

template<class TSelector >
virtual bool ug::IRefiner::mark
inline

◆ mark() [5/10]

template<class TSelector >
bool ug::HangingNodeRefinerBase< TSelector >::mark ( Face f,
RefinementMark  refMark = RM_REFINE 
)
virtual

Marks a element for refinement.

Reimplemented from ug::IRefiner.

Reimplemented in ug::HangingNodeRefiner_Grid.

References ug::RM_CLOSURE, ug::RM_DUMMY, ug::RM_LOCAL, and ug::RM_REFINE.

◆ mark() [6/10]

template<class TSelector >
bool ug::IRefiner::mark

marks the specified geometric object

The default implementation casts the object to a more concrete type (Vertex, Edge, Face, Volume) and calls the appropriate mark method.

◆ mark() [7/10]

template<class TSelector >
virtual bool ug::IRefiner::mark
inline

Marks an element for refinement. Default implementation is empty.

◆ mark() [8/10]

template<class TSelector >
bool ug::HangingNodeRefinerBase< TSelector >::mark ( Vertex v,
RefinementMark  refMark = RM_REFINE 
)
virtual

Marks a element for refinement.

Reimplemented from ug::IRefiner.

Reimplemented in ug::HangingNodeRefiner_Grid.

◆ mark() [9/10]

template<class TSelector >
virtual bool ug::IRefiner::mark
inline

◆ mark() [10/10]

template<class TSelector >
bool ug::HangingNodeRefinerBase< TSelector >::mark ( Volume v,
RefinementMark  refMark = RM_REFINE 
)
virtual

Marks a element for refinement.

Reimplemented from ug::IRefiner.

Reimplemented in ug::HangingNodeRefiner_Grid.

References ug::RM_CLOSURE, ug::RM_DUMMY, ug::RM_LOCAL, and ug::RM_REFINE.

◆ mark_neighborhood()

template<class TSelector >
void ug::HangingNodeRefinerBase< TSelector >::mark_neighborhood ( size_t  numIterations,
RefinementMark  refMark,
bool  sideNbrsOnly 
)
virtual

Marks the neighborhood of the current selection.

See also
ISelector::mark_neighborhood

Reimplemented from ug::IRefiner.

References ug::Grid::num_volumes(), and pcl::OneProcTrue().

◆ marked_adaptive()

template<class TSelector >
template<class TElem >
bool ug::HangingNodeRefinerBase< TSelector >::marked_adaptive ( TElem *  elem) const
inline

◆ marked_coarsen()

template<class TSelector >
template<class TElem >
bool ug::HangingNodeRefinerBase< TSelector >::marked_coarsen ( TElem *  elem) const
inline

◆ marked_refine() [1/2]

template<class TSelector >
bool ug::HangingNodeRefinerBase< TSelector >::marked_refine ( Edge elem) const
inline

◆ marked_refine() [2/2]

template<class TSelector >
template<class TElem >
bool ug::HangingNodeRefinerBase< TSelector >::marked_refine ( TElem *  elem) const
inline

◆ marked_regular()

template<class TSelector >
template<class TElem >
bool ug::HangingNodeRefinerBase< TSelector >::marked_regular ( TElem *  elem) const
inline

◆ marked_to_constrained()

template<class TSelector >
template<class TElem >
bool ug::HangingNodeRefinerBase< TSelector >::marked_to_constrained ( TElem *  elem) const
inlineprotected

◆ marked_to_constraining()

template<class TSelector >
template<class TElem >
bool ug::HangingNodeRefinerBase< TSelector >::marked_to_constraining ( TElem *  elem) const
inlineprotected

◆ marked_to_normal()

template<class TSelector >
template<class TElem >
bool ug::HangingNodeRefinerBase< TSelector >::marked_to_normal ( TElem *  elem) const
inlineprotected

◆ node_dependency_order_1_enabled()

template<class TSelector >
bool ug::HangingNodeRefinerBase< TSelector >::node_dependency_order_1_enabled ( )
inline

enables or disables node-dependency-order-1.

If enabled, hanging nodes may only depend on non-hanging nodes. An edge containing a hanging node thus will not have a hanging-node as a corner vertex.

Enabled by default.

References ug::HangingNodeRefinerBase< TSelector >::m_nodeDependencyOrder1.

◆ perform_refinement()

template<class TSelector >
void ug::HangingNodeRefinerBase< TSelector >::perform_refinement
protectedvirtual

performs refinement on the marked elements.

The grid's message hub is informed using a "GridAdaption" message, passing an instance of GridMessage_Adapation, with values GMAT_HNODE_REFINEMENT_BEGINS and GMAT_HNODE_REFINEMENT_ENDS. See lib_grid/lib_grid_messages.h for more details.

as defined in lib_grid/

automatically extends the refinement to avoid multiple hanging nodes on a single edge or face.

refine calls several virtual methods, which allow to influence the refinement process. Most notably the methods

  • collect_objects_for_refine
  • pre_refine
    • post_refine

are called in the given order. During element refinement further virtual methods are called, which perform the actual element refinement.

Implements ug::IRefiner.

References ug::Grid::enable_options(), ug::GMAT_HNODE_REFINEMENT_BEGINS, ug::GMAT_HNODE_REFINEMENT_ENDS, ug::GRIDOPT_AUTOGENERATE_SIDES, HNODE_PROFILE_BEGIN, HNODE_PROFILE_END, ug::LIB_GRID, LOG, ug::Grid::option_is_enabled(), ug::RM_REFINE, and UG_DLOG.

◆ post_refine()

template<class TSelector >
virtual void ug::HangingNodeRefinerBase< TSelector >::post_refine ( )
inlineprotectedvirtual

called by refine after refinement is done.

Reimplemented in ug::HangingNodeRefiner_Grid, and ug::ParallelHangingNodeRefiner_MultiGrid.

◆ pre_refine()

template<class TSelector >
virtual void ug::HangingNodeRefinerBase< TSelector >::pre_refine ( )
inlineprotectedvirtual

called by refine after collect_objects_for_refine and before actual refinement begins.

Reimplemented in ug::HangingNodeRefiner_MultiGrid, and ug::ParallelHangingNodeRefiner_MultiGrid.

◆ process_constrained_edge()

template<class TSelector >
void ug::HangingNodeRefinerBase< TSelector >::process_constrained_edge ( ConstrainedEdge cde)
protectedvirtual

called to refine the specified element.

Refines the element. Corner vertices of the newly created element can be specified through newCornerVrts. newCornerVrts = NULL (default) means, that the corner vertices of the original element shall be taken.

References ug::ConstrainingEdge::clear_constrained_edges(), ug::ConstrainingFace::clear_constrained_edges(), ug::Grid::create_and_replace(), ug::EDGE, ug::FACE, ug::ConstrainedEdge::get_constraining_object(), ug::ConstrainedEdge::get_parent_base_object_id(), and UG_ASSERT.

◆ process_constrained_face()

template<class TSelector >
void ug::HangingNodeRefinerBase< TSelector >::process_constrained_face ( ConstrainedFace cdf)
protectedvirtual

called to refine the specified element.

Refines the element. Corner vertices of the newly created element can be specified through newCornerVrts. newCornerVrts = NULL (default) means, that the corner vertices of the original element shall be taken.

References ug::ConstrainingFace::clear_constrained_faces(), ug::Grid::create_and_replace(), ug::FACE, ug::ConstrainedFace::get_constraining_object(), ug::ConstrainedFace::get_parent_base_object_id(), ug::FaceVertices::num_vertices(), and UG_ASSERT.

◆ process_constrained_vertex()

template<class TSelector >
void ug::HangingNodeRefinerBase< TSelector >::process_constrained_vertex ( ConstrainedVertex cdv)
protectedvirtual

called to refine the specified element.

Refines the element. Corner vertices of the newly created element can be specified through newCornerVrts. newCornerVrts = NULL (default) means, that the corner vertices of the original element shall be taken.

References ug::ConstrainingEdge::clear_constrained_vertices(), ug::ConstrainingFace::clear_constrained_vertices(), ug::Grid::create_and_replace(), ug::EDGE, ug::FACE, ug::ConstrainedVertex::get_constraining_object(), ug::ConstrainedVertex::get_parent_base_object_id(), and UG_ASSERT.

◆ process_constraining_edge()

template<class TSelector >
void ug::HangingNodeRefinerBase< TSelector >::process_constraining_edge ( ConstrainingEdge cge)
protectedvirtual

called to refine the specified element.

Refines the element. Corner vertices of the newly created element can be specified through newCornerVrts. newCornerVrts = NULL (default) means, that the corner vertices of the original element shall be taken.

Reimplemented in ug::HangingNodeRefiner_MultiGrid, and ug::HangingNodeRefiner_Grid.

◆ process_constraining_face()

template<class TSelector >
void ug::HangingNodeRefinerBase< TSelector >::process_constraining_face ( ConstrainingFace cgf)
protectedvirtual

called to refine the specified element.

Refines the element. Corner vertices of the newly created element can be specified through newCornerVrts. newCornerVrts = NULL (default) means, that the corner vertices of the original element shall be taken.

Reimplemented in ug::HangingNodeRefiner_Grid.

References ug::Grid::create_and_replace(), ug::FaceVertices::num_vertices(), and UG_ASSERT.

◆ refine_edge_with_hanging_vertex()

template<class TSelector >
void ug::HangingNodeRefinerBase< TSelector >::refine_edge_with_hanging_vertex ( Edge e,
Vertex **  newCornerVrts = NULL 
)
protectedvirtual

called to refine the specified element.

Refines the element. Corner vertices of the newly created element can be specified through newCornerVrts. newCornerVrts = NULL (default) means, that the corner vertices of the original element shall be taken.

Reimplemented in ug::HangingNodeRefiner_MultiGrid.

References ug::ConstrainingEdge::add_constrained_object(), ug::Grid::create(), ug::Grid::create_and_replace(), ug::ConstrainedEdge::set_constraining_object(), ug::ConstrainingEdge::type_match(), UG_ASSERT, and ug::EdgeVertices::vertex().

◆ refine_edge_with_normal_vertex()

template<class TSelector >
void ug::HangingNodeRefinerBase< TSelector >::refine_edge_with_normal_vertex ( Edge e,
Vertex **  newCornerVrts = NULL 
)
protectedvirtual

called to refine the specified element.

Refines the element. Corner vertices of the newly created element can be specified through newCornerVrts. newCornerVrts = NULL (default) means, that the corner vertices of the original element shall be taken.

Reimplemented in ug::HangingNodeRefiner_MultiGrid, and ug::HangingNodeRefiner_Grid.

References ug::Grid::create(), ug::Grid::create_by_cloning(), ug::Edge::refine(), ug::Grid::register_element(), and UG_ASSERT.

◆ refine_face_with_hanging_vertex()

template<class TSelector >
void ug::HangingNodeRefinerBase< TSelector >::refine_face_with_hanging_vertex ( Face f,
Vertex **  newCornerVrts = NULL 
)
protectedvirtual

◆ refine_face_with_normal_vertex()

template<class TSelector >
void ug::HangingNodeRefinerBase< TSelector >::refine_face_with_normal_vertex ( Face f,
Vertex **  newCornerVrts = NULL 
)
protectedvirtual

called to refine the specified element.

Refines the element. Corner vertices of the newly created element can be specified through newCornerVrts. newCornerVrts = NULL (default) means, that the corner vertices of the original element shall be taken.

Reimplemented in ug::HangingNodeRefiner_MultiGrid, and ug::HangingNodeRefiner_Grid.

References ug::Grid::create_by_cloning(), ug::ElementDebugInfo(), ug::Grid::get_edge(), ug::MAX_FACE_VERTICES, ug::Face::num_edges(), ug::FaceVertices::num_vertices(), ug::Face::refine(), ug::Grid::register_element(), ug::RM_REFINE, ug::FaceDescriptor::set_vertex(), and UG_ASSERT.

◆ refine_volume_with_normal_vertex()

template<class TSelector >
void ug::HangingNodeRefinerBase< TSelector >::refine_volume_with_normal_vertex ( Volume v,
Vertex **  newVolumeVrts = NULL 
)
protectedvirtual

called to refine the specified element.

Refines the element. Corner vertices of the newly created element can be specified through newCornerVrts. newCornerVrts = NULL (default) means, that the corner vertices of the original element shall be taken.

Reimplemented in ug::HangingNodeRefiner_MultiGrid, and ug::HangingNodeRefiner_Grid.

References ug::Grid::create_by_cloning(), ug::Grid::get_edge(), ug::Grid::get_face(), ug::GetGridObjectCenter(), ug::Volume::num_edges(), ug::Volume::num_faces(), ug::FaceVertices::num_vertices(), ug::VolumeVertices::num_vertices(), ug::Volume::refine(), ug::Grid::register_element(), ug::VolumeDescriptor::set_vertex(), UG_ASSERT, UG_COND_THROW, and ug::VolumeVertices::vertex().

◆ refinement_is_allowed() [1/4]

template<class TSelector >
virtual bool ug::HangingNodeRefinerBase< TSelector >::refinement_is_allowed ( Edge elem)
inlineprotectedvirtual

a callback that allows to deny refinement of special edges

Reimplemented in ug::HangingNodeRefiner_MultiGrid, and ug::ParallelHangingNodeRefiner_MultiGrid.

◆ refinement_is_allowed() [2/4]

template<class TSelector >
virtual bool ug::HangingNodeRefinerBase< TSelector >::refinement_is_allowed ( Face elem)
inlineprotectedvirtual

a callback that allows to deny refinement of special faces

Reimplemented in ug::HangingNodeRefiner_MultiGrid, and ug::ParallelHangingNodeRefiner_MultiGrid.

◆ refinement_is_allowed() [3/4]

template<class TSelector >
virtual bool ug::HangingNodeRefinerBase< TSelector >::refinement_is_allowed ( Vertex elem)
inlineprotectedvirtual

a callback that allows to deny refinement of special vertices

Reimplemented in ug::HangingNodeRefiner_MultiGrid, and ug::ParallelHangingNodeRefiner_MultiGrid.

◆ refinement_is_allowed() [4/4]

template<class TSelector >
virtual bool ug::HangingNodeRefinerBase< TSelector >::refinement_is_allowed ( Volume elem)
inlineprotectedvirtual

a callback that allows to deny refinement of special volumes

Reimplemented in ug::HangingNodeRefiner_MultiGrid, and ug::ParallelHangingNodeRefiner_MultiGrid.

◆ remove_coarsen_marks()

template<class TSelector >
template<class TElem >
bool ug::HangingNodeRefinerBase< TSelector >::remove_coarsen_marks
protected

removes coarsen marks from the selection

Note that derived classes are not informed about those deselections!

References ug::RM_COARSEN.

◆ remove_hmark()

template<class TSelector >
template<class TElem >
void ug::HangingNodeRefinerBase< TSelector >::remove_hmark ( TElem *  elem,
uint  mark 
)
protected

◆ save_marks_to_file()

◆ set_center_vertex() [1/2]

template<class TSelector >
virtual void ug::HangingNodeRefinerBase< TSelector >::set_center_vertex ( Edge e,
Vertex v 
)
protectedpure virtual

Associates a vertex with the edge (pure virtual).

Implemented in ug::HangingNodeRefiner_MultiGrid, and ug::HangingNodeRefiner_Grid.

◆ set_center_vertex() [2/2]

template<class TSelector >
virtual void ug::HangingNodeRefinerBase< TSelector >::set_center_vertex ( Face f,
Vertex v 
)
protectedpure virtual

Associates a vertex with the face (pure virtual).

Implemented in ug::HangingNodeRefiner_MultiGrid, and ug::HangingNodeRefiner_Grid.

◆ set_grid()

template<class TSelector >
void ug::HangingNodeRefinerBase< TSelector >::set_grid ( typename TSelector::grid_type *  grid)
protected

performs registration and deregistration at a grid.

Sets a grid and performs registration at the given grid. The associated selector is also initialised with the given grid. It is cruical to call this method or everything will fail.

call set_grid(NULL) to unregister the observer from a grid.

Please note that this method is not declared virtual, since it is called during construction and destruction.

References ug::OT_GRID_OBSERVER.

Member Data Documentation

◆ m_adjustingRefMarks

template<class TSelector >
bool ug::HangingNodeRefinerBase< TSelector >::m_adjustingRefMarks
private

true during collect_objects_for_refine

Referenced by ug::HangingNodeRefinerBase< TSelector >::adjusting_ref_marks().

◆ m_newlyMarkedRefEdges

template<class TSelector >
std::vector<Edge*> ug::HangingNodeRefinerBase< TSelector >::m_newlyMarkedRefEdges
private

◆ m_newlyMarkedRefFaces

template<class TSelector >
std::vector<Face*> ug::HangingNodeRefinerBase< TSelector >::m_newlyMarkedRefFaces
private

◆ m_newlyMarkedRefVols

template<class TSelector >
std::vector<Volume*> ug::HangingNodeRefinerBase< TSelector >::m_newlyMarkedRefVols
private

◆ m_newlyMarkedRefVrts

template<class TSelector >
std::vector<Vertex*> ug::HangingNodeRefinerBase< TSelector >::m_newlyMarkedRefVrts
private

◆ m_nodeDependencyOrder1

template<class TSelector >
bool ug::HangingNodeRefinerBase< TSelector >::m_nodeDependencyOrder1
private

◆ m_pGrid

template<class TSelector >
Grid* ug::HangingNodeRefinerBase< TSelector >::m_pGrid
private

◆ m_refMarkAdjusters

template<class TSelector >
std::vector<SPIRefMarkAdjuster> ug::HangingNodeRefinerBase< TSelector >::m_refMarkAdjusters
protected

◆ m_selMarkedElements


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