00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034 char scalar_pde_C[] = "$Header: /cvsroot/Lorene/C++/Source/Tensor/Scalar/scalar_pde.C,v 1.19 2007/05/06 10:48:15 p_grandclement Exp $" ;
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117 #include "map.h"
00118 #include "scalar.h"
00119 #include "tensor.h"
00120 #include "param.h"
00121 #include "cmp.h"
00122 #include "param_elliptic.h"
00123
00124
00125
00126
00127
00128
00129
00130
00131
00132 Scalar Scalar::poisson() const {
00133
00134 Param bidon ;
00135 Cmp csource(*this) ;
00136 Cmp cresu(mp) ;
00137 cresu = 0. ;
00138
00139 mp->poisson(csource, bidon, cresu) ;
00140
00141 Scalar resu(cresu) ;
00142 return resu ;
00143 }
00144
00145
00146
00147
00148 void Scalar::poisson(Param& par, Scalar& uu) const {
00149
00150 Cmp csource(*this) ;
00151 Cmp cuu(uu) ;
00152
00153 mp->poisson(csource, par, cuu) ;
00154
00155 uu = cuu ;
00156 }
00157
00158
00159
00160
00161
00162
00163
00164
00165 Scalar Scalar::poisson_tau() const {
00166
00167 Param bidon ;
00168 Cmp csource(*this) ;
00169 Cmp cresu(mp) ;
00170 cresu = 0. ;
00171
00172 mp->poisson_tau(csource, bidon, cresu) ;
00173
00174 Scalar resu(cresu) ;
00175 return resu ;
00176 }
00177
00178
00179
00180 void Scalar::poisson_tau (Param& par, Scalar& uu) const {
00181
00182 Cmp csource(*this) ;
00183 Cmp cuu(uu) ;
00184
00185 mp->poisson_tau(csource, par, cuu) ;
00186
00187 uu = cuu ;
00188 }
00189
00190
00191
00192
00193
00194
00195
00196 Scalar Scalar::poisson_angu(double lambda) const {
00197
00198 Param bidon ;
00199
00200 Scalar resu(*mp) ;
00201 resu = 0. ;
00202
00203 mp->poisson_angu(*this, bidon, resu, lambda) ;
00204
00205 return resu ;
00206 }
00207
00208
00209
00210
00211
00212
00213 Scalar Scalar::avance_dalembert(Param& par, const Scalar& fjm1,
00214 const Scalar& source) const {
00215
00216 Scalar fjp1(*mp) ;
00217
00218 mp->dalembert(par, fjp1, *this, fjm1, source) ;
00219
00220 return fjp1 ;
00221
00222 }
00223
00224
00225
00226
00227
00228
00229
00230 Scalar Scalar::sol_elliptic(Param_elliptic& ope_var) const {
00231
00232
00233 const Map_af* map_affine = dynamic_cast <const Map_af*> (mp) ;
00234 const Map_log* map_log = dynamic_cast <const Map_log*> (mp) ;
00235
00236 if ((map_affine == 0x0) && (map_log == 0x0)) {
00237 cout << "sol_elliptic only defined for affine or log mapping" << endl ;
00238 abort() ;
00239 }
00240
00241 Scalar res (*mp) ;
00242 res.set_etat_qcq() ;
00243
00244 if (map_affine != 0x0)
00245 map_affine->sol_elliptic (ope_var, *this, res) ;
00246 else
00247 map_log->sol_elliptic (ope_var, *this, res) ;
00248
00249 return (res) ;
00250 }
00251
00252 Scalar Scalar::sol_elliptic_boundary(Param_elliptic& ope_var, const Mtbl_cf& bound,
00253 double fact_dir, double fact_neu) const {
00254
00255
00256 const Map_af* map_affine = dynamic_cast <const Map_af*> (mp) ;
00257 const Map_log* map_log = dynamic_cast <const Map_log*> (mp) ;
00258
00259 if ((map_affine == 0x0) && (map_log == 0x0)) {
00260 cout << "sol_elliptic only defined for affine or log mapping" << endl ;
00261 abort() ;
00262 }
00263
00264 Scalar res (*mp) ;
00265 res.set_etat_qcq() ;
00266
00267 if (map_affine != 0x0)
00268 map_affine->sol_elliptic_boundary (ope_var, *this, res, bound,
00269 fact_dir, fact_neu ) ;
00270 else
00271 map_log->sol_elliptic_boundary (ope_var, *this, res, bound,
00272 fact_dir, fact_neu ) ;
00273
00274 return (res) ;
00275 }
00276
00277
00278 Scalar Scalar::sol_elliptic_boundary(Param_elliptic& ope_var, const Scalar& bound,
00279 double fact_dir, double fact_neu) const {
00280
00281
00282 const Map_af* map_affine = dynamic_cast <const Map_af*> (mp) ;
00283 const Map_log* map_log = dynamic_cast <const Map_log*> (mp) ;
00284
00285 if ((map_affine == 0x0) && (map_log == 0x0)) {
00286 cout << "sol_elliptic only defined for affine or log mapping" << endl ;
00287 abort() ;
00288 }
00289
00290 Scalar res (*mp) ;
00291 res.set_etat_qcq() ;
00292
00293 if (map_affine != 0x0)
00294 map_affine->sol_elliptic_boundary (ope_var, *this, res, bound,
00295 fact_dir, fact_neu ) ;
00296 else
00297 map_log->sol_elliptic_boundary (ope_var, *this, res, bound,
00298 fact_dir, fact_neu ) ;
00299
00300 return (res) ;
00301 }
00302
00303
00304
00305
00306
00307
00308
00309
00310 Scalar Scalar::sol_elliptic_no_zec(Param_elliptic& ope_var, double val) const {
00311
00312
00313 const Map_af* map_affine = dynamic_cast <const Map_af*> (mp) ;
00314 const Map_log* map_log = dynamic_cast <const Map_log*> (mp) ;
00315
00316 if ((map_affine == 0x0) && (map_log == 0x0)) {
00317 cout << "sol_elliptic_no_zec only defined for affine or log mapping" << endl ;
00318 abort() ;
00319 }
00320
00321 Scalar res (*mp) ;
00322 res.set_etat_qcq() ;
00323
00324 if (map_affine != 0x0)
00325 map_affine->sol_elliptic_no_zec (ope_var, *this, res, val) ;
00326 else
00327 map_log->sol_elliptic_no_zec (ope_var, *this, res, val) ;
00328
00329 return (res) ;
00330 }
00331
00332
00333
00334
00335
00336
00337 Scalar Scalar::sol_elliptic_only_zec(Param_elliptic& ope_var, double val) const {
00338
00339
00340 const Map_af* map_affine = dynamic_cast <const Map_af*> (mp) ;
00341
00342 if (map_affine == 0x0) {
00343 cout << "sol_elliptic_no_zec only defined for affine or log mapping" << endl ;
00344 abort() ;
00345 }
00346
00347 Scalar res (*mp) ;
00348 res.set_etat_qcq() ;
00349
00350 map_affine->sol_elliptic_only_zec (ope_var, *this, res, val) ;
00351 return (res) ;
00352 }
00353
00354
00355
00356
00357
00358
00359 Scalar Scalar::sol_elliptic_sin_zec(Param_elliptic& ope_var, double* amplis, double* phases)
00360 const {
00361
00362
00363 const Map_af* map_affine = dynamic_cast <const Map_af*> (mp) ;
00364
00365 if (map_affine == 0x0) {
00366 cout << "sol_elliptic_sin_zec only defined for affine mapping" << endl ;
00367 abort() ;
00368 }
00369
00370 Scalar res (*mp) ;
00371 res.set_etat_qcq() ;
00372
00373 map_affine->sol_elliptic_sin_zec (ope_var, *this, res, amplis, phases) ;
00374
00375 return (res) ;
00376 }
00377
00378
00379
00380
00381
00382 Scalar Scalar::sol_elliptic_fixe_der_zero (double valeur,
00383 Param_elliptic& ope_var) const {
00384
00385
00386 const Map_af* map_affine = dynamic_cast <const Map_af*> (mp) ;
00387
00388 if (map_affine == 0x0) {
00389 cout << "sol_elliptic_no_zec only defined for affine mapping" << endl ;
00390 abort() ;
00391 }
00392
00393 Scalar res (*mp) ;
00394 res.set_etat_qcq() ;
00395
00396 map_affine->sol_elliptic_fixe_der_zero (valeur, ope_var, *this, res) ;
00397
00398 return (res) ;
00399 }
00400
00401
00402
00403
00404
00405 Scalar Scalar::sol_elliptic_2d (Param_elliptic& ope_var) const {
00406
00407
00408 const Map_af* map_affine = dynamic_cast <const Map_af*> (mp) ;
00409
00410 if (map_affine == 0x0) {
00411 cout << "Poisson 2D only defined for affine mapping" << endl ;
00412 abort() ;
00413 }
00414
00415 Scalar res (*mp) ;
00416 res.set_etat_qcq() ;
00417
00418 map_affine->sol_elliptic_2d(ope_var, *this, res) ;
00419
00420 return (res) ;
00421 }
00422
00423
00424
00425
00426 Scalar Scalar::sol_elliptic_pseudo_1d (Param_elliptic& ope_var) const {
00427
00428
00429 const Map_af* map_affine = dynamic_cast <const Map_af*> (mp) ;
00430
00431 if (map_affine == 0x0) {
00432 cout << "Pseudo_1d only defined for affine mapping" << endl ;
00433 abort() ;
00434 }
00435
00436 Scalar res (*mp) ;
00437 res.set_etat_qcq() ;
00438
00439 map_affine->sol_elliptic_pseudo_1d(ope_var, *this, res) ;
00440
00441 return (res) ;
00442 }