BELFEM 0.9.0
Berkeley Lab Finite Element Framework
Loading...
Searching...
No Matches
cl_Mesh_CurvedElementChecker.hpp
Go to the documentation of this file.
1/*
2 * BELFEM -- The Berkeley Lab Finite Element Framework
3 * Copyright (c) 2026, The Regents of the University of California,
4 * through Lawrence Berkeley National Laboratory (subject to receipt of any required
5 * approvals from the U.S. Dept. of Energy). All rights reserved.
6 *
7 * Developers: Christian Messe, Gregory Giard
8 *
9 * See the top-level LICENSE file for the complete license and disclaimer.
10 */
11
12#ifndef BELFEM_CL_MESH_CURVEDELEMENTCHECKER_HPP
13#define BELFEM_CL_MESH_CURVEDELEMENTCHECKER_HPP
14
15#include "cl_Vector.hpp"
16#include "cl_Mesh.hpp"
17
18namespace belfem
19{
20 namespace mesh
21 {
27 {
28 const proc_t mCommRank ;
29
30 const uint mMeshDimension ;
31
32 // blocks on mesh
33 Cell< Block * > & mBlocks ;
34
35 // sidesets on mesh
36 Cell< SideSet * > & mSideSets ;
37
38 // epsilon environment for mesh
39 const real mTwoMeshEpsilon = 2e-9 ;
40 const real mFourMeshEpsilon = mTwoMeshEpsilon + mTwoMeshEpsilon ;
41 const real mEightMeshEpsilon = mFourMeshEpsilon + mFourMeshEpsilon ;
42
43 // for quad4
44 Cell< Node * > mNodes ;
45 real mX[ 4 ];
46 real mY[ 4 ];
47 real mZ[ 4 ];
48
49
50 // function pointer to checker
51 bool
52 ( CurvedElementChecker::*mFunCheck )( Element * aElement );
53
54//------------------------------------------------------------------------------
55 public:
56//------------------------------------------------------------------------------
57
59 const uint aMeshDimension,
60 Cell< Block * > & aBlocks,
61 Cell< SideSet * > & aSideSets );
62
64
67
68//------------------------------------------------------------------------------
69 private:
70//------------------------------------------------------------------------------
71
72 void
73 link_check_function( const ElementType aElementType );
74
75//------------------------------------------------------------------------------
76
77 bool
78 check_linear( Element * aElement );
79
80//------------------------------------------------------------------------------
81
82 bool
83 check_tri6_2d( Element * aElement );
84
85//------------------------------------------------------------------------------
86
87 bool
88 check_quad8_2d( Element * aElement );
89
90//------------------------------------------------------------------------------
91
92 bool
93 check_quad9_2d( Element * aElement );
94
95//------------------------------------------------------------------------------
96
97 bool
98 check_tri6( Element * aElement );
99
100//------------------------------------------------------------------------------
101
102 bool
103 check_quad4( Element * aElement );
104
105//------------------------------------------------------------------------------
106
107 bool
108 check_quad4_face( Element * aElement, const uint aFaceIndex );
109
110 bool
111 check_quad4_face_sub();
112
113//------------------------------------------------------------------------------
114
115 bool
116 check_quad8( Element * aElement );
117
118//------------------------------------------------------------------------------
119
120 bool
121 check_quad9( Element * aElement );
122
123//------------------------------------------------------------------------------
124
125 bool
126 check_tet10( Element * aElement );
127
128//------------------------------------------------------------------------------
129
130 bool
131 check_penta6( Element * aElement );
132
133//------------------------------------------------------------------------------
134
135 bool
136 check_penta15( Element * aElement );
137
138//------------------------------------------------------------------------------
139
140 bool
141 check_penta18( Element * aElement );
142
143//------------------------------------------------------------------------------
144
145 bool
146 check_hex8( Element * aElement );
147
148//------------------------------------------------------------------------------
149
150 bool
151 check_hex20( Element * aElement );
152
153//------------------------------------------------------------------------------
154
155 bool
156 check_hex27( Element * aElement );
157
158//------------------------------------------------------------------------------
159
160 bool
161 check_midpoint( const real aA,
162 const real aB,
163 const real aC ) const ;
164
165//------------------------------------------------------------------------------
166
167 bool
168 check_midpoint( const real aA,
169 const real aB,
170 const real aC,
171 const real aD,
172 const real aE ) const ;
173
174//------------------------------------------------------------------------------
175
176 bool
177 check_midpoint( const real aA,
178 const real aB,
179 const real aC,
180 const real aD,
181 const real aE,
182 const real aF,
183 const real aG,
184 const real aH,
185 const real aI ) const ;
186
187//------------------------------------------------------------------------------
188 };
189
190//------------------------------------------------------------------------------
191
192 inline bool
193 CurvedElementChecker::check_linear( Element * aElement )
194 {
195 // do nothing, linear elements are never curved
196 return false ;
197 }
198
199//------------------------------------------------------------------------------
200 inline bool
201 CurvedElementChecker::check_midpoint( const real aA,
202 const real aB,
203 const real aC ) const
204 {
205 return std::abs( aA + aB - aC - aC ) > mTwoMeshEpsilon ;
206 }
207
208//------------------------------------------------------------------------------
209
210 inline bool
211 CurvedElementChecker::check_midpoint( const real aA,
212 const real aB,
213 const real aC,
214 const real aD,
215 const real aE ) const
216 {
217 return std::abs( aA + aB + aC + aD - aE - aE - aE - aE ) > mFourMeshEpsilon ;
218 }
219
220//------------------------------------------------------------------------------
221
222 inline bool
223 CurvedElementChecker::check_midpoint( const real aA,
224 const real aB,
225 const real aC,
226 const real aD,
227 const real aE,
228 const real aF,
229 const real aG,
230 const real aH,
231 const real aI ) const
232 {
233 return std::abs( aA + aB + aC + aD + aE + aF + aG + aH
234 -aI - aI - aI - aI -aI - aI - aI - aI ) > mEightMeshEpsilon ;
235 }
236
237//------------------------------------------------------------------------------
238 }
239}
240#endif //BELFEM_CL_MESH_CURVEDELEMENTCHECKER_HPP
Cell is a wrapper around the standard vector.
Definition cl_Cell.hpp:42
CurvedElementChecker(const uint aMeshDimension, Cell< Block * > &aBlocks, Cell< SideSet * > &aSideSets)
Definition cl_Mesh_CurvedElementChecker.cpp:24
index_t flag_curved_elements()
Definition cl_Mesh_CurvedElementChecker.cpp:38
Lagrange Element baseclass.
Definition cl_Element.hpp:35
Definition cl_EF_EdgeFunction.hpp:17
USER GUIDES:
Definition cl_Capacitor.cpp:16
unsigned int uint
Definition typedefs.hpp:30
int proc_t
Definition commtypes.hpp:29
ElementType
Element types.
Definition Mesh_Enums.hpp:27
uint32_t index_t
Definition typedefs.hpp:52
double real
Definition typedefs.hpp:36