LCOV - code coverage report
Current view: top level - include/geom - cell_prism15.h (source / functions) Hit Total Coverage
Test: libMesh/libmesh: #4229 (6a9aeb) with base 727f46 Lines: 9 12 75.0 %
Date: 2025-08-19 19:27:09 Functions: 8 10 80.0 %
Legend: Lines: hit not hit

          Line data    Source code
       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             : 
      19             : 
      20             : #ifndef LIBMESH_CELL_PRISM15_H
      21             : #define LIBMESH_CELL_PRISM15_H
      22             : 
      23             : // Local includes
      24             : #include "libmesh/cell_prism.h"
      25             : 
      26             : namespace libMesh
      27             : {
      28             : 
      29             : /**
      30             :  * The \p Prism15 is an element in 3D composed of 15 nodes.
      31             :  * It is numbered like this:
      32             :  *
      33             :  * \verbatim
      34             :  *   PRISM15:
      35             :  *                5
      36             :  *                o
      37             :  *               /:\
      38             :  *              / : \
      39             :  *             /  :  \
      40             :  *            /   :   \
      41             :  *        14 o    :    o 13
      42             :  *          /     :     \
      43             :  *         /      :      \
      44             :  *        /       o 11    \
      45             :  *     3 /        :        \4
      46             :  *      o---------o---------o
      47             :  *      |         :12       |
      48             :  *      |         :         |
      49             :  *      |         :         |            zeta
      50             :  *      |         o         |             ^   eta (into page)
      51             :  *      |        .2.        |             | /
      52             :  *      |       .   .       |             |/
      53             :  *    9 o      .     .      o 10          o---> xi
      54             :  *      |     .       .     |
      55             :  *      |  8 o         o 7  |
      56             :  *      |   .           .   |
      57             :  *      |  .             .  |
      58             :  *      | .               . |
      59             :  *      |.                 .|
      60             :  *      o---------o---------o
      61             :  *      0         6         1
      62             :  * \endverbatim
      63             :  *
      64             :  * (xi, eta, zeta): { 0  <= xi   <= 1
      65             :  *                  { 0  <= eta  <= 1
      66             :  *                  { -1 <= zeta <= 1
      67             :  *                  { xi + eta   <= 1
      68             :  * are the reference element coordinates associated with the given
      69             :  * numbering.
      70             :  *
      71             :  * \author Benjamin S. Kirk
      72             :  * \date 2003
      73             :  * \brief A 3D prismatic element with 15 nodes.
      74             :  */
      75             : class Prism15 final : public Prism
      76             : {
      77             : public:
      78             : 
      79             :   /**
      80             :    * Constructor.  By default this element has no parent.
      81             :    */
      82             :   explicit
      83      154863 :   Prism15 (Elem * p=nullptr) :
      84      154863 :     Prism(num_nodes, p, _nodelinks_data)
      85      154863 :   {}
      86             : 
      87             :   Prism15 (Prism15 &&) = delete;
      88             :   Prism15 (const Prism15 &) = delete;
      89             :   Prism15 & operator= (const Prism15 &) = delete;
      90             :   Prism15 & operator= (Prism15 &&) = delete;
      91      160626 :   virtual ~Prism15() = default;
      92             : 
      93             :   /**
      94             :    * \returns \p PRISM15.
      95             :    */
      96   362563917 :   virtual ElemType type () const override { return PRISM15; }
      97             : 
      98             :   /**
      99             :    * \returns 15.
     100             :    */
     101   131282376 :   virtual unsigned int n_nodes() const override { return num_nodes; }
     102             : 
     103             :   /**
     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 Prism15::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 Prism15::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 built 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 or \p INFEDGE2 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 built coincident with edges 0 to 2, or \p
     187             :    * INFEDGE2 built coincident with edges 3 to 5.
     188             :    */
     189             :   virtual void build_edge_ptr (std::unique_ptr<Elem> & edge, const unsigned int i) override;
     190             : 
     191             :   virtual void connectivity(const unsigned int sc,
     192             :                             const IOPackage iop,
     193             :                             std::vector<dof_id_type> & conn) const override;
     194             :   /**
     195             :    * \returns 2 for all \p n.
     196             :    */
     197           0 :   virtual unsigned int n_second_order_adjacent_vertices (const unsigned int) const override
     198           0 :   { return 2; }
     199             : 
     200             :   /**
     201             :    * \returns The element-local number of the \f$ v^{th} \f$ vertex
     202             :    * that defines the \f$ n^{th} \f$ second-order node.
     203             :    *
     204             :    * \note \p n is counted as depicted above, \f$ 6 \le n < 15 \f$.
     205             :    */
     206             :   virtual unsigned short int second_order_adjacent_vertex (const unsigned int n,
     207             :                                                            const unsigned int v) const override;
     208             : 
     209             :   /**
     210             :    * \returns The child number \p c and element-local index \p v of the
     211             :    * \f$ n^{th} \f$ second-order node on the parent element.  See
     212             :    * elem.h for further details.
     213             :    */
     214             :   virtual std::pair<unsigned short int, unsigned short int>
     215             :   second_order_child_vertex (const unsigned int n) const override;
     216             : 
     217             :   /**
     218             :    * Geometric constants for Prism15.
     219             :    */
     220             :   static const int num_nodes = 15;
     221             :   static const int nodes_per_side = 8;
     222             :   static const int nodes_per_edge = 3;
     223             : 
     224             :   /**
     225             :    * This maps the \f$ j^{th} \f$ node of the \f$ i^{th} \f$ side to
     226             :    * element node numbers.
     227             :    */
     228             :   static const unsigned int side_nodes_map[num_sides][nodes_per_side];
     229             : 
     230             :   /**
     231             :    * This maps the \f$ j^{th} \f$ node of the \f$ i^{th} \f$ edge to
     232             :    * element node numbers.
     233             :    */
     234             :   static const unsigned int edge_nodes_map[num_edges][nodes_per_edge];
     235             : 
     236             :   /**
     237             :    * A specialization for computing the volume of a Prism15.
     238             :    */
     239             :   virtual Real volume () const override;
     240             : 
     241             :   virtual void permute(unsigned int perm_num) override final;
     242             : 
     243             :   virtual void flip(BoundaryInfo *) override final;
     244             : 
     245             :   ElemType side_type (const unsigned int s) const override final;
     246             : 
     247             : protected:
     248             : 
     249             :   /**
     250             :    * Data for links to nodes.
     251             :    */
     252             :   Node * _nodelinks_data[num_nodes];
     253             : 
     254             : 
     255             : 
     256             : #ifdef LIBMESH_ENABLE_AMR
     257             : 
     258             :   /**
     259             :    * Matrix used to create the elements children.
     260             :    */
     261     3142731 :   virtual Real embedding_matrix (const unsigned int i,
     262             :                                  const unsigned int j,
     263             :                                  const unsigned int k) const override
     264     3142731 :   { return _embedding_matrix[i][j][k]; }
     265             : 
     266             :   /**
     267             :    * Matrix that computes new nodal locations/solution values
     268             :    * from current nodes/solution.
     269             :    */
     270             :   static const Real _embedding_matrix[num_children][num_nodes][num_nodes];
     271             : 
     272     2491860 :   LIBMESH_ENABLE_TOPOLOGY_CACHES;
     273             : 
     274             : #endif
     275             : 
     276             : };
     277             : 
     278             : } // namespace libMesh
     279             : 
     280             : #endif // LIBMESH_CELL_PRISM15_H

Generated by: LCOV version 1.14