LCOV - code coverage report
Current view: top level - src/geom - cell_tet14.C (source / functions) Hit Total Coverage
Test: libMesh/libmesh: #4343 (6ea38c) with base 8c3130 Lines: 152 271 56.1 %
Date: 2026-10-13 21:47:33 Functions: 22 26 84.6 %
Legend: Lines: hit not hit

          Line data    Source code
       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             : 
      19             : // Local includes
      20             : #include "libmesh/cell_tet14.h"
      21             : #include "libmesh/edge_edge3.h"
      22             : #include "libmesh/face_tri7.h"
      23             : #include "libmesh/enum_io_package.h"
      24             : #include "libmesh/enum_order.h"
      25             : 
      26             : #ifdef LIBMESH_ENABLE_AMR
      27             : namespace {
      28             :   constexpr libMesh::Real r18 = 18;
      29             :   constexpr libMesh::Real r64 = 64;
      30             :   constexpr libMesh::Real r72 = 72;
      31             : }
      32             : #endif
      33             : 
      34             : namespace libMesh
      35             : {
      36             : 
      37             : 
      38             : 
      39             : // ------------------------------------------------------------
      40             : // Tet14 class static member initializations
      41             : const int Tet14::num_nodes;
      42             : const int Tet14::nodes_per_side;
      43             : const int Tet14::nodes_per_edge;
      44             : 
      45             : // ------------------------------------------------------------
      46             : // Tet14 class member functions
      47             : 
      48    78910768 : bool Tet14::is_vertex(const unsigned int i) const
      49             : {
      50    78910768 :   if (i < 4)
      51    22527961 :     return true;
      52     3764096 :   return false;
      53             : }
      54             : 
      55     3116160 : bool Tet14::is_edge(const unsigned int i) const
      56             : {
      57     3116160 :   if (i < 4 || i > 9)
      58     1246464 :     return false;
      59      155808 :   return true;
      60             : }
      61             : 
      62     9552027 : bool Tet14::is_face(const unsigned int i) const
      63             : {
      64     9552027 :   if (i > 9)
      65     2274117 :     return true;
      66      594670 :   return false;
      67             : }
      68             : 
      69     5347789 : bool Tet14::is_node_on_side(const unsigned int n,
      70             :                             const unsigned int s) const
      71             : {
      72      428557 :   libmesh_assert_less (s, n_sides());
      73      428557 :   return std::find(std::begin(side_nodes_map[s]),
      74     5347789 :                    std::end(side_nodes_map[s]),
      75     5347789 :                    n) != std::end(side_nodes_map[s]);
      76             : }
      77             : 
      78             : std::vector<unsigned>
      79   848897822 : Tet14::nodes_on_side(const unsigned int s) const
      80             : {
      81    68167794 :   libmesh_assert_less(s, n_sides());
      82   917065616 :   return {std::begin(side_nodes_map[s]), std::end(side_nodes_map[s])};
      83             : }
      84             : 
      85             : std::vector<unsigned>
      86      235434 : Tet14::nodes_on_edge(const unsigned int e) const
      87             : {
      88       19596 :   libmesh_assert_less(e, n_edges());
      89      255030 :   return {std::begin(edge_nodes_map[e]), std::end(edge_nodes_map[e])};
      90             : }
      91             : 
      92     3856524 : bool Tet14::is_node_on_edge(const unsigned int n,
      93             :                             const unsigned int e) const
      94             : {
      95      268392 :   libmesh_assert_less (e, n_edges());
      96      268392 :   return std::find(std::begin(edge_nodes_map[e]),
      97     3856524 :                    std::end(edge_nodes_map[e]),
      98     3856524 :                    n) != std::end(edge_nodes_map[e]);
      99             : }
     100             : 
     101             : 
     102             : #ifdef LIBMESH_ENABLE_AMR
     103             : 
     104             : // This function only works if LIBMESH_ENABLE_AMR...
     105    11451610 : bool Tet14::is_child_on_side(const unsigned int c,
     106             :                              const unsigned int s) const
     107             : {
     108             :   // Table of local IDs for the midege nodes on the side opposite a given node.
     109             :   // See the ASCII art in the header file for this class to confirm this.
     110    11451610 :   const unsigned int midedge_nodes_opposite[4][3] =
     111             :     {
     112             :       {5,8,9}, // midedge nodes opposite node 0
     113             :       {6,7,9}, // midedge nodes opposite node 1
     114             :       {4,7,8}, // midedge nodes opposite node 2
     115             :       {4,5,6}  // midedge nodes opposite node 3
     116             :     };
     117             : 
     118             :   // Call the base class helper function
     119    11904154 :   return Tet::is_child_on_side_helper(c, s, midedge_nodes_opposite);
     120             : }
     121             : 
     122             : #else
     123             : 
     124             : bool Tet14::is_child_on_side(const unsigned int /*c*/,
     125             :                              const unsigned int /*s*/) const
     126             : {
     127             :   libmesh_not_implemented();
     128             :   return false;
     129             : }
     130             : 
     131             : #endif //LIBMESH_ENABLE_AMR
     132             : 
     133             : 
     134             : 
     135    16953844 : bool Tet14::has_affine_map() const
     136             : {
     137             :   // Make sure edges are straight
     138     2769434 :   Point v10 = this->point(1) - this->point(0);
     139    18341251 :   if (!v10.relative_fuzzy_equals
     140    16953844 :       ((this->point(4) - this->point(0))*2))
     141        1166 :     return false;
     142     2767102 :   Point v21 = this->point(2) - this->point(1);
     143    18324729 :   if (!v21.relative_fuzzy_equals
     144    16938488 :       ((this->point(5) - this->point(1))*2))
     145           0 :     return false;
     146     2767102 :   Point v20 = this->point(2) - this->point(0);
     147    18324729 :   if (!v20.relative_fuzzy_equals
     148    16938488 :       ((this->point(6) - this->point(0))*2))
     149           0 :     return false;
     150     2767102 :   Point v30 = this->point(3) - this->point(0);
     151    18324729 :   if (!v30.relative_fuzzy_equals
     152    16938488 :       ((this->point(7) - this->point(0))*2))
     153           0 :     return false;
     154     2767102 :   Point v31 = this->point(3) - this->point(1);
     155    18324729 :   if (!v31.relative_fuzzy_equals
     156    16938488 :       ((this->point(8) - this->point(1))*2))
     157           0 :     return false;
     158     2767102 :   Point v32 = this->point(3) - this->point(2);
     159    18324729 :   if (!v32.relative_fuzzy_equals
     160    16938488 :       ((this->point(9) - this->point(2))*2))
     161           0 :     return false;
     162             : 
     163             :   // Make sure midface nodes are midface
     164    16938488 :   if (!(v20+v10).relative_fuzzy_equals
     165    16938488 :       ((this->point(10) - this->point(0))*3))
     166           0 :     return false;
     167    16938488 :   if (!(v30+v10).relative_fuzzy_equals
     168    16938488 :       ((this->point(11) - this->point(0))*3))
     169           0 :     return false;
     170    16938488 :   if (!(v31+v21).relative_fuzzy_equals
     171    16938488 :       ((this->point(12) - this->point(1))*3))
     172           0 :     return false;
     173    16938488 :   if (!(v30+v20).relative_fuzzy_equals
     174    16938488 :       ((this->point(13) - this->point(0))*3))
     175           0 :     return false;
     176             : 
     177     1386241 :   return true;
     178             : }
     179             : 
     180             : 
     181             : 
     182   254301084 : Order Tet14::default_order() const
     183             : {
     184   254301084 :   return THIRD;
     185             : }
     186             : 
     187             : 
     188             : 
     189  2330052764 : unsigned int Tet14::local_side_node(unsigned int side,
     190             :                                     unsigned int side_node) const
     191             : {
     192   191515464 :   libmesh_assert_less (side, this->n_sides());
     193   191515464 :   libmesh_assert_less (side_node, Tet14::nodes_per_side);
     194             : 
     195  2330052764 :   return Tet14::side_nodes_map[side][side_node];
     196             : }
     197             : 
     198             : 
     199             : 
     200   103877716 : unsigned int Tet14::local_edge_node(unsigned int edge,
     201             :                                     unsigned int edge_node) const
     202             : {
     203     4640976 :   libmesh_assert_less (edge, this->n_edges());
     204     4640976 :   libmesh_assert_less (edge_node, Tet14::nodes_per_edge);
     205             : 
     206   103877716 :   return Tet14::edge_nodes_map[edge][edge_node];
     207             : }
     208             : 
     209             : 
     210             : 
     211    19493472 : std::unique_ptr<Elem> Tet14::build_side_ptr (const unsigned int i)
     212             : {
     213    19493472 :   return this->simple_build_side_ptr<Tri7, Tet14>(i);
     214             : }
     215             : 
     216             : 
     217             : 
     218    14573792 : void Tet14::build_side_ptr (std::unique_ptr<Elem> & side,
     219             :                             const unsigned int i)
     220             : {
     221    14573792 :   this->simple_build_side_ptr<Tet14>(side, i, TRI7);
     222    14573792 : }
     223             : 
     224             : 
     225             : 
     226     5256960 : std::unique_ptr<Elem> Tet14::build_edge_ptr (const unsigned int i)
     227             : {
     228     5256960 :   return this->simple_build_edge_ptr<Edge3,Tet14>(i);
     229             : }
     230             : 
     231             : 
     232             : 
     233           0 : void Tet14::build_edge_ptr (std::unique_ptr<Elem> & edge, const unsigned int i)
     234             : {
     235           0 :   this->simple_build_edge_ptr<Tet14>(edge, i, EDGE3);
     236           0 : }
     237             : 
     238             : 
     239             : 
     240           0 : void Tet14::connectivity(const unsigned int sc,
     241             :                          const IOPackage iop,
     242             :                          std::vector<dof_id_type> & conn) const
     243             : {
     244           0 :   libmesh_assert(_nodes);
     245           0 :   libmesh_assert_less (sc, this->n_sub_elem());
     246           0 :   libmesh_assert_not_equal_to (iop, INVALID_IO_PACKAGE);
     247             : 
     248           0 :   switch (iop)
     249             :     {
     250           0 :     case TECPLOT:
     251             :       {
     252           0 :         conn.resize(8);
     253           0 :         switch (sc)
     254             :           {
     255             : 
     256             : 
     257             :             // Linear sub-tet 0
     258           0 :           case 0:
     259             : 
     260           0 :             conn[0] = this->node_id(0)+1;
     261           0 :             conn[1] = this->node_id(4)+1;
     262           0 :             conn[2] = this->node_id(6)+1;
     263           0 :             conn[3] = this->node_id(6)+1;
     264           0 :             conn[4] = this->node_id(7)+1;
     265           0 :             conn[5] = this->node_id(7)+1;
     266           0 :             conn[6] = this->node_id(7)+1;
     267           0 :             conn[7] = this->node_id(7)+1;
     268             : 
     269           0 :             return;
     270             : 
     271             :             // Linear sub-tet 1
     272           0 :           case 1:
     273             : 
     274           0 :             conn[0] = this->node_id(4)+1;
     275           0 :             conn[1] = this->node_id(1)+1;
     276           0 :             conn[2] = this->node_id(5)+1;
     277           0 :             conn[3] = this->node_id(5)+1;
     278           0 :             conn[4] = this->node_id(8)+1;
     279           0 :             conn[5] = this->node_id(8)+1;
     280           0 :             conn[6] = this->node_id(8)+1;
     281           0 :             conn[7] = this->node_id(8)+1;
     282             : 
     283           0 :             return;
     284             : 
     285             :             // Linear sub-tet 2
     286           0 :           case 2:
     287             : 
     288           0 :             conn[0] = this->node_id(5)+1;
     289           0 :             conn[1] = this->node_id(2)+1;
     290           0 :             conn[2] = this->node_id(6)+1;
     291           0 :             conn[3] = this->node_id(6)+1;
     292           0 :             conn[4] = this->node_id(9)+1;
     293           0 :             conn[5] = this->node_id(9)+1;
     294           0 :             conn[6] = this->node_id(9)+1;
     295           0 :             conn[7] = this->node_id(9)+1;
     296             : 
     297           0 :             return;
     298             : 
     299             :             // Linear sub-tet 3
     300           0 :           case 3:
     301             : 
     302           0 :             conn[0] = this->node_id(7)+1;
     303           0 :             conn[1] = this->node_id(8)+1;
     304           0 :             conn[2] = this->node_id(9)+1;
     305           0 :             conn[3] = this->node_id(9)+1;
     306           0 :             conn[4] = this->node_id(3)+1;
     307           0 :             conn[5] = this->node_id(3)+1;
     308           0 :             conn[6] = this->node_id(3)+1;
     309           0 :             conn[7] = this->node_id(3)+1;
     310             : 
     311           0 :             return;
     312             : 
     313             :             // Linear sub-tet 4
     314           0 :           case 4:
     315             : 
     316           0 :             conn[0] = this->node_id(4)+1;
     317           0 :             conn[1] = this->node_id(8)+1;
     318           0 :             conn[2] = this->node_id(6)+1;
     319           0 :             conn[3] = this->node_id(6)+1;
     320           0 :             conn[4] = this->node_id(7)+1;
     321           0 :             conn[5] = this->node_id(7)+1;
     322           0 :             conn[6] = this->node_id(7)+1;
     323           0 :             conn[7] = this->node_id(7)+1;
     324             : 
     325           0 :             return;
     326             : 
     327             :             // Linear sub-tet 5
     328           0 :           case 5:
     329             : 
     330           0 :             conn[0] = this->node_id(4)+1;
     331           0 :             conn[1] = this->node_id(5)+1;
     332           0 :             conn[2] = this->node_id(6)+1;
     333           0 :             conn[3] = this->node_id(6)+1;
     334           0 :             conn[4] = this->node_id(8)+1;
     335           0 :             conn[5] = this->node_id(8)+1;
     336           0 :             conn[6] = this->node_id(8)+1;
     337           0 :             conn[7] = this->node_id(8)+1;
     338             : 
     339           0 :             return;
     340             : 
     341             :             // Linear sub-tet 6
     342           0 :           case 6:
     343             : 
     344           0 :             conn[0] = this->node_id(5)+1;
     345           0 :             conn[1] = this->node_id(9)+1;
     346           0 :             conn[2] = this->node_id(6)+1;
     347           0 :             conn[3] = this->node_id(6)+1;
     348           0 :             conn[4] = this->node_id(8)+1;
     349           0 :             conn[5] = this->node_id(8)+1;
     350           0 :             conn[6] = this->node_id(8)+1;
     351           0 :             conn[7] = this->node_id(8)+1;
     352             : 
     353           0 :             return;
     354             : 
     355             :             // Linear sub-tet 7
     356           0 :           case 7:
     357             : 
     358           0 :             conn[0] = this->node_id(7)+1;
     359           0 :             conn[1] = this->node_id(6)+1;
     360           0 :             conn[2] = this->node_id(9)+1;
     361           0 :             conn[3] = this->node_id(9)+1;
     362           0 :             conn[4] = this->node_id(8)+1;
     363           0 :             conn[5] = this->node_id(8)+1;
     364           0 :             conn[6] = this->node_id(8)+1;
     365           0 :             conn[7] = this->node_id(8)+1;
     366             : 
     367           0 :             return;
     368             : 
     369             : 
     370           0 :           default:
     371           0 :             libmesh_error_msg("Invalid sc = " << sc);
     372             :           }
     373             :       }
     374             : 
     375           0 :     case VTK:
     376             :       {
     377             :         // VTK has vtkHigherOrderTetra which might have the same
     378             :         // connectivity as our Tet14, but this has not been tested
     379             :         // yet.
     380             :         libmesh_experimental();
     381           0 :         conn.resize(Tet14::num_nodes);
     382           0 :         for (auto i : index_range(conn))
     383           0 :           conn[i] = this->node_id(i);
     384           0 :         return;
     385             :       }
     386             : 
     387           0 :     default:
     388           0 :       libmesh_error_msg("Unsupported IO package " << iop);
     389             :     }
     390             : }
     391             : 
     392             : 
     393             : 
     394    27309720 : unsigned int Tet14::n_second_order_adjacent_vertices (const unsigned int n) const
     395             : {
     396    27309720 :   switch (n)
     397             :     {
     398      386640 :     case 4:
     399             :     case 5:
     400             :     case 6:
     401             :     case 7:
     402             :     case 8:
     403             :     case 9:
     404      386640 :       return 2;
     405             : 
     406    10923888 :     case 10:
     407             :     case 11:
     408             :     case 12:
     409             :     case 13:
     410    10923888 :       return 3;
     411             : 
     412           0 :     default:
     413           0 :       libmesh_error_msg("Invalid n = " << n);
     414             :     }
     415             : }
     416             : 
     417             : 
     418             : 
     419             : 
     420             : const unsigned short int Tet14::_second_order_vertex_child_number[14] =
     421             :   {
     422             :     99,99,99,99, // Vertices
     423             :     0,1,0,0,1,2, // Edges
     424             :     5,4,6,7      // Faces
     425             :   };
     426             : 
     427             : 
     428             : 
     429             : const unsigned short int Tet14::_second_order_vertex_child_index[14] =
     430             :   {
     431             :     99,99,99,99, // Vertices
     432             :     1,2,2,3,3,3, // Edges
     433             :     10,13,12,13  // Faces
     434             :   };
     435             : 
     436             : 
     437             : 
     438             : std::pair<unsigned short int, unsigned short int>
     439           0 : Tet14::second_order_child_vertex (const unsigned int n) const
     440             : {
     441           0 :   libmesh_assert_greater_equal (n, this->n_vertices());
     442           0 :   libmesh_assert_less (n, this->n_nodes());
     443           0 :   return std::pair<unsigned short int, unsigned short int>
     444           0 :     (_second_order_vertex_child_number[n],
     445           0 :      _second_order_vertex_child_index[n]);
     446             : }
     447             : 
     448             : 
     449             : 
     450    65543328 : unsigned short int Tet14::second_order_adjacent_vertex (const unsigned int n,
     451             :                                                         const unsigned int v) const
     452             : {
     453     1546560 :   libmesh_assert_greater_equal (n, this->n_vertices());
     454     1546560 :   libmesh_assert_less (n, this->n_nodes());
     455     1546560 :   libmesh_assert_less (v, 3);
     456     1546560 :   libmesh_assert (n > 9 || v < 2); // Only face nodes have multiple adjacencies
     457    65543328 :   return _second_order_adjacent_vertices[n-this->n_vertices()][v];
     458             : }
     459             : 
     460             : 
     461             : 
     462             : const unsigned short int Tet14::_second_order_adjacent_vertices[10][3] =
     463             :   {
     464             :     {0, 1, 99}, // vertices adjacent to node 4
     465             :     {1, 2, 99}, // vertices adjacent to node 5
     466             :     {0, 2, 99}, // vertices adjacent to node 6
     467             :     {0, 3, 99}, // vertices adjacent to node 7
     468             :     {1, 3, 99}, // vertices adjacent to node 8
     469             :     {2, 3, 99}, // vertices adjacent to node 9
     470             :     {0, 1,  2}, // vertices adjacent to node 10
     471             :     {0, 1,  3}, // vertices adjacent to node 11
     472             :     {1, 2,  3}, // vertices adjacent to node 12
     473             :     {0, 2,  3}, // vertices adjacent to node 13
     474             :   };
     475             : 
     476             : 
     477             : 
     478             : 
     479             : 
     480             : #ifdef LIBMESH_ENABLE_AMR
     481             : 
     482             : const Real Tet14::_embedding_matrix[Tet14::num_children][Tet14::num_nodes][Tet14::num_nodes] =
     483             :   {
     484             :     // embedding matrix for child 0
     485             :     {
     486             :       //    0      1      2      3      4      5      6      7      8      9     10     11     12     13
     487             :       {    1.,    0.,    0.,    0.,    0.,    0.,    0.,    0.,    0.,    0.,    0.,    0.,    0.,    0.}, // 0
     488             :       {    0.,    0.,    0.,    0.,    1.,    0.,    0.,    0.,    0.,    0.,    0.,    0.,    0.,    0.}, // 1
     489             :       {    0.,    0.,    0.,    0.,    0.,    0.,    1.,    0.,    0.,    0.,    0.,    0.,    0.,    0.}, // 2
     490             :       {    0.,    0.,    0.,    0.,    0.,    0.,    0.,    1.,    0.,    0.,    0.,    0.,    0.,    0.}, // 3
     491             :       { 0.375,-0.125,    0.,    0.,  0.75,    0.,    0.,    0.,    0.,    0.,    0.,    0.,    0.,    0.}, // 4
     492             :       {.09375,-.03125,-.03125,  0., 0.125,-0.125, 0.125,    0.,    0.,    0.,.84375,    0.,    0.,    0.}, // 5
     493             :       { 0.375,    0.,-0.125,    0.,    0.,    0.,  0.75,    0.,    0.,    0.,    0.,    0.,    0.,    0.}, // 6
     494             :       { 0.375,    0.,    0.,-0.125,    0.,    0.,    0.,  0.75,    0.,    0.,    0.,    0.,    0.,    0.}, // 7
     495             :       {.09375,-.03125,   0.,-.03125,0.125,    0.,    0., 0.125,-0.125,    0.,    0.,.84375,    0.,    0.}, // 8
     496             :       {.09375,    0.,-.03125,-.03125,  0.,    0., 0.125, 0.125,    0.,-0.125,    0.,    0.,    0.,.84375}, // 9
     497             :       { 5/r18,-1/r18,-1/r18,    0., 4/r18,-2/r18, 4/r18,    0.,    0.,    0.,   0.5,    0.,    0.,    0.}, // 10
     498             :       { 5/r18,-1/r18,    0.,-1/r18, 4/r18,    0.,    0., 4/r18,-2/r18,    0.,    0.,   0.5,    0.,    0.}, // 11
     499             :       { 0.125,-1/r72,-1/r72,-1/r72,    0.,-2/r18,    0.,    0.,-2/r18,-2/r18, 0.375, 0.375, 0.125, 0.375}, // 12
     500             :       { 5/r18,    0.,-1/r18,-1/r18,    0.,    0., 4/r18, 4/r18,    0.,-2/r18,    0.,    0.,    0.,   0.5}  // 13
     501             :     },
     502             : 
     503             :     // embedding matrix for child 1?
     504             :     {
     505             :       //    0      1      2      3      4      5      6      7      8      9     10     11     12     13
     506             :       {    0.,    0.,    0.,    0.,    1.,    0.,    0.,    0.,    0.,    0.,    0.,    0.,    0.,    0.}, // 0
     507             :       {    0.,    1.,    0.,    0.,    0.,    0.,    0.,    0.,    0.,    0.,    0.,    0.,    0.,    0.}, // 1
     508             :       {    0.,    0.,    0.,    0.,    0.,    1.,    0.,    0.,    0.,    0.,    0.,    0.,    0.,    0.}, // 2
     509             :       {    0.,    0.,    0.,    0.,    0.,    0.,    0.,    0.,    1.,    0.,    0.,    0.,    0.,    0.}, // 3
     510             :       {-0.125, 0.375,    0.,    0.,  0.75,    0.,    0.,    0.,    0.,    0.,    0.,    0.,    0.,    0.}, // 4
     511             :       {    0., 0.375,-0.125,    0.,    0.,  0.75,    0.,    0.,    0.,    0.,    0.,    0.,    0.,    0.}, // 5
     512             :       {-.03125,.09375,-.03125,  0., 0.125, 0.125,-0.125,    0.,    0.,    0.,.84375,    0.,    0.,    0.}, // 6
     513             :       {-.03125,.09375,   0.,-.03125,0.125,    0.,    0.,-0.125, 0.125,    0.,    0.,.84375,    0.,    0.}, // 7
     514             :       {    0., 0.375,    0.,-0.125,    0.,    0.,    0.,    0.,  0.75,    0.,    0.,    0.,    0.,    0.}, // 8
     515             :       {    0.,.09375,-0.03125,-0.03125,0., 0.125,    0.,    0., 0.125,-0.125,    0.,    0.,.84375,    0.}, // 9
     516             :       {-1/r18, 5/r18,-1/r18,    0., 4/r18, 4/r18,-2/r18,    0.,    0.,    0.,   0.5,    0.,    0.,    0.}, // 10
     517             :       {-1/r18, 5/r18,    0.,-1/r18, 4/r18,    0.,    0.,-2/r18, 4/r18,    0.,    0.,   0.5,    0.,    0.}, // 11
     518             :       {    0., 5/r18,-1/r18,-1/r18,    0., 4/r18,    0.,    0., 4/r18,-2/r18,    0.,    0.,   0.5,    0.}, // 12
     519             :       {-1/r72, 0.125,-1/r72,-1/r72,    0.,    0.,-2/r18,-2/r18,    0.,-2/r18, 0.375, 0.375, 0.375, 0.125}  // 13
     520             :     },
     521             : 
     522             :     // embedding matrix for child 2
     523             :     {
     524             :       //    0      1      2      3      4      5      6      7      8      9     10     11     12     13
     525             :       {    0.,    0.,    0.,    0.,    0.,    0.,    1.,    0.,    0.,    0.,    0.,    0.,    0.,    0.}, // 0
     526             :       {    0.,    0.,    0.,    0.,    0.,    1.,    0.,    0.,    0.,    0.,    0.,    0.,    0.,    0.}, // 1
     527             :       {    0.,    0.,    1.,    0.,    0.,    0.,    0.,    0.,    0.,    0.,    0.,    0.,    0.,    0.}, // 2
     528             :       {    0.,    0.,    0.,    0.,    0.,    0.,    0.,    0.,    0.,    1.,    0.,    0.,    0.,    0.}, // 3
     529             :       {-.03125,-.03125,.09375,  0.,-0.125, 0.125, 0.125,    0.,    0.,    0.,.84375,    0.,    0.,    0.}, // 4
     530             :       {    0.,-0.125, 0.375,    0.,    0.,  0.75,    0.,    0.,    0.,    0.,    0.,    0.,    0.,    0.}, // 5
     531             :       {-0.125,    0., 0.375,    0.,    0.,    0.,  0.75,    0.,    0.,    0.,    0.,    0.,    0.,    0.}, // 6
     532             :       {-.03125,   0.,.09375,-.03125,   0.,    0., 0.125,-0.125,    0., 0.125,    0.,    0.,    0.,.84375}, // 7
     533             :       {    0.,-.03125,.09375,-.03125,  0., 0.125,    0.,    0.,-0.125, 0.125,    0.,    0.,.84375,    0.}, // 8
     534             :       {    0.,    0., 0.375,-0.125,    0.,    0.,    0.,    0.,    0.,  0.75,    0.,    0.,    0.,    0.}, // 9
     535             :       {-1/r18,-1/r18, 5/r18,    0.,-2/r18, 4/r18, 4/r18,    0.,    0.,    0.,   0.5,    0.,    0.,    0.}, // 10
     536             :       {-1/r72,-1/r72, 0.125,-1/r72,-2/r18,    0.,    0.,-2/r18,-2/r18,    0., 0.375, 0.125, 0.375, 0.375}, // 11
     537             :       {    0.,-1/r18, 5/r18,-1/r18,    0., 4/r18,    0.,    0.,-2/r18, 4/r18,    0.,    0.,   0.5,    0.}, // 12
     538             :       {-1/r18,    0., 5/r18,-1/r18,    0.,    0., 4/r18,-2/r18,    0., 4/r18,    0.,    0.,    0.,   0.5}  // 13
     539             :     },
     540             : 
     541             :     // embedding matrix for child 3
     542             :     {
     543             :       //    0      1      2      3      4      5      6      7      8      9     10     11     12     13
     544             :       {    0.,    0.,    0.,    0.,    0.,    0.,    0.,    1.,    0.,    0.,    0.,    0.,    0.,    0.}, // 0
     545             :       {    0.,    0.,    0.,    0.,    0.,    0.,    0.,    0.,    1.,    0.,    0.,    0.,    0.,    0.}, // 1
     546             :       {    0.,    0.,    0.,    0.,    0.,    0.,    0.,    0.,    0.,    1.,    0.,    0.,    0.,    0.}, // 2
     547             :       {    0.,    0.,    0.,    1.,    0.,    0.,    0.,    0.,    0.,    0.,    0.,    0.,    0.,    0.}, // 3
     548             :       {-.03125,-.03125,  0.,.09375,-0.125,    0.,    0., 0.125, 0.125,    0.,    0.,.84375,    0.,    0.}, // 4
     549             :       {    0.,-.03125,-.03125,.09375,  0.,-0.125,    0.,    0., 0.125, 0.125,    0.,    0.,.84375,    0.}, // 5
     550             :       {-.03125,    0.,-.03125,.09375,  0.,    0.,-0.125, 0.125,    0., 0.125,    0.,    0.,    0.,.84375}, // 6
     551             :       {-0.125,    0.,    0., 0.375,    0.,    0.,    0.,  0.75,    0.,    0.,    0.,    0.,    0.,    0.}, // 7
     552             :       {    0.,-0.125,    0., 0.375,    0.,    0.,    0.,    0.,  0.75,    0.,    0.,    0.,    0.,    0.}, // 8
     553             :       {    0.,    0.,-0.125, 0.375,    0.,    0.,    0.,    0.,    0.,  0.75,    0.,    0.,    0.,    0.}, // 9
     554             :       {-1/r72,-1/r72,-1/r72, 0.125,-2/r18,-2/r18,-2/r18,    0.,    0.,    0., 0.125, 0.375, 0.375, 0.375}, // 10
     555             :       {-1/r18,-1/r18,    0., 5/r18,-2/r18,    0.,    0., 4/r18, 4/r18,    0.,    0.,   0.5,    0.,    0.}, // 11
     556             :       {    0.,-1/r18,-1/r18, 5/r18,    0.,-2/r18,    0.,    0., 4/r18, 4/r18,    0.,    0.,   0.5,    0.}, // 12
     557             :       {-1/r18,    0.,-1/r18, 5/r18,    0.,    0.,-2/r18, 4/r18,    0., 4/r18,    0.,    0.,    0.,   0.5}  // 13
     558             :     },
     559             : 
     560             :     // embedding matrix for child 4
     561             :     {
     562             :       //    0      1      2      3      4      5      6      7      8      9     10     11     12     13
     563             :       {    0.,    0.,    0.,    0.,    1.,    0.,    0.,    0.,    0.,    0.,    0.,    0.,    0.,    0.}, // 0
     564             :       {    0.,    0.,    0.,    0.,    0.,    0.,    0.,    0.,    1.,    0.,    0.,    0.,    0.,    0.}, // 1
     565             :       {    0.,    0.,    0.,    0.,    0.,    0.,    1.,    0.,    0.,    0.,    0.,    0.,    0.,    0.}, // 2
     566             :       {    0.,    0.,    0.,    0.,    0.,    0.,    0.,    1.,    0.,    0.,    0.,    0.,    0.,    0.}, // 3
     567             :       {-.03125,.09375,   0.,-.03125,0.125,    0.,    0.,-0.125, 0.125,    0.,    0.,.84375,    0.,    0.}, // 4
     568             :       { 1/r64, 1/r64, 1/r64, 1/r64,-0.125,-0.125,-0.125,-0.125,-0.125,-0.125,27/r64,27/r64,27/r64,27/r64}, // 5
     569             :       {.09375,-.03125,-.03125,  0., 0.125,-0.125, 0.125,    0.,    0.,    0.,.84375,    0.,    0.,    0.}, // 6
     570             :       {.09375,-.03125,   0.,-.03125,0.125,    0.,    0., 0.125,-0.125,    0.,    0.,.84375,    0.,    0.}, // 7
     571             :       {-.03125,-.03125,  0.,.09375,-0.125,    0.,    0., 0.125, 0.125,    0.,    0.,.84375,    0.,    0.}, // 8
     572             :       {.09375,    0.,-.03125,-.03125,  0.,    0., 0.125, 0.125,    0.,-0.125,    0.,    0.,    0.,.84375}, // 9
     573             :       { 2/r72, 2/r72,    0.,    0.,    0.,-2/r18,-2/r18,-2/r18,-2/r18,-2/r18,   0.5,   0.5,  0.25,  0.25}, // 10
     574             :       {    0.,    0,     0.,    0.,    0.,    0.,    0.,    0.,    0.,    0.,    0.,    1.,    0.,    0.}, // 11
     575             :       { 2/r72,    0.,    0., 2/r72,-2/r18,-2/r18,-2/r18,    0.,-2/r18,-2/r18,  0.25,   0.5,  0.25,   0.5}, // 12
     576             :       { 0.125,-1/r72,-1/r72,-1/r72,    0.,-2/r18,    0.,    0.,-2/r18,-2/r18, 0.375, 0.375, 0.125, 0.375}  // 13
     577             :     },
     578             : 
     579             :     // embedding matrix for child 5?
     580             :     {
     581             :       //    0      1      2      3      4      5      6      7      8      9     10     11     12     13
     582             :       {    0.,    0.,    0.,    0.,    1.,    0.,    0.,    0.,    0.,    0.,    0.,    0.,    0.,    0.}, // 0
     583             :       {    0.,    0.,    0.,    0.,    0.,    1.,    0.,    0.,    0.,    0.,    0.,    0.,    0.,    0.}, // 1
     584             :       {    0.,    0.,    0.,    0.,    0.,    0.,    1.,    0.,    0.,    0.,    0.,    0.,    0.,    0.}, // 2
     585             :       {    0.,    0.,    0.,    0.,    0.,    0.,    0.,    0.,    1.,    0.,    0.,    0.,    0.,    0.}, // 3
     586             :       {-.03125,.09375,-.03125,  0., 0.125, 0.125,-0.125,    0.,    0.,    0.,.84375,    0.,    0.,    0.}, // 4
     587             :       {-.03125,-.03125,.09375,  0.,-0.125, 0.125, 0.125,    0.,    0.,    0.,.84375,    0.,    0.,    0.}, // 5
     588             :       {.09375,-.03125,-.03125,  0., 0.125,-0.125, 0.125,    0.,    0.,    0.,.84375,    0.,    0.,    0.}, // 6
     589             :       {-.03125,.09375,   0.,-.03125,0.125,    0.,    0.,-0.125, 0.125,    0.,    0.,.84375,    0.,    0.}, // 7
     590             :       {    0.,.09375,-.03125,-.03125,  0., 0.125,    0.,    0., 0.125,-0.125,    0.,    0.,.84375,    0.}, // 8
     591             :       { 1/r64, 1/r64, 1/r64, 1/r64,-0.125,-0.125,-0.125,-0.125,-0.125,-0.125,27/r64,27/r64,27/r64,27/r64}, // 9
     592             :       {    0.,    0,     0.,    0.,    0.,    0.,    0.,    0.,    0.,    0.,    1.,    0.,    0.,    0.}, // 10
     593             :       {-1/r72, 0.125,-1/r72,-1/r72,    0.,    0.,-2/r18,-2/r18,    0.,-2/r18, 0.375, 0.375, 0.375, 0.125}, // 11
     594             :       {    0., 2/r72, 2/r72,    0.,-2/r18,    0.,-2/r18,-2/r18,-2/r18,-2/r18,   0.5,  0.25,   0.5,  0.25}, // 12
     595             :       { 2/r72, 2/r72,    0.,    0.,    0.,-2/r18,-2/r18,-2/r18,-2/r18,-2/r18,   0.5,   0.5,  0.25,  0.25}  // 13
     596             :     },
     597             : 
     598             :     // embedding matrix for child 6?
     599             :     {
     600             :       //    0      1      2      3      4      5      6      7      8      9     10     11     12     13
     601             :       {    0.,    0.,    0.,    0.,    0.,    0.,    1.,    0.,    0.,    0.,    0.,    0.,    0.,    0.}, // 0
     602             :       {    0.,    0.,    0.,    0.,    0.,    1.,    0.,    0.,    0.,    0.,    0.,    0.,    0.,    0.}, // 1
     603             :       {    0.,    0.,    0.,    0.,    0.,    0.,    0.,    0.,    0.,    1.,    0.,    0.,    0.,    0.}, // 2
     604             :       {    0.,    0.,    0.,    0.,    0.,    0.,    0.,    0.,    1.,    0.,    0.,    0.,    0.,    0.}, // 3
     605             :       {-.03125,-.03125,.09375,  0.,-0.125, 0.125, 0.125,    0.,    0.,    0.,.84375,    0.,    0.,    0.}, // 4
     606             :       {    0.,-.03125,.09375,-.03125,  0., 0.125,    0.,    0.,-0.125, 0.125,    0.,    0.,.84375,    0.}, // 5
     607             :       {-.03125,    0.,.09375,-.03125,  0.,    0., 0.125,-0.125,    0., 0.125,    0.,    0.,    0.,.84375}, // 6
     608             :       { 1/r64, 1/r64, 1/r64, 1/r64,-0.125,-0.125,-0.125,-0.125,-0.125,-0.125,27/r64,27/r64,27/r64,27/r64}, // 7
     609             :       {    0.,.09375,-.03125,-.03125,  0., 0.125,    0.,    0., 0.125,-0.125,    0.,    0.,.84375,    0.}, // 8
     610             :       {    0.,-.03125,-.03125,.09375,  0.,-0.125,    0.,    0., 0.125, 0.125,    0.,    0.,.84375,    0.}, // 9
     611             :       {-1/r72,-1/r72, 0.125,-1/r72,-2/r18,    0.,    0.,-2/r18,-2/r18,    0., 0.375, 0.125, 0.375, 0.375}, // 10
     612             :       {    0., 2/r72, 2/r72,    0.,-2/r18,    0.,-2/r18,-2/r18,-2/r18,-2/r18,   0.5,  0.25,   0.5,  0.25}, // 11
     613             :       {    0.,    0,     0.,    0.,    0.,    0.,    0.,    0.,    0.,    0.,    0.,    0.,    1.,    0.}, // 12
     614             :       {    0.,    0., 2/r72, 2/r72,-2/r18,-2/r18,-2/r18,-2/r18,-2/r18,    0.,  0.25,  0.25,   0.5,   0.5}  // 13
     615             :     },
     616             : 
     617             :     // embedding matrix for child 7?
     618             :     {
     619             :       //    0      1      2      3      4      5      6      7      8      9     10     11     12     13
     620             :       {    0.,    0.,    0.,    0.,    0.,    0.,    1.,    0.,    0.,    0.,    0.,    0.,    0.,    0.}, // 0
     621             :       {    0.,    0.,    0.,    0.,    0.,    0.,    0.,    0.,    1.,    0.,    0.,    0.,    0.,    0.}, // 1
     622             :       {    0.,    0.,    0.,    0.,    0.,    0.,    0.,    0.,    0.,    1.,    0.,    0.,    0.,    0.}, // 2
     623             :       {    0.,    0.,    0.,    0.,    0.,    0.,    0.,    1.,    0.,    0.,    0.,    0.,    0.,    0.}, // 3
     624             :       { 1/r64, 1/r64, 1/r64, 1/r64,-0.125,-0.125,-0.125,-0.125,-0.125,-0.125,27/r64,27/r64,27/r64,27/r64}, // 4
     625             :       {    0.,-.03125,-.03125,.09375,  0.,-0.125,    0.,    0., 0.125, 0.125,    0.,    0.,.84375,    0.}, // 5
     626             :       {-.03125,    0.,.09375,-.03125,  0.,    0., 0.125,-0.125,    0., 0.125,    0.,    0.,    0.,.84375}, // 6
     627             :       {.09375,    0.,-.03125,-.03125,  0.,    0., 0.125, 0.125,    0.,-0.125,    0.,    0.,    0.,.84375}, // 7
     628             :       {-.03125,-.03125,  0.,.09375,-0.125,    0.,    0., 0.125, 0.125,    0.,    0.,.84375,    0.,    0.}, // 8
     629             :       {-.03125,    0.,-.03125,.09375,  0.,    0.,-0.125, 0.125,    0., 0.125,    0.,    0.,    0.,.84375}, // 9
     630             :       {    0.,    0., 2/r72, 2/r72,-2/r18,-2/r18,-2/r18,-2/r18,-2/r18,    0.,  0.25,  0.25,   0.5,   0.5}, // 10
     631             :       { 2/r72,    0.,    0., 2/r72,-2/r18,-2/r18,-2/r18,    0.,-2/r18,-2/r18,  0.25,   0.5,  0.25,   0.5}, // 11
     632             :       {-1/r72,-1/r72,-1/r72, 0.125,-2/r18,-2/r18,-2/r18,    0.,    0.,    0., 0.125, 0.375, 0.375, 0.375}, // 12
     633             :       {    0.,    0,     0.,    0.,    0.,    0.,    0.,    0.,    0.,    0.,    0.,    0.,    0.,    1.}, // 13
     634             :     }
     635             :   };
     636             : 
     637             : 
     638             : 
     639    48369027 : Real Tet14::embedding_matrix (const unsigned int i,
     640             :                               const unsigned int j,
     641             :                               const unsigned int k) const
     642             : {
     643             :   // Choose an optimal diagonal, if one has not already been selected
     644    48369027 :   this->choose_diagonal();
     645             : 
     646             :   // Permuted j and k indices
     647             :   unsigned int
     648     2039726 :     jp=j,
     649     2039726 :     kp=k;
     650             : 
     651    48369027 :   if ((i>3) && (this->_diagonal_selection!=DIAG_02_13))
     652             :     {
     653             :       // Just the enum value cast to an unsigned int...
     654      246236 :       const unsigned ds = static_cast<unsigned int>(this->_diagonal_selection); // == 1 or 2
     655             : 
     656             :       // Instead of doing a lot of arithmetic, use these
     657             :       // straightforward arrays for the permutations.  Note that 3 ->
     658             :       // 3 and 10 -> 10, and the first array consists of "forward"
     659             :       // permutations of the sets {0,1,2}, {4,5,6}, {7,8,9}, and
     660             :       // {11,12,13} while the second array consists of "reverse"
     661             :       // permutations of the same sets.
     662             : 
     663     5948657 :       const unsigned int perms[2][14] =
     664             :         {
     665             :           {1, 2, 0, 3, 5, 6, 4, 8, 9, 7, 10, 12, 13, 11},
     666             :           {2, 0, 1, 3, 6, 4, 5, 9, 7, 8, 10, 13, 11, 12}
     667             :         };
     668             : 
     669             :       // Permute j
     670     5948657 :       jp = perms[ds-1][j];
     671             :       //      if (jp<3)
     672             :       //        jp = (jp+ds)%3;
     673             :       //      else if (jp>3)
     674             :       //        jp = (jp-1+ds)%3 + 1 + 3*((jp-1)/3);
     675             : 
     676             :       // Permute k
     677     5948657 :       kp = perms[ds-1][k];
     678             :       //      if (kp<3)
     679             :       //        kp = (kp+ds)%3;
     680             :       //      else if (kp>3)
     681             :       //        kp = (kp-1+ds)%3 + 1 + 3*((kp-1)/3);
     682             :     }
     683             : 
     684             :   // Debugging:
     685             :   // libMesh::err << "Selected diagonal " << _diagonal_selection << std::endl;
     686             :   // libMesh::err << "j=" << j << std::endl;
     687             :   // libMesh::err << "k=" << k << std::endl;
     688             :   // libMesh::err << "jp=" << jp << std::endl;
     689             :   // libMesh::err << "kp=" << kp << std::endl;
     690             : 
     691             :   // Call embedding matrix with permuted indices
     692    48369027 :   return this->_embedding_matrix[i][jp][kp];
     693             : }
     694             : 
     695             : 
     696             : const std::vector<std::pair<unsigned char, unsigned char>> &
     697     7634568 : Tet14::parent_bracketing_nodes(unsigned int c,
     698             :                                unsigned int n) const
     699             : {
     700             :   // Choose an optimal diagonal, if one has not already been selected
     701     7634568 :   this->choose_diagonal();
     702             : 
     703             :   // Just the enum value cast to an unsigned int...
     704     7634568 :   const unsigned ds = static_cast<unsigned int>(this->_diagonal_selection);
     705             : 
     706     7634568 :   return Tet14::_parent_bracketing_nodes[ds][c][n];
     707             : }
     708             : 
     709             : 
     710             : const std::vector<std::pair<unsigned char, unsigned char>>
     711             :   Tet14::_parent_bracketing_nodes[3][Tet14::num_children][Tet14::num_nodes] =
     712             : {
     713             :   // DIAG_02_13
     714             :   {
     715             :     // Node 0,      1,      2,      3,      4,      5,      6,      7,      8,      9,
     716             :     //             10,             11,             12,             13
     717             :     // Child 0
     718             :     {      {},{{0,1}},{{0,2}},{{0,3}},{{0,4}},{{4,6}},{{0,6}},{{0,7}},{{4,7}},{{6,7}},{{0,10}},{{0,11}},{{0,12}},{{0,13}} },
     719             :     // Child 1
     720             :     { {{0,1}},     {},{{1,2}},{{1,3}},{{1,4}},{{1,5}},{{4,5}},{{4,8}},{{1,8}},{{5,8}},{{1,10}},{{1,11}},{{1,12}},{{1,13}} },
     721             :     // Child 2
     722             :     { {{0,2}},{{1,2}},     {},{{2,3}},{{5,6}},{{2,5}},{{2,6}},{{6,9}},{{5,9}},{{2,9}},{{2,10}},{{2,11}},{{2,12}},{{2,13}} },
     723             :     // Child 3
     724             :     { {{0,3}},{{1,3}},{{2,3}},     {},{{7,8}},{{8,9}},{{7,9}},{{3,7}},{{3,8}},{{3,9}},{{3,10}},{{3,11}},{{3,12}},{{3,13}} },
     725             :     // Child 4
     726             :     { {{0,1}},{{1,3}},{{0,2}},{{0,3}},{{4,8}},{{6,8}},{{4,6}},{{4,7}},{{7,8}},{{6,7}},
     727             :             {{10,11}},{{0,8},{1,7},{3,4}},  {{11,13}},       {{0,12}} },
     728             :     // Child 5
     729             :     { {{0,1}},{{1,2}},{{0,2}},{{1,3}},{{4,5}},{{5,6}},{{4,6}},{{4,8}},{{5,8}},{{6,8}},
     730             :   {{0,5},{1,6},{2,4}},       {{1,13}},      {{10,12}},      {{10,11}} },
     731             :     // Child 6
     732             :     { {{0,2}},{{1,2}},{{2,3}},{{1,3}},{{5,6}},{{5,9}},{{6,9}},{{6,8}},{{5,8}},{{8,9}},
     733             :              {{2,11}},      {{10,12}},{{1,9},{2,8},{3,5}},  {{12,13}} },
     734             :     // Child 7
     735             :     { {{0,2}},{{1,3}},{{2,3}},{{0,3}},{{6,8}},{{8,9}},{{6,9}},{{6,7}},{{7,8}},{{7,9}},
     736             :             {{12,13}},      {{11,13}},       {{3,10}},{{0,9},{2,7},{3,6}} }
     737             :   },
     738             :   // DIAG_03_12
     739             :   {
     740             :     // Node 0,      1,      2,      3,      4,      5,      6,      7,      8,      9,
     741             :     //             10,             11,             12,             13
     742             :     // Child 0
     743             :     {      {},{{0,1}},{{0,2}},{{0,3}},{{0,4}},{{4,6}},{{0,6}},{{0,7}},{{4,7}},{{6,7}},{{0,10}},{{0,11}},{{0,12}},{{0,13}} },
     744             :     // Child 1
     745             :     { {{0,1}},     {},{{1,2}},{{1,3}},{{1,4}},{{1,5}},{{4,5}},{{4,8}},{{1,8}},{{5,8}},{{1,10}},{{1,11}},{{1,12}},{{1,13}} },
     746             :     // Child 2
     747             :     { {{0,2}},{{1,2}},     {},{{2,3}},{{5,6}},{{2,5}},{{2,6}},{{6,9}},{{5,9}},{{2,9}},{{2,10}},{{2,11}},{{2,12}},{{2,13}} },
     748             :     // Child 3
     749             :     { {{0,3}},{{1,3}},{{2,3}},     {},{{7,8}},{{8,9}},{{7,9}},{{3,7}},{{3,8}},{{3,9}},{{3,10}},{{3,11}},{{3,12}},{{3,13}} },
     750             :     // Child 4
     751             :     { {{0,3}},{{1,2}},{{0,2}},{{2,3}},{{5,7}},{{5,6}},{{6,7}},{{7,9}},{{5,9}},{{6,9}},
     752             :             {{10,13}},      {{12,13}},       {{2,11}},{{0,9},{2,7},{3,6}} },
     753             :     // Child 5
     754             :     { {{0,1}},{{1,2}},{{0,2}},{{0,3}},{{4,5}},{{5,6}},{{4,6}},{{4,7}},{{5,7}},{{6,7}},
     755             :   {{0,5},{1,6},{2,4}},      {{10,11}},      {{10,13}},       {{0,12}} },
     756             :     // Child 6
     757             :     { {{0,1}},{{1,3}},{{1,2}},{{0,3}},{{4,8}},{{5,8}},{{4,5}},{{4,7}},{{7,8}},{{5,7}},
     758             :              {{1,13}},{{0,8},{1,7},{3,4}},  {{11,12}},      {{10,11}} },
     759             :     // Child 7
     760             :     { {{0,3}},{{1,3}},{{1,2}},{{2,3}},{{7,8}},{{5,8}},{{5,7}},{{7,9}},{{8,9}},{{5,9}},
     761             :             {{11,12}},       {{3,10}},{{1,9},{2,8},{3,5}},  {{12,13}} }
     762             :   },
     763             :   // DIAG_01_23
     764             :   {
     765             :     // Node 0,      1,      2,      3,      4,      5,      6,      7,      8,      9,
     766             :     //             10,             11,             12,             13
     767             :     // Child 0
     768             :     {      {},{{0,1}},{{0,2}},{{0,3}},{{0,4}},{{4,6}},{{0,6}},{{0,7}},{{4,7}},{{6,7}},{{0,10}},{{0,11}},{{0,12}},{{0,13}} },
     769             :     // Child 1
     770             :     { {{0,1}},     {},{{1,2}},{{1,3}},{{1,4}},{{1,5}},{{4,5}},{{4,8}},{{1,8}},{{5,8}},{{1,10}},{{1,11}},{{1,12}},{{1,13}} },
     771             :     // Child 2
     772             :     { {{0,2}},{{1,2}},     {},{{2,3}},{{5,6}},{{2,5}},{{2,6}},{{6,9}},{{5,9}},{{2,9}},{{2,10}},{{2,11}},{{2,12}},{{2,13}} },
     773             :     // Child 3
     774             :     { {{0,3}},{{1,3}},{{2,3}},     {},{{7,8}},{{8,9}},{{7,9}},{{3,7}},{{3,8}},{{3,9}},{{3,10}},{{3,11}},{{3,12}},{{3,13}} },
     775             :     // Child 4
     776             :     { {{0,1}},{{1,2}},{{2,3}},{{1,3}},{{4,5}},{{5,9}},{{4,9}},{{4,8}},{{5,8}},{{8,9}},
     777             :             {{10,12}},       {{1,13}},{{1,9},{2,8},{3,5}},  {{11,12}} },
     778             :     // Child 5
     779             :     { {{0,1}},{{1,2}},{{0,2}},{{2,3}},{{4,5}},{{5,6}},{{4,6}},{{4,9}},{{5,9}},{{6,9}},
     780             :   {{0,5},{1,6},{2,4}},      {{10,12}},       {{2,11}},      {{10,13}} },
     781             :     // Child 6
     782             :     { {{0,3}},{{0,1}},{{0,2}},{{2,3}},{{4,7}},{{4,6}},{{6,7}},{{7,9}},{{4,9}},{{6,9}},
     783             :              {{0,12}},      {{11,13}},      {{10,13}},{{0,9},{2,7},{3,6}} },
     784             :     // Child 7
     785             :     { {{0,3}},{{0,1}},{{2,3}},{{1,3}},{{4,7}},{{4,9}},{{7,9}},{{7,8}},{{4,8}},{{8,9}},
     786             :             {{11,13}},{{0,8},{1,7},{3,4}},  {{11,12}},       {{3,10}} }
     787             :   }
     788             : };
     789             : 
     790             : #endif // #ifdef LIBMESH_ENABLE_AMR
     791             : 
     792             : 
     793             : 
     794     1302421 : void Tet14::permute(unsigned int perm_num)
     795             : {
     796       70392 :   libmesh_assert_less (perm_num, 12);
     797             : 
     798     1302421 :   const unsigned int side = perm_num % 4;
     799     1302421 :   const unsigned int rotate = perm_num / 4;
     800             : 
     801     2621451 :   for (unsigned int i = 0; i != rotate; ++i)
     802             :     {
     803     1319030 :       swap3nodes(0,1,2);
     804     1248284 :       swap3nodes(4,5,6);
     805     1248284 :       swap3nodes(7,8,9);
     806     1248284 :       swap3nodes(11,12,13);
     807     1248284 :       swap3neighbors(1,2,3);
     808             :     }
     809             : 
     810     1302421 :   switch (side) {
     811       18448 :   case 0:
     812       18448 :     break;
     813      307678 :   case 1:
     814      307678 :     swap3nodes(0,2,3);
     815      290826 :     swap3nodes(4,5,8);
     816      290826 :     swap3nodes(6,9,7);
     817      290826 :     swap3nodes(10,12,11);
     818      290826 :     swap3neighbors(0,2,1);
     819      290826 :     break;
     820      314539 :   case 2:
     821      314539 :     swap3nodes(2,0,3);
     822      297145 :     swap3nodes(5,4,8);
     823      297145 :     swap3nodes(6,7,9);
     824      297145 :     swap3nodes(10,11,12);
     825      297145 :     swap3neighbors(0,1,2);
     826      297145 :     break;
     827      330711 :   case 3:
     828      330711 :     swap3nodes(2,1,3);
     829      313013 :     swap3nodes(5,8,9);
     830      313013 :     swap3nodes(6,4,7);
     831      313013 :     swap3nodes(10,11,13);
     832      313013 :     swap3neighbors(0,1,3);
     833      313013 :     break;
     834           0 :   default:
     835           0 :     libmesh_error();
     836             :   }
     837     1302421 : }
     838             : 
     839             : 
     840        6912 : void Tet14::flip(BoundaryInfo * boundary_info)
     841             : {
     842         576 :   libmesh_assert(boundary_info);
     843             : 
     844        6912 :   swap2nodes(0,2);
     845        6912 :   swap2nodes(4,5);
     846        6912 :   swap2nodes(7,9);
     847        6912 :   swap2nodes(11,12);
     848         576 :   swap2neighbors(1,2);
     849        6912 :   swap2boundarysides(1,2,boundary_info);
     850        6912 :   swap2boundaryedges(0,1,boundary_info);
     851        6912 :   swap2boundaryedges(3,5,boundary_info);
     852        6912 : }
     853             : 
     854             : 
     855  1596678512 : ElemType Tet14::side_type (const unsigned int libmesh_dbg_var(s)) const
     856             : {
     857   129603392 :   libmesh_assert_less (s, 4);
     858  1596678512 :   return TRI7;
     859             : }
     860             : 
     861             : 
     862             : } // namespace libMesh

Generated by: LCOV version 1.14