9#include "hierarchic_fe.h"
13double Legendre(
unsigned n,
double x,
double t) {
21 double Pi = 2 * x - t;
22 for (
unsigned i = 2; i <= n; ++i) {
24 (2 * i - 1) * (2 * x - t) / i * Pi - (i - 1) * t * t / i * Pim1;
60double Jacobi(
unsigned n,
double alpha,
double beta,
double x) {
68 return 0.5 * (alpha - beta + x * (alpha + beta + 2));
71 double p1 = 0.5 * (alpha - beta + x * (alpha + beta + 2));
73 for (
unsigned j = 1; j < n; ++j) {
75 2 * (j + 1) * (j + alpha + beta + 1) * (2 * j + alpha + beta);
77 (2 * j + alpha + beta + 1) * (alpha * alpha - beta * beta);
78 const double alpha3 = (2 * j + alpha + beta) * (2 * j + alpha + beta + 1) *
79 (2 * j + alpha + beta + 2);
81 2 * (j + alpha) * (j + beta) * (2 * j + alpha + beta + 2);
82 p2 = 1. / alpha1 * ((alpha2 + alpha3 * x) * p1 - alpha4 * p0);
89double Jacobi(
unsigned n,
double alpha,
double x) {
90 return Jacobi(n, alpha, 0, x);
93double IJacobi(
unsigned n,
double alpha,
double x) {
102 double ajp1P = 2 * 2 * (2 + alpha) * (2 * 2 + alpha - 2);
103 double bjp1P = 2 * 2 + alpha - 1;
104 double cjp1P = (2 * 2 + alpha) * (2 * 2 + alpha - 2);
105 double djp1P = 2 * (2 + alpha - 1) * (2 - 1) * (2 * 2 + alpha);
107 double Pjm1 = (2 + alpha) * x - 1;
109 (bjp1P * (cjp1P * (2 * x - 1) + alpha * alpha) * Pjm1 - djp1P * Pjm2) /
111 for (
unsigned j = 2; j < n; ++j) {
112 ajp1P = 2 * (j + 1) * ((j + 1) + alpha) * (2 * (j + 1) + alpha - 2);
113 bjp1P = 2 * (j + 1) + alpha - 1;
114 cjp1P = (2 * (j + 1) + alpha) * (2 * (j + 1) + alpha - 2);
115 djp1P = 2 * ((j + 1) + alpha - 1) * ((j + 1) - 1) * (2 * (j + 1) + alpha);
117 (bjp1P * (cjp1P * (2 * x - 1) + alpha * alpha) * Pj - djp1P * Pjm1) /
124 const double anL = (n + alpha) / ((2 * n + alpha - 1) * (2 * n + alpha));
125 const double bnL = alpha / ((2 * n + alpha - 2) * (2 * n + alpha));
126 const double cnL = (n - 1) / ((2 * n + alpha - 2) * (2 * n + alpha - 1));
127 return anL * Pj + bnL * Pjm1 - cnL * Pjm2;
131 return Jacobi(n - 1, alpha, x);
134double JacobiDx(
unsigned n,
double alpha,
double x) {
138 return Jacobi(n - 1, alpha + 1, 1, x) * (alpha + n + 1);
Collects data structures and algorithms designed for scalar finite element methods primarily meant fo...
double Legendre(unsigned n, double x, double t)
computes the n-th degree scaled Legendre Polynomial
double ILegendreDx(unsigned n, double x, double t)
Computes .
double IJacobiDx(unsigned n, double alpha, double x)
Computes the derivative of the n-th integrated scaled Jacobi polynomial.
double ILegendre(unsigned n, double x, double t)
computes the integral of the (n-1)-th degree scaled Legendre Polynomial
double Jacobi(unsigned n, double alpha, double beta, double x)
Computes the n-th degree shifted Jacobi polynomial.
double IJacobi(unsigned n, double alpha, double x)
Evaluate the integral of the (n-1)-th degree Jacobi Polynomial for .
double JacobiDx(unsigned n, double alpha, double x)
Computes the derivative of the n-th degree Jacobi Polynomial for .
double ILegendreDt(unsigned n, double x, double t)
Computes .
double LegendreDx(unsigned n, double x, double t)
Computes the derivative of the n-th degree scaled Legendre polynomial.