LCOV - code coverage report
Current view: top level - include/geom - cell_pyramid13.h (source / functions) Hit Total Coverage
Test: libMesh/libmesh: #4554 (5a536d) with base 54e0d5 Lines: 6 10 60.0 %
Date: 2026-09-16 12:37:14 Functions: 5 9 55.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             : 
      20             : #ifndef LIBMESH_CELL_PYRAMID13_H
      21             : #define LIBMESH_CELL_PYRAMID13_H
      22             : 
      23             : // Local includes
      24             : #include "libmesh/cell_pyramid.h"
      25             : #include "libmesh/fe_reference_element_traits.h"
      26             : 
      27             : namespace libMesh
      28             : {
      29             : 
      30             : /**
      31             :  * The \p Pyramid13 is an element in 3D composed of 13 nodes, designed
      32             :  * to interface with a QUAD8 element on the base and a TRI6 element on
      33             :  * each of the triangular faces.  Cubit will generate hybrid meshes
      34             :  * with linear pyramids, but as of version 14 will not export
      35             :  * quadratic pyramids.  Paraview should support 13-node pyramids...
      36             :  *
      37             :  * The node numbering for the pyramid13 is given below:
      38             :  *
      39             :  * \verbatim
      40             :  *   PYRAMID13:
      41             :  *                       o 4
      42             :  *                     //|\
      43             :  *                    // | \
      44             :  *                   //  |  \
      45             :  *                  //   |   \
      46             :  *              12 o/    |    o 11
      47             :  *                //     |     \
      48             :  *               /o 9    o 10   \
      49             :  *              //       |       \          zeta
      50             :  *             //        |        \          ^   eta (into page)
      51             :  *          3 o/.......o.|........o 2        | /
      52             :  *           ./       7  |       /           |/
      53             :  *          ./           |      /            o---> xi
      54             :  *         ./            |     /
      55             :  *        ./             |    /
      56             :  *     8 o/              |   o 6
      57             :  *      ./               |  /
      58             :  *     ./                | /
      59             :  *    ./                 |/
      60             :  *    o--------o---------o
      61             :  *    0        5         1
      62             :  * \endverbatim
      63             :  *
      64             :  * (xi, eta, zeta): { zeta-1 <= xi   <= 1-zeta
      65             :  *                  { zeta-1 <= eta  <= 1-zeta
      66             :  *                  {      0 <= zeta <= 1
      67             :  * are the reference element coordinates associated with the given
      68             :  * numbering.
      69             :  *
      70             :  * \author John W. Peterson
      71             :  * \date 2014
      72             :  * \brief A 3D pyramid element with 13 nodes.
      73             :  */
      74             : class Pyramid13 final : public Pyramid
      75             : {
      76             : public:
      77             : 
      78             :   /**
      79             :    * Constructor.  By default this element has no parent.
      80             :    */
      81             :   explicit
      82        8436 :   Pyramid13 (Elem * p=nullptr) :
      83        8436 :     Pyramid(num_nodes, p, _nodelinks_data)
      84        8436 :   {}
      85             : 
      86             :   Pyramid13 (Pyramid13 &&) = delete;
      87             :   Pyramid13 (const Pyramid13 &) = delete;
      88             :   Pyramid13 & operator= (const Pyramid13 &) = delete;
      89             :   Pyramid13 & operator= (Pyramid13 &&) = delete;
      90       14353 :   virtual ~Pyramid13() = default;
      91             : 
      92             :   /**
      93             :    * \returns 13.
      94             :    */
      95     6260955 :   virtual unsigned int n_nodes() const override { return num_nodes; }
      96             : 
      97             :   /**
      98             :    * \returns \p PYRAMID13.
      99             :    */
     100    20942728 :   virtual ElemType type () const override { return PYRAMID13; }
     101             : 
     102             :   /**
     103             :    * FIXME: we don't yet have a refinement pattern for pyramids...
     104             :    * \returns 1.
     105             :    */
     106           0 :   virtual unsigned int n_sub_elem() const override { return 1; }
     107             : 
     108             :   /**
     109             :    * \returns \p true if the specified (local) node number is a vertex.
     110             :    */
     111             :   virtual bool is_vertex(const unsigned int i) const override;
     112             : 
     113             :   /**
     114             :    * \returns \p true if the specified (local) node number is an edge.
     115             :    */
     116             :   virtual bool is_edge(const unsigned int i) const override;
     117             : 
     118             :   /**
     119             :    * \returns \p true if the specified (local) node number is a face.
     120             :    */
     121             :   virtual bool is_face(const unsigned int i) const override;
     122             : 
     123             :   /**
     124             :    * \returns \p true if the specified (local) node number is on the
     125             :    * specified side.
     126             :    */
     127             :   virtual bool is_node_on_side(const unsigned int n,
     128             :                                const unsigned int s) const override;
     129             : 
     130             :   virtual std::vector<unsigned int> nodes_on_side(const unsigned int s) const override;
     131             : 
     132             :   virtual std::vector<unsigned int> nodes_on_edge(const unsigned int e) const override;
     133             : 
     134             :   /**
     135             :    * \returns \p true if the specified (local) node number is on the
     136             :    * specified edge.
     137             :    */
     138             :   virtual bool is_node_on_edge(const unsigned int n,
     139             :                                const unsigned int e) const override;
     140             : 
     141             :   /**
     142             :    * \returns \p true if the element map is definitely affine within
     143             :    * numerical tolerances.
     144             :    */
     145             :   virtual bool has_affine_map () const override;
     146             : 
     147             :   /**
     148             :    * \returns SECOND.
     149             :    */
     150             :   virtual Order default_order() const override;
     151             : 
     152             :   /**
     153             :    * \returns \p Pyramid13::side_nodes_map[side][side_node] after doing some range checking.
     154             :    */
     155             :   virtual unsigned int local_side_node(unsigned int side,
     156             :                                        unsigned int side_node) const override;
     157             : 
     158             :   /**
     159             :    * \returns \p Pyramid13::edge_nodes_map[edge][edge_node] after doing some range checking.
     160             :    */
     161             :   virtual unsigned int local_edge_node(unsigned int edge,
     162             :                                        unsigned int edge_node) const override;
     163             : 
     164             :   /**
     165             :    * Builds a \p QUAD8 or \p TRI6 coincident with face i.
     166             :    * The \p std::unique_ptr<Elem> handles the memory aspect.
     167             :    */
     168             :   virtual std::unique_ptr<Elem> build_side_ptr (const unsigned int i) override;
     169             : 
     170             :   /**
     171             :    * Rebuilds a \p QUAD8 or \p TRI6 built coincident with face i.
     172             :    */
     173             :   virtual void build_side_ptr (std::unique_ptr<Elem> & elem,
     174             :                                const unsigned int i) override;
     175             : 
     176             :   // Avoid hiding deprecated version with different signature
     177             :   using Elem::build_side_ptr;
     178             : 
     179             :   /**
     180             :    * Builds a \p EDGE3 coincident with edge i.
     181             :    * The \p std::unique_ptr<Elem> handles the memory aspect.
     182             :    */
     183             :   virtual std::unique_ptr<Elem> build_edge_ptr (const unsigned int i) override;
     184             : 
     185             :   /**
     186             :    * Rebuilds a \p EDGE3 coincident with edge i.
     187             :    */
     188             :   virtual void build_edge_ptr (std::unique_ptr<Elem> & edge, const unsigned int i) override;
     189             : 
     190             :   virtual void connectivity(const unsigned int sc,
     191             :                             const IOPackage iop,
     192             :                             std::vector<dof_id_type> & conn) const override;
     193             : 
     194             :   /**
     195             :    * \returns 2 for all edge nodes.
     196             :    */
     197             :   virtual unsigned int n_second_order_adjacent_vertices (const unsigned int n) const override;
     198             : 
     199             :   /**
     200             :    * \returns The element-local number of the \f$ v^{th} \f$ vertex
     201             :    * that defines the \f$ n^{th} \f$ second-order node.
     202             :    */
     203             :   virtual unsigned short int second_order_adjacent_vertex (const unsigned int n,
     204             :                                                            const unsigned int v) const override;
     205             : 
     206             :   /**
     207             :    * Geometric constants for Pyramid13.
     208             :    */
     209             :   static const int num_nodes = 13;
     210             :   static const int nodes_per_side = 8;
     211             :   static const int nodes_per_edge = 3;
     212             : 
     213             :   /**
     214             :    * This maps the \f$ j^{th} \f$ node of the \f$ i^{th} \f$ side to
     215             :    * element node numbers.
     216             :    */
     217             :   static const ReferenceElementTable<num_sides, nodes_per_side> side_nodes_map;
     218             : 
     219             :   /**
     220             :    * This maps the \f$ j^{th} \f$ node of the \f$ i^{th} \f$ edge to
     221             :    * element node numbers.
     222             :    */
     223             :   static const ReferenceElementTable<num_edges, nodes_per_edge> edge_nodes_map;
     224             : 
     225             :   /**
     226             :    * Specialization for computing the volume of a Pyramid13.
     227             :    */
     228             :   virtual Real volume () const override;
     229             : 
     230             :   virtual void permute(unsigned int perm_num) override final;
     231             : 
     232             :   virtual void flip(BoundaryInfo *) override final;
     233             : 
     234             :   ElemType side_type (const unsigned int s) const override final;
     235             : 
     236             : protected:
     237             : 
     238             :   /**
     239             :    * Data for links to nodes.
     240             :    */
     241             :   Node * _nodelinks_data[num_nodes];
     242             : 
     243             : 
     244             : 
     245             : #ifdef LIBMESH_ENABLE_AMR
     246             : 
     247             :   /**
     248             :    * Matrix used to create the elements children.
     249             :    */
     250           0 :   virtual Real embedding_matrix (const unsigned int,
     251             :                                  const unsigned int,
     252             :                                  const unsigned int) const override
     253           0 :   { libmesh_not_implemented(); return 0.; }
     254             : 
     255           0 :   LIBMESH_ENABLE_TOPOLOGY_CACHES;
     256             : 
     257             : #endif // LIBMESH_ENABLE_AMR
     258             : 
     259             : };
     260             : 
     261             : } // namespace libMesh
     262             : 
     263             : 
     264             : #endif // LIBMESH_CELL_PYRAMID13_H

Generated by: LCOV version 1.14