ug4
ug::GlobalFracturedMediaRefiner Class Reference

#include <global_fractured_media_refiner.h>

+ Inheritance diagram for ug::GlobalFracturedMediaRefiner:

Public Member Functions

virtual bool adaptivity_supported () const
 returns whether the refiner is able to perform adaptive refinement More...
 
void assign_grid (MultiGrid &mg)
 
void assign_grid (MultiGrid *mg)
 
virtual bool coarsening_supported () const
 returns true, if the refiner supports coarsening. More...
 
virtual Gridget_associated_grid ()
 DEPRECIATED! Use grid(). Has to return the associated grid. Pure virtual. More...
 
 GlobalFracturedMediaRefiner (MultiGrid &mg, SPRefinementProjector projector=SPNULL)
 
 GlobalFracturedMediaRefiner (SPRefinementProjector projector=SPNULL)
 
virtual Gridgrid ()
 Returns the grid associated with the refiner. More...
 
virtual void grid_to_be_destroyed (Grid *grid)
 
bool is_fracture (int subInd)
 returns whether the specified subset is regarded as a fracture. More...
 
void mark_as_fracture (int subInd, bool isFracture)
 sets the position attachment More...
 
virtual MultiGridmulti_grid ()
 
virtual bool save_marks_to_file (const char *filename)
 Writes the associated grid and marks to a file. Pure virtual. More...
 
void set_subset_handler (ISubsetHandler &sh)
 
void set_subset_handler (ISubsetHandler *sh)
 
virtual ~GlobalFracturedMediaRefiner ()
 
- Public Member Functions inherited from ug::IRefiner
virtual void clear_marks ()
 clears all marks. Default implementation is empty More...
 
bool coarsen ()
 Performs coarsening on the elements marked RM_COARSEN. More...
 
bool debugging_enabled () const
 
void enable_debugging (bool enable)
 
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...
 
 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...
 
virtual void mark_neighborhood (size_t numIterations, RefinementMark refMark, bool sideNbrsOnly)
 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 bool mark (Vertex *v, RefinementMark refMark=RM_REFINE)
 Marks an element for refinement. Default implementation is empty. More...
 
virtual bool mark (Edge *e, RefinementMark refMark=RM_REFINE)
 Marks an element for refinement. Default implementation is empty. More...
 
virtual bool mark (Face *f, RefinementMark refMark=RM_REFINE)
 Marks an element for refinement. Default implementation is empty. More...
 
virtual bool mark (Volume *v, RefinementMark refMark=RM_REFINE)
 Marks an element for refinement. Default implementation is empty. More...
 
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...
 
virtual RefinementMark get_mark (Vertex *v) const
 Returns the mark of a given element. Default returns RM_REFINE. More...
 
virtual RefinementMark get_mark (Edge *e) const
 Returns the mark of a given element. Default returns RM_REFINE. More...
 
virtual RefinementMark get_mark (Face *f) const
 Returns the mark of a given element. Default returns RM_REFINE. More...
 
virtual RefinementMark get_mark (Volume *v) const
 Returns the mark of a given element. Default returns RM_REFINE. 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 Member Functions

virtual void adjust_marks ()
 called by perform_refinement to adjust the marks More...
 
template<class TElem >
void assign_elem_and_side_marks ()
 performs the actual marking More...
 
virtual void communicate_marks (BoolMarker &marker)
 Called by adjust_marks. Default implementation does nothing. More...
 
template<class TElem >
bool is_fracture_element (TElem *e)
 returns true if the specified element is a fracture element. More...
 
template<class TElem >
void mark_sides_of_marked_top_level_elements ()
 recursively marks sides of all marked top level elements of the given type More...
 
template<class TElem >
size_t num_marked (const std::vector< TElem * > &elems) const
 returns the number of marked entries More...
 
virtual void num_marked_edges_local (std::vector< int > &numMarkedEdgesOut)
 returns the number of (globally) marked edges on this level of the hierarchy More...
 
template<class TElem >
void num_marked_elems (std::vector< int > &numMarkedElemsOut)
 
virtual void num_marked_faces_local (std::vector< int > &numMarkedFacesOut)
 returns the number of (globally) marked faces on this level of the hierarchy More...
 
virtual void num_marked_volumes_local (std::vector< int > &numMarkedVolsOut)
 returns the number of (globally) marked volumes on this level of the hierarchy More...
 
