00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 char prepa_helmholtz_plus_C[] = "$Header: /cvsroot/Lorene/C++/Source/Non_class_members/PDE/prepa_helmholtz_plus.C,v 1.3 2008/02/18 13:53:43 j_novak Exp $" ;
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043 #include <stdio.h>
00044 #include <stdlib.h>
00045 #include <math.h>
00046
00047 #include "matrice.h"
00048 #include "type_parite.h"
00049 #include "proto.h"
00050
00051
00052
00053
00054
00055
00056
00057
00058 Matrice _prepa_helmholtz_plus_nondege_pas_prevu(const Matrice &so) {
00059
00060 cout << "Unknown case for prepa_helmholtz_plus_nondege" << endl ;
00061 abort() ;
00062 exit(-1) ;
00063 return so;
00064 }
00065
00066
00067
00068
00069
00070
00071 Matrice _prepa_helmholtz_plus_nondege_r_cheb (const Matrice &lap) {
00072
00073 int n = lap.get_dim(0) ;
00074 int non_dege = 2 ;
00075
00076 Matrice res(n-non_dege, n-non_dege) ;
00077 res.set_etat_qcq() ;
00078 for (int i=0 ; i<n-non_dege ; i++)
00079 for (int j=0 ; j<n-non_dege ; j++)
00080 res.set(i, j) = lap(i, j+non_dege) ;
00081
00082 res.set_band (4,4) ;
00083 res.set_lu() ;
00084
00085 return res ;
00086 }
00087
00088
00089
00090
00091
00092
00093 Matrice _prepa_helmholtz_plus_nondege_r_chebp (const Matrice &lap) {
00094
00095 int n = lap.get_dim(0) ;
00096 int non_dege = 1 ;
00097
00098 Matrice res(n-non_dege, n-non_dege) ;
00099 res.set_etat_qcq() ;
00100 for (int i=0 ; i<n-non_dege ; i++)
00101 for (int j=0 ; j<n-non_dege ; j++)
00102 res.set(i, j) = lap(i, j+non_dege) ;
00103
00104 res.set_band (4,1) ;
00105 res.set_lu() ;
00106 return res ;
00107 }
00108
00109
00110
00111
00112
00113
00114 Matrice prepa_helmholtz_plus_nondege(const Matrice &ope, int base_r) {
00115
00116
00117 static Matrice (*prepa_helmholtz_plus_nondege[MAX_BASE])
00118 (const Matrice&) ;
00119 static int nap = 0 ;
00120
00121
00122 if (nap==0) {
00123 nap = 1 ;
00124 for (int i=0 ; i<MAX_BASE ; i++) {
00125 prepa_helmholtz_plus_nondege[i] =
00126 _prepa_helmholtz_plus_nondege_pas_prevu ;
00127 }
00128
00129 prepa_helmholtz_plus_nondege[R_CHEB >> TRA_R] =
00130 _prepa_helmholtz_plus_nondege_r_cheb ;
00131 prepa_helmholtz_plus_nondege[R_CHEBP >> TRA_R] =
00132 _prepa_helmholtz_plus_nondege_r_chebp ;
00133 }
00134
00135 Matrice res(prepa_helmholtz_plus_nondege[base_r](ope)) ;
00136 return res ;
00137 }
00138