v0.13.1
Loading...
Searching...
No Matches
MeshRefinement.hpp
Go to the documentation of this file.
1/** \file MeshRefinement.hpp
2 * \brief Interface for mesh refinement
3 *
4 * \ingroup mofem_refiner
5 */
6
7#ifndef __MESHREFINE_HPP__
8#define __MESHREFINE_HPP__
9
10namespace MoFEM {
11
12/** \brief Mesh refinement interface
13
14 Currently this class is abstraction to Core interface. In future should be
15 outsourced as independent interface.
16
17 \bug Not working on partitioned meshes
18 \bug Need to be implemented as a stand alone interface not as a part of core
19 structure which should be only basic database
20 \bug If outsourced, class member functions should follow name convention
21 \bug Spelling mistakes will be corrected with names fix to follow name
22 convetion
23
24 \ingroup mofem_refiner
25 */
27
28 MoFEMErrorCode query_interface(boost::typeindex::type_index type_index,
29 UnknownInterface **iface) const;
30
32 MeshRefinement(const MoFEM::Core &core);
33
34 virtual ~MeshRefinement() = default;
35
36 /**
37 * \brief make vertices in the middle of edges in meshset and add them to
38 * refinement levels defined by bit
39 *
40 * Takes entities fromm meshsets and queried recursively (get entities from
41 * meshsets in meshsets, usually have to be used for CUBIT meshset).
42 * If meshset does not contain any edges, get entities in dimension 3 and get
43 * edge adjacencies.
44 *
45 * \param EntityHandle meshset
46 * \param BitRefLevel bitLevel
47 * \param recursive If true, meshsets containing meshsets are queried
48 * recursively. Returns the contents of meshsets, but not the meshsets
49 * themselves if true.
50 */
52 const BitRefLevel &bit,
53 const bool recursive = false,
54 int verb = QUIET,
55 EntityHandle start_v = 0);
56
57 /**
58 * \brief make vertices in the middle of edges in meshset and add them to
59 * Refinement levels defined by bit
60 *
61 * Takes entities from meshsets and queried recursively (get entities from
62 * meshsets in meshsets, usually have to be used for CUBIT meshset).
63 * If meshset does not contain any edges, get entities in dimension 3 and get
64 * edge adjacencies.
65 *
66 * \param Range consisting edges for refine
67 * \param BitRefLevel bitLevel
68 * \param recursive If true, meshsets containing meshsets are queried
69 * recursively. Returns the contents of meshsets, but not the meshsets
70 * themselves if true.
71 */
73 const BitRefLevel &bit,
74 int verb = QUIET,
75 EntityHandle start_v = 0);
76
77 /**\brief refine TET in the meshset
78 *
79 * \param EntityHandle meshset
80 * \param BitRefLevel bitLevel
81 * \param verb verbosity level
82 */
84 int verb = QUIET, const bool debug = false);
85
86 /**\brief refine TET in the meshset
87 *
88 * \param Range of tets to refine
89 * \param BitRefLevel bitLevel
90 * \param BitRefLevel bitLevel
91 * \param verb verbosity level
92 */
93 MoFEMErrorCode refineTets(const Range &tets, const BitRefLevel &bit,
94 int verb = QUIET, const bool debug = false);
95
96 /**\brief refine TET in the meshset
97 *
98 * \param Range of tets to refine
99 * \param BitRefLevel bitLevel
100 * \param BitRefLevel bitLevel
101 * \param verb verbosity level
102 */
104 const BitRefLevel &bit,
105 int verb = QUIET,
106 const bool debug = false);
107
108 /**\brief refine TET in the meshset
109 *
110 * \param Range of tets to refine
111 * \param BitRefLevel bitLevel
112 * \param BitRefLevel bitLevel
113 * \param verb verbosity level
114 */
116 const BitRefLevel &bit,
117 int verb = QUIET,
118 const bool debug = false);
119
120 /**\brief refine PRISM in the meshset
121 *
122 * \param EntityHandle meshset
123 * \param BitRefLevel bitLevel
124 */
126 const BitRefLevel &bit, int verb = QUIET);
127
128 /**\brief refine meshset, i.e. add child of refined entities to meshset
129 *
130 * \param EntityHandle meshset where to save the child refined entities
131 * \param BitRefLevel bitLevel
132 * \param recursive If true, meshsets containing meshsets are queried
133 * recursively. Returns the contents of meshsets, but not the meshsets
134 * themselves if true.
135 */
137 const BitRefLevel &bit,
138 const bool recursive = false, int verb = QUIET);
139
140 /**\brief refine TET in the meshset
141 *
142 * \param EntityHandle meshset
143 * \param BitRefLevel bitLevel
144 * \param verb verbosity level
145 */
147 int verb = QUIET, const bool debug = false);
148
149 /**\brief refine TRI in the meshset
150 *
151 * \param Range of tets to refine
152 * \param BitRefLevel bitLevel
153 * \param BitRefLevel bitLevel
154 * \param verb verbosity level
155 */
156 MoFEMErrorCode refineTris(const Range &tris, const BitRefLevel &bit,
157 int verb = QUIET, const bool debug = false);
158
159 /**\brief refine TRI in the meshset
160 *
161 * \param Range of tets to refine
162 * \param BitRefLevel bitLevel
163 * \param BitRefLevel bitLevel
164 * \param verb verbosity level
165 */
167 const BitRefLevel &bit,
168 int verb = QUIET,
169 const bool debug = false);
170
171 /**\brief refine TRI in the meshset
172 *
173 * \param Range of tets to refine
174 * \param BitRefLevel bitLevel
175 * \param BitRefLevel bitLevel
176 * \param verb verbosity level
177 */
179 const BitRefLevel &bit,
180 int verb = QUIET,
181 const bool debug = false);
182
183private:
184 struct SetParent {
185 map<EntityHandle, EntityHandle> parentsToChange;
186 MoFEMErrorCode operator()(const EntityHandle ent, const EntityHandle parent,
187 const RefEntity_multiIndex *ref_ents_ptr,
189
191 };
192
193
194 /**
195 * @brief Functions setting edges for refinemnt on enetity level
196 *
197 */
198 using SetEdgeBitsFun = boost::function<
199
200 MoFEMErrorCode(moab::Interface &moab,
202 &ref_parent_ents_view,
203 EntityHandle tet, BitRefEdges &parent_edges_bit,
204 EntityHandle *edge_new_nodes, int *split_edges
205
206 )>;
207
208 /**\brief refine TET in the meshset
209 *
210 * \param Range of tets to refine
211 * \param BitRefLevel bitLevel
212 * \param verb verbosity level
213 */
214 MoFEMErrorCode refineTets(const Range &tets, const BitRefLevel &bit,
215 SetEdgeBitsFun set_edge_bits, int verb,
216 const bool debug);
217
218 MoFEMErrorCode refineTris(const Range &tris, const BitRefLevel &bit,
219 SetEdgeBitsFun set_edge_bits, int verb,
220 const bool debug);
221};
222
223} // namespace MoFEM
224
225#endif // __MESHREFINE_HPP__
226
227/**
228 * \defgroup mofem_refiner MeshRefinement
229 * \brief Refine mesh by splitting edges
230 *
231 */
@ QUIET
Definition: definitions.h:208
static const bool debug
multi_index_container< boost::shared_ptr< RefEntity >, indexed_by< ordered_unique< tag< Ent_mi_tag >, const_mem_fun< RefEntity, EntityHandle, &RefEntity::getEnt > >, ordered_non_unique< tag< Ent_Ent_mi_tag >, const_mem_fun< RefEntity, EntityHandle, &RefEntity::getParentEnt > >, ordered_non_unique< tag< Composite_EntType_and_ParentEntType_mi_tag >, composite_key< RefEntity, const_mem_fun< RefEntity, EntityType, &RefEntity::getEntType >, const_mem_fun< RefEntity, EntityType, &RefEntity::getParentEntType > > >, ordered_non_unique< tag< Composite_ParentEnt_And_EntType_mi_tag >, composite_key< RefEntity, const_mem_fun< RefEntity, EntityType, &RefEntity::getEntType >, const_mem_fun< RefEntity, EntityHandle, &RefEntity::getParentEnt > > > > > RefEntity_multiIndex
auto bit
set bit
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
Definition: Exceptions.hpp:56
std::bitset< BITREFEDGES_SIZE > BitRefEdges
Definition: Types.hpp:34
std::bitset< BITREFLEVEL_SIZE > BitRefLevel
Bit structure attached to each entity identifying to what mesh entity is attached.
Definition: Types.hpp:40
implementation of Data Operators for Forces and Sources
Definition: Common.hpp:10
multi_index_container< boost::shared_ptr< RefEntity >, indexed_by< ordered_non_unique< const_mem_fun< RefEntity, EntityHandle, &RefEntity::getParentEnt > >, hashed_unique< tag< Composite_EntType_and_ParentEntType_mi_tag >, composite_key< boost::shared_ptr< RefEntity >, const_mem_fun< RefEntity, EntityHandle, &RefEntity::getEnt >, const_mem_fun< RefEntity, EntityHandle, &RefEntity::getParentEnt > > > > > RefEntity_multiIndex_view_by_ordered_parent_entity
Core (interface) class.
Definition: Core.hpp:82
MoFEMErrorCode operator()(const EntityHandle ent, const EntityHandle parent, const RefEntity_multiIndex *ref_ents_ptr, MoFEM::Core &cOre)
map< EntityHandle, EntityHandle > parentsToChange
Mesh refinement interface.
MoFEMErrorCode refineTetsHangingNodes(const Range &tets, const BitRefLevel &bit, int verb=QUIET, const bool debug=false)
refine TET in the meshset
virtual ~MeshRefinement()=default
MoFEMErrorCode refineTets(const EntityHandle meshset, const BitRefLevel &bit, int verb=QUIET, const bool debug=false)
refine TET in the meshset
MoFEMErrorCode query_interface(boost::typeindex::type_index type_index, UnknownInterface **iface) const
MoFEMErrorCode addVerticesInTheMiddleOfEdges(const EntityHandle meshset, const BitRefLevel &bit, const bool recursive=false, int verb=QUIET, EntityHandle start_v=0)
make vertices in the middle of edges in meshset and add them to refinement levels defined by bit
MoFEMErrorCode refinePrisms(const EntityHandle meshset, const BitRefLevel &bit, int verb=QUIET)
refine PRISM in the meshset
MoFEMErrorCode refineTrisHangingNodes(const EntityHandle meshset, const BitRefLevel &bit, int verb=QUIET, const bool debug=false)
refine TRI in the meshset
boost::function< MoFEMErrorCode(moab::Interface &moab, RefEntity_multiIndex_view_by_ordered_parent_entity &ref_parent_ents_view, EntityHandle tet, BitRefEdges &parent_edges_bit, EntityHandle *edge_new_nodes, int *split_edges)> SetEdgeBitsFun
Functions setting edges for refinemnt on enetity level.
MoFEMErrorCode refineTris(const EntityHandle meshset, const BitRefLevel &bit, int verb=QUIET, const bool debug=false)
refine TET in the meshset
MoFEMErrorCode refineMeshset(const EntityHandle meshset, const BitRefLevel &bit, const bool recursive=false, int verb=QUIET)
refine meshset, i.e. add child of refined entities to meshset
base class for all interface classes