virtual void perform_refinement ()
 performs refinement on the marked elements. More...
 
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...
 
virtual void refinement_step_begins ()
 this method helps derived classes to perform operations directly before actual element refinment is performed. More...
 
virtual void refinement_step_ends ()
 this method helps derived classes to perform operations directly after actual element refinment took place. More...
 
- Protected Member Functions inherited from ug::IRefiner
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

BoolMarker m_marker
 
MultiGridm_pMG
 
ISubsetHandlerm_pSH
 
std::vector< bool > m_subsetIsFracture
 
- 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
 

Detailed Description

If a subset shall be refined as a fracture, you may tell the refiner through its method mark_as_fracture. Make sure that the subset specified in this call, consists of two layers of elements. Pleas have a look at the literature for a more detailed description of a fractures topology. If you don't want to treat a subset as a fracture anymore (i.e. since the elements have a good aspect ratio after a couple of refinements), you may tell the refiner by setting the fracture mark to false using the method mark_as_fracture once again.

Constructor & Destructor Documentation

◆ GlobalFracturedMediaRefiner() [1/2]

ug::GlobalFracturedMediaRefiner::GlobalFracturedMediaRefiner ( SPRefinementProjector  projector = SPNULL)

◆ GlobalFracturedMediaRefiner() [2/2]

ug::GlobalFracturedMediaRefiner::GlobalFracturedMediaRefiner ( MultiGrid mg,
SPRefinementProjector  projector = SPNULL 
)

References assign_grid(), and m_pMG.

◆ ~GlobalFracturedMediaRefiner()

ug::GlobalFracturedMediaRefiner::~GlobalFracturedMediaRefiner ( )
virtual

Member Function Documentation

◆ adaptivity_supported()

virtual bool ug::GlobalFracturedMediaRefiner::adaptivity_supported ( ) const
inlinevirtual

returns whether the refiner is able to perform adaptive refinement

pure virtual!

Implements ug::IRefiner.

◆ adjust_marks()

void ug::GlobalFracturedMediaRefiner::adjust_marks ( )
protectedvirtual

called by perform_refinement to adjust the marks

Everything that shall be refined, should be marked in m_marker. Note that the method calls communicate_marks twice, to allow derived classes to e.g. communicate marks in a parallel environment. There thus shouldn't be a need to reimplement adjust_marks in a derived class.

References ug::Grid::edges_begin(), ug::Grid::edges_end(), m_marker, m_pMG, ug::BoolMarker::mark(), ug::MultiGrid::num(), UG_THROW, ug::Grid::vertices_begin(), and ug::Grid::vertices_end().

Referenced by perform_refinement().

◆ assign_elem_and_side_marks()

template<class TElem >
void ug::GlobalFracturedMediaRefiner::assign_elem_and_side_marks
protected

◆ assign_grid() [1/2]

void ug::GlobalFracturedMediaRefiner::assign_grid ( MultiGrid mg)

◆ assign_grid() [2/2]

◆ coarsening_supported()

virtual bool ug::GlobalFracturedMediaRefiner::coarsening_supported ( ) const
inlinevirtual

returns true, if the refiner supports coarsening.

pure virtual!

Implements ug::IRefiner.

◆ communicate_marks()

virtual void ug::GlobalFracturedMediaRefiner::communicate_marks ( BoolMarker marker)
inlineprotectedvirtual

Called by adjust_marks. Default implementation does nothing.

