00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 char solp_helmholtz_plus_C[] = "$Header: /cvsroot/Lorene/C++/Source/Non_class_members/PDE/solp_helmholtz_plus.C,v 1.3 2008/02/18 13:53:45 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 Tbl _solp_helmholtz_plus_pas_prevu (const Matrice &, const Matrice &,
00055 const Tbl &, double, double) {
00056 cout << " Solution homogene pas prevue ..... : "<< endl ;
00057 abort() ;
00058 exit(-1) ;
00059 Tbl res(1) ;
00060 return res;
00061 }
00062
00063
00064
00065
00066
00067
00068 Tbl _solp_helmholtz_plus_r_cheb (const Matrice &lap, const Matrice &nondege,
00069 const Tbl &source, double alpha, double beta) {
00070
00071 int n = lap.get_dim(0) ;
00072 int dege = n-nondege.get_dim(0) ;
00073 assert (dege ==2) ;
00074
00075 Tbl source_aux(source*alpha*alpha) ;
00076 Tbl xso(source_aux) ;
00077 Tbl xxso(source_aux) ;
00078 multx_1d(n, &xso.t, R_CHEB) ;
00079 multx_1d(n, &xxso.t, R_CHEB) ;
00080 multx_1d(n, &xxso.t, R_CHEB) ;
00081 source_aux = beta*beta/alpha/alpha*source_aux+2*beta/alpha*xso+xxso ;
00082
00083 source_aux = cl_helmholtz_plus (source_aux, R_CHEB) ;
00084
00085 Tbl so(n-dege) ;
00086 so.set_etat_qcq() ;
00087 for (int i=0 ; i<n-dege ; i++)
00088 so.set(i) = source_aux(i) ;
00089
00090 Tbl auxi(nondege.inverse(so)) ;
00091
00092 Tbl res(n) ;
00093 res.set_etat_qcq() ;
00094 for (int i=dege ; i<n ; i++)
00095 res.set(i) = auxi(i-dege) ;
00096
00097 for (int i=0 ; i<dege ; i++)
00098 res.set(i) = 0 ;
00099 return res ;
00100 }
00101
00102
00103
00104
00105 Tbl _solp_helmholtz_plus_r_chebp (const Matrice &lap, const Matrice &nondege,
00106 const Tbl &source, double alpha, double) {
00107
00108 int n = lap.get_dim(0) ;
00109 int dege = n-nondege.get_dim(0) ;
00110 assert (dege ==1) ;
00111
00112 Tbl source_aux(source*alpha*alpha) ;
00113 source_aux = cl_helmholtz_plus (source_aux, R_CHEBP) ;
00114
00115 Tbl so(n-dege) ;
00116 so.set_etat_qcq() ;
00117 for (int i=0 ; i<n-dege ; i++)
00118 so.set(i) = source_aux(i) ;
00119
00120 Tbl auxi(nondege.inverse(so)) ;
00121
00122 Tbl res(n) ;
00123 res.set_etat_qcq() ;
00124 for (int i=dege ; i<n ; i++)
00125 res.set(i) = auxi(i-dege) ;
00126
00127 for (int i=0 ; i<dege ; i++)
00128 res.set(i) = 0 ;
00129 return res ;
00130 }
00131
00132
00133
00134
00135
00136 Tbl solp_helmholtz_plus (const Matrice &lap, const Matrice &nondege,
00137 const Tbl &source, double alpha, double beta,
00138 int base_r) {
00139
00140
00141 static Tbl (*solp_helmholtz_plus[MAX_BASE]) (const Matrice&, const Matrice&,
00142 const Tbl&, double, double) ;
00143 static int nap = 0 ;
00144
00145
00146 if (nap==0) {
00147 nap = 1 ;
00148 for (int i=0 ; i<MAX_BASE ; i++) {
00149 solp_helmholtz_plus[i] = _solp_helmholtz_plus_pas_prevu ;
00150 }
00151
00152 solp_helmholtz_plus[R_CHEB >> TRA_R] = _solp_helmholtz_plus_r_cheb ;
00153 solp_helmholtz_plus[R_CHEBP >> TRA_R] = _solp_helmholtz_plus_r_chebp ;
00154 }
00155
00156 Tbl res(solp_helmholtz_plus[base_r] (lap, nondege, source, alpha, beta)) ;
00157 return res ;
00158 }