libMesh
fe_lagrange_shape_1D.C
Go to the documentation of this file.
1 // The libMesh Finite Element Library.
2 // Copyright (C) 2002-2024 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 // Local includes
20 #include "libmesh/fe.h"
21 #include "libmesh/elem.h"
22 #include "libmesh/fe_lagrange_shape_1D.h"
23 
24 
25 namespace libMesh
26 {
27 
28 
31 
32 
33 template <>
35  const Order order,
36  const unsigned int i,
37  const Point & p)
38 {
39  return fe_lagrange_1D_shape(order, i, p(0));
40 }
41 
42 template <>
44  const Order order,
45  const unsigned int i,
46  const Point & p)
47 {
48  return fe_lagrange_1D_shape(order, i, p(0));
49 }
50 
51 
52 template <>
54  const Order order,
55  const unsigned int i,
56  const Point & p,
57  const bool add_p_level)
58 {
59  libmesh_assert(elem);
60 
61  return fe_lagrange_1D_shape(static_cast<Order>(order + add_p_level * elem->p_level()), i, p(0));
62 }
63 
64 
65 
66 template <>
68  const Elem * elem,
69  const unsigned int i,
70  const Point & p,
71  const bool add_p_level)
72 {
73  libmesh_assert(elem);
74  return fe_lagrange_1D_shape(static_cast<Order>(fet.order + add_p_level * elem->p_level()), i, p(0));
75 }
76 
77 template <>
79  const Order order,
80  const unsigned int i,
81  const Point & p,
82  const bool add_p_level)
83 {
84  libmesh_assert(elem);
85 
86  return fe_lagrange_1D_shape(static_cast<Order>(order + add_p_level * elem->p_level()), i, p(0));
87 }
88 
89 template <>
91  const Elem * elem,
92  const unsigned int i,
93  const Point & p,
94  const bool add_p_level)
95 {
96  libmesh_assert(elem);
97  return fe_lagrange_1D_shape(static_cast<Order>(fet.order + add_p_level * elem->p_level()), i, p(0));
98 }
99 
100 
101 
102 template <>
104  const Order order,
105  const unsigned int i,
106  const unsigned int j,
107  const Point & p)
108 {
109  return fe_lagrange_1D_shape_deriv(order, i, j, p(0));
110 }
111 
112 
113 
114 template <>
116  const Order order,
117  const unsigned int i,
118  const unsigned int j,
119  const Point & p)
120 {
121  return fe_lagrange_1D_shape_deriv(order, i, j, p(0));
122 }
123 
124 
125 
126 template <>
128  const Order order,
129  const unsigned int i,
130  const unsigned int j,
131  const Point & p,
132  const bool add_p_level)
133 {
134  libmesh_assert(elem);
135 
136  return fe_lagrange_1D_shape_deriv(static_cast<Order>(order + add_p_level * elem->p_level()), i, j, p(0));
137 }
138 
139 
140 
141 template <>
143  const Order order,
144  const unsigned int i,
145  const unsigned int j,
146  const Point & p,
147  const bool add_p_level)
148 {
149  libmesh_assert(elem);
150 
151  return fe_lagrange_1D_shape_deriv(static_cast<Order>(order + add_p_level * elem->p_level()), i, j, p(0));
152 }
153 
154 
155 template <>
157  const Elem * elem,
158  const unsigned int i,
159  const unsigned int j,
160  const Point & p,
161  const bool add_p_level)
162 {
163  libmesh_assert(elem);
164  return fe_lagrange_1D_shape_deriv(static_cast<Order>(fet.order + add_p_level * elem->p_level()), i, j, p(0));
165 }
166 
167 
168 template <>
170  const Elem * elem,
171  const unsigned int i,
172  const unsigned int j,
173  const Point & p,
174  const bool add_p_level)
175 {
176  libmesh_assert(elem);
177  return fe_lagrange_1D_shape_deriv(static_cast<Order>(fet.order + add_p_level * elem->p_level()), i, j, p(0));
178 }
179 
180 
181 #ifdef LIBMESH_ENABLE_SECOND_DERIVATIVES
182 
183 template <>
185  const Order order,
186  const unsigned int i,
187  const unsigned int j,
188  const Point & p)
189 {
190  return fe_lagrange_1D_shape_second_deriv(order, i, j, p(0));
191 }
192 
193 
194 
195 template <>
197  const Order order,
198  const unsigned int i,
199  const unsigned int j,
200  const Point & p)
201 {
202  return fe_lagrange_1D_shape_second_deriv(order, i, j, p(0));
203 }
204 
205 
206 
207 template <>
209  const Order order,
210  const unsigned int i,
211  const unsigned int j,
212  const Point & p,
213  const bool add_p_level)
214 {
215  libmesh_assert(elem);
216 
217  return fe_lagrange_1D_shape_second_deriv(static_cast<Order>(order + add_p_level * elem->p_level()), i, j, p(0));
218 }
219 
220 
221 
222 template <>
224  const Order order,
225  const unsigned int i,
226  const unsigned int j,
227  const Point & p,
228  const bool add_p_level)
229 {
230  libmesh_assert(elem);
231 
232  return fe_lagrange_1D_shape_second_deriv(static_cast<Order>(order + add_p_level * elem->p_level()), i, j, p(0));
233 }
234 
235 
236 template <>
238  const Elem * elem,
239  const unsigned int i,
240  const unsigned int j,
241  const Point & p,
242  const bool add_p_level)
243 {
244  libmesh_assert(elem);
245  return fe_lagrange_1D_shape_second_deriv(static_cast<Order>(fet.order + add_p_level * elem->p_level()), i, j, p(0));
246 }
247 
248 
249 template <>
251  const Elem * elem,
252  const unsigned int i,
253  const unsigned int j,
254  const Point & p,
255  const bool add_p_level)
256 {
257  libmesh_assert(elem);
258  return fe_lagrange_1D_shape_second_deriv(static_cast<Order>(fet.order + add_p_level * elem->p_level()), i, j, p(0));
259 }
260 
261 #endif // LIBMESH_ENABLE_SECOND_DERIVATIVES
262 
263 } // namespace libMesh
264 
class FEType hides (possibly multiple) FEFamily and approximation orders, thereby enabling specialize...
Definition: fe_type.h:182
ElemType
Defines an enum for geometric element types.
Order
defines an enum for polynomial orders.
Definition: enum_order.h:40
Real fe_lagrange_1D_shape_second_deriv(const Order order, const unsigned int i, const unsigned int j, const Real xi)
static OutputShape shape(const ElemType t, const Order o, const unsigned int i, const Point &p)
This is the base class from which all geometric element types are derived.
Definition: elem.h:94
static OutputShape shape_deriv(const ElemType t, const Order o, const unsigned int i, const unsigned int j, const Point &p)
unsigned int p_level() const
Definition: elem.h:2945
OrderWrapper order
The approximation order of the element.
Definition: fe_type.h:201
The libMesh namespace provides an interface to certain functionality in the library.
Real fe_lagrange_1D_shape_deriv(const Order order, const unsigned int i, const unsigned int j, const Real xi)
LIBMESH_DEFAULT_VECTORIZED_FE(template<>Real FE< 0, BERNSTEIN)
libmesh_assert(ctx)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
Real fe_lagrange_1D_shape(const Order order, const unsigned int i, const Real xi)
A Point defines a location in LIBMESH_DIM dimensional Real space.
Definition: point.h:39
static OutputShape shape_second_deriv(const ElemType t, const Order o, const unsigned int i, const unsigned int j, const Point &p)