00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037 #include <iostream>
00038
00039 using namespace std ;
00040
00041 #include <stdlib.h>
00042 #include <math.h>
00043
00044 #include "grid.h"
00045
00046 void legendre_nodes_weight_GL(int n, double* coloc, double* weight,
00047 double prec = 1.e-12, int itemax = 100) ;
00048
00049
00050
00051
00052
00053
00054 Grid_Legendre_GL::Grid_Legendre_GL(int nb_nodes) : Grid(nb_nodes) {
00055
00056 double* weights = new double[nn+1] ;
00057
00058 double precis = 1.e-12 ;
00059 int nitermax = 200 ;
00060
00061 legendre_nodes_weight_GL(nn+1, xx, weights, precis, nitermax) ;
00062
00063 delete [] weights ;
00064 }
00065
00066
00067
00068
00069
00070
00071 Grid_Legendre_GL::Grid_Legendre_GL(const Grid_Legendre_GL& gi) : Grid(gi) {}
00072
00073
00074
00075
00076
00077
00078 Grid_Legendre_GL::~Grid_Legendre_GL() {}
00079
00080
00081
00082
00083
00084
00085 void Grid_Legendre_GL::operator=(const Grid_Legendre_GL& gi) {
00086
00087 Grid::operator=(gi) ;
00088 }
00089
00090
00091
00092
00093
00094
00095
00096 ostream& operator<<(ostream& ost, const Grid_Legendre_GL& xn) {
00097
00098 ost << "Legendre Gauss-Lobatto nodes : " ;
00099 int nn = xn.n() ;
00100 ost << "number of nodes : " << nn + 1 << endl ;
00101 for (int i=0; i<=nn; i++) {
00102 ost << " x(" << i << ") = " << xn(i) << endl ;
00103 }
00104
00105 return ost ;
00106 }
00107