LCOV - code coverage report
Current view: top level - include/geom - cell_tet10.h (source / functions) Hit Total Coverage
Test: libMesh/libmesh: #4554 (5a536d) with base 54e0d5 Lines: 9 10 90.0 %
Date: 2026-09-16 12:37:14 Functions: 8 9 88.9 %
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             : 
      20             : #ifndef LIBMESH_CELL_TET10_H
      21             : #define LIBMESH_CELL_TET10_H
      22             : 
      23             : // Local includes
      24             : #include "libmesh/cell_tet.h"
      25             : #include "libmesh/fe_reference_element_traits.h"
      26             : 
      27             : namespace libMesh
      28             : {
      29             : 
      30             : /**
      31             :  * The \p Tet10 is an element in 3D composed of 10 nodes.  It is
      32             :  * numbered like this:
      33             :  *
      34             :  * \verbatim
      35             :  *               3
      36             :  *   TET10:      o
      37             :  *              /|\
      38             :  *             / | \
      39             :  *         7  /  |  \9
      40             :  *           o   |   o              zeta
      41             :  *          /    |8   \              ^
      42             :  *         /     o     \             |
      43             :  *        /    6 |      \            |
      44             :  *     0 o.....o.|.......o 2         o---> eta
      45             :  *        \      |      /             \
      46             :  *         \     |     /               \
      47             :  *          \    |    /                 xi (out of page)
      48             :  *         4 o   |   o 5
      49             :  *            \  |  /
      50             :  *             \ | /
      51             :  *              \|/
      52             :  *               o
      53             :  *               1
      54             :  * \endverbatim
      55             :  *
      56             :  * (xi, eta, zeta): { 0 <= xi   <= 1
      57             :  *                  { 0 <= eta  <= 1
      58             :  *                  { 0 <= zeta <= 1
      59             :  *                  { xi + eta + zeta <= 1
      60             :  *
      61             :  * \author Benjamin S. Kirk
      62             :  * \date 2002
      63             :  * \brief A 3D tetrahedral element with 10 nodes.
      64             :  */
      65             : class Tet10 final : public Tet
      66             : {
      67             : public:
      68             : 
      69             :   /**
      70             :    * Constructor.  By default this element has no parent.
      71             :    */
      72             :   explicit
      73       94882 :   Tet10 (Elem * p=nullptr) :
      74       94882 :     Tet(num_nodes, p, _nodelinks_data)
      75       94882 :   {}
      76             : 
      77             :   Tet10 (Tet10 &&) = delete;
      78             :   Tet10 (const Tet10 &) = delete;
      79             :   Tet10 & operator= (const Tet10 &) = delete;
      80             :   Tet10 & operator= (Tet10 &&) = delete;
      81      160469 :   virtual ~Tet10() = default;
      82             : 
      83             :   /**
      84             :    * \returns \p TET10.
      85             :    */
      86   239257472 :   virtual ElemType type () const override { return TET10; }
      87             : 
      88             :   /**
      89             :    * \returns 10.
      90             :    */
      91    99167443 :   virtual unsigned int n_nodes() const override { return num_nodes; }
      92             : 
      93             :   /**
      94             :    * \returns 8.
      95             :    */
      96           0 :   virtual unsigned int n_sub_elem() const override { return 8; }
      97             : 
      98             :   /**
      99             :    * \returns \p true if the specified (local) node number is a vertex.
     100             :    */
     101             :   virtual bool is_vertex(const unsigned int i) const override;
     102             : 
     103             :   /**
     104             :    * \returns \p true if the specified (local) node number is an edge.
     105             :    */
     106             :   virtual bool is_edge(const unsigned int i) const override;
     107             : 
     108             :   /**
     109             :    * \returns \p true if the specified (local) node number is a face.
     110             :    */
     111             :   virtual bool is_face(const unsigned int i) const override;
     112             : 
     113             :   /**
     114             :    * \returns \p true if the specified (local) node number is on the
     115             :    * specified side.
     116             :    */
     117             :   virtual bool is_node_on_side(const unsigned int n,
     118             :                                const unsigned int s) const override;
     119             : 
     120             :   virtual std::vector<unsigned int> nodes_on_side(const unsigned int s) const override;
     121             : 
     122             :   virtual std::vector<unsigned int> nodes_on_edge(const unsigned int e) const override;
     123             : 
     124             :   /**
     125             :    * \returns \p true if the specified (local) node number is on the
     126             :    * specified edge.
     127             :    */
     128             :   virtual bool is_node_on_edge(const unsigned int n,
     129             :                                const unsigned int e) const override;
     130             : 
     131             :   /**
     132             :    * \returns \p true if the specified child is on the
     133             :    * specified side.
     134             :    */
     135             :   virtual bool is_child_on_side(const unsigned int c,
     136             :                                 const unsigned int s) const override;
     137             : 
     138             :   /**
     139             :    * \returns \p true if the element map is definitely affine within
     140             :    * numerical tolerances.
     141             :    */
     142             :   virtual bool has_affine_map () const override;
     143             : 
     144             :   /**
     145             :    * \returns SECOND.
     146             :    */
     147             :   virtual Order default_order() const override;
     148             : 
     149             :   /**
     150             :    * \returns \p Tet10::side_nodes_map[side][side_node] after doing some range checking.
     151             :    */
     152             :   virtual unsigned int local_side_node(unsigned int side,
     153             :                                        unsigned int side_node) const override;
     154             : 
     155             :   /**
     156             :    * \returns \p Tet10::edge_nodes_map[edge][edge_node] after doing some range checking.
     157             :    */
     158             :   virtual unsigned int local_edge_node(unsigned int edge,
     159             :                                        unsigned int edge_node) const override;
     160             : 
     161             :   /**
     162             :    * Builds a \p TRI6 built coincident with face i.
     163             :    * The \p std::unique_ptr<Elem> handles the memory aspect.
     164             :    */
     165             :   virtual std::unique_ptr<Elem> build_side_ptr (const unsigned int i) override;
     166             : 
     167             :   /**
     168             :    * Rebuilds a TRI6 built coincident with face i.
     169             :    */
     170             :   virtual void build_side_ptr (std::unique_ptr<Elem> & elem,
     171             :                                const unsigned int i) override;
     172             : 
     173             :   // Avoid hiding deprecated version with different signature
     174             :   using Elem::build_side_ptr;
     175             : 
     176             :   /**
     177             :    * Builds a \p EDGE3 built coincident with edge i.
     178             :    * The \p std::unique_ptr<Elem> handles the memory aspect.
     179             :    */
     180             :   virtual std::unique_ptr<Elem> build_edge_ptr (const unsigned int i) override;
     181             : 
     182             :   /**
     183             :    * Rebuilds a \p EDGE3 coincident with edge i.
     184             :    */
     185             :   virtual void build_edge_ptr (std::unique_ptr<Elem> & edge, const unsigned int i) override;
     186             : 
     187             :   virtual void connectivity(const unsigned int sc,
     188             :                             const IOPackage iop,
     189             :                             std::vector<dof_id_type> & conn) const override;
     190             : 
     191             :   /**
     192             :    * \returns 2 for all \p n.
     193             :    */
     194      488640 :   virtual unsigned int n_second_order_adjacent_vertices (const unsigned int) const override
     195      488640 :   { return 2; }
     196             : 
     197             :   /**
     198             :    * \returns The element-local number of the \f$ v^{th} \f$ vertex
     199             :    * that defines the \f$ n^{th} \f$ second-order node.
     200             :    *
     201             :    * \note \p n is counted as depicted above, \f$ 4 \le n < 10 \f$.
     202             :    */
     203             :   virtual unsigned short int second_order_adjacent_vertex (const unsigned int n,
     204             :                                                            const unsigned int v) const override;
     205             : 
     206             :   /**
     207             :    * \returns The child number \p c and element-local index \p v of the
     208             :    * \f$ n^{th} \f$ second-order node on the parent element.  See
     209             :    * elem.h for further details.
     210             :    */
     211             :   virtual std::pair<unsigned short int, unsigned short int>
     212             :   second_order_child_vertex (const unsigned int n) const override;
     213             : 
     214             :   /**
     215             :    * Geometric constants for Tet10.
     216             :    */
     217             :   static const int num_nodes = 10;
     218             :   static const int nodes_per_side = 6;
     219             :   static const int nodes_per_edge = 3;
     220             : 
     221             :   /**
     222             :    * This maps the \f$ j^{th} \f$ node of the \f$ i^{th} \f$ side to
     223             :    * element node numbers.
     224             :    */
     225             :   static const ReferenceElementTable<num_sides, nodes_per_side> side_nodes_map;
     226             : 
     227             :   /**
     228             :    * This maps the \f$ j^{th} \f$ node of the \f$ i^{th} \f$ edge to
     229             :    * element node numbers.
     230             :    */
     231             :   static const ReferenceElementTable<num_edges, nodes_per_edge> edge_nodes_map;
     232             : 
     233             :   /**
     234             :    * A specialization for computing the volume of a Tet10.
     235             :    */
     236             :   virtual Real volume () const override;
     237             : 
     238             :   virtual void permute(unsigned int perm_num) override final;
     239             : 
     240             :   virtual void flip(BoundaryInfo *) override final;
     241             : 
     242             :   ElemType side_type (const unsigned int s) const override final;
     243             : 
     244             : protected:
     245             : 
     246             :   /**
     247             :    * Data for links to nodes.
     248             :    */
     249             :   Node * _nodelinks_data[num_nodes];
     250             : 
     251             : 
     252             : 
     253             : #ifdef LIBMESH_ENABLE_AMR
     254             : 
     255             :   /**
     256             :    * Matrix used to create the elements children.
     257             :    */
     258             :   virtual Real embedding_matrix (const unsigned int i,
     259             :                                  const unsigned int j,
     260             :                                  const unsigned int k) const override;
     261             : 
     262             :   /**
     263             :    * Matrix that computes new nodal locations/solution values
     264             :    * from current nodes/solution.
     265             :    */
     266             :   static const Real _embedding_matrix[num_children][num_nodes][num_nodes];
     267             : 
     268     2847264 :   LIBMESH_ENABLE_TOPOLOGY_CACHES;
     269             : 
     270             : #endif // LIBMESH_ENABLE_AMR
     271             : 
     272             : private:
     273             : 
     274             :   /**
     275             :    * Matrix that tells which vertices define the location
     276             :    * of mid-side (or second-order) nodes
     277             :    */
     278             :   static const unsigned short int _second_order_adjacent_vertices[6][2];
     279             : 
     280             :   /**
     281             :    * Vector that names a child sharing each second order node.
     282             :    */
     283             :   static const unsigned short int _second_order_vertex_child_number[10];
     284             : 
     285             :   /**
     286             :    * Vector that names the child vertex index for each second order node.
     287             :    */
     288             :   static const unsigned short int _second_order_vertex_child_index[10];
     289             : };
     290             : 
     291             : } // namespace libMesh
     292             : 
     293             : 
     294             : #endif // LIBMESH_CELL_TET10_H

Generated by: LCOV version 1.14