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 #ifndef __MTBL_CF_H_
00032 #define __MTBL_CF_H_
00033
00034
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
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130
00131
00132
00133
00134
00135
00136
00137
00138
00139
00140
00141
00142
00143
00144
00145
00146
00147
00148
00149
00150
00151
00152
00153
00154
00155
00156
00157
00158 #include "tbl.h"
00159 #include "base_val.h"
00160 #include "grilles.h"
00161
00162 class Mg3d ;
00163
00182 class Mtbl_cf {
00183
00184
00185
00186 private:
00188 const Mg3d* mg ;
00190 int nzone ;
00192 int etat ;
00193
00194 public:
00196 Base_val base ;
00197
00201 Tbl** t ;
00202
00203
00204
00205
00206 public:
00208 Mtbl_cf(const Mg3d& mgrid, const Base_val& basis) ;
00210 Mtbl_cf(const Mg3d* p_mgrid, const Base_val& basis) ;
00211
00213 Mtbl_cf(const Mg3d&, FILE* ) ;
00214
00216 Mtbl_cf(const Mtbl_cf& ) ;
00218 ~Mtbl_cf() ;
00219
00220
00221
00223 void operator=(const Mtbl_cf& ) ;
00225 void operator=(double ) ;
00227 void operator=(int ) ;
00228
00229
00230
00231 private:
00235 void del_t() ;
00236
00237 public:
00238
00243 void set_etat_nondef() ;
00244
00249 void set_etat_zero() ;
00250
00257 void set_etat_qcq() ;
00258
00267 void annule_hard() ;
00268
00279 void annule(int l_min, int l_max) ;
00280
00281
00282
00283 public:
00284
00290 Tbl& set(int l) {
00291 assert(l < nzone) ;
00292 assert(etat == ETATQCQ) ;
00293 return *(t[l]) ;
00294 };
00295
00296
00302 const Tbl& operator()(int l) const {
00303 assert(l < nzone) ;
00304 assert(etat == ETATQCQ) ;
00305 return *(t[l]) ;
00306 };
00307
00308
00315 double& set(int l, int k, int j, int i) {
00316 assert(l < nzone) ;
00317 assert(etat == ETATQCQ) ;
00318 return (t[l])->set(k, j, i) ;
00319 };
00320
00321
00328 double operator()(int l, int k, int j, int i) const {
00329 assert(etat != ETATNONDEF) ;
00330 assert(l < nzone) ;
00331 if (etat == ETATZERO) {
00332 double zero = 0. ;
00333 return zero ;
00334 }
00335 else return (*t[l])(k, j, i) ;
00336 };
00337
00348 double val_point(int l, double x, double theta, double phi) const ;
00349
00361 double val_point_symy(int l, double x, double theta, double phi) const ;
00362
00374 double val_point_asymy(int l, double x, double theta, double phi) const ;
00375
00388 double val_point_jk(int l, double x, int j, int k) const ;
00389
00403 double val_point_jk_symy(int l, double x, int j, int k) const ;
00404
00418 double val_point_jk_asymy(int l, double x, int j, int k) const ;
00419
00429 double val_out_bound_jk(int l, int j, int k) const ;
00430
00441 double val_in_bound_jk(int l, int j, int k) const ;
00442
00443
00444
00445
00446
00447 public:
00449 const Mg3d* get_mg() const { return mg ; };
00450
00452 int get_etat() const { return etat ; };
00453
00455 int get_nzone() const { return nzone ; } ;
00456
00457
00458
00459
00460 public:
00461
00463 void sauve(FILE *) const ;
00464
00472 void display(double threshold = 1.e-7, int precision = 4,
00473 ostream& ostr = cout) const ;
00474
00481 void affiche_seuil(ostream& ostr, int precision = 4,
00482 double threshold = 1.e-7) const ;
00484 friend ostream& operator<<(ostream& , const Mtbl_cf& ) ;
00485
00486
00487
00488 public:
00490 void operator+=(const Mtbl_cf & ) ;
00492 void operator-=(const Mtbl_cf & ) ;
00494 void operator*=(double ) ;
00496 void operator/=(double ) ;
00497
00498
00499
00500 public:
00502 void dsdx() ;
00503
00505 void d2sdx2() ;
00506
00511 void sx() ;
00512
00517 void sx2() ;
00518
00523 void mult_x() ;
00524
00528 void sxm1_zec() ;
00529
00533 void mult_xm1_zec() ;
00534
00538 void mult2_xm1_zec() ;
00539
00541 void dsdt() ;
00542
00544 void d2sdt2() ;
00545
00547 void ssint() ;
00548
00550 void scost() ;
00551
00553 void mult_ct() ;
00554
00556 void mult_st() ;
00557
00559 void dsdp() ;
00560
00562 void d2sdp2() ;
00563
00565 void mult_cp() ;
00566
00568 void mult_sp() ;
00569
00571 void lapang() ;
00572
00573
00574
00575 public:
00591 void poisson_angu(double lambda = 0) ;
00592
00593 } ;
00594 ostream& operator<<(ostream& , const Mtbl_cf& ) ;
00595
00602
00603 Mtbl_cf operator+(const Mtbl_cf& ) ;
00605 Mtbl_cf operator-(const Mtbl_cf& ) ;
00607 Mtbl_cf operator+(const Mtbl_cf&, const Mtbl_cf& ) ;
00609 Mtbl_cf operator-(const Mtbl_cf&, const Mtbl_cf& ) ;
00611 Mtbl_cf operator*(const Mtbl_cf&, double ) ;
00613 Mtbl_cf operator*(double, const Mtbl_cf& ) ;
00615 Mtbl_cf operator*(const Mtbl_cf&, int ) ;
00617 Mtbl_cf operator*(int, const Mtbl_cf& ) ;
00619 Mtbl_cf operator/(const Mtbl_cf&, double ) ;
00621 Mtbl_cf operator/(const Mtbl_cf&, int ) ;
00622
00624 Mtbl_cf abs(const Mtbl_cf& ) ;
00625
00631 Tbl max(const Mtbl_cf& ) ;
00632
00638 Tbl min(const Mtbl_cf& ) ;
00639
00645 Tbl norme(const Mtbl_cf& ) ;
00646
00655 Tbl diffrel(const Mtbl_cf& a, const Mtbl_cf& b) ;
00656
00665 Tbl diffrelmax(const Mtbl_cf& a, const Mtbl_cf& b) ;
00666
00669 #endif