libMesh
cell_inf_hex16.C
Go to the documentation of this file.
1 // The libMesh Finite Element Library.
2 // Copyright (C) 2002-2024 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/side.h"
30 #include "libmesh/enum_io_package.h"
31 #include "libmesh/enum_order.h"
32 
33 namespace libMesh
34 {
35 
36 
37 // ------------------------------------------------------------
38 // InfHex16 class static member initializations
39 const int InfHex16::num_nodes;
40 const int InfHex16::num_sides;
41 const int InfHex16::num_edges;
42 const int InfHex16::num_children;
43 const int InfHex16::nodes_per_side;
44 const int InfHex16::nodes_per_edge;
45 
47  {
48  { 0, 1, 2, 3, 8, 9, 10, 11}, // Side 0
49  { 0, 1, 4, 5, 8, 12, 99, 99}, // Side 1
50  { 1, 2, 5, 6, 9, 13, 99, 99}, // Side 2
51  { 2, 3, 6, 7, 10, 14, 99, 99}, // Side 3
52  { 3, 0, 7, 4, 11, 15, 99, 99} // Side 4
53  };
54 
56  {
57  {0, 1, 8}, // Edge 0
58  {1, 2, 9}, // Edge 1
59  {2, 3, 10}, // Edge 2
60  {0, 3, 11}, // Edge 3
61  {0, 4, 99}, // Edge 4
62  {1, 5, 99}, // Edge 5
63  {2, 6, 99}, // Edge 6
64  {3, 7, 99} // Edge 7
65  };
66 
67 // ------------------------------------------------------------
68 // InfHex16 class member functions
69 
70 bool InfHex16::is_node_on_side(const unsigned int n,
71  const unsigned int s) const
72 {
73  libmesh_assert_less (s, n_sides());
74  return std::find(std::begin(side_nodes_map[s]),
75  std::end(side_nodes_map[s]),
76  n) != std::end(side_nodes_map[s]);
77 }
78 
79 std::vector<unsigned>
80 InfHex16::nodes_on_side(const unsigned int s) const
81 {
82  libmesh_assert_less(s, n_sides());
83  auto trim = (s == 0) ? 0 : 2;
84  return {std::begin(side_nodes_map[s]), std::end(side_nodes_map[s]) - trim};
85 }
86 
87 std::vector<unsigned>
88 InfHex16::nodes_on_edge(const unsigned int e) const
89 {
90  libmesh_assert_less(e, n_edges());
91  auto trim = (e < 4) ? 0 : 1;
92  return {std::begin(edge_nodes_map[e]), std::end(edge_nodes_map[e]) - trim};
93 }
94 
95 bool InfHex16::is_node_on_edge(const unsigned int n,
96  const unsigned int e) const
97 {
98  libmesh_assert_less (e, n_edges());
99  return std::find(std::begin(edge_nodes_map[e]),
100  std::end(edge_nodes_map[e]),
101  n) != std::end(edge_nodes_map[e]);
102 }
103 
104 
105 
107 {
108  return SECOND;
109 }
110 
111 
112 
113 unsigned int InfHex16::local_side_node(unsigned int side,
114  unsigned int side_node) const
115 {
116  libmesh_assert_less (side, this->n_sides());
117 
118  // Never more than 8 nodes per side.
119  libmesh_assert_less (side_node, InfHex16::nodes_per_side);
120 
121  // Some sides have 6 nodes.
122  libmesh_assert(side == 0 || side_node < 6);
123 
124  return InfHex16::side_nodes_map[side][side_node];
125 }
126 
127 
128 
129 unsigned int InfHex16::local_edge_node(unsigned int edge,
130  unsigned int edge_node) const
131 {
132  libmesh_assert_less (edge, this->n_edges());
133 
134  // Never more than 3 nodes per edge.
135  libmesh_assert_less (edge_node, InfHex16::nodes_per_edge);
136 
137  // Some edges only have 2 nodes.
138  libmesh_assert(edge < 4 || edge_node < 2);
139 
140  return InfHex16::edge_nodes_map[edge][edge_node];
141 }
142 
143 
144 
145 std::unique_ptr<Elem> InfHex16::build_side_ptr (const unsigned int i,
146  bool proxy)
147 {
148  libmesh_assert_less (i, this->n_sides());
149 
150  std::unique_ptr<Elem> face;
151  if (proxy)
152  {
153 #ifdef LIBMESH_ENABLE_DEPRECATED
154  libmesh_deprecated();
155  switch (i)
156  {
157  // base
158  case 0:
159  {
160  face = std::make_unique<Side<Quad8,InfHex16>>(this,i);
161  break;
162  }
163 
164  // ifem sides
165  case 1:
166  case 2:
167  case 3:
168  case 4:
169  {
170  face = std::make_unique<Side<InfQuad6,InfHex16>>(this,i);
171  break;
172  }
173 
174  default:
175  libmesh_error_msg("Invalid side i = " << i);
176  }
177 #else
178  libmesh_error();
179 #endif // LIBMESH_ENABLE_DEPRECATED
180  }
181  else
182  {
183  // Think of a unit cube: (-1,1) x (-1,1) x (1,1)
184  switch (i)
185  {
186  // the base face
187  case 0:
188  {
189  face = std::make_unique<Quad8>(this);
190  break;
191  }
192 
193  // connecting to another infinite element
194  case 1:
195  case 2:
196  case 3:
197  case 4:
198  {
199  face = std::make_unique<InfQuad6>(this);
200  break;
201  }
202 
203  default:
204  libmesh_error_msg("Invalid side i = " << i);
205  }
206 
207  // Set the nodes
208  for (auto n : face->node_index_range())
209  face->set_node(n) = this->node_ptr(InfHex16::side_nodes_map[i][n]);
210  }
211 
212 #ifdef LIBMESH_ENABLE_DEPRECATED
213  if (!proxy) // proxy sides used to leave parent() set
214 #endif
215  face->set_parent(nullptr);
216  face->set_interior_parent(this);
217 
218  face->subdomain_id() = this->subdomain_id();
219  face->set_mapping_type(this->mapping_type());
220 #ifdef LIBMESH_ENABLE_AMR
221  face->set_p_level(this->p_level());
222 #endif
223 
224  return face;
225 }
226 
227 
228 
229 void InfHex16::build_side_ptr (std::unique_ptr<Elem> & side,
230  const unsigned int i)
231 {
232  libmesh_assert_less (i, this->n_sides());
233 
234  // Think of a unit cube: (-1,1) x (-1,1) x (1,1)
235  switch (i)
236  {
237  // the base face
238  case 0:
239  {
240  if (!side.get() || side->type() != QUAD8)
241  {
242  side = this->build_side_ptr(i, false);
243  return;
244  }
245  break;
246  }
247 
248  // connecting to another infinite element
249  case 1:
250  case 2:
251  case 3:
252  case 4:
253  {
254  if (!side.get() || side->type() != INFQUAD6)
255  {
256  side = this->build_side_ptr(i, false);
257  return;
258  }
259  break;
260  }
261 
262  default:
263  libmesh_error_msg("Invalid side i = " << i);
264  }
265 
266  side->subdomain_id() = this->subdomain_id();
267  side->set_mapping_type(this->mapping_type());
268 
269  // Set the nodes
270  for (auto n : side->node_index_range())
271  side->set_node(n) = this->node_ptr(InfHex16::side_nodes_map[i][n]);
272 }
273 
274 
275 
276 std::unique_ptr<Elem> InfHex16::build_edge_ptr (const unsigned int i)
277 {
278  if (i < 4) // base edges
279  return this->simple_build_edge_ptr<Edge3,InfHex16>(i);
280 
281  // infinite edges
282  return this->simple_build_edge_ptr<InfEdge2,InfHex16>(i);
283 }
284 
285 
286 
287 void InfHex16::build_edge_ptr (std::unique_ptr<Elem> & edge,
288  const unsigned int i)
289 {
290  libmesh_assert_less (i, this->n_edges());
291 
292  switch (i)
293  {
294  // the base edges
295  case 0:
296  case 1:
297  case 2:
298  case 3:
299  {
300  if (!edge.get() || edge->type() != EDGE3)
301  {
302  edge = this->build_edge_ptr(i);
303  return;
304  }
305  break;
306  }
307 
308  // the infinite edges
309  case 4:
310  case 5:
311  case 6:
312  case 7:
313  {
314  if (!edge.get() || edge->type() != INFEDGE2)
315  {
316  edge = this->build_edge_ptr(i);
317  return;
318  }
319  break;
320  }
321 
322  default:
323  libmesh_error_msg("Invalid edge i = " << i);
324  }
325 
326  edge->subdomain_id() = this->subdomain_id();
327  edge->set_mapping_type(this->mapping_type());
328 #ifdef LIBMESH_ENABLE_AMR
329  edge->set_p_level(this->p_level());
330 #endif
331 
332  // Set the nodes
333  for (auto n : edge->node_index_range())
334  edge->set_node(n) = this->node_ptr(InfHex16::edge_nodes_map[i][n]);
335 }
336 
337 
338 
339 void InfHex16::connectivity(const unsigned int sc,
340  const IOPackage iop,
341  std::vector<dof_id_type> & conn) const
342 {
344  libmesh_assert_less (sc, this->n_sub_elem());
345  libmesh_assert_not_equal_to (iop, INVALID_IO_PACKAGE);
346 
347  switch (iop)
348  {
349  case TECPLOT:
350  {
351  switch (sc)
352  {
353  case 0:
354 
355  conn[0] = this->node_id(0)+1;
356  conn[1] = this->node_id(1)+1;
357  conn[2] = this->node_id(2)+1;
358  conn[3] = this->node_id(3)+1;
359  conn[4] = this->node_id(4)+1;
360  conn[5] = this->node_id(5)+1;
361  conn[6] = this->node_id(6)+1;
362  conn[7] = this->node_id(7)+1;
363  return;
364 
365  default:
366  libmesh_error_msg("Invalid sc = " << sc);
367  }
368  }
369 
370  default:
371  libmesh_error_msg("Unsupported IO package " << iop);
372  }
373 }
374 
375 
376 
377 
378 unsigned short int InfHex16::second_order_adjacent_vertex (const unsigned int n,
379  const unsigned int v) const
380 {
381  libmesh_assert_greater_equal (n, this->n_vertices());
382  libmesh_assert_less (n, this->n_nodes());
383  libmesh_assert_less (v, 2);
384  // note that the _second_order_adjacent_vertices matrix is
385  // stored in \p InfHex
386  return _second_order_adjacent_vertices[n-this->n_vertices()][v];
387 }
388 
389 
390 
391 std::pair<unsigned short int, unsigned short int>
392 InfHex16::second_order_child_vertex (const unsigned int n) const
393 {
394  libmesh_assert_greater_equal (n, this->n_vertices());
395  libmesh_assert_less (n, this->n_nodes());
396  /*
397  * the _second_order_vertex_child_* vectors are
398  * stored in cell_inf_hex.C, since they are identical
399  * for InfHex16 and InfHex18
400  */
401  return std::pair<unsigned short int, unsigned short int>
404 }
405 
406 
407 
408 
409 
410 #ifdef LIBMESH_ENABLE_AMR
411 
413  {
414  // embedding matrix for child 0
415  {
416  // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 th parent Node
417  { 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.
418  { 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
419  { -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
420  { 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
421  { 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
422  { 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
423  { 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
424  { 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
425  { 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
426  { -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
427  { -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
428  { 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
429  { 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
430  { 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
431  { 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
432  { 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
433  },
434 
435  // embedding matrix for child 1
436  {
437  // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 th parent Node
438  { 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.
439  { 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
440  { 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
441  { -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
442  { 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
443  { 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
444  { 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
445  { 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
446  { -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
447  { 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
448  { -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
449  { -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
450  { 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
451  { 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
452  { 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
453  { 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
454  },
455 
456  // embedding matrix for child 2
457  {
458  // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 th parent Node
459  { -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.
460  { 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
461  { 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
462  { 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
463  { 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
464  { 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
465  { 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
466  { 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
467  { -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
468  { 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
469  { 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
470  { -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
471  { 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
472  { 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
473  { 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
474  { 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
475  },
476 
477  // embedding matrix for child 3
478  {
479  // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 th parent Node
480  { 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.
481  { -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
482  { 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
483  { 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
484  { 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
485  { 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
486  { 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
487  { 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
488  { -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
489  { -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
490  { 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
491  { -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
492  { 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
493  { 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
494  { 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
495  { 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
496  }
497  };
498 
499 
500 #endif
501 
502 
503 void
504 InfHex16::permute(unsigned int perm_num)
505 {
506  libmesh_assert_less (perm_num, 4);
507 
508  for (unsigned int i = 0; i != perm_num; ++i)
509  {
510  swap4nodes(0,1,2,3);
511  swap4nodes(4,5,6,7);
512  swap4nodes(8,9,10,11);
513  swap4nodes(12,13,14,15);
514  swap4neighbors(1,2,3,4);
515  }
516 }
517 
518 
519 void
520 InfHex16::flip(BoundaryInfo * boundary_info)
521 {
522  swap2nodes(0,1);
523  swap2nodes(2,3);
524  swap2nodes(4,5);
525  swap2nodes(6,7);
526  swap2nodes(9,11);
527  swap2nodes(13,15);
528  swap2neighbors(2,4);
529  swap2boundarysides(2,4,boundary_info);
530  swap2boundaryedges(1,3,boundary_info);
531  swap2boundaryedges(4,5,boundary_info);
532  swap2boundaryedges(6,7,boundary_info);
533 }
534 
535 
536 ElemType
537 InfHex16::side_type (const unsigned int s) const
538 {
539  libmesh_assert_less (s, 5);
540  if (s == 0)
541  return QUAD8;
542  return INFQUAD6;
543 }
544 
545 
546 } // namespace libMesh
547 
548 #endif // ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
ElemType
Defines an enum for geometric element types.
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:3171
Order
defines an enum for polynomial orders.
Definition: enum_order.h:40
Node ** _nodes
Pointers to the nodes we are connected to.
Definition: elem.h:2087
static const int nodes_per_edge
virtual std::pair< unsigned short int, unsigned short int > second_order_child_vertex(const unsigned int n) const override
IOPackage
libMesh interfaces with several different software packages for the purposes of creating, reading, and writing mesh files.
virtual std::vector< unsigned int > nodes_on_side(const unsigned int s) const override
static const int num_edges
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:3155
unsigned int p_level() const
Definition: elem.h:2945
static const int num_nodes
Geometric constants for InfHex16.
The libMesh namespace provides an interface to certain functionality in the library.
static const unsigned int edge_nodes_map[num_edges][nodes_per_edge]
This maps the node of the edge to element node numbers.
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...
Definition: cell_inf_hex.h:238
virtual unsigned int local_edge_node(unsigned int edge, unsigned int edge_node) const override
virtual Order default_order() const override
void swap4nodes(unsigned int n1, unsigned int n2, unsigned int n3, unsigned int n4)
Swaps four node_ptrs, "rotating" them.
Definition: elem.h:1984
virtual void flip(BoundaryInfo *) override final
Flips the element (by swapping node and neighbor pointers) to have a mapping Jacobian of opposite sig...
virtual std::unique_ptr< Elem > build_edge_ptr(const unsigned int i) override
ElemMappingType mapping_type() const
Definition: elem.h:2957
void swap2nodes(unsigned int n1, unsigned int n2)
Swaps two node_ptrs.
Definition: elem.h:1933
static const unsigned int side_nodes_map[num_sides][nodes_per_side]
This maps the node of the side to element node numbers.
static const Real _embedding_matrix[num_children][num_nodes][num_nodes]
Matrix that computes new nodal locations/solution values from current nodes/solution.
ElemType side_type(const unsigned int s) const override final
static const int num_children
virtual void permute(unsigned int perm_num) override final
Permutes the element (by swapping node and neighbor pointers) according to the specified index...
The BoundaryInfo class contains information relevant to boundary conditions including storing faces...
Definition: boundary_info.h:57
libmesh_assert(ctx)
virtual unsigned int n_vertices() const override final
Definition: cell_inf_hex.h:92
virtual std::vector< unsigned int > nodes_on_edge(const unsigned int e) const override
virtual unsigned int n_sub_elem() const override
virtual unsigned int local_side_node(unsigned int side, unsigned int side_node) const override
void swap2neighbors(unsigned int n1, unsigned int n2)
Swaps two neighbor_ptrs.
Definition: elem.h:1943
static const unsigned short int _second_order_vertex_child_index[18]
Vector that names the child vertex index for each second order node.
Definition: cell_inf_hex.h:248
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual bool is_node_on_side(const unsigned int n, const unsigned int s) const override
subdomain_id_type subdomain_id() const
Definition: elem.h:2391
virtual void connectivity(const unsigned int sc, const IOPackage iop, std::vector< dof_id_type > &conn) const override
virtual unsigned int n_nodes() const override
const Node * node_ptr(const unsigned int i) const
Definition: elem.h:2331
void swap4neighbors(unsigned int n1, unsigned int n2, unsigned int n3, unsigned int n4)
Swaps four neighbor_ptrs, "rotating" them.
Definition: elem.h:1994
static const int nodes_per_side
virtual std::unique_ptr< Elem > build_side_ptr(const unsigned int i, bool proxy=false) override
static const int num_sides
virtual unsigned int n_edges() const override final
Definition: cell_inf_hex.h:105
dof_id_type node_id(const unsigned int i) const
Definition: elem.h:2299
virtual unsigned short int second_order_adjacent_vertex(const unsigned int n, const unsigned int v) const override
virtual bool is_node_on_edge(const unsigned int n, const unsigned int e) const override
static const unsigned short int _second_order_vertex_child_number[18]
Vector that names a child sharing each second order node.
Definition: cell_inf_hex.h:243
virtual unsigned int n_sides() const override final
Definition: cell_inf_hex.h:85