libMesh
inf_fe_base_radial.C
Go to the documentation of this file.
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 std::unique_ptr<const Elem> InfFEBase::build_elem (const Elem * inf_elem)
39 {
40  return inf_elem->build_side_ptr(0);
41 }
42 
43 
44 
46 {
47  switch (type)
48  {
49  // 3D infinite elements:
50  // with Dim=3 -> infinite elements on their own
51  case INFHEX8:
52  return QUAD4;
53 
54  case INFHEX16:
55  return QUAD8;
56 
57  case INFHEX18:
58  return QUAD9;
59 
60  case INFPRISM6:
61  return TRI3;
62 
63  case INFPRISM12:
64  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  case INFQUAD4:
70  return EDGE2;
71 
72  case INFQUAD6:
73  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  case INFEDGE2:
80  return INVALID_ELEM;
81 
82  default:
83  libmesh_error_msg("ERROR: Unsupported element type!: " << Utility::enum_to_string(type));
84  }
85 }
86 
87 
88 
89 
90 
91 unsigned int InfFEBase::n_base_mapping_sf (const Elem & base_elem,
92  const Order base_mapping_order)
93 {
94  switch (base_elem.dim())
95  {
96  case 0:
97  return 1;
98  case 1:
99  return FE<1,LAGRANGE>::n_shape_functions (base_elem.type(),
100  base_mapping_order);
101  case 2:
102  return FE<2,LAGRANGE>::n_shape_functions (base_elem.type(),
103  base_mapping_order);
104  default:
105  libmesh_error_msg("Unsupported base_elem dim = " << base_elem.dim());
106  }
107 }
108 
109 
110 
111 
112 
113 // ------------------------------------------------------------
114 // InfFERadial class members
115 unsigned int InfFERadial::n_dofs_at_node (const Order o_radial,
116  const unsigned int n_onion)
117 {
118  libmesh_assert_less (n_onion, 2);
119 
120  if (n_onion == 0)
121  /*
122  * in the base, no matter what, we have 1 node associated
123  * with radial direction
124  */
125  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  return static_cast<unsigned int>(o_radial);
132 }
133 
134 
135 } // namespace libMesh
136 
137 #endif //ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
ElemType
Defines an enum for geometric element types.
static ElemType get_elem_type(const ElemType type)
static unsigned int n_base_mapping_sf(const Elem &base_elem, const Order base_mapping_order)
Order
defines an enum for polynomial orders.
Definition: enum_order.h:40
virtual std::unique_ptr< Elem > build_side_ptr(const unsigned int i)=0
This is the base class from which all geometric element types are derived.
Definition: elem.h:94
The libMesh namespace provides an interface to certain functionality in the library.
static std::unique_ptr< const Elem > build_elem(const Elem *inf_elem)
Build the base element of an infinite element.
static unsigned int n_dofs_at_node(const Order o_radial, const unsigned int n_onion)
virtual unsigned int n_shape_functions() const override
Definition: fe.C:75
std::string enum_to_string(const T e)
virtual unsigned short dim() const =0
virtual ElemType type() const =0