If you communicate marks (using an or operation) in this method, then the GlobalFracturedMediaRefiner should run fine in a parallel environment, too. The default implementation does nothing (that's fine for a serial environment).

Reimplemented in ug::ParallelGlobalFracturedMediaRefiner.

Referenced by assign_elem_and_side_marks().

◆ get_associated_grid()

virtual Grid* ug::GlobalFracturedMediaRefiner::get_associated_grid ( )
inlinevirtual

DEPRECIATED! Use grid(). Has to return the associated grid. Pure virtual.

Implements ug::IRefiner.

References m_pMG.

◆ grid()

virtual Grid* ug::GlobalFracturedMediaRefiner::grid ( )
inlinevirtual

Returns the grid associated with the refiner.

Pure virtual. Specify this method in derived classes!

Implements ug::IRefiner.

References m_pMG.

◆ grid_to_be_destroyed()

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

Reimplemented from ug::GridObserver.

References m_pMG.

◆ is_fracture()

bool ug::GlobalFracturedMediaRefiner::is_fracture ( int  subInd)

returns whether the specified subset is regarded as a fracture.

References m_subsetIsFracture.

Referenced by is_fracture_element().

◆ is_fracture_element()

template<class TElem >
bool ug::GlobalFracturedMediaRefiner::is_fracture_element ( TElem *  e)
inlineprotected

returns true if the specified element is a fracture element.

Note that this method does not check whether the underlying subset-handler is valid. Make sure to check that beforehand.

References ug::ISubsetHandler::get_subset_index(), is_fracture(), and m_pSH.

Referenced by assign_elem_and_side_marks(), and save_marks_to_file().

◆ mark_as_fracture()

void ug::GlobalFracturedMediaRefiner::mark_as_fracture ( int  subInd,
bool  isFracture 
)

sets the position attachment

If you don't explicitly set the position attachment through this method, the default position attachment is used, as returned by ug::GetDefaultPositionAttachment. if enabled, a subset will be regarded as a fracture. If a subset is regarded as a fracture, it will be refined appropriately. Please make sure, that the specified subset has a valid topology, as described in ug::GlobalFracturedMediaRefiner.

Parameters
subIndThe index of the subset whose property is set
isFracturetrue or false, indicating whether the subset shall be regarded as a fracture or not.

References m_subsetIsFracture.

◆ mark_sides_of_marked_top_level_elements()

template<class TElem >
void ug::GlobalFracturedMediaRefiner::mark_sides_of_marked_top_level_elements
protected

recursively marks sides of all marked top level elements of the given type

References ug::MultiGrid::begin(), ug::CollectAssociated(), ug::MultiGrid::end(), ug::BoolMarker::is_marked(), m_marker, m_pMG, ug::BoolMarker::mark(), ug::MultiGrid::num_levels(), and UG_THROW.

◆ multi_grid()

virtual MultiGrid* ug::GlobalFracturedMediaRefiner::multi_grid ( )
inlinevirtual

References m_pMG.

◆ num_marked()

template<class TElem >
size_t ug::GlobalFracturedMediaRefiner::num_marked ( const std::vector< TElem * > &  elems) const
protected

returns the number of marked entries

References ug::BoolMarker::is_marked(), and m_marker.

Referenced by save_marks_to_file().

◆ num_marked_edges_local()

void ug::GlobalFracturedMediaRefiner::num_marked_edges_local ( std::vector< int > &  numMarkedEdgesOut)
protectedvirtual

returns the number of (globally) marked edges on this level of the hierarchy

Implements ug::IRefiner.

◆ num_marked_elems()

template<class TElem >
void ug::GlobalFracturedMediaRefiner::num_marked_elems ( std::vector< int > &  numMarkedElemsOut)
protected

◆ num_marked_faces_local()

void ug::GlobalFracturedMediaRefiner::num_marked_faces_local ( std::vector< int > &  numMarkedFacesOut)
protectedvirtual

returns the number of (globally) marked faces on this level of the hierarchy

Implements ug::IRefiner.

◆ num_marked_volumes_local()

void ug::GlobalFracturedMediaRefiner::num_marked_volumes_local ( std::vector< int > &  numMarkedVolsOut)
protectedvirtual

returns the number of (globally) marked volumes on this level of the hierarchy

Implements ug::IRefiner.

◆ perform_refinement()

void ug::GlobalFracturedMediaRefiner::perform_refinement ( )
protectedvirtual

performs refinement on the marked elements.

Implements ug::IRefiner.

References adjust_marks(), ug::MultiGrid::begin(), ug::MultiGrid::create(), ug::MultiGrid::create_by_cloning(), ug::MultiGrid::enable_hierarchical_insertion(), ug::Grid::enable_options(), ug::MultiGrid::end(), ug::FACEOPT_AUTOGENERATE_EDGES, ug::MultiGrid::get_child_vertex(), ug::Grid::get_edge(), ug::Grid::get_face(), ug::MultiGrid::get_grid_objects(), GFDR_PROFILE, GFDR_PROFILE_END, GFDR_PROFILE_FUNC, ug::GMAT_GLOBAL_REFINEMENT_BEGINS, ug::GMAT_GLOBAL_REFINEMENT_ENDS, ug::MultiGrid::hierarchical_insertion_enabled(), ug::BoolMarker::is_marked(), ug::LIB_GRID, LOG, ug::IRefiner::m_adjustedMarksDebugFilename, m_marker, ug::IRefiner::m_messageHub, m_pMG, ug::IRefiner::m_projector, ug::MultiGrid::num(), ug::Face::num_edges(), ug::Volume::num_edges(), ug::Grid::num_faces(), ug::Volume::num_faces(), ug::MultiGrid::num_levels(), ug::FaceVertices::num_vertices(), ug::VolumeVertices::num_vertices(), ug::Grid::num_volumes(), ug::Grid::option_is_enabled(), ug::IRefiner::projector(), ug::Edge::refine(), ug::Face::refine(), ug::Volume::refine(), refinement_is_allowed(), refinement_step_begins(), refinement_step_ends(), ug::Grid::register_element(), ug::Grid::reserve(), save_marks_to_file(), ug::FaceDescriptor::set_num_vertices(), ug::FaceDescriptor::set_vertex(), ug::EdgeDescriptor::set_vertices(), UG_DLOG, UG_THROW, SmartPtr< T, FreePolicy >::valid(), ug::EdgeVertices::vertex(), ug::FaceVertices::vertex(), ug::VolumeVertices::vertex(), and ug::VOLOPT_AUTOGENERATE_FACES.

◆ refinement_is_allowed() [1/4]

virtual bool ug::GlobalFracturedMediaRefiner::refinement_is_allowed ( Edge elem)
inlineprotectedvirtual

a callback that allows to deny refinement of special edges

Reimplemented in ug::ParallelGlobalFracturedMediaRefiner.

◆ refinement_is_allowed() [2/4]

virtual bool ug::GlobalFracturedMediaRefiner::refinement_is_allowed ( Face elem)
inlineprotectedvirtual

a callback that allows to deny refinement of special faces

Reimplemented in ug::ParallelGlobalFracturedMediaRefiner.

◆ refinement_is_allowed() [3/4]

virtual bool ug::GlobalFracturedMediaRefiner::refinement_is_allowed ( Vertex elem)
inlineprotectedvirtual

a callback that allows to deny refinement of special vertices

Reimplemented in ug::ParallelGlobalFracturedMediaRefiner.

Referenced by assign_elem_and_side_marks(), and perform_refinement().

◆ refinement_is_allowed() [4/4]

virtual bool ug::GlobalFracturedMediaRefiner::refinement_is_allowed ( Volume elem)
inlineprotectedvirtual

a callback that allows to deny refinement of special volumes

Reimplemented in ug::ParallelGlobalFracturedMediaRefiner.

◆ refinement_step_begins()

virtual void ug::GlobalFracturedMediaRefiner::refinement_step_begins ( )
inlineprotectedvirtual

this method helps derived classes to perform operations directly before actual element refinment is performed.

Called from the refine() method in each refinement-iteration after collect_objects_for_refine(). Default implementation is empty.

Reimplemented in ug::ParallelGlobalFracturedMediaRefiner.

Referenced by perform_refinement().

◆ refinement_step_ends()

virtual void ug::GlobalFracturedMediaRefiner::refinement_step_ends ( )
inlineprotectedvirtual

this method helps derived classes to perform operations directly after actual element refinment took place.

Called from the refine() method in each refinement-iteration after all scheduled elements had been refined. The refine process will either terminate after this method or will start a new iteration, if new elements had been marked during refine. Default implementation is empty.

Reimplemented in ug::ParallelGlobalFracturedMediaRefiner.

Referenced by perform_refinement().

◆ save_marks_to_file()

bool ug::GlobalFracturedMediaRefiner::save_marks_to_file ( const char *  filename)
virtual

◆ set_subset_handler() [1/2]

void ug::GlobalFracturedMediaRefiner::set_subset_handler ( ISubsetHandler sh)
inline

References m_pSH.

◆ set_subset_handler() [2/2]

void ug::GlobalFracturedMediaRefiner::set_subset_handler ( ISubsetHandler sh)
inline

References m_pSH.

Referenced by ug::CreateGlobalFracturedDomainRefiner().

Member Data Documentation

◆ m_marker

◆ m_pMG

◆ m_pSH

ISubsetHandler* ug::GlobalFracturedMediaRefiner::m_pSH
protected

◆ m_subsetIsFracture

std::vector<bool> ug::GlobalFracturedMediaRefiner::m_subsetIsFracture
protected

Referenced by is_fracture(), and mark_as_fracture().


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