33 #ifndef __H__UG__REFINER_INTERFACE__
34 #define __H__UG__REFINER_INTERFACE__
115 template <
class TElem>
121 template <
class TElem>
127 template <
class TElem>
192 size_t numIterations,
194 bool sideNbrsOnly) {}
212 template <
class TIterator>
213 void mark(
const TIterator& iterBegin,
const TIterator& iterEnd,
216 TIterator iter = iterBegin;
217 while(iter != iterEnd){
218 mark(*iter, refMark);
Base-class for edges.
Definition: grid_base_objects.h:397
Faces are 2-dimensional objects.
Definition: grid_base_objects.h:510
Manages the elements of a grid and their interconnection.
Definition: grid.h:132
The base class for all geometric objects, such as vertices, edges, faces, volumes,...
Definition: grid_base_objects.h:157
The refiner interface allows to mark elements for refinement and to call refine.
Definition: refiner_interface.h:67
void mark(const TIterator &iterBegin, const TIterator &iterEnd, RefinementMark refMark=RM_REFINE)
marks all elements between iterBegin and iterEnd.
Definition: refiner_interface.h:213
virtual bool perform_coarsening()
Called by coarsen(). Derived classes sould implement their coarsen algorithm here.
Definition: refiner_interface.h:290
bool coarsen()
Performs coarsening on the elements marked RM_COARSEN.
Definition: refiner_interface.cpp:162
SPMessageHub m_messageHub
Definition: refiner_interface.h:300
virtual bool local_marks_supported() const
returns true, if the refiner supports local marks.
Definition: refiner_interface.h:99
size_t num_marked_elements()
returns the number of (globally) marked grid-objects of highest dimension
Definition: refiner_interface.h:264
virtual void num_marked_edges_local(std::vector< int > &numMarkedEdgesOut)=0
returns the number of locally marked edges on all levels of the hierarchy
virtual bool mark(Vertex *v, RefinementMark refMark=RM_REFINE)
Marks an element for refinement. Default implementation is empty.
Definition: refiner_interface.h:103
virtual void perform_refinement()=0
called by refine(). Derived classes should implement their refinement algorithm here.
virtual void clear_marks()
clears all marks. Default implementation is empty
Definition: refiner_interface.h:88
virtual void num_marked_volumes_local(std::vector< int > &numMarkedVolsOut)=0
returns the number of locally marked volumes on all levels of the hierarchy
void adaption_begins()
notifies all listeners of the associated message-hub, that adaption begins / ends.
Definition: refiner_interface.cpp:69
size_t num_marked_faces()
returns the number of (globally) marked faces on all levels of the hierarchy
Definition: refiner_interface.h:260
void adaption_ends()
notifies all listeners of the associated message-hub, that adaption begins / ends.
Definition: refiner_interface.cpp:85
size_t num_marked_edges()
returns the number of (globally) marked edges on all levels of the hierarchy
Definition: refiner_interface.h:258
int get_local_face_mark(Volume *vol, Face *f) const
returns the local mark of the specified face of the given volume
Definition: refiner_interface.cpp:266
virtual void mark_neighborhood(size_t numIterations, RefinementMark refMark, bool sideNbrsOnly)
marks the neighborhood of currently marked elements.
Definition: refiner_interface.h:191
virtual Grid * grid()=0
Returns the grid associated with the refiner.
virtual bool mark(Face *f, RefinementMark refMark=RM_REFINE)
Marks an element for refinement. Default implementation is empty.
Definition: refiner_interface.h:105
void enable_debugging(bool enable)
Definition: refiner_interface.h:276
bool marked_local(TElem *elem) const
Definition: refiner_interface.h:122
SPRefinementProjector projector()
Definition: refiner_interface.h:78
void set_projector(SPRefinementProjector projector)
Definition: refiner_interface.h:75
virtual void mark_local(Face *e, int mark)
Marks a face or volume for local refinement.
Definition: refiner_interface.h:142
bool marked_closure(TElem *elem) const
Definition: refiner_interface.h:116
virtual int get_local_mark(Volume *e) const
returns the local mark of the specified face or volume.
Definition: refiner_interface.h:151
void set_adjusted_marks_debug_filename(const char *filename)
sets a filename to which adjusted marks are saved during refinement / coarsening
Definition: refiner_interface.cpp:217
virtual bool save_marks_to_file(const char *filename)=0
Writes the associated grid and marks to a file. Pure virtual.
virtual bool adaptivity_supported() const =0
returns whether the refiner is able to perform adaptive refinement
virtual RefinementMark get_mark(Face *f) const
Returns the mark of a given element. Default returns RM_REFINE.
Definition: refiner_interface.h:200
bool m_adaptionIsActive
Definition: refiner_interface.h:303
void set_message_hub(SPMessageHub msgHub)
sets the message hub.
Definition: refiner_interface.cpp:212
virtual int get_local_mark(Face *e) const
returns the local mark of the specified face or volume.
Definition: refiner_interface.h:150
virtual void mark_local(Volume *e, int mark)
Marks a face or volume for local refinement.
Definition: refiner_interface.h:143
bool m_debuggingEnabled
Definition: refiner_interface.h:304
virtual bool coarsening_supported() const =0
returns true, if the refiner supports coarsening.
bool marked_full(TElem *elem) const
Definition: refiner_interface.h:128
virtual Grid * get_associated_grid()=0
DEPRECIATED! Use grid(). Has to return the associated grid. Pure virtual.
int m_msgIdAdaption
Definition: refiner_interface.h:301
void mark_neighborhood(size_t numIterations)
marks the neighborhood of currently marked elements.
Definition: refiner_interface.h:179
IRefiner(SPRefinementProjector projector=SPNULL)
Definition: refiner_interface.h:69
SPRefinementProjector m_projector
Definition: refiner_interface.h:302
bool debugging_enabled() const
Definition: refiner_interface.h:277
virtual bool mark(Edge *e, RefinementMark refMark=RM_REFINE)
Marks an element for refinement. Default implementation is empty.
Definition: refiner_interface.h:104
void refine()
Performs refinement on the marked elements.
Definition: refiner_interface.cpp:100
virtual bool mark(Volume *v, RefinementMark refMark=RM_REFINE)
Marks an element for refinement. Default implementation is empty.
Definition: refiner_interface.h:106
size_t num_marked_volumes()
returns the number of (globally) marked volumes on all levels of the hierarchy
Definition: refiner_interface.h:262
std::string m_adjustedMarksDebugFilename
Definition: refiner_interface.h:305
virtual ~IRefiner()
Definition: refiner_interface.h:73
virtual RefinementMark get_mark(Edge *e) const
Returns the mark of a given element. Default returns RM_REFINE.
Definition: refiner_interface.h:199
virtual RefinementMark get_mark(Volume *v) const
Returns the mark of a given element. Default returns RM_REFINE.
Definition: refiner_interface.h:201
virtual void num_marked_faces_local(std::vector< int > &numMarkedFacesOut)=0
returns the number of locally marked faces on all levels of the hierarchy
virtual RefinementMark get_mark(Vertex *v) const
Returns the mark of a given element. Default returns RM_REFINE.
Definition: refiner_interface.h:198
int get_local_edge_mark(Face *f, Edge *e) const
returns the local mark of the specified edge of the given face
Definition: refiner_interface.cpp:227
Base-class for all vertex-types.
Definition: grid_base_objects.h:231
Volumes are 3-dimensional objects.
Definition: grid_base_objects.h:754
RefinementMark
refinement-marks allow to specify how an element shall be processed during refinement.
Definition: refiner_interface.h:48
@ RM_COARSEN
the element is coarsened (only valid for adaptive multi-grid refinement)
Definition: refiner_interface.h:56
@ RM_NONE
no refinement is performed
Definition: refiner_interface.h:49
@ RM_COPY
DEPRECATED. Use RM_CLOSURE or RM_LOCAL with localMark = 0 instead.
Definition: refiner_interface.h:51
@ RM_REFINE
DEPRECATED. Use RM_FULL instead.
Definition: refiner_interface.h:55
@ RM_CLOSURE
Refines elements according to associated marked edges.
Definition: refiner_interface.h:50
@ RM_MAX
the highest constant in RefinementMark. Should always be smaller than 128!
Definition: refiner_interface.h:58
@ RM_ANISOTROPIC
DEPRECATED. Use RM_CLOSURE instead.
Definition: refiner_interface.h:52
@ RM_LOCAL
Refines elements according to a local refinement mark (use 'mark_local')
Definition: refiner_interface.h:53
@ RM_DUMMY
used internally during mark-adjustment
Definition: refiner_interface.h:57
@ RM_FULL
Fully refines an element and all associated sides and edges.
Definition: refiner_interface.h:54
const NullSmartPtr SPNULL
The equivalent to NULL for smart pointers.
Definition: smart_pointer.h:90
#define UG_THROW(msg)
Definition: error.h:57