v0.9.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 /*
12  * MoFEM is distributed in the hope that it will be useful, but WITHOUT
13  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
15  * License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with MoFEM. If not, see <http://www.gnu.org/licenses/>
19  */
20 
21 #ifndef __PRISMINTERFACE_HPP__
22 #define __PRISMINTERFACE_HPP__
23 
24 #include "UnknownInterface.hpp"
25 
26 namespace MoFEM {
27 
30 
31 /**
32  * \brief Create interface from given surface and insert flat prisms in-between
33  *
34  * \ingroup mofem_prism_interface
35 */
37 
39  UnknownInterface **iface) const;
40 
42  PrismInterface(const MoFEM::Core &core);
43 
44  /// destructor
46 
47  /**
48  * \brief Store tetrahedra from each side of the interface
49  * separately in two child meshsets of the parent meshset
50  *
51  * Additional third child meshset contains nodes which can be split
52  * and skin edges
53  *
54  * \param msId Id of meshset
55  * \param cubit_bc_type type of meshset (NODESET, SIDESET or BLOCKSET and
56  * more)
57  * \param mesh_bit_level interface is added on this bit level
58  * \param recursive if true parent meshset is searched recursively
59  * \param verb verbosity level
60  *
61  * \note if bit_level == BitRefLevel.set() then interface will be added
62  * on all bit levels
63  */
64  MoFEMErrorCode getSides(const int msId, const CubitBCType cubit_bc_type,
65  const BitRefLevel mesh_bit_level,
66  const bool recursive, int verb = QUIET);
67 
68  /**
69  * \brief Store tetrahedra from each side of the interface
70  * in two child meshsets of the parent meshset
71  *
72  * Additional third child meshset contains nodes which can be split
73  * and skin edges
74  *
75  * \param sideset parent meshset with the surface
76  * \param mesh_bit_level interface is added on this bit level
77  * \param recursive if true parent meshset is searched recursively
78  * \param verb verbosity level
79  *
80  * \note if bit_level == BitRefLevel.set() then interface will be added
81  * on all bit levels
82  *
83  * 1. Get tets adjacent to nodes of the interface meshset.
84  * 2. Take skin faces from these tets and get edges from that skin.
85  * 3. Take skin from triangles of the interface.
86  * 4. Subtract edges of skin faces from skin of triangles in order to get
87  * edges in the volume of the body, and not on the interface boundary.
88  * 5. Iterate between all triangles of the interface and find adjacent tets
89  * on each side of the interface
90  */
91  MoFEMErrorCode getSides(const EntityHandle sideset,
92  const BitRefLevel mesh_bit_level,
93  const bool recursive, int verb = QUIET);
94 
95  /**
96  * \brief Find triangles which have three nodes on internal surface skin
97  *
98  * Internal surface skin is a set of all edges on the boundary of a given
99  * surface inside the body. This set of edges is also called the surface
100  * front. If a triangle has three nodes on the surface front, none of these
101  * nodes can be split. Therefore, such a triangle cannot be split and
102  * should be removed from the surface.
103  *
104  * @param sideset meshset with surface
105  * @param mesh_bit_level bit ref level of the volume mesh
106  * @param recursive if true search in sub-meshsets
107  * @param faces_with_three_nodes_on_front returned faces
108  * @param verb verbosity level
109  *
110  * @return error code
111  */
113  const EntityHandle sideset, const BitRefLevel mesh_bit_level,
114  const bool recursive, Range &faces_with_three_nodes_on_front,
115  int verb = QUIET);
116 
117  /**
118  * \brief Split nodes and other entities of tetrahedra on both sides
119  * of the interface and insert flat prisms in-between
120  *
121  * \param meshset volume meshset containing 3D entities around the interface
122  * \param bit bit ref level on which new entities will be stored
123  * \param msId meshset ID of the surface
124  * \param cubit_bc_type type of meshset (NODESET, SIDESET or BLOCKSET and
125  *more)
126  * \param add_interface_entities if true add prism elements at interface
127  * \param recursive if true parent meshset is searched recursively
128  * \param verb verbosity level
129  *
130  * \note Parent meshset must have three child meshsets: two with tetrahedra
131  * from each side of the interface, third containing nodes which can be split
132  * and skin edges
133  */
134  MoFEMErrorCode splitSides(const EntityHandle meshset, const BitRefLevel &bit,
135  const int msId, const CubitBCType cubit_bc_type,
136  const bool add_interface_entities,
137  const bool recursive = false, int verb = QUIET);
138 
139  /**
140  * \brief Split nodes and other entities of tetrahedra on both sides
141  * of the interface and insert flat prisms in-between
142  *
143  * \param meshset volume meshset containing 3D entities around the interface
144  * \param bit bit ref level on which new entities will be stored
145  * \param sideset meshset with surface
146  * \param add_interface_entities if true add prism elements at interface
147  * \param recursive if true parent meshset is searched recursively
148  * \param verb verbosity level
149  *
150  * \note Parent meshset must have three child meshsets: two with tetrahedra
151  * from each side of the interface, third containing nodes which can be split
152  * and skin edges
153  */
154  MoFEMErrorCode splitSides(const EntityHandle meshset, const BitRefLevel &bit,
155  const EntityHandle sideset,
156  const bool add_interface_entities,
157  const bool recursive = false, int verb = QUIET);
158 
159  /**
160  * \brief Split nodes and other entities of tetrahedra on both sides
161  * of the interface and insert flat prisms in-between
162  *
163  * \param meshset volume meshset containing 3D entities around the interface
164  * \param bit bit ref level on which new entities will be stored
165  * \param inhered_from_bit_level inherit nodes and other entities form this
166  * bit level
167  * \param inhered_from_bit_level_mask corresponding mask
168  * \param sideset meshset with surface
169  * \param add_interface_entities if true add prism elements at interface
170  * \param recursive if true parent meshset is searched recursively
171  * \param verb verbosity level
172  *
173  * \note Parent meshset must have three child meshsets: two with tetrahedra
174  * from each side of the interface, third containing nodes which can be split
175  * and skin edges
176  * \note inhered_from_bit_level needs to be specified for some meshsets
177  * with interfaces. Some nodes on some refinement levels are dividing edges
178  * but not splitting faces. Inheriting those nodes will not split faces.
179  */
180  MoFEMErrorCode splitSides(const EntityHandle meshset, const BitRefLevel &bit,
181  const BitRefLevel &inhered_from_bit_level,
182  const BitRefLevel &inhered_from_bit_level_mask,
183  const EntityHandle sideset,
184  const bool add_interface_entities,
185  const bool recursive = false, int verb = QUIET);
186 };
187 
188 } // namespace MoFEM
189 
190 /**
191  * \defgroup mofem_prism_interface PrismInterface
192  * \brief Create prism interface between faces
193  *
194  * Create interface from given surface and insert flat prisms in-between
195  *
196  * \ingroup mofem
197  */
198 
199 #endif // __PRISMINTERFACE_HPP__
MoFEM interface unique ID.
MoFEMErrorCode query_interface(const MOFEMuuid &uuid, UnknownInterface **iface) const
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.
base class for all interface classes
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...
Core (interface) class.
Definition: Core.hpp:50
MoFEM interface.
std::bitset< BITINTERFACEUID_SIZE > BitIntefaceId
Definition: Types.hpp:55
implementation of Data Operators for Forces and Sources
Definition: Common.hpp:21
PrismInterface(const MoFEM::Core &core)
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
Definition: Exceptions.hpp:66
Create interface from given surface and insert flat prisms in-between.
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...
std::bitset< BITREFLEVEL_SIZE > BitRefLevel
Bit structure attached to each entity identifying to what mesh entity is attached.
Definition: Types.hpp:50
std::bitset< 32 > CubitBCType
Definition: Types.hpp:62
static const MOFEMuuid IDD_MOFEMPrismInterface