libMesh
cell_inf_hex16.C
Go to the documentation of this file.
1 // The libMesh Finite Element Library.
2 // Copyright (C) 2002-2025 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 
32 namespace libMesh
33 {
34 
35 
36 // ------------------------------------------------------------
37 // InfHex16 class static member initializations
38 const int InfHex16::num_nodes;
39 const int InfHex16::nodes_per_side;
40 const int InfHex16::nodes_per_edge;
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 
66 bool 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 
75 std::vector<unsigned>
76 InfHex16::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 
83 std::vector<unsigned>
84 InfHex16::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 
91 bool 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 
109 unsigned 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 
125 unsigned 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 
141 std::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 
182 void 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 
228 std::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 
239 void 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 
287 void 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 
326 unsigned 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 
339 std::pair<unsigned short int, unsigned short int>
340 InfHex16::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 
451 void
452 InfHex16::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 
467 void
468 InfHex16::flip(BoundaryInfo * boundary_info)
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 
486 ElemType
487 InfHex16::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
static const int num_children
Definition: cell_inf_hex.h:85
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:3550
Order
defines an enum for polynomial orders.
Definition: enum_order.h:40
static const int num_sides
Geometric constants for all InfHexes.
Definition: cell_inf_hex.h:83
Node ** _nodes
Pointers to the nodes we are connected to.
Definition: elem.h:2245
virtual std::unique_ptr< Elem > build_side_ptr(const unsigned int i) override
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
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:3534
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:250
virtual unsigned int local_edge_node(unsigned int edge, unsigned int edge_node) const override
static const int num_edges
Definition: cell_inf_hex.h:84
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:2143
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
void swap2nodes(unsigned int n1, unsigned int n2)
Swaps two node_ptrs.
Definition: elem.h:2092
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
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:99
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:2102
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:260
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
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
void swap4neighbors(unsigned int n1, unsigned int n2, unsigned int n3, unsigned int n4)
Swaps four neighbor_ptrs, "rotating" them.
Definition: elem.h:2153
static const int nodes_per_side
virtual unsigned int n_edges() const override final
Definition: cell_inf_hex.h:112
dof_id_type node_id(const unsigned int i) const
Definition: elem.h:2475
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:255
virtual unsigned int n_sides() const override final
Definition: cell_inf_hex.h:92