Line data Source code
1 : // The libMesh Finite Element Library.
2 : // Copyright (C) 2002-2026 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/fe.h"
22 : #include "libmesh/elem.h"
23 : #include "libmesh/fe_lagrange_gll_shape.h"
24 :
25 :
26 : namespace libMesh
27 : {
28 :
29 88992 : LIBMESH_DEFAULT_VECTORIZED_FE(1,L2_LAGRANGE_GLL)
30 36228 : LIBMESH_DEFAULT_VECTORIZED_FE(1,LAGRANGE_GLL)
31 :
32 :
33 : template <>
34 0 : Real FE<1,L2_LAGRANGE_GLL>::shape(const ElemType,
35 : const Order order,
36 : const unsigned int i,
37 : const Point & p)
38 : {
39 0 : return fe_lagrange_gll_1D_shape(order, i, p(0));
40 : }
41 :
42 :
43 : template <>
44 87708 : Real FE<1,L2_LAGRANGE_GLL>::shape(const Elem * elem,
45 : const Order order,
46 : const unsigned int i,
47 : const Point & p,
48 : const bool add_p_level)
49 : {
50 7309 : libmesh_assert(elem);
51 :
52 102326 : return fe_lagrange_gll_1D_shape(order + add_p_level*elem->p_level(), i, p(0));
53 : }
54 :
55 :
56 : template <>
57 0 : Real FE<1,L2_LAGRANGE_GLL>::shape(const FEType fet,
58 : const Elem * elem,
59 : const unsigned int i,
60 : const Point & p,
61 : const bool add_p_level)
62 : {
63 0 : libmesh_assert(elem);
64 :
65 0 : return fe_lagrange_gll_1D_shape(fet.order + add_p_level*elem->p_level(), i, p(0));
66 : }
67 :
68 :
69 : template <>
70 0 : Real FE<1,L2_LAGRANGE_GLL>::shape_deriv(const ElemType,
71 : const Order order,
72 : const unsigned int i,
73 : const unsigned int j,
74 : const Point & p)
75 : {
76 0 : return fe_lagrange_gll_1D_shape_deriv(order, i, j, p(0));
77 : }
78 :
79 :
80 : template <>
81 35064 : Real FE<1,L2_LAGRANGE_GLL>::shape_deriv(const Elem * elem,
82 : const Order order,
83 : const unsigned int i,
84 : const unsigned int j,
85 : const Point & p,
86 : const bool add_p_level)
87 : {
88 2922 : libmesh_assert(elem);
89 :
90 40908 : return fe_lagrange_gll_1D_shape_deriv(order + add_p_level*elem->p_level(), i, j, p(0));
91 : }
92 :
93 :
94 : template <>
95 0 : Real FE<1,L2_LAGRANGE_GLL>::shape_deriv(const FEType fet,
96 : const Elem * elem,
97 : const unsigned int i,
98 : const unsigned int j,
99 : const Point & p,
100 : const bool add_p_level)
101 : {
102 0 : libmesh_assert(elem);
103 :
104 0 : return fe_lagrange_gll_1D_shape_deriv(fet.order + add_p_level*elem->p_level(), i, j, p(0));
105 : }
106 :
107 :
108 : template <>
109 0 : Real FE<1,LAGRANGE_GLL>::shape(const ElemType,
110 : const Order order,
111 : const unsigned int i,
112 : const Point & p)
113 : {
114 0 : return fe_lagrange_gll_1D_shape(order, fe_lagrange_gll_1D_index(order, i), p(0));
115 : }
116 :
117 :
118 : template <>
119 28504 : Real FE<1,LAGRANGE_GLL>::shape(const Elem * elem,
120 : const Order order,
121 : const unsigned int i,
122 : const Point & p,
123 : const bool add_p_level)
124 : {
125 2409 : libmesh_assert(elem);
126 :
127 30913 : const Order total_order = order + add_p_level*elem->p_level();
128 :
129 47916 : return fe_lagrange_gll_1D_shape(total_order, fe_lagrange_gll_1D_index(total_order, i), p(0));
130 : }
131 :
132 :
133 : template <>
134 0 : Real FE<1,LAGRANGE_GLL>::shape(const FEType fet,
135 : const Elem * elem,
136 : const unsigned int i,
137 : const Point & p,
138 : const bool add_p_level)
139 : {
140 0 : libmesh_assert(elem);
141 :
142 0 : const Order total_order = fet.order + add_p_level*elem->p_level();
143 :
144 0 : return fe_lagrange_gll_1D_shape(total_order, fe_lagrange_gll_1D_index(total_order, i), p(0));
145 : }
146 :
147 :
148 : template <>
149 0 : Real FE<1,LAGRANGE_GLL>::shape_deriv(const ElemType,
150 : const Order order,
151 : const unsigned int i,
152 : const unsigned int j,
153 : const Point & p)
154 : {
155 0 : return fe_lagrange_gll_1D_shape_deriv(order, fe_lagrange_gll_1D_index(order, i), j, p(0));
156 : }
157 :
158 :
159 : template <>
160 14100 : Real FE<1,LAGRANGE_GLL>::shape_deriv(const Elem * elem,
161 : const Order order,
162 : const unsigned int i,
163 : const unsigned int j,
164 : const Point & p,
165 : const bool add_p_level)
166 : {
167 1175 : libmesh_assert(elem);
168 :
169 15275 : const Order total_order = order + add_p_level*elem->p_level();
170 :
171 23274 : return fe_lagrange_gll_1D_shape_deriv(total_order, fe_lagrange_gll_1D_index(total_order, i), j, p(0));
172 : }
173 :
174 :
175 : template <>
176 0 : Real FE<1,LAGRANGE_GLL>::shape_deriv(const FEType fet,
177 : const Elem * elem,
178 : const unsigned int i,
179 : const unsigned int j,
180 : const Point & p,
181 : const bool add_p_level)
182 : {
183 0 : libmesh_assert(elem);
184 :
185 0 : const Order total_order = fet.order + add_p_level*elem->p_level();
186 :
187 0 : return fe_lagrange_gll_1D_shape_deriv(total_order, fe_lagrange_gll_1D_index(total_order, i), j, p(0));
188 : }
189 :
190 :
191 : #ifdef LIBMESH_ENABLE_SECOND_DERIVATIVES
192 :
193 : template <>
194 0 : Real FE<1,L2_LAGRANGE_GLL>::shape_second_deriv(const ElemType,
195 : const Order order,
196 : const unsigned int i,
197 : const unsigned int j,
198 : const Point & p)
199 : {
200 0 : return fe_lagrange_gll_1D_shape_second_deriv(order, i, j, p(0));
201 : }
202 :
203 :
204 : template <>
205 35064 : Real FE<1,L2_LAGRANGE_GLL>::shape_second_deriv(const Elem * elem,
206 : const Order order,
207 : const unsigned int i,
208 : const unsigned int j,
209 : const Point & p,
210 : const bool add_p_level)
211 : {
212 2922 : libmesh_assert(elem);
213 :
214 40908 : return fe_lagrange_gll_1D_shape_second_deriv(order + add_p_level*elem->p_level(), i, j, p(0));
215 : }
216 :
217 :
218 : template <>
219 0 : Real FE<1,L2_LAGRANGE_GLL>::shape_second_deriv(const FEType fet,
220 : const Elem * elem,
221 : const unsigned int i,
222 : const unsigned int j,
223 : const Point & p,
224 : const bool add_p_level)
225 : {
226 0 : libmesh_assert(elem);
227 :
228 0 : return fe_lagrange_gll_1D_shape_second_deriv(fet.order + add_p_level*elem->p_level(), i, j, p(0));
229 : }
230 :
231 :
232 : template <>
233 0 : Real FE<1,LAGRANGE_GLL>::shape_second_deriv(const ElemType,
234 : const Order order,
235 : const unsigned int i,
236 : const unsigned int j,
237 : const Point & p)
238 : {
239 0 : return fe_lagrange_gll_1D_shape_second_deriv(order, fe_lagrange_gll_1D_index(order, i), j, p(0));
240 : }
241 :
242 :
243 : template <>
244 14100 : Real FE<1,LAGRANGE_GLL>::shape_second_deriv(const Elem * elem,
245 : const Order order,
246 : const unsigned int i,
247 : const unsigned int j,
248 : const Point & p,
249 : const bool add_p_level)
250 : {
251 1175 : libmesh_assert(elem);
252 :
253 15275 : const Order total_order = order + add_p_level*elem->p_level();
254 :
255 23274 : return fe_lagrange_gll_1D_shape_second_deriv(total_order, fe_lagrange_gll_1D_index(total_order, i), j, p(0));
256 : }
257 :
258 :
259 : template <>
260 0 : Real FE<1,LAGRANGE_GLL>::shape_second_deriv(const FEType fet,
261 : const Elem * elem,
262 : const unsigned int i,
263 : const unsigned int j,
264 : const Point & p,
265 : const bool add_p_level)
266 : {
267 0 : libmesh_assert(elem);
268 :
269 0 : const Order total_order = fet.order + add_p_level*elem->p_level();
270 :
271 0 : return fe_lagrange_gll_1D_shape_second_deriv(total_order, fe_lagrange_gll_1D_index(total_order, i), j, p(0));
272 : }
273 :
274 :
275 : #endif // LIBMESH_ENABLE_SECOND_DERIVATIVES
276 :
277 : } // namespace libMesh
|