00001
00023 char map_log_elliptic_C[] = "$Header $" ;
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055 #include <stdlib.h>
00056 #include <math.h>
00057
00058
00059 #include "tbl.h"
00060 #include "mtbl_cf.h"
00061 #include "map.h"
00062 #include "param_elliptic.h"
00063
00064
00065
00066
00067
00068 void Map_log::sol_elliptic(Param_elliptic& ope_var, const Scalar& source,
00069 Scalar& pot) const {
00070
00071 assert(source.get_etat() != ETATNONDEF) ;
00072 assert(source.get_mp().get_mg() == mg) ;
00073 assert(pot.get_mp().get_mg() == mg) ;
00074
00075 assert(source.check_dzpuis(2) || source.check_dzpuis(3) ||
00076 source.check_dzpuis(4)) ;
00077
00078
00079
00080 const Valeur& sourva = source.get_spectral_va() ;
00081
00082 if (sourva.get_etat() == ETATZERO) {
00083 pot.set_etat_zero() ;
00084 return ;
00085 }
00086
00087
00088 assert(sourva.get_etat() == ETATQCQ) ;
00089
00090 Valeur rho(sourva.get_mg()) ;
00091 sourva.coef() ;
00092 rho = *(sourva.c_cf) ;
00093
00094 rho.ylm() ;
00095
00096
00097
00098 ope_var.var_F.set_spectral_va().coef() ;
00099 ope_var.var_F.set_spectral_va().ylm() ;
00100 ope_var.var_G.set_spectral_va().coef() ;
00101 ope_var.var_G.set_spectral_va().ylm() ;
00102
00103
00104
00105 Mtbl_cf resu = elliptic_solver (ope_var, *(rho.c_cf)) ;
00106
00107
00108
00109 pot.set_etat_zero() ;
00110
00111 pot.set_etat_qcq() ;
00112
00113 pot.set_spectral_va() = resu ;
00114 pot.set_spectral_va().ylm_i() ;
00115
00116 pot.set_dzpuis(0) ;
00117 }
00118
00119
00120
00121
00122
00123
00124
00125 void Map_log::sol_elliptic_boundary(Param_elliptic& ope_var, const Scalar& source,
00126 Scalar& pot, const Mtbl_cf& bound,
00127 double fact_dir, double fact_neu) const {
00128
00129 assert(source.get_etat() != ETATNONDEF) ;
00130 assert(source.get_mp().get_mg() == mg) ;
00131 assert(pot.get_mp().get_mg() == mg) ;
00132
00133 assert(source.check_dzpuis(2) || source.check_dzpuis(3) ||
00134 source.check_dzpuis(4)) ;
00135
00136
00137
00138 const Valeur& sourva = source.get_spectral_va() ;
00139
00140 if (sourva.get_etat() == ETATZERO) {
00141 pot.set_etat_zero() ;
00142 return ;
00143 }
00144
00145
00146 assert(sourva.get_etat() == ETATQCQ) ;
00147
00148 Valeur rho(sourva.get_mg()) ;
00149 sourva.coef() ;
00150 rho = *(sourva.c_cf) ;
00151
00152 rho.ylm() ;
00153
00154
00155
00156 ope_var.var_F.set_spectral_va().coef() ;
00157 ope_var.var_F.set_spectral_va().ylm() ;
00158 ope_var.var_G.set_spectral_va().coef() ;
00159 ope_var.var_G.set_spectral_va().ylm() ;
00160
00161
00162
00163 Mtbl_cf resu = elliptic_solver_boundary (ope_var, *(rho.c_cf), bound,
00164 fact_dir, fact_neu) ;
00165
00166
00167
00168 pot.set_etat_zero() ;
00169
00170 pot.set_etat_qcq() ;
00171
00172 pot.set_spectral_va() = resu ;
00173 pot.set_spectral_va().ylm_i() ;
00174
00175 pot.set_dzpuis(0) ;
00176 }
00177
00178
00179
00180
00181
00182
00183
00184 void Map_log::sol_elliptic_boundary(Param_elliptic& ope_var, const Scalar& source,
00185 Scalar& pot, const Scalar& bound,
00186 double fact_dir, double fact_neu) const {
00187
00188 assert(source.get_etat() != ETATNONDEF) ;
00189 assert(source.get_mp().get_mg() == mg) ;
00190 assert(pot.get_mp().get_mg() == mg) ;
00191
00192 assert(source.check_dzpuis(2) || source.check_dzpuis(3) ||
00193 source.check_dzpuis(4)) ;
00194
00195
00196
00197 const Valeur& sourva = source.get_spectral_va() ;
00198
00199 if (sourva.get_etat() == ETATZERO) {
00200 pot.set_etat_zero() ;
00201 return ;
00202 }
00203
00204
00205 assert(sourva.get_etat() == ETATQCQ) ;
00206
00207 Valeur rho(sourva.get_mg()) ;
00208 sourva.coef() ;
00209 rho = *(sourva.c_cf) ;
00210
00211 rho.ylm() ;
00212
00213
00214
00215 ope_var.var_F.set_spectral_va().coef() ;
00216 ope_var.var_F.set_spectral_va().ylm() ;
00217 ope_var.var_G.set_spectral_va().coef() ;
00218 ope_var.var_G.set_spectral_va().ylm() ;
00219
00220
00221
00222 Scalar bbound = bound;
00223 bbound.set_spectral_va().ylm() ;
00224 const Map& mapp = bbound.get_mp();
00225
00226 const Mg3d& gri2d = *mapp.get_mg();
00227
00228 assert(&gri2d == source.get_mp().get_mg()->get_angu_1dom()) ;
00229
00230 Mtbl_cf bound2 (gri2d , bbound.get_spectral_base()) ;
00231 bound2.annule_hard() ;
00232
00233 if (bbound.get_etat() != ETATZERO){
00234
00235 int nr = gri2d.get_nr(0) ;
00236 int nt = gri2d.get_nt(0) ;
00237 int np = gri2d.get_np(0) ;
00238
00239 for(int k=0; k<np+2; k++)
00240 for (int j=0; j<=nt-1; j++)
00241 for(int xi=0; xi<= nr-1; xi++)
00242 {
00243 bound2.set(0, k , j , xi) = (*bbound.get_spectral_va().c_cf)(0, k, j, xi) ;
00244 }
00245 }
00246
00247
00248 Mtbl_cf resu = elliptic_solver_boundary (ope_var, *(rho.c_cf), bound2,
00249 fact_dir, fact_neu) ;
00250
00251
00252
00253 pot.set_etat_zero() ;
00254
00255 pot.set_etat_qcq() ;
00256
00257 pot.set_spectral_va() = resu ;
00258 pot.set_spectral_va().ylm_i() ;
00259
00260 pot.set_dzpuis(0) ;
00261 }
00262
00263
00264
00265
00266
00267
00268 void Map_log::sol_elliptic_no_zec (Param_elliptic& ope_var, const Scalar& source,
00269 Scalar& pot, double val) const {
00270
00271 assert(source.get_etat() != ETATNONDEF) ;
00272 assert(source.get_mp().get_mg() == mg) ;
00273 assert(pot.get_mp().get_mg() == mg) ;
00274
00275 assert(source.check_dzpuis(2) || source.check_dzpuis(3) ||
00276 source.check_dzpuis(4)) ;
00277
00278
00279
00280 const Valeur& sourva = source.get_spectral_va() ;
00281
00282 if (sourva.get_etat() == ETATZERO) {
00283 pot.set_etat_zero() ;
00284 return ;
00285 }
00286
00287
00288 assert(sourva.get_etat() == ETATQCQ) ;
00289
00290 Valeur rho(sourva.get_mg()) ;
00291 sourva.coef() ;
00292 rho = *(sourva.c_cf) ;
00293
00294 rho.ylm() ;
00295
00296
00297
00298 ope_var.var_F.set_spectral_va().coef() ;
00299 ope_var.var_F.set_spectral_va().ylm() ;
00300 ope_var.var_G.set_spectral_va().coef() ;
00301 ope_var.var_G.set_spectral_va().ylm() ;
00302
00303
00304
00305 Mtbl_cf resu = elliptic_solver_no_zec (ope_var, *(rho.c_cf), val) ;
00306
00307
00308
00309 pot.set_etat_zero() ;
00310
00311 pot.set_etat_qcq() ;
00312
00313 pot.set_spectral_va() = resu ;
00314 pot.set_spectral_va().ylm_i() ;
00315
00316 pot.set_dzpuis(0) ;
00317 }
00318
00319