libMesh
fe_lagrange_shape_1D.C
Go to the documentation of this file.
1 // The libMesh Finite Element Library.
2 // Copyright (C) 2002-2019 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 namespace libMesh
25 {
26 
27 template <>
29  const Order order,
30  const unsigned int i,
31  const Point & p)
32 {
33  return fe_lagrange_1D_shape(order, i, p(0));
34 }
35 
36 template <>
38  const Order order,
39  const unsigned int i,
40  const Point & p)
41 {
42  return fe_lagrange_1D_shape(order, i, p(0));
43 }
44 
45 
46 template <>
48  const Order order,
49  const unsigned int i,
50  const Point & p,
51  const bool add_p_level)
52 {
53  libmesh_assert(elem);
54 
55  return fe_lagrange_1D_shape(static_cast<Order>(order + add_p_level * elem->p_level()), i, p(0));
56 }
57 
58 
59 
60 template <>
62  const Order order,
63  const unsigned int i,
64  const Point & p,
65  const bool add_p_level)
66 {
67  libmesh_assert(elem);
68 
69  return fe_lagrange_1D_shape(static_cast<Order>(order + add_p_level * elem->p_level()), i, p(0));
70 }
71 
72 
73 
74 template <>
76  const Order order,
77  const unsigned int i,
78  const unsigned int j,
79  const Point & p)
80 {
81  return fe_lagrange_1D_shape_deriv(order, i, j, p(0));
82 }
83 
84 
85 
86 template <>
88  const Order order,
89  const unsigned int i,
90  const unsigned int j,
91  const Point & p)
92 {
93  return fe_lagrange_1D_shape_deriv(order, i, j, p(0));
94 }
95 
96 
97 
98 template <>
100  const Order order,
101  const unsigned int i,
102  const unsigned int j,
103  const Point & p,
104  const bool add_p_level)
105 {
106  libmesh_assert(elem);
107 
108  return fe_lagrange_1D_shape_deriv(static_cast<Order>(order + add_p_level * elem->p_level()), i, j, p(0));
109 }
110 
111 
112 
113 template <>
115  const Order order,
116  const unsigned int i,
117  const unsigned int j,
118  const Point & p,
119  const bool add_p_level)
120 {
121  libmesh_assert(elem);
122 
123  return fe_lagrange_1D_shape_deriv(static_cast<Order>(order + add_p_level * elem->p_level()), i, j, p(0));
124 }
125 
126 
127 
128 #ifdef LIBMESH_ENABLE_SECOND_DERIVATIVES
129 
130 template <>
132  const Order order,
133  const unsigned int i,
134  const unsigned int j,
135  const Point & p)
136 {
137  return fe_lagrange_1D_shape_second_deriv(order, i, j, p(0));
138 }
139 
140 
141 
142 template <>
144  const Order order,
145  const unsigned int i,
146  const unsigned int j,
147  const Point & p)
148 {
149  return fe_lagrange_1D_shape_second_deriv(order, i, j, p(0));
150 }
151 
152 
153 
154 template <>
156  const Order order,
157  const unsigned int i,
158  const unsigned int j,
159  const Point & p,
160  const bool add_p_level)
161 {
162  libmesh_assert(elem);
163 
164  return fe_lagrange_1D_shape_second_deriv(static_cast<Order>(order + add_p_level * elem->p_level()), i, j, p(0));
165 }
166 
167 
168 
169 template <>
171  const Order order,
172  const unsigned int i,
173  const unsigned int j,
174  const Point & p,
175  const bool add_p_level)
176 {
177  libmesh_assert(elem);
178 
179  return fe_lagrange_1D_shape_second_deriv(static_cast<Order>(order + add_p_level * elem->p_level()), i, j, p(0));
180 }
181 
182 #endif // LIBMESH_ENABLE_SECOND_DERIVATIVES
183 
184 } // namespace libMesh
185 
libMesh::FE::shape_second_deriv
static OutputShape shape_second_deriv(const ElemType t, const Order o, const unsigned int i, const unsigned int j, const Point &p)
libMesh::fe_lagrange_1D_shape_second_deriv
Real fe_lagrange_1D_shape_second_deriv(const Order order, const unsigned int i, const unsigned int j, const Real xi)
Definition: fe_lagrange_shape_1D.h:294
libMesh
The libMesh namespace provides an interface to certain functionality in the library.
Definition: factoryfunction.C:55
libMesh::Order
Order
Definition: enum_order.h:40
libMesh::Elem::p_level
unsigned int p_level() const
Definition: elem.h:2512
libMesh::fe_lagrange_1D_shape_deriv
Real fe_lagrange_1D_shape_deriv(const Order order, const unsigned int i, const unsigned int j, const Real xi)
Definition: fe_lagrange_shape_1D.h:210
libMesh::libmesh_assert
libmesh_assert(ctx)
libMesh::FE::shape
static OutputShape shape(const ElemType t, const Order o, const unsigned int i, const Point &p)
libMesh::FE::shape_deriv
static OutputShape shape_deriv(const ElemType t, const Order o, const unsigned int i, const unsigned int j, const Point &p)
libMesh::Point
A Point defines a location in LIBMESH_DIM dimensional Real space.
Definition: point.h:38
libMesh::fe_lagrange_1D_shape
Real fe_lagrange_1D_shape(const Order order, const unsigned int i, const Real xi)
Definition: fe_lagrange_shape_1D.h:102
libMesh::Elem
This is the base class from which all geometric element types are derived.
Definition: elem.h:100
libMesh::Real
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
Definition: libmesh_common.h:121
libMesh::ElemType
ElemType
Defines an enum for geometric element types.
Definition: enum_elem_type.h:33