libMesh
Loading...
Searching...
No Matches
inf_fe_jacobi_20_00_eval.C
Go to the documentation of this file.
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// Local Includes
20#include "libmesh/libmesh_config.h"
21
22#ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
23
24#include "libmesh/inf_fe.h"
25#include "libmesh/jacobi_polynomials.h"
26
27namespace libMesh
28{
29
30// Anonymous namespace for local helper functions
31namespace {
32
33Real jacobi_20_00_eval(unsigned n, Real x)
34{
35 if (n == 0)
36 return 1.;
37
38 Real val = JacobiPolynomials::value(n, /*alpha=*/2, /*beta=*/0, x);
39
40 // For n>0, there is an even/odd shift of -1/+1 applied. I'm not
41 // sure why this is done for the infinite elements, as it is not
42 // part of the "standard" Jacobi polynomial definition, I'm just
43 // copying what was done in the original implementation...
44 return val + (n % 2 == 0 ? -1 : +1);
45}
46
47Real jacobi_20_00_eval_deriv(unsigned n, Real x)
48{
49 return JacobiPolynomials::deriv(n, /*alpha=*/2, /*beta=*/0, x);
50}
51} // anonymous namespace
52
53
54
55 // Specialize the eval() function for 1, 2, and 3 dimensions and the CARTESIAN mapping type
56 // to call the local helper function from the anonymous namespace.
57template <> Real InfFE<1,JACOBI_20_00,CARTESIAN>::eval(Real x, Order, unsigned n) { return jacobi_20_00_eval(n, x); }
58template <> Real InfFE<2,JACOBI_20_00,CARTESIAN>::eval(Real x, Order, unsigned n) { return jacobi_20_00_eval(n, x); }
59template <> Real InfFE<3,JACOBI_20_00,CARTESIAN>::eval(Real x, Order, unsigned n) { return jacobi_20_00_eval(n, x); }
60
61// Specialize the eval_deriv() function for 1, 2, and 3 dimensions and the CARTESIAN mapping type
62// to call the local helper function from the anonymous namespace.
63template <> Real InfFE<1,JACOBI_20_00,CARTESIAN>::eval_deriv(Real x, Order, unsigned n) { return jacobi_20_00_eval_deriv(n, x); }
64template <> Real InfFE<2,JACOBI_20_00,CARTESIAN>::eval_deriv(Real x, Order, unsigned n) { return jacobi_20_00_eval_deriv(n, x); }
65template <> Real InfFE<3,JACOBI_20_00,CARTESIAN>::eval_deriv(Real x, Order, unsigned n) { return jacobi_20_00_eval_deriv(n, x); }
66
67} // namespace libMesh
68
69#endif // LIBMESH_ENABLE_INFINITE_ELEMENTS
static Real eval(Real v, Order o_radial, unsigned int i)
static Real eval_deriv(Real v, Order o_radial, unsigned int i)
Real value(unsigned n, unsigned alpha, unsigned beta, Real x)
The Jacobi polynomial value and derivative formulas are based on the corresponding Wikipedia article ...
Real deriv(unsigned n, unsigned alpha, unsigned beta, Real x)
The libMesh namespace provides an interface to certain functionality in the library.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real