LCOV - code coverage report
Current view: top level - src/fe - inf_fe_base_radial.C (source / functions) Hit Total Coverage
Test: libMesh/libmesh: #4229 (6a9aeb) with base 727f46 Lines: 15 39 38.5 %
Date: 2025-08-19 19:27:09 Functions: 3 4 75.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             : // Local includes
      21             : #include "libmesh/libmesh_config.h"
      22             : 
      23             : #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
      24             : 
      25             : #include "libmesh/inf_fe.h"
      26             : #include "libmesh/inf_fe_macro.h"
      27             : #include "libmesh/fe.h"
      28             : #include "libmesh/elem.h"
      29             : #include "libmesh/enum_to_string.h"
      30             : 
      31             : namespace libMesh
      32             : {
      33             : 
      34             : 
      35             : 
      36             : // ------------------------------------------------------------
      37             : // InfFEBase class members
      38      288589 : std::unique_ptr<const Elem> InfFEBase::build_elem (const Elem * inf_elem)
      39             : {
      40      288589 :   return inf_elem->build_side_ptr(0);
      41             : }
      42             : 
      43             : 
      44             : 
      45        1215 : ElemType InfFEBase::get_elem_type (const ElemType type)
      46             : {
      47        1215 :   switch (type)
      48             :     {
      49             :       // 3D infinite elements:
      50             :       // with Dim=3 -> infinite elements on their own
      51         727 :     case INFHEX8:
      52         727 :       return QUAD4;
      53             : 
      54           0 :     case INFHEX16:
      55           0 :       return QUAD8;
      56             : 
      57         184 :     case INFHEX18:
      58         184 :       return QUAD9;
      59             : 
      60           0 :     case INFPRISM6:
      61           0 :       return TRI3;
      62             : 
      63         304 :     case INFPRISM12:
      64         304 :       return TRI6;
      65             : 
      66             :       // 2D infinite elements:
      67             :       // with Dim=3 -> used as boundary condition,
      68             :       // with Dim=2 -> infinite elements on their own
      69           0 :     case INFQUAD4:
      70           0 :       return EDGE2;
      71             : 
      72           0 :     case INFQUAD6:
      73           0 :       return EDGE3;
      74             : 
      75             :       // 1D infinite elements:
      76             :       // with Dim=2 -> used as boundary condition,
      77             :       // with Dim=1 -> infinite elements on their own,
      78             :       //               but no base element!
      79           0 :     case INFEDGE2:
      80           0 :       return INVALID_ELEM;
      81             : 
      82           0 :     default:
      83           0 :       libmesh_error_msg("ERROR: Unsupported element type!: " << Utility::enum_to_string(type));
      84             :     }
      85             : }
      86             : 
      87             : 
      88             : 
      89             : 
      90             : 
      91           0 : unsigned int InfFEBase::n_base_mapping_sf (const Elem & base_elem,
      92             :                                            const Order base_mapping_order)
      93             : {
      94           0 :   switch (base_elem.dim())
      95             :     {
      96           0 :     case 0:
      97           0 :       return 1;
      98           0 :     case 1:
      99           0 :       return FE<1,LAGRANGE>::n_shape_functions (base_elem.type(),
     100           0 :                                                 base_mapping_order);
     101           0 :     case 2:
     102           0 :       return FE<2,LAGRANGE>::n_shape_functions (base_elem.type(),
     103           0 :                                                 base_mapping_order);
     104           0 :     default:
     105           0 :       libmesh_error_msg("Unsupported base_elem dim = " << base_elem.dim());
     106             :     }
     107             : }
     108             : 
     109             : 
     110             : 
     111             : 
     112             : 
     113             : // ------------------------------------------------------------
     114             : // InfFERadial class members
     115      259000 : unsigned int InfFERadial::n_dofs_at_node (const Order o_radial,
     116             :                                           const unsigned int n_onion)
     117             : {
     118       98280 :   libmesh_assert_less (n_onion, 2);
     119             : 
     120      259000 :   if (n_onion == 0)
     121             :     /*
     122             :      * in the base, no matter what, we have 1 node associated
     123             :      * with radial direction
     124             :      */
     125       49039 :     return 1;
     126             :   else
     127             :     /*
     128             :      * this works, since for Order o_radial=CONST=0, we still
     129             :      * have the (1-v)/2 mode, associated to the base
     130             :      */
     131      129922 :     return static_cast<unsigned int>(o_radial);
     132             : }
     133             : 
     134             : 
     135             : } // namespace libMesh
     136             : 
     137             : #endif //ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS

Generated by: LCOV version 1.14