libMesh
Loading...
Searching...
No Matches
cell_inf_hex16.C
Go to the documentation of this file.
1// The libMesh Finite Element Library.
2// Copyright (C) 2002-2026 Benjamin S. Kirk, John W. Peterson, Roy H. Stogner
3
4// This library is free software; you can redistribute it and/or
5// modify it under the terms of the GNU Lesser General Public
6// License as published by the Free Software Foundation; either
7// version 2.1 of the License, or (at your option) any later version.
8
9// This library is distributed in the hope that it will be useful,
10// but WITHOUT ANY WARRANTY; without even the implied warranty of
11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12// Lesser General Public License for more details.
13
14// You should have received a copy of the GNU Lesser General Public
15// License along with this library; if not, write to the Free Software
16// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17
18// Local includes
19#include "libmesh/libmesh_config.h"
20
21#ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
22
23// Local includes cont'd
24#include "libmesh/cell_inf_hex16.h"
25#include "libmesh/edge_edge3.h"
26#include "libmesh/edge_inf_edge2.h"
27#include "libmesh/face_quad8.h"
28#include "libmesh/face_inf_quad6.h"
29#include "libmesh/enum_io_package.h"
30#include "libmesh/enum_order.h"
31
32namespace libMesh
33{
34
35
36// ------------------------------------------------------------
37// InfHex16 class static member initializations
38const int InfHex16::num_nodes;
41
43 {
44 { 0, 1, 2, 3, 8, 9, 10, 11}, // Side 0
45 { 0, 1, 4, 5, 8, 12, 99, 99}, // Side 1
46 { 1, 2, 5, 6, 9, 13, 99, 99}, // Side 2
47 { 2, 3, 6, 7, 10, 14, 99, 99}, // Side 3
48 { 3, 0, 7, 4, 11, 15, 99, 99} // Side 4
49 };
50
52 {
53 {0, 1, 8}, // Edge 0
54 {1, 2, 9}, // Edge 1
55 {2, 3, 10}, // Edge 2
56 {0, 3, 11}, // Edge 3
57 {0, 4, 99}, // Edge 4
58 {1, 5, 99}, // Edge 5
59 {2, 6, 99}, // Edge 6
60 {3, 7, 99} // Edge 7
61 };
62
63// ------------------------------------------------------------
64// InfHex16 class member functions
65
66bool InfHex16::is_node_on_side(const unsigned int n,
67 const unsigned int s) const
68{
69 libmesh_assert_less (s, n_sides());
70 return std::find(std::begin(side_nodes_map[s]),
71 std::end(side_nodes_map[s]),
72 n) != std::end(side_nodes_map[s]);
73}
74
75std::vector<unsigned>
76InfHex16::nodes_on_side(const unsigned int s) const
77{
78 libmesh_assert_less(s, n_sides());
79 auto trim = (s == 0) ? 0 : 2;
80 return {std::begin(side_nodes_map[s]), std::end(side_nodes_map[s]) - trim};
81}
82
83std::vector<unsigned>
84InfHex16::nodes_on_edge(const unsigned int e) const
85{
86 libmesh_assert_less(e, n_edges());
87 auto trim = (e < 4) ? 0 : 1;
88 return {std::begin(edge_nodes_map[e]), std::end(edge_nodes_map[e]) - trim};
89}
90
91bool InfHex16::is_node_on_edge(const unsigned int n,
92 const unsigned int e) const
93{
94 libmesh_assert_less (e, n_edges());
95 return std::find(std::begin(edge_nodes_map[e]),
96 std::end(edge_nodes_map[e]),
97 n) != std::end(edge_nodes_map[e]);
98}
99
100
101
103{
104 return SECOND;
105}
106
107
108
109unsigned int InfHex16::local_side_node(unsigned int side,
110 unsigned int side_node) const
111{
112 libmesh_assert_less (side, this->n_sides());
113
114 // Never more than 8 nodes per side.
115 libmesh_assert_less (side_node, InfHex16::nodes_per_side);
116
117 // Some sides have 6 nodes.
118 libmesh_assert(side == 0 || side_node < 6);
119
120 return InfHex16::side_nodes_map[side][side_node];
121}
122
123
124
125unsigned int InfHex16::local_edge_node(unsigned int edge,
126 unsigned int edge_node) const
127{
128 libmesh_assert_less (edge, this->n_edges());
129
130 // Never more than 3 nodes per edge.
131 libmesh_assert_less (edge_node, InfHex16::nodes_per_edge);
132
133 // Some edges only have 2 nodes.
134 libmesh_assert(edge < 4 || edge_node < 2);
135
136 return InfHex16::edge_nodes_map[edge][edge_node];
137}
138
139
140
141std::unique_ptr<Elem> InfHex16::build_side_ptr (const unsigned int i)
142{
143 libmesh_assert_less (i, this->n_sides());
144
145 std::unique_ptr<Elem> face;
146 // Think of a unit cube: (-1,1) x (-1,1) x (1,1)
147 switch (i)
148 {
149 // the base face
150 case 0:
151 {
152 face = std::make_unique<Quad8>();
153 break;
154 }
155
156 // connecting to another infinite element
157 case 1:
158 case 2:
159 case 3:
160 case 4:
161 {
162 face = std::make_unique<InfQuad6>();
163 break;
164 }
165
166 default:
167 libmesh_error_msg("Invalid side i = " << i);
168 }
169
170 // Set the nodes
171 for (auto n : face->node_index_range())
172 face->set_node(n, this->node_ptr(InfHex16::side_nodes_map[i][n]));
173
174 face->set_interior_parent(this);
175 face->inherit_data_from(*this);
176
177 return face;
178}
179
180
181
182void InfHex16::build_side_ptr (std::unique_ptr<Elem> & side,
183 const unsigned int i)
184{
185 libmesh_assert_less (i, this->n_sides());
186
187 // Think of a unit cube: (-1,1) x (-1,1) x (1,1)
188 switch (i)
189 {
190 // the base face
191 case 0:
192 {
193 if (!side.get() || side->type() != QUAD8)
194 {
195 side = this->build_side_ptr(i);
196 return;
197 }
198 break;
199 }
200
201 // connecting to another infinite element
202 case 1:
203 case 2:
204 case 3:
205 case 4:
206 {
207 if (!side.get() || side->type() != INFQUAD6)
208 {
209 side = this->build_side_ptr(i);
210 return;
211 }
212 break;
213 }
214
215 default:
216 libmesh_error_msg("Invalid side i = " << i);
217 }
218
219 side->inherit_data_from(*this);
220
221 // Set the nodes
222 for (auto n : side->node_index_range())
223 side->set_node(n, this->node_ptr(InfHex16::side_nodes_map[i][n]));
224}
225
226
227
228std::unique_ptr<Elem> InfHex16::build_edge_ptr (const unsigned int i)
229{
230 if (i < 4) // base edges
231 return this->simple_build_edge_ptr<Edge3,InfHex16>(i);
232
233 // infinite edges
234 return this->simple_build_edge_ptr<InfEdge2,InfHex16>(i);
235}
236
237
238
239void InfHex16::build_edge_ptr (std::unique_ptr<Elem> & edge,
240 const unsigned int i)
241{
242 libmesh_assert_less (i, this->n_edges());
243
244 switch (i)
245 {
246 // the base edges
247 case 0:
248 case 1:
249 case 2:
250 case 3:
251 {
252 if (!edge.get() || edge->type() != EDGE3)
253 {
254 edge = this->build_edge_ptr(i);
255 return;
256 }
257 break;
258 }
259
260 // the infinite edges
261 case 4:
262 case 5:
263 case 6:
264 case 7:
265 {
266 if (!edge.get() || edge->type() != INFEDGE2)
267 {
268 edge = this->build_edge_ptr(i);
269 return;
270 }
271 break;
272 }
273
274 default:
275 libmesh_error_msg("Invalid edge i = " << i);
276 }
277
278 edge->inherit_data_from(*this);
279
280 // Set the nodes
281 for (auto n : edge->node_index_range())
282 edge->set_node(n, this->node_ptr(InfHex16::edge_nodes_map[i][n]));
283}
284
285
286
287void InfHex16::connectivity(const unsigned int sc,
288 const IOPackage iop,
289 std::vector<dof_id_type> & conn) const
290{
292 libmesh_assert_less (sc, this->n_sub_elem());
293 libmesh_assert_not_equal_to (iop, INVALID_IO_PACKAGE);
294
295 switch (iop)
296 {
297 case TECPLOT:
298 {
299 switch (sc)
300 {
301 case 0:
302
303 conn[0] = this->node_id(0)+1;
304 conn[1] = this->node_id(1)+1;
305 conn[2] = this->node_id(2)+1;
306 conn[3] = this->node_id(3)+1;
307 conn[4] = this->node_id(4)+1;
308 conn[5] = this->node_id(5)+1;
309 conn[6] = this->node_id(6)+1;
310 conn[7] = this->node_id(7)+1;
311 return;
312
313 default:
314 libmesh_error_msg("Invalid sc = " << sc);
315 }
316 }
317
318 default:
319 libmesh_error_msg("Unsupported IO package " << iop);
320 }
321}
322
323
324
325
326unsigned short int InfHex16::second_order_adjacent_vertex (const unsigned int n,
327 const unsigned int v) const
328{
329 libmesh_assert_greater_equal (n, this->n_vertices());
330 libmesh_assert_less (n, this->n_nodes());
331 libmesh_assert_less (v, 2);
332 // note that the _second_order_adjacent_vertices matrix is
333 // stored in \p InfHex
334 return _second_order_adjacent_vertices[n-this->n_vertices()][v];
335}
336
337
338
339std::pair<unsigned short int, unsigned short int>
340InfHex16::second_order_child_vertex (const unsigned int n) const
341{
342 libmesh_assert_greater_equal (n, this->n_vertices());
343 libmesh_assert_less (n, this->n_nodes());
344 /*
345 * the _second_order_vertex_child_* vectors are
346 * stored in cell_inf_hex.C, since they are identical
347 * for InfHex16 and InfHex18
348 */
349 return std::pair<unsigned short int, unsigned short int>
352}
353
354
355
356
357
358#ifdef LIBMESH_ENABLE_AMR
359
361 {
362 // embedding matrix for child 0
363 {
364 // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 th parent Node
365 { 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}, // 0th child N.
366 { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}, // 1
367 { -0.25, -0.25, -0.25, -0.25, 0.0, 0.0, 0.0, 0.0, 0.5, 0.5, 0.5, 0.5, 0.0, 0.0, 0.0, 0.0}, // 2
368 { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0}, // 3
369 { 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}, // 4
370 { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0}, // 5
371 { 0.0, 0.0, 0.0, 0.0, -0.25, -0.25, -0.25, -0.25, 0.0, 0.0, 0.0, 0.0, 0.5, 0.5, 0.5, 0.5}, // 6
372 { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0}, // 7
373 { 0.375, -0.125, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.75, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}, // 8
374 { -0.1875, -0.1875, -0.1875, -0.1875, 0.0, 0.0, 0.0, 0.0, 0.75, 0.375, 0.25, 0.375, 0.0, 0.0, 0.0, 0.0}, // 9
375 { -0.1875, -0.1875, -0.1875, -0.1875, 0.0, 0.0, 0.0, 0.0, 0.375, 0.25, 0.375, 0.75, 0.0, 0.0, 0.0, 0.0}, // 10
376 { 0.375, 0.0, 0.0, -0.125, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.75, 0.0, 0.0, 0.0, 0.0}, // 11
377 { 0.0, 0.0, 0.0, 0.0, 0.375, -0.125, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.75, 0.0, 0.0, 0.0}, // 12
378 { 0.0, 0.0, 0.0, 0.0, -0.1875, -0.1875, -0.1875, -0.1875, 0.0, 0.0, 0.0, 0.0, 0.75, 0.375, 0.25, 0.375}, // 13
379 { 0.0, 0.0, 0.0, 0.0, -0.1875, -0.1875, -0.1875, -0.1875, 0.0, 0.0, 0.0, 0.0, 0.375, 0.25, 0.375, 0.75}, // 14
380 { 0.0, 0.0, 0.0, 0.0, 0.375, 0.0, 0.0, -0.125, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.75} // 15
381 },
382
383 // embedding matrix for child 1
384 {
385 // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 th parent Node
386 { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}, // 0th child N.
387 { 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}, // 1
388 { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}, // 2
389 { -0.25, -0.25, -0.25, -0.25, 0.0, 0.0, 0.0, 0.0, 0.5, 0.5, 0.5, 0.5, 0.0, 0.0, 0.0, 0.0}, // 3
390 { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0}, // 4
391 { 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}, // 5
392 { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0}, // 6
393 { 0.0, 0.0, 0.0, 0.0, -0.25, -0.25, -0.25, -0.25, 0.0, 0.0, 0.0, 0.0, 0.5, 0.5, 0.5, 0.5}, // 7
394 { -0.125, 0.375, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.75, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}, // 8
395 { 0.0, 0.375, -0.125, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.75, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}, // 9
396 { -0.1875, -0.1875, -0.1875, -0.1875, 0.0, 0.0, 0.0, 0.0, 0.375, 0.75, 0.375, 0.25, 0.0, 0.0, 0.0, 0.0}, // 10
397 { -0.1875, -0.1875, -0.1875, -0.1875, 0.0, 0.0, 0.0, 0.0, 0.75, 0.375, 0.25, 0.375, 0.0, 0.0, 0.0, 0.0}, // 11
398 { 0.0, 0.0, 0.0, 0.0, -0.125, 0.375, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.75, 0.0, 0.0, 0.0}, // 12
399 { 0.0, 0.0, 0.0, 0.0, 0.0, 0.375, -0.125, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.75, 0.0, 0.0}, // 13
400 { 0.0, 0.0, 0.0, 0.0, -0.1875, -0.1875, -0.1875, -0.1875, 0.0, 0.0, 0.0, 0.0, 0.375, 0.75, 0.375, 0.25}, // 14
401 { 0.0, 0.0, 0.0, 0.0, -0.1875, -0.1875, -0.1875, -0.1875, 0.0, 0.0, 0.0, 0.0, 0.75, 0.375, 0.25, 0.375} // 15
402 },
403
404 // embedding matrix for child 2
405 {
406 // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 th parent Node
407 { -0.25, -0.25, -0.25, -0.25, 0.0, 0.0, 0.0, 0.0, 0.5, 0.5, 0.5, 0.5, 0.0, 0.0, 0.0, 0.0}, // 0th child N.
408 { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}, // 1
409 { 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}, // 2
410 { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0}, // 3
411 { 0.0, 0.0, 0.0, 0.0, -0.25, -0.25, -0.25, -0.25, 0.0, 0.0, 0.0, 0.0, 0.5, 0.5, 0.5, 0.5}, // 4
412 { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0}, // 5
413 { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}, // 6
414 { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0}, // 7
415 { -0.1875, -0.1875, -0.1875, -0.1875, 0.0, 0.0, 0.0, 0.0, 0.375, 0.75, 0.375, 0.25, 0.0, 0.0, 0.0, 0.0}, // 8
416 { 0.0, -0.125, 0.375, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.75, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}, // 9
417 { 0.0, 0.0, 0.375, -0.125, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.75, 0.0, 0.0, 0.0, 0.0, 0.0}, // 10
418 { -0.1875, -0.1875, -0.1875, -0.1875, 0.0, 0.0, 0.0, 0.0, 0.25, 0.375, 0.75, 0.375, 0.0, 0.0, 0.0, 0.0}, // 11
419 { 0.0, 0.0, 0.0, 0.0, -0.1875, -0.1875, -0.1875, -0.1875, 0.0, 0.0, 0.0, 0.0, 0.375, 0.75, 0.375, 0.25}, // 12
420 { 0.0, 0.0, 0.0, 0.0, 0.0, -0.125, 0.375, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.75, 0.0, 0.0}, // 13
421 { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.375, -0.125, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.75, 0.0}, // 14
422 { 0.0, 0.0, 0.0, 0.0, -0.1875, -0.1875, -0.1875, -0.1875, 0.0, 0.0, 0.0, 0.0, 0.25, 0.375, 0.75, 0.375} // 15
423 },
424
425 // embedding matrix for child 3
426 {
427 // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 th parent Node
428 { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0}, // 0th child N.
429 { -0.25, -0.25, -0.25, -0.25, 0.0, 0.0, 0.0, 0.0, 0.5, 0.5, 0.5, 0.5, 0.0, 0.0, 0.0, 0.0}, // 1
430 { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0}, // 2
431 { 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}, // 3
432 { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0}, // 4
433 { 0.0, 0.0, 0.0, 0.0, -0.25, -0.25, -0.25, -0.25, 0.0, 0.0, 0.0, 0.0, 0.5, 0.5, 0.5, 0.5}, // 5
434 { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0}, // 6
435 { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}, // 7
436 { -0.1875, -0.1875, -0.1875, -0.1875, 0.0, 0.0, 0.0, 0.0, 0.375, 0.25, 0.375, 0.75, 0.0, 0.0, 0.0, 0.0}, // 8
437 { -0.1875, -0.1875, -0.1875, -0.1875, 0.0, 0.0, 0.0, 0.0, 0.25, 0.375, 0.75, 0.375, 0.0, 0.0, 0.0, 0.0}, // 9
438 { 0.0, 0.0, -0.125, 0.375, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.75, 0.0, 0.0, 0.0, 0.0, 0.0}, // 10
439 { -0.125, 0.0, 0.0, 0.375, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.75, 0.0, 0.0, 0.0, 0.0}, // 11
440 { 0.0, 0.0, 0.0, 0.0, -0.1875, -0.1875, -0.1875, -0.1875, 0.0, 0.0, 0.0, 0.0, 0.375, 0.25, 0.375, 0.75}, // 12
441 { 0.0, 0.0, 0.0, 0.0, -0.1875, -0.1875, -0.1875, -0.1875, 0.0, 0.0, 0.0, 0.0, 0.25, 0.375, 0.75, 0.375}, // 13
442 { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.125, 0.375, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.75, 0.0}, // 14
443 { 0.0, 0.0, 0.0, 0.0, -0.125, 0.0, 0.0, 0.375, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.75} // 15
444 }
445 };
446
447
448#endif
449
450
451void
452InfHex16::permute(unsigned int perm_num)
453{
454 libmesh_assert_less (perm_num, 4);
455
456 for (unsigned int i = 0; i != perm_num; ++i)
457 {
458 swap4nodes(0,1,2,3);
459 swap4nodes(4,5,6,7);
460 swap4nodes(8,9,10,11);
461 swap4nodes(12,13,14,15);
462 swap4neighbors(1,2,3,4);
463 }
464}
465
466
467void
469{
470 libmesh_assert(boundary_info);
471
472 swap2nodes(0,1);
473 swap2nodes(2,3);
474 swap2nodes(4,5);
475 swap2nodes(6,7);
476 swap2nodes(9,11);
477 swap2nodes(13,15);
478 swap2neighbors(2,4);
479 swap2boundarysides(2,4,boundary_info);
480 swap2boundaryedges(1,3,boundary_info);
481 swap2boundaryedges(4,5,boundary_info);
482 swap2boundaryedges(6,7,boundary_info);
483}
484
485
487InfHex16::side_type (const unsigned int s) const
488{
489 libmesh_assert_less (s, 5);
490 if (s == 0)
491 return QUAD8;
492 return INFQUAD6;
493}
494
495
496} // namespace libMesh
497
498#endif // ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
The BoundaryInfo class contains information relevant to boundary conditions including storing faces,...
void swap4nodes(unsigned int n1, unsigned int n2, unsigned int n3, unsigned int n4)
Swaps four node_ptrs, "rotating" them.
Definition elem.h:2152
void swap2nodes(unsigned int n1, unsigned int n2)
Swaps two node_ptrs.
Definition elem.h:2101
Node ** _nodes
Pointers to the nodes we are connected to.
Definition elem.h:2254
void swap2neighbors(unsigned int n1, unsigned int n2)
Swaps two neighbor_ptrs.
Definition elem.h:2111
void swap2boundarysides(unsigned short s1, unsigned short s2, BoundaryInfo *boundary_info) const
Swaps two sides in boundary_info, if it is non-null.
Definition elem.C:3579
void swap2boundaryedges(unsigned short e1, unsigned short e2, BoundaryInfo *boundary_info) const
Swaps two edges in boundary_info, if it is non-null.
Definition elem.C:3595
dof_id_type node_id(const unsigned int i) const
Definition elem.h:2484
void swap4neighbors(unsigned int n1, unsigned int n2, unsigned int n3, unsigned int n4)
Swaps four neighbor_ptrs, "rotating" them.
Definition elem.h:2162
virtual std::unique_ptr< Elem > build_side_ptr(const unsigned int i) override
virtual bool is_node_on_edge(const unsigned int n, const unsigned int e) const override
virtual unsigned int n_nodes() const override
static const unsigned int side_nodes_map[num_sides][nodes_per_side]
This maps the node of the side to element node numbers.
ElemType side_type(const unsigned int s) const override final
virtual unsigned short int second_order_adjacent_vertex(const unsigned int n, const unsigned int v) const override
virtual void connectivity(const unsigned int sc, const IOPackage iop, std::vector< dof_id_type > &conn) const override
static const int nodes_per_edge
static const int nodes_per_side
static const int num_nodes
Geometric constants for InfHex16.
virtual unsigned int local_edge_node(unsigned int edge, unsigned int edge_node) const override
virtual unsigned int local_side_node(unsigned int side, unsigned int side_node) const override
virtual void permute(unsigned int perm_num) override final
Permutes the element (by swapping node and neighbor pointers) according to the specified index.
virtual std::vector< unsigned int > nodes_on_edge(const unsigned int e) const override
virtual Order default_order() const override
static const unsigned int edge_nodes_map[num_edges][nodes_per_edge]
This maps the node of the edge to element node numbers.
virtual std::pair< unsigned short int, unsigned short int > second_order_child_vertex(const unsigned int n) const override
virtual unsigned int n_sub_elem() const override
virtual std::vector< unsigned int > nodes_on_side(const unsigned int s) const override
virtual std::unique_ptr< Elem > build_edge_ptr(const unsigned int i) override
virtual void flip(BoundaryInfo *) override final
Flips the element (by swapping node and neighbor pointers) to have a mapping Jacobian of opposite sig...
virtual bool is_node_on_side(const unsigned int n, const unsigned int s) const override
static const Real _embedding_matrix[num_children][num_nodes][num_nodes]
Matrix that computes new nodal locations/solution values from current nodes/solution.
static const unsigned short int _second_order_adjacent_vertices[8][2]
For higher-order elements, namely InfHex16 and InfHex18, the matrices for adjacent vertices of second...
static const unsigned short int _second_order_vertex_child_index[18]
Vector that names the child vertex index for each second order node.
static const int num_children
virtual unsigned int n_edges() const override final
static const int num_edges
virtual unsigned int n_sides() const override final
static const unsigned short int _second_order_vertex_child_number[18]
Vector that names a child sharing each second order node.
static const int num_sides
Geometric constants for all InfHexes.
virtual unsigned int n_vertices() const override final
The libMesh namespace provides an interface to certain functionality in the library.
IOPackage
libMesh interfaces with several different software packages for the purposes of creating,...
ElemType
Defines an enum for geometric element types.
libmesh_assert(ctx)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real