svMultiPhysics
All Classes Namespaces Files Functions Variables Pages
nn_elem_props.h
1/* Copyright (c) Stanford University, The Regents of the University of California, and others.
2 *
3 * All Rights Reserved.
4 *
5 * See Copyright-SimVascular.txt for additional details.
6 *
7 * Permission is hereby granted, free of charge, to any person obtaining
8 * a copy of this software and associated documentation files (the
9 * "Software"), to deal in the Software without restriction, including
10 * without limitation the rights to use, copy, modify, merge, publish,
11 * distribute, sublicense, and/or sell copies of the Software, and to
12 * permit persons to whom the Software is furnished to do so, subject
13 * to the following conditions:
14 *
15 * The above copyright notice and this permission notice shall be included
16 * in all copies or substantial portions of the Software.
17 *
18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
19 * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
20 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
21 * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
22 * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
23 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
24 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
25 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
26 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
27 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
28 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */
30
31/// @brief Define a map type used to set element properties.
32using SetElementPropsMapType = std::map<int, std::function<void(int, mshType&)>>;
33
34/// @brief Map used to set 3D element properties.
35///
36/// This replicates the case statement in the Fortran 'SUBROUTINE SELECTELE(lM)'
37/// defined in NN.f.
38//
39SetElementPropsMapType set_3d_element_props = {
40
41 {4, [](int insd, mshType& mesh) -> void {
42 mesh.eType = ElementType::TET4;
43 mesh.nG = 4;
44 mesh.vtkType = 10;
45 mesh.nEf = 4;
46 mesh.lShpF = true;
47 }
48 },
49
50 {6, [](int insd, mshType& mesh) -> void {
51 mesh.eType = ElementType::WDG;
52 mesh.nG = 6;
53 mesh.vtkType = 13;
54 mesh.nEf = 3;
55 mesh.lShpF = true;
56 }
57 },
58
59 {8, [](int insd, mshType& mesh) -> void {
60 mesh.eType = ElementType::HEX8;
61 mesh.nG = 8;
62 mesh.vtkType = 12;
63 mesh.nEf = 6;
64 mesh.lShpF = false;
65 }
66 },
67
68 {20, [](int insd, mshType& mesh) -> void {
69 mesh.eType = ElementType::HEX20;
70 mesh.nG = 27;
71 mesh.vtkType = 25;
72 mesh.nEf = 6;
73 mesh.lShpF = false;
74 }
75 },
76
77 {27, [](int insd, mshType& mesh) -> void {
78 mesh.eType = ElementType::HEX27;
79 mesh.nG = 27;
80 mesh.vtkType = 29;
81 mesh.nEf = 6;
82 mesh.lShpF = false;
83 }
84 },
85
86 {10, [](int insd, mshType& mesh) -> void {
87 mesh.eType = ElementType::TET10;
88 mesh.nG = 15;
89 mesh.vtkType = 24;
90 mesh.nEf = 4;
91 mesh.lShpF = false;
92 }
93 },
94
95 {20, [](int insd, mshType& mesh) -> void {
96 mesh.eType = ElementType::HEX20;
97 mesh.nG = 27;
98 mesh.vtkType = 25;
99 mesh.nEf = 6;
100 mesh.lShpF = false;
101 }
102 },
103
104 {27, [](int insd, mshType& mesh) -> void {
105 mesh.eType = ElementType::HEX27;
106 mesh.nG = 27;
107 mesh.vtkType = 29;
108 mesh.nEf = 6;
109 mesh.lShpF = false;
110 }
111 },
112};
113
114//---------------------
115// set_2d_element_props
116//---------------------
117// Map used to set 2D element properties.
118//
119SetElementPropsMapType set_2d_element_props = {
120
121 {3, [](int insd, mshType& mesh) -> void {
122 mesh.eType = ElementType::TRI3;
123 mesh.nG = 3;
124 mesh.vtkType = 5;
125 mesh.nEf = 3;
126 mesh.lShpF = true;
127 }
128 },
129
130 {4, [](int insd, mshType& mesh) -> void {
131 mesh.eType = ElementType::QUD4;
132 mesh.nG = 4;
133 mesh.vtkType = 9;
134 mesh.nEf = 4;
135 mesh.lShpF = false;
136 }
137 },
138
139 {6, [](int insd, mshType& mesh) -> void {
140 mesh.eType = ElementType::TRI6;
141 mesh.nG = 7;
142 mesh.vtkType = 22;
143 mesh.nEf = 3;
144 mesh.lShpF = false;
145 }
146 },
147
148 {8, [](int insd, mshType& mesh) -> void {
149 mesh.eType = ElementType::QUD8;
150 mesh.nG = 9;
151 mesh.vtkType = 23;
152 mesh.nEf = 4;
153 mesh.lShpF = false;
154 }
155 },
156
157 {9, [](int insd, mshType& mesh) -> void {
158 mesh.eType = ElementType::QUD9;
159 mesh.nG = 9;
160 mesh.vtkType = 28;
161 mesh.nEf = 4;
162 mesh.lShpF = false;
163 }
164 },
165};
166
167/// @brief Map used to set 1D element properties.
168//
169SetElementPropsMapType set_1d_element_props = {
170
171 {2, [](int insd, mshType& mesh) -> void {
172 mesh.eType = ElementType::LIN1;
173 mesh.nG = 2;
174 mesh.vtkType = 3;
175 mesh.nEf = 2;
176 mesh.lShpF = true;
177 }
178 },
179
180 {3, [](int insd, mshType& mesh) -> void {
181 mesh.eType = ElementType::LIN2;
182 mesh.nG = 3;
183 mesh.vtkType = 21;
184 mesh.nEf = 2;
185 mesh.lShpF = false;
186 }
187 },
188};
189
190/// @brief Define a map type used to set face properties.
191using SetFacePropsMapType = std::map<int, std::function<void(int, faceType&)>>;
192
193/// @brief Map used to set face properties.
194///
195/// set_face_element_props[eNoN].
196///
197/// Replaces the Fortan 'select' statemnt in 'SELECTELEB'.
198//
199SetFacePropsMapType set_face_element_props = {
200
201 {1, [](int insd, faceType& face) -> void
202 {
203 face.eType = ElementType::PNT;
204 face.nG = 1;
205 }
206 },
207
208 // Two nodes per element.
209 //
210 {2, [](int insd, faceType& face) -> void
211 {
212 if (insd == 1) {
213 face.eType = ElementType::LIN1;
214 face.nG = 2;
215 }
216 }
217 },
218
219 {3, [](int insd, faceType& face) -> void
220 {
221 if (insd == 2) {
222 face.eType = ElementType::TRI3;
223 } else {
224 face.eType = ElementType::LIN2;
225 }
226 face.nG = 3;
227 }
228 },
229
230 {4, [](int insd, faceType& face) -> void {
231 face.eType = ElementType::QUD4;
232 face.nG = 4;
233 }
234 },
235
236 {6, [](int insd, faceType& face) -> void {
237 face.eType = ElementType::TRI6;
238 face.nG = 7;
239 }
240 },
241
242 {8, [](int insd, faceType& face) -> void {
243 face.eType = ElementType::QUD8;
244 face.nG = 9;
245 }
246 },
247
248 {9, [](int insd, faceType& face) -> void {
249 face.eType = ElementType::QUD9;
250 face.nG = 9;
251 }
252 },
253
254
255};
256
The face type containing mesh at boundary.
Definition ComMod.h:521
This is the container for a mesh or NURBS patch, those specific to NURBS are noted.
Definition ComMod.h:832