29 #ifndef OOMPH_ORTHPOLY_HEADER
30 #define OOMPH_ORTHPOLY_HEADER
34 #include <oomph-lib-config.h>
52 const double eps = 1.0e-15;
57 inline double legendre(
const unsigned&
p,
const double&
x)
60 if (
p == 0)
return 1.0;
69 double L0 = 1.0, L1 = 1.0, L2 =
x;
71 for (
unsigned n = 1;
n <
p;
n++)
77 L2 = ((2 *
n + 1) *
x * L1 -
n * L0) / (
n + 1);
102 double L0 = 1.0, L1 = 1.0, L2 =
x;
104 for (
unsigned n = 1;
n <
p;
n++)
110 L2 = ((2 *
n + 1) *
x * L1 -
n * L0) / (
n + 1);
123 double dL1 = 1.0, dL2 = 3 *
x, dL3 = 0.0;
124 if (
p == 0)
return 0.0;
131 for (
unsigned n = 2;
n <
p;
n++)
133 dL3 = 1.0 /
n * ((2.0 *
n + 1.0) *
x * dL2 - (
n + 1.0) * dL1);
146 double ddL2 = 3.0, ddL3 = 15 *
x, ddL4 = 0.0;
147 if (
p == 0)
return 0.0;
156 for (
unsigned i = 3;
i <
p;
i++)
159 1.0 / (
i - 1.0) * ((2.0 *
i + 1.0) *
x * ddL3 - (
i + 2.0) * ddL2);
176 if (
p == 0)
return P0;
181 for (
unsigned n = 1;
n <
p;
n++)
191 P2 = ((a2n + a3n *
x) * P1 - a4n *
P0) / a1n;
220 for (
unsigned n = 1;
n <
p;
n++)
233 P2 = ((a2n + a3n *
x) * P1 - a4n *
P0) / a1n;
int i
Definition: BiCGSTAB_step_by_step.cpp:9
const unsigned n
Definition: CG3DPackingUnitTest.cpp:11
RowVector3d w
Definition: Matrix_resize_int.cpp:3
float * p
Definition: Tutorial_Map_using.cpp:9
RealScalar alpha
Definition: level1_cplx_impl.h:151
Scalar beta
Definition: level2_cplx_impl.h:36
double P0
Definition: two_dim.cc:101
double dlegendre(const unsigned &p, const double &x)
Definition: orthpoly.h:121
const double eps
Definition: orthpoly.h:52
double ddlegendre(const unsigned &p, const double &x)
Definition: orthpoly.h:144
void gl_nodes(const unsigned &Nnode, Vector< double > &x)
Definition: orthpoly.cc:105
double legendre(const unsigned &p, const double &x)
Definition: orthpoly.h:57
void legendre_vector(const unsigned &p, const double &x, Vector< double > &polys)
Definition: orthpoly.h:88
void gll_nodes(const unsigned &Nnode, Vector< double > &x)
Calculates the Gauss Lobatto Legendre abscissas for degree p = NNode-1.
Definition: orthpoly.cc:33
double jacobi(const int &alpha, const int &beta, const unsigned &p, const double &x)
Calculate the Jacobi polnomials.
Definition: orthpoly.h:168
DRAIG: Change all instances of (SPATIAL_DIM) to (DIM-1).
Definition: AnisotropicHookean.h:10
list x
Definition: plotDoE.py:28