v0.13.1
PrismInterface.hpp
Go to the documentation of this file.
1/**
2 * \file PrismInterface.hpp
3 *
4 * \brief MoFEM interface
5 *
6 * Insert prisms in the interface between two surfaces
7 *
8 * \ingroup mofem_prism_interface
9 */
10
11#ifndef __PRISMINTERFACE_HPP__
12#define __PRISMINTERFACE_HPP__
13
14#include "UnknownInterface.hpp"
15
16namespace MoFEM {
17
18/**
19 * \brief Create interface from given surface and insert flat prisms in-between
20 *
21 * \ingroup mofem_prism_interface
22*/
24
25 MoFEMErrorCode query_interface(boost::typeindex::type_index type_index,
26 UnknownInterface **iface) const;
27
29 PrismInterface(const MoFEM::Core &core);
30
31 /// destructor
32 ~PrismInterface() = default;
33
34 /**
35 * \brief Store tetrahedra from each side of the interface
36 * separately in two child meshsets of the parent meshset
37 *
38 * Additional third child meshset contains nodes which can be split
39 * and skin edges
40 *
41 * \param msId Id of meshset
42 * \param cubit_bc_type type of meshset (NODESET, SIDESET or BLOCKSET and
43 * more)
44 * \param mesh_bit_level interface is added on this bit level
45 * \param recursive if true parent meshset is searched recursively
46 * \param verb verbosity level
47 *
48 * \note if bit_level == BitRefLevel.set() then interface will be added
49 * on all bit levels
50 */
51 MoFEMErrorCode getSides(const int msId, const CubitBCType cubit_bc_type,
52 const BitRefLevel mesh_bit_level,
53 const bool recursive, int verb = QUIET);
54
55 /**
56 * \brief Store tetrahedra from each side of the interface
57 * separately in two child meshsets of the parent meshset
58 *
59 * Additional third child meshset contains nodes which can be split
60 * and skin edges
61 *
62 * \param msId Id of meshset
63 * \param cubit_bc_type type of meshset (NODESET, SIDESET or BLOCKSET and
64 * more)
65 * \param mesh_bit_level interface is added on this bit level
66 * \param seed_side use seed to decide which side to choose first
67 * \param recursive if true parent meshset is searched recursively
68 * \param verb verbosity level
69 *
70 * \note if bit_level == BitRefLevel.set() then interface will be added
71 * on all bit levels
72 */
73 MoFEMErrorCode getSides(const int msId, const CubitBCType cubit_bc_type,
74 const BitRefLevel mesh_bit_level, Range seed_side,
75 const bool recursive, int verb = QUIET);
76
77 /**
78 * \brief Store tetrahedra from each side of the interface
79 * in two child meshsets of the parent meshset
80 *
81 * Additional third child meshset contains nodes which can be split
82 * and skin edges
83 *
84 * \param sideset parent meshset with the surface
85 * \param mesh_bit_level interface is added on this bit level
86 * \param recursive if true parent meshset is searched recursively
87 * \param verb verbosity level
88 *
89 * \note if bit_level == BitRefLevel.set() then interface will be added
90 * on all bit levels
91 *
92 * 1. Get tets adjacent to nodes of the interface meshset.
93 * 2. Take skin faces from these tets and get edges from that skin.
94 * 3. Take skin from triangles of the interface.
95 * 4. Subtract edges of skin faces from skin of triangles in order to get
96 * edges in the volume of the body, and not on the interface boundary.
97 * 5. Iterate between all triangles of the interface and find adjacent tets
98 * on each side of the interface
99 */
100 MoFEMErrorCode getSides(const EntityHandle sideset,
101 const BitRefLevel mesh_bit_level,
102 const bool recursive, int verb = QUIET);
103
104/**
105 * \brief Store tetrahedra from each side of the interface
106 * in two child meshsets of the parent meshset
107 *
108 * Additional third child meshset contains nodes which can be split
109 * and skin edges
110 *
111 * \param sideset parent meshset with the surface
112 * \param mesh_bit_level interface is added on this bit level
113 * \param seed_side use seed to decide which side to choose first
114 * \param recursive if true parent meshset is searched recursively
115 * \param verb verbosity level
116 *
117 * \note if bit_level == BitRefLevel.set() then interface will be added
118 * on all bit levels
119 *
120 * 1. Get tets adjacent to nodes of the interface meshset.
121 * 2. Take skin faces from these tets and get edges from that skin.
122 * 3. Take skin from triangles of the interface.
123 * 4. Subtract edges of skin faces from skin of triangles in order to get
124 * edges in the volume of the body, and not on the interface boundary.
125 * 5. Iterate between all triangles of the interface and find adjacent tets
126 * on each side of the interface
127 */
128 MoFEMErrorCode getSides(const EntityHandle sideset,
129 const BitRefLevel mesh_bit_level, Range seed_side,
130 const bool recursive, int verb = QUIET);
131
132 /**
133 * \brief Find triangles which have three nodes on internal surface skin
134 *
135 * Internal surface skin is a set of all edges on the boundary of a given
136 * surface inside the body. This set of edges is also called the surface
137 * front. If a triangle has three nodes on the surface front, none of these
138 * nodes can be split. Therefore, such a triangle cannot be split and
139 * should be removed from the surface.
140 *
141 * @param sideset meshset with surface
142 * @param mesh_bit_level bit ref level of the volume mesh
143 * @param recursive if true search in sub-meshsets
144 * @param faces_with_three_nodes_on_front returned faces
145 * @param verb verbosity level
146 *
147 * @return error code
148 */
150 const EntityHandle sideset, const BitRefLevel mesh_bit_level,
151 const bool recursive, Range &faces_with_three_nodes_on_front,
152 int verb = QUIET);
153
154 /**
155 * \brief Split nodes and other entities of tetrahedra on both sides
156 * of the interface and insert flat prisms in-between
157 *
158 * \param meshset volume meshset containing 3D entities around the interface
159 * \param bit bit ref level on which new entities will be stored
160 * \param msId meshset ID of the surface
161 * \param cubit_bc_type type of meshset (NODESET, SIDESET or BLOCKSET and
162 *more)
163 * \param add_interface_entities if true add prism elements at interface
164 * \param recursive if true parent meshset is searched recursively
165 * \param verb verbosity level
166 *
167 * \note Parent meshset must have three child meshsets: two with tetrahedra
168 * from each side of the interface, third containing nodes which can be split
169 * and skin edges
170 */
171 MoFEMErrorCode splitSides(const EntityHandle meshset, const BitRefLevel &bit,
172 const int msId, const CubitBCType cubit_bc_type,
173 const bool add_interface_entities,
174 const bool recursive = false, int verb = QUIET);
175
176 /**
177 * \brief Split nodes and other entities of tetrahedra on both sides
178 * of the interface and insert flat prisms in-between
179 *
180 * \param meshset volume meshset containing 3D entities around the interface
181 * \param bit bit ref level on which new entities will be stored
182 * \param sideset meshset with surface
183 * \param add_interface_entities if true add prism elements at interface
184 * \param recursive if true parent meshset is searched recursively
185 * \param verb verbosity level
186 *
187 * \note Parent meshset must have three child meshsets: two with tetrahedra
188 * from each side of the interface, third containing nodes which can be split
189 * and skin edges
190 */
191 MoFEMErrorCode splitSides(const EntityHandle meshset, const BitRefLevel &bit,
192 const EntityHandle sideset,
193 const bool add_interface_entities,
194 const bool recursive = false, int verb = QUIET);
195
196 /**
197 * \brief Split nodes and other entities of tetrahedra on both sides
198 * of the interface and insert flat prisms in-between
199 *
200 * \param meshset volume meshset containing 3D entities around the interface
201 * \param bit bit ref level on which new entities will be stored
202 * \param inhered_from_bit_level inherit nodes and other entities form this
203 * bit level
204 * \param inhered_from_bit_level_mask corresponding mask
205 * \param sideset meshset with surface
206 * \param add_interface_entities if true add prism elements at interface
207 * \param recursive if true parent meshset is searched recursively
208 * \param verb verbosity level
209 *
210 * \note Parent meshset must have three child meshsets: two with tetrahedra
211 * from each side of the interface, third containing nodes which can be split
212 * and skin edges
213 * \note inhered_from_bit_level needs to be specified for some meshsets
214 * with interfaces. Some nodes on some refinement levels are dividing edges
215 * but not splitting faces. Inheriting those nodes will not split faces.
216 */
217 MoFEMErrorCode splitSides(const EntityHandle meshset, const BitRefLevel &bit,
218 const BitRefLevel &inhered_from_bit_level,
219 const BitRefLevel &inhered_from_bit_level_mask,
220 const EntityHandle sideset,
221 const bool add_interface_entities,
222 const bool recursive = false, int verb = QUIET);
223
224};
225
226} // namespace MoFEM
227
228/**
229 * \defgroup mofem_prism_interface PrismInterface
230 * \brief Create prism interface between faces
231 *
232 * Create interface from given surface and insert flat prisms in-between
233 *
234 * \ingroup mofem
235 */
236
237#endif // __PRISMINTERFACE_HPP__
MoFEM interface.
@ QUIET
Definition: definitions.h:208
auto bit
set bit
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
Definition: Exceptions.hpp:56
std::bitset< 32 > CubitBCType
Definition: Types.hpp:52
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: MoFEM.hpp:24
Core (interface) class.
Definition: Core.hpp:82
Create interface from given surface and insert flat prisms in-between.
PrismInterface(const MoFEM::Core &core)
MoFEMErrorCode findFacesWithThreeNodesOnInternalSurfaceSkin(const EntityHandle sideset, const BitRefLevel mesh_bit_level, const bool recursive, Range &faces_with_three_nodes_on_front, int verb=QUIET)
Find triangles which have three nodes on internal surface skin.
~PrismInterface()=default
destructor
MoFEMErrorCode query_interface(boost::typeindex::type_index type_index, UnknownInterface **iface) const
MoFEMErrorCode getSides(const int msId, const CubitBCType cubit_bc_type, const BitRefLevel mesh_bit_level, const bool recursive, int verb=QUIET)
Store tetrahedra from each side of the interface separately in two child meshsets of the parent meshs...
MoFEMErrorCode splitSides(const EntityHandle meshset, const BitRefLevel &bit, const int msId, const CubitBCType cubit_bc_type, const bool add_interface_entities, const bool recursive=false, int verb=QUIET)
Split nodes and other entities of tetrahedra on both sides of the interface and insert flat prisms in...
base class for all interface classes