ug4
hanging_node_refiner_grid.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2011-2015: G-CSC, Goethe University Frankfurt
3  * Author: Sebastian Reiter
4  *
5  * This file is part of UG4.
6  *
7  * UG4 is free software: you can redistribute it and/or modify it under the
8  * terms of the GNU Lesser General Public License version 3 (as published by the
9  * Free Software Foundation) with the following additional attribution
10  * requirements (according to LGPL/GPL v3 §7):
11  *
12  * (1) The following notice must be displayed in the Appropriate Legal Notices
13  * of covered and combined works: "Based on UG4 (www.ug4.org/license)".
14  *
15  * (2) The following notice must be displayed at a prominent place in the
16  * terminal output of covered works: "Based on UG4 (www.ug4.org/license)".
17  *
18  * (3) The following bibliography is recommended for citation and must be
19  * preserved in all covered files:
20  * "Reiter, S., Vogel, A., Heppner, I., Rupp, M., and Wittum, G. A massively
21  * parallel geometric multigrid solver on hierarchically distributed grids.
22  * Computing and visualization in science 16, 4 (2013), 151-164"
23  * "Vogel, A., Reiter, S., Rupp, M., Nägel, A., and Wittum, G. UG4 -- a novel
24  * flexible software system for simulating pde based models on high performance
25  * computers. Computing and visualization in science 16, 4 (2013), 165-179"
26  *
27  * This program is distributed in the hope that it will be useful,
28  * but WITHOUT ANY WARRANTY; without even the implied warranty of
29  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
30  * GNU Lesser General Public License for more details.
31  */
32 
33 #ifndef __H__UG__HANGING_NODE_REFINER_GRID__
34 #define __H__UG__HANGING_NODE_REFINER_GRID__
35 
37 
38 namespace ug
39 {
40 
43 
45 
55 {
56  public:
59 
60  public:
64 
65  virtual ~HangingNodeRefiner_Grid();
66 
67  virtual void grid_to_be_destroyed(Grid* grid);
68 
69  virtual void assign_grid(Grid& grid);
70  virtual Grid* get_associated_grid() {return m_pGrid;}
71  virtual Grid* grid() {return m_pGrid;}
72 
73  virtual bool adaptivity_supported() const {return true;}
74  virtual bool coarsening_supported() const {return false;}
75 
77  virtual bool mark(Vertex* v, RefinementMark refMark = RM_REFINE);
78 
80  virtual bool mark(Edge* e, RefinementMark refMark = RM_REFINE);
81 
83  virtual bool mark(Face* f, RefinementMark refMark = RM_REFINE);
84 
86  virtual bool mark(Volume* v, RefinementMark refMark = RM_REFINE);
87 
88 
89  virtual bool local_marks_supported() const {return true;}
90 
91  virtual void mark_local(Face* f, int localMark);
92  virtual void mark_local(Volume* f, int localMark);
93 
94  virtual int get_local_mark(Face* f) const;
95  virtual int get_local_mark(Volume* f) const;
96 
97  protected:
98  void attach_local_marks();
99 
101  virtual void num_marked_edges_local(std::vector<int>& numMarkedEdgesOut);
103  virtual void num_marked_faces_local(std::vector<int>& numMarkedFacesOut);
105  virtual void num_marked_volumes_local(std::vector<int>& numMarkedVolsOut);
106 
107  template <class TElem>
108  void num_marked_elems(std::vector<int>& numMarkedElemsOut);
109 
111 
117  void set_grid(Grid* grid);
118 
119  virtual void collect_objects_for_refine();
120 
122  virtual void post_refine();
123 
124  virtual void process_constraining_edge(ConstrainingEdge* cge);
125  virtual void refine_edge_with_normal_vertex(Edge* e,
126  Vertex** newCornerVrts = NULL);
127 
128  virtual void refine_face_with_normal_vertex(Face* f,
129  Vertex** newCornerVrts = NULL);
130  virtual void process_constraining_face(ConstrainingFace* cgf);
131 
133  Vertex** newVolumeVrts = NULL);
134 
136  virtual Vertex* get_center_vertex(Edge* e);
137 
139  virtual void set_center_vertex(Edge* e, Vertex* v);
140 
142  virtual Vertex* get_center_vertex(Face* f);
143 
145  virtual void set_center_vertex(Face* f, Vertex* v);
146 
147  private:
154 };
155 
157 
158 }// end of namespace
159 
160 #endif
contains elements of type
Definition: grid_objects_1d.h:279
This class is used to store constrained geometric objects.
Definition: grid_objects_2d.h:562
Base-class for edges.
Definition: grid_base_objects.h:397
Faces are 2-dimensional objects.
Definition: grid_base_objects.h:510
Definition: grid.h:211
Definition: grid.h:221
Manages the elements of a grid and their interconnection.
Definition: grid.h:132
Specialization of ug::HangingNodeRefiner for ug::Grid.
Definition: hanging_node_refiner_grid.h:55
virtual void mark_local(Face *f, int localMark)
Marks a face or volume for local refinement.
Definition: hanging_node_refiner_grid.cpp:138
AInt m_aLocalMark
Definition: hanging_node_refiner_grid.h:150
virtual void process_constraining_edge(ConstrainingEdge *cge)
called to refine the specified element.
Definition: hanging_node_refiner_grid.cpp:343
Grid::FaceAttachmentAccessor< AVertex > m_aaVertexFACE
Definition: hanging_node_refiner_grid.h:152
virtual void process_constraining_face(ConstrainingFace *cgf)
called to refine the specified element.
Definition: hanging_node_refiner_grid.cpp:376
virtual void collect_objects_for_refine()
marks unmarked elements that have to be refined due to marked neighbors.
Definition: hanging_node_refiner_grid.cpp:226
virtual bool local_marks_supported() const
returns true, if the refiner supports local marks.
Definition: hanging_node_refiner_grid.h:89
virtual int get_local_mark(Face *f) const
returns the local mark of the specified face or volume.
Definition: hanging_node_refiner_grid.cpp:167
virtual void num_marked_volumes_local(std::vector< int > &numMarkedVolsOut)
returns the number of (globally) marked volumes on this level of the hierarchy
Definition: hanging_node_refiner_grid.cpp:209
virtual void post_refine()
erases unused refined elements
Definition: hanging_node_refiner_grid.cpp:295
HangingNodeRefiner_Grid(SPRefinementProjector projector=SPNULL)
Definition: hanging_node_refiner_grid.cpp:43
virtual Grid * get_associated_grid()
DEPRECIATED! Use grid(). Has to return the associated grid. Pure virtual.
Definition: hanging_node_refiner_grid.h:70
virtual bool adaptivity_supported() const
returns whether the refiner is able to perform adaptive refinement
Definition: hanging_node_refiner_grid.h:73
virtual void set_center_vertex(Edge *e, Vertex *v)
Associates a vertex with the edge.
Definition: hanging_node_refiner_grid.cpp:404
HangingNodeRefinerBase< Selector > BaseClass
Definition: hanging_node_refiner_grid.h:57
AVertex m_aVertex
Definition: hanging_node_refiner_grid.h:149
virtual void refine_face_with_normal_vertex(Face *f, Vertex **newCornerVrts=NULL)
called to refine the specified element.
Definition: hanging_node_refiner_grid.cpp:365
virtual void num_marked_edges_local(std::vector< int > &numMarkedEdgesOut)
returns the number of (globally) marked edges on this level of the hierarchy
Definition: hanging_node_refiner_grid.cpp:197
void set_grid(Grid *grid)
performs registration and deregistration at a grid.
Definition: hanging_node_refiner_grid.cpp:80
virtual Grid * grid()
Returns the grid associated with the refiner.
Definition: hanging_node_refiner_grid.h:71
virtual void num_marked_faces_local(std::vector< int > &numMarkedFacesOut)
returns the number of (globally) marked faces on this level of the hierarchy
Definition: hanging_node_refiner_grid.cpp:203
virtual bool coarsening_supported() const
returns true, if the refiner supports coarsening.
Definition: hanging_node_refiner_grid.h:74
virtual ~HangingNodeRefiner_Grid()
Definition: hanging_node_refiner_grid.cpp:62
MultiElementAttachmentAccessor< AInt > m_aaLocalMark
Definition: hanging_node_refiner_grid.h:153
virtual void refine_edge_with_normal_vertex(Edge *e, Vertex **newCornerVrts=NULL)
called to refine the specified element.
Definition: hanging_node_refiner_grid.cpp:354
Grid::EdgeAttachmentAccessor< AVertex > m_aaVertexEDGE
Definition: hanging_node_refiner_grid.h:151
Grid * m_pGrid
Definition: hanging_node_refiner_grid.h:148
void attach_local_marks()
Definition: hanging_node_refiner_grid.cpp:184
virtual void refine_volume_with_normal_vertex(Volume *v, Vertex **newVolumeVrts=NULL)
called to refine the specified element.
Definition: hanging_node_refiner_grid.cpp:387
virtual void assign_grid(Grid &grid)
Definition: hanging_node_refiner_grid.cpp:74
void num_marked_elems(std::vector< int > &numMarkedElemsOut)
Definition: hanging_node_refiner_grid.cpp:217
virtual void grid_to_be_destroyed(Grid *grid)
Definition: hanging_node_refiner_grid.cpp:68
virtual Vertex * get_center_vertex(Edge *e)
Returns the vertex associated with the edge.
Definition: hanging_node_refiner_grid.cpp:397
Base class for a hanging-node refiner.
Definition: hanging_node_refiner_base.h:92
virtual bool mark(Vertex *v, RefinementMark refMark=RM_REFINE)
Marks an element for refinement. Default implementation is empty.
Definition: refiner_interface.h:103
SPRefinementProjector projector()
Definition: refiner_interface.h:78
Accesses attachements in different element types at the same time.
Definition: attachment_util.h:56
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_REFINE
DEPRECATED. Use RM_FULL instead.
Definition: refiner_interface.h:55
const NullSmartPtr SPNULL
The equivalent to NULL for smart pointers.
Definition: smart_pointer.h:90
the ug namespace