Hi gk,

you are right, the value of the Legendre polynomial should be 1 at x=1 for all 
orders and the polynomials should be defined based on the interval [-1,1]. As 
the deal.II libraray is based on the reference interval [0,1] the polynomials 
are transformed to that interval, that operation is documented. Furthermore, 
the resulting polynomials are scaled in order to be orthonormal instead of just 
orthogonal over that interval. Unfortunately, the latter operation is not 
properly documented. You can of course re-scale the polynomials afterwards in 
order to obtain the original polynomials. Or you simply create them directly, 
the three term recursion is simple enough. In any case, "Legendre" is a 
mis-namer in deal.II.

Von: [email protected] [[email protected]]" im Auftrag von 
"gaurav k [[email protected]]
Gesendet: Freitag, 17. Juni 2011 22:13
Bis: [email protected]
Betreff: [deal.II] Legendre Polynomials

Hi,

I am trying to develop an exponential filter for my code and for that I need to 
construct the Vandermonde matrix using legendre polynomials. I've taken a very 
simple code to find the output of legendre polynomials at various orders as a 
test case and I seem to be getting the wrong results. I am using version 7.0.0

Code:

#include <iostream>
#include <base/polynomial.h>

using namespace dealii;

int main ()
{
  degree = 1;
  Polynomials::Legendre test(degree);
  std::cout << test.value(1) << std::endl;
}




Output:
For degree = 0
1
For degree = 1
1.73205
For degree = 2
2.23607

Shouldn't the value be 1 for all the three cases or am I missing a very simple 
point here?

--
Thanks,
gk

_______________________________________________
dealii mailing list http://poisson.dealii.org/mailman/listinfo/dealii

Reply via email to