00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 char ope_vorton_mat_C[] = "$Header: /cvsroot/Lorene/C++/Source/Ope_elementary/Ope_vorton/ope_vorton_mat.C,v 1.2 2007/04/24 15:52:55 p_grandclement Exp $" ;
00022
00023
00024
00025
00026
00027
00028 #include <math.h>
00029 #include <stdlib.h>
00030
00031 #include "proto.h"
00032 #include "ope_elementary.h"
00033 #include "diff.h"
00034
00035
00036
00037
00038
00039
00040 Matrice _vorton_mat_pas_prevu(int, double, double, int, int) {
00041 cout << "Vorton : base not implemented..." << endl ;
00042 abort() ;
00043 exit(-1) ;
00044 Matrice res(1, 1) ;
00045 return res;
00046 }
00047
00048
00049
00050
00051 Matrice _vorton_mat_r_chebu_trois (int n, int lq) {
00052
00053
00054 Diff_xdsdx2 xdd(R_CHEBU, n) ;
00055 Diff_dsdx d(R_CHEBU, n) ;
00056 Diff_sx sx(R_CHEBU, n) ;
00057
00058 return (xdd+2*d-lq*(lq+1)*sx) ;
00059 }
00060
00061 Matrice _vorton_mat_r_chebu (int n, double, double, int lq, int dz) {
00062 Matrice res(n, n) ;
00063 res.set_etat_qcq() ;
00064 switch (dz) {
00065 case 3 :
00066 res = _vorton_mat_r_chebu_trois (n, lq) ;
00067 break ;
00068 default :
00069 abort() ;
00070 exit(-1) ;
00071 }
00072 return res ;
00073 }
00074
00075
00076
00077
00078
00079
00080
00081 Matrice _vorton_mat_r_cheb (int n, double alpha, double beta, int lq, int) {
00082 Diff_dsdx2 d2(R_CHEB, n) ;
00083 Diff_xdsdx2 xd2(R_CHEB, n) ;
00084 Diff_x2dsdx2 x2d2(R_CHEB, n) ;
00085 Diff_dsdx d1(R_CHEB, n) ;
00086 Diff_xdsdx xd1(R_CHEB, n) ;
00087 Diff_id id(R_CHEB, n) ;
00088
00089 double echelle = beta/alpha ;
00090 return (x2d2 + (2*echelle)*xd2 + (echelle*echelle)*d2 - (lq*(lq+1))*id) ;
00091 }
00092
00093 void Ope_vorton::do_ope_mat() const {
00094 if (ope_mat != 0x0)
00095 delete ope_mat ;
00096
00097
00098 static Matrice (*vorton_mat[MAX_BASE])(int, double, double, int, int);
00099 static int nap = 0 ;
00100
00101
00102 if (nap==0) {
00103 nap = 1 ;
00104 for (int i=0 ; i<MAX_BASE ; i++) {
00105 vorton_mat[i] = _vorton_mat_pas_prevu ;
00106 }
00107
00108 vorton_mat[R_CHEB >> TRA_R] = _vorton_mat_r_cheb ;
00109 vorton_mat[R_CHEBU >> TRA_R] = _vorton_mat_r_chebu ;
00110 }
00111 ope_mat = new Matrice(vorton_mat[base_r](nr, alpha, beta, l_quant, dzpuis)) ;
00112 }