23char laplacien_mat_C[] =
"$Header: /cvsroot/Lorene/C++/Source/Non_class_members/PDE/laplacien_mat.C,v 1.11 2014/10/13 08:53:29 j_novak Exp $" ;
151Matrice _laplacien_mat_pas_prevu(
int n,
int l,
double echelle,
int puis) {
152 cout <<
"laplacien pas prevu..." << endl ;
153 cout <<
"n : " << n << endl ;
154 cout <<
"l : " << l << endl ;
155 cout <<
"puissance : " << puis << endl ;
156 cout <<
"echelle : " << echelle << endl ;
169Matrice _laplacien_mat_r_jaco02 (
int n,
int l,
double,
int) {
171 const int nmax = 200 ;
172 static Matrice* tab[nmax] ;
173 static int nb_dejafait = 0 ;
174 static int l_dejafait[nmax] ;
175 static int nr_dejafait[nmax] ;
180 for (
int conte=0 ; conte<nb_dejafait ; conte ++)
181 if ((l_dejafait[conte] == l) && (nr_dejafait[conte] == n))
186 if (nb_dejafait >= nmax) {
187 cout <<
"_laplacien_mat_r_jaco02 : trop de matrices" << endl ;
193 l_dejafait[nb_dejafait] = l ;
194 nr_dejafait[nb_dejafait] = n ;
200 tab[nb_dejafait] =
new Matrice(d2 + 2.*sxd -(l*(l+1))*sx2) ;
202 indice = nb_dejafait ;
206 return *tab[indice] ;
215Matrice _laplacien_mat_r_chebp (
int n,
int l,
double,
int) {
217 const int nmax = 200 ;
218 static Matrice* tab[nmax] ;
219 static int nb_dejafait = 0 ;
220 static int l_dejafait[nmax] ;
221 static int nr_dejafait[nmax] ;
226 for (
int conte=0 ; conte<nb_dejafait ; conte ++)
227 if ((l_dejafait[conte] == l) && (nr_dejafait[conte] == n))
232 if (nb_dejafait >= nmax) {
233 cout <<
"_laplacien_mat_r_chebp : trop de matrices" << endl ;
239 l_dejafait[nb_dejafait] = l ;
240 nr_dejafait[nb_dejafait] = n ;
246 tab[nb_dejafait] =
new Matrice(d2 + 2.*sxd -(l*(l+1))*sx2) ;
248 indice = nb_dejafait ;
252 return *tab[indice] ;
262Matrice _laplacien_mat_r_chebi (
int n,
int l,
double,
int) {
264 const int nmax = 200 ;
265 static Matrice* tab[nmax] ;
266 static int nb_dejafait = 0 ;
267 static int l_dejafait[nmax] ;
268 static int nr_dejafait[nmax] ;
273 for (
int conte=0 ; conte<nb_dejafait ; conte ++)
274 if ((l_dejafait[conte] == l) && (nr_dejafait[conte] == n))
279 if (nb_dejafait >= nmax) {
280 cout <<
"_laplacien_mat_r_chebi : trop de matrices" << endl ;
286 l_dejafait[nb_dejafait] = l ;
287 nr_dejafait[nb_dejafait] = n ;
293 tab[nb_dejafait] =
new Matrice(d2 + 2.*sxd - (l*(l+1))*sx2) ;
294 indice = nb_dejafait ;
298 return *tab[indice] ;
308Matrice _laplacien_mat_r_chebu(
int n,
int l,
double,
int puis) {
313 res = _laplacien_mat_r_chebu_quatre (n, l) ;
316 res = _laplacien_mat_r_chebu_trois (n, l) ;
319 res = _laplacien_mat_r_chebu_deux (n, l) ;
322 res = _laplacien_mat_r_chebu_cinq (n, l) ;
332Matrice _laplacien_mat_r_chebu_quatre (
int n,
int l) {
334 const int nmax = 200 ;
335 static Matrice* tab[nmax] ;
336 static int nb_dejafait = 0 ;
337 static int l_dejafait[nmax] ;
338 static int nr_dejafait[nmax] ;
343 for (
int conte=0 ; conte<nb_dejafait ; conte ++)
344 if ((l_dejafait[conte] == l) && (nr_dejafait[conte] == n))
349 if (nb_dejafait >= nmax) {
350 cout <<
"_laplacien_mat_r_chebu_quatre : trop de matrices" << endl ;
356 l_dejafait[nb_dejafait] = l ;
357 nr_dejafait[nb_dejafait] = n ;
362 tab[nb_dejafait] =
new Matrice(dd-(l*(l+1))*xx) ;
363 indice = nb_dejafait ;
367 return *tab[indice] ;
371Matrice _laplacien_mat_r_chebu_trois (
int n,
int l) {
373 const int nmax = 200 ;
374 static Matrice* tab[nmax] ;
375 static int nb_dejafait = 0 ;
376 static int l_dejafait[nmax] ;
377 static int nr_dejafait[nmax] ;
382 for (
int conte=0 ; conte<nb_dejafait ; conte ++)
383 if ((l_dejafait[conte] == l) && (nr_dejafait[conte] == n))
388 if (nb_dejafait >= nmax) {
389 cout <<
"_laplacien_mat_r_chebu_trois : trop de matrices" << endl ;
395 l_dejafait[nb_dejafait] = l ;
396 nr_dejafait[nb_dejafait] = n ;
401 tab[nb_dejafait] =
new Matrice(xd2 -(l*(l+1))*sx) ;
403 indice = nb_dejafait ;
407 return *tab[indice] ;
412Matrice _laplacien_mat_r_chebu_deux (
int n,
int l) {
414 const int nmax = 200 ;
415 static Matrice* tab[nmax] ;
416 static int nb_dejafait = 0 ;
417 static int l_dejafait[nmax] ;
418 static int nr_dejafait[nmax] ;
423 for (
int conte=0 ; conte<nb_dejafait ; conte ++)
424 if ((l_dejafait[conte] == l) && (nr_dejafait[conte] == n))
429 if (nb_dejafait >= nmax) {
430 cout <<
"_laplacien_mat_r_chebu_deux : trop de matrices" << endl ;
436 l_dejafait[nb_dejafait] = l ;
437 nr_dejafait[nb_dejafait] = n ;
439 Diff_x2dsdx2 x2dd(
R_CHEBU, n) ;
442 tab[nb_dejafait] =
new Matrice(x2dd - (l*(l+1))*
id) ;
444 indice = nb_dejafait ;
448 return *tab[indice] ;
452Matrice _laplacien_mat_r_chebu_cinq (
int n,
int l) {
454 const int nmax = 200 ;
455 static Matrice* tab[nmax] ;
456 static int nb_dejafait = 0 ;
457 static int l_dejafait[nmax] ;
458 static int nr_dejafait[nmax] ;
463 for (
int conte=0 ; conte<nb_dejafait ; conte ++)
464 if ((l_dejafait[conte] == l) && (nr_dejafait[conte] == n))
469 if (nb_dejafait >= nmax) {
470 cout <<
"_laplacien_mat_r_chebu_cinq : trop de matrices" << endl ;
476 l_dejafait[nb_dejafait] = l ;
477 nr_dejafait[nb_dejafait] = n ;
479 Diff_x2dsdx2 x2dd(
R_CHEBU, n) ;
483 tab[nb_dejafait] =
new Matrice( x2dd + 6.*xd1 + (6-l*(l+1))*
id ) ;
485 indice = nb_dejafait ;
489 return *tab[indice] ;
497Matrice _laplacien_mat_r_cheb (
int n,
int l,
double echelle,
int) {
499 const int nmax = 200 ;
500 static Matrice* tab[nmax] ;
501 static int nb_dejafait = 0 ;
502 static int l_dejafait[nmax] ;
503 static int nr_dejafait[nmax] ;
504 static double vieux_echelle = 0;
507 if (vieux_echelle != echelle) {
508 for (
int i=0 ; i<nb_dejafait ; i++) {
510 nr_dejafait[i] = -1 ;
515 vieux_echelle = echelle ;
521 for (
int conte=0 ; conte<nb_dejafait ; conte ++)
522 if ((l_dejafait[conte] == l) && (nr_dejafait[conte] == n))
527 if (nb_dejafait >= nmax) {
528 cout <<
"_laplacien_mat_r_cheb : trop de matrices" << endl ;
534 l_dejafait[nb_dejafait] = l ;
535 nr_dejafait[nb_dejafait] = n ;
537 Diff_dsdx2 d2(
R_CHEB, n) ;
538 Diff_xdsdx2 xd2(
R_CHEB, n) ;
539 Diff_x2dsdx2 x2d2(
R_CHEB, n) ;
541 Diff_xdsdx xd1(
R_CHEB, n) ;
545 new Matrice(x2d2 + (2*echelle)*xd2 + (echelle*echelle)*d2
546 + 2*xd1 + (2*echelle)*d1 - (l*(l+1))*
id) ;
547 indice = nb_dejafait ;
551 return *tab[indice] ;
558Matrice laplacien_mat(
int n,
int l,
double echelle,
int puis,
int base_r)
562 static Matrice (*laplacien_mat[
MAX_BASE])(int, int, double, int) ;
569 laplacien_mat[i] = _laplacien_mat_pas_prevu ;
572 laplacien_mat[
R_CHEB >>
TRA_R] = _laplacien_mat_r_cheb ;
573 laplacien_mat[
R_CHEBU >>
TRA_R] = _laplacien_mat_r_chebu ;
574 laplacien_mat[
R_CHEBP >>
TRA_R] = _laplacien_mat_r_chebp ;
575 laplacien_mat[
R_CHEBI >>
TRA_R] = _laplacien_mat_r_chebi ;
579 return laplacien_mat[base_r](n, l, echelle, puis) ;
#define MAX_BASE
Nombre max. de bases differentes.
#define R_CHEBU
base de Chebychev ordinaire (fin), dev. en 1/r
#define R_JACO02
base de Jacobi(0,2) ordinaire (finjac)
#define R_CHEBI
base de Cheb. impaire (rare) seulement
#define TRA_R
Translation en R, used for a bitwise shift (in hex)
#define R_CHEB
base de Chebychev ordinaire (fin)
#define R_CHEBP
base de Cheb. paire (rare) seulement