1#ifndef DUNE_FEM_SPACE_SHAPEFUNCTIONSET_LEGENDREPOLYNOMIALS_HH
2#define DUNE_FEM_SPACE_SHAPEFUNCTIONSET_LEGENDREPOLYNOMIALS_HH
15 class LegendrePolynomials
18 static const int maxOrder = 11;
20 static const double factor[ maxOrder ][ maxOrder ];
21 static const double weight[ maxOrder ];
24 static double evaluate (
const int num,
const double x )
26 assert( 0 <= num && num < maxOrder );
28 double phi = factor[ num ][ num ];
29 for(
int i = num-1; i >= 0; --i )
30 phi = phi * x + factor[ num ][ i ];
31 return weight[ num ] * phi;
34 static double jacobian (
const int num,
const double x )
36 assert( 0 <= num && num < maxOrder );
41 phi = factor[ num ][ num ] * num;
42 for(
int i = num-1; i >= 1; --i )
43 phi = phi * x + factor[ num ][ i ] * i;
45 return weight[ num ] * phi;
48 static double hessian (
const int num,
const double x )
50 assert( 0 <= num && num < maxOrder );
55 phi = factor[ num ][ num ] * num * ( num-1 );
56 for(
int i = num-1; i >= 2; --i )
57 phi = phi * x + factor[ num ][ i ] * i * (i-1);
59 return weight[ num ] * phi;
Dune namespace.
Definition: alignedallocator.hh:13