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 #ifndef __VECTOR_H_
00027 #define __VECTOR_H_
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
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
00159
00160
00161
00162
00163
00164
00165
00166
00167
00168
00169
00170
00171
00172
00173 class Vector_divfree ;
00174
00175
00176
00177
00178
00179
00184 class Vector: public Tensor {
00185
00186
00187
00188 protected:
00194 mutable Scalar* p_potential[N_MET_MAX] ;
00195
00201 mutable Vector_divfree* p_div_free[N_MET_MAX] ;
00202
00215 mutable Scalar* p_eta ;
00216
00229 mutable Scalar* p_mu ;
00230
00237 mutable Scalar* p_A ;
00238
00239
00240
00241 public:
00250 Vector(const Map& map, int tipe, const Base_vect& triad_i) ;
00251
00260 Vector(const Map& map, int tipe, const Base_vect* triad_i) ;
00261
00262 Vector(const Vector& a) ;
00263
00267 Vector(const Tensor& a) ;
00268
00279 Vector(const Map& map, const Base_vect& triad_i, FILE* fich) ;
00280
00281 virtual ~Vector() ;
00282
00283
00284
00285
00286 protected:
00287 virtual void del_deriv() const;
00288
00290 void set_der_0x0() const ;
00291
00296 virtual void del_derive_met(int) const ;
00297
00302 void set_der_met_0x0(int) const ;
00303
00304
00305
00306
00307 public:
00311 virtual void change_triad(const Base_vect& ) ;
00312
00314 virtual void operator=(const Vector& a) ;
00315
00317 virtual void operator=(const Tensor& a) ;
00318
00328 void set_vr_eta_mu(const Scalar& vr_i, const Scalar& eta_i,
00329 const Scalar& mu_i) ;
00330
00335 void decompose_div(const Metric&) const ;
00336
00344 const Scalar& potential(const Metric& ) const ;
00345
00353 const Vector_divfree& div_free(const Metric& ) const;
00354
00360 virtual void exponential_filter_r(int lzmin, int lzmax, int p,
00361 double alpha= -16.) ;
00362
00368 virtual void exponential_filter_ylm(int lzmin, int lzmax, int p,
00369 double alpha= -16.) ;
00370
00371
00372
00373
00374 public:
00375 Scalar& set(int ) ;
00376
00377 const Scalar& operator()(int ) const;
00378
00388 virtual int position(const Itbl& idx) const {
00389 assert (idx.get_ndim() == 1) ;
00390 assert (idx.get_dim(0) == 1) ;
00391 assert ((idx(0) >= 1) && (idx(0) <= 3)) ;
00392
00393 return (idx(0) - 1) ;
00394
00395 } ;
00396
00407 virtual Itbl indices(int place) const {
00408 assert((place>=0) && (place<3)) ;
00409
00410 Itbl res(1) ;
00411 res = place + 1;
00412 return res ;
00413
00414 };
00415
00420 virtual void std_spectral_base() ;
00421
00426 virtual void pseudo_spectral_base() ;
00427
00440 virtual const Scalar& eta() const ;
00441
00454 virtual const Scalar& mu() const ;
00455
00456
00463 virtual const Scalar& A() const ;
00464
00465
00478 void update_vtvp() ;
00479
00480
00481
00482
00483 public:
00487 const Scalar& divergence(const Metric&) const ;
00488
00492 const Vector_divfree curl() const ;
00493
00497 Vector derive_lie(const Vector& v) const ;
00498
00506 Sym_tensor ope_killing(const Metric& gam) const ;
00507
00517 Sym_tensor ope_killing_conf(const Metric& gam) const ;
00518
00533 Vector poisson(double lambda, int method = 6) const ;
00534
00564 Vector poisson(double lambda, const Metric_flat& met_f, int method = 6) const ;
00565
00581 Vector poisson(const double lambda, Param& par,
00582 int method = 6) const ;
00583
00596 void poisson_boundary(double lambda, const Mtbl_cf& limit_vr,
00597 const Mtbl_cf& limit_eta, const Mtbl_cf& limit_mu,
00598 int num_front, double fact_dir, double fact_neu,
00599 Vector& resu) const ;
00600
00601
00607 void poisson_boundary2(double lam, Vector& resu, Scalar boundvr,
00608 Scalar boundeta, Scalar boundmu, double dir_vr,
00609 double neum_vr, double dir_eta, double neum_eta,
00610 double dir_mu, double neum_mu ) const ;
00611
00612
00613 Vector poisson_dirichlet(double lambda, const Valeur& limit_vr,
00614 const Valeur& limit_vt, const Valeur& limit_vp,
00615 int num_front) const ;
00616
00629 Vector poisson_neumann(double lambda, const Valeur& limit_vr,
00630 const Valeur& limit_vt, const Valeur& limit_vp,
00631 int num_front) const ;
00632
00645 Vector poisson_robin(double lambda, const Valeur& limit_vr,
00646 const Valeur& limit_vt, const Valeur& limit_vp,
00647 double fact_dir, double fact_neu,
00648 int num_front) const ;
00649
00650
00664 double flux(double radius, const Metric& met) const ;
00665
00666 void poisson_block(double lambda, Vector& resu) const ;
00667
00668
00669
00670 public:
00690 void visu_arrows(double xmin, double xmax, double ymin, double ymax,
00691 double zmin, double zmax, const char* title0 = 0x0,
00692 const char* filename0 = 0x0, bool start_dx = true, int nx = 8, int ny = 8,
00693 int nz = 8) const ;
00694
00695 void visu_streamline(double xmin, double xmax, double ymin, double ymax,
00696 double zmin, double zmax, const char* title0 = 0x0,
00697 const char* filename0 = 0x0, bool start_dx = true, int nx = 8, int ny = 8,
00698 int nz = 8) const ;
00699
00700
00701
00702 };
00703
00704
00705
00706
00707
00708
00709
00710
00720 class Vector_divfree: public Vector {
00721
00722
00723
00724 protected:
00726 const Metric* const met_div ;
00727
00728
00729
00730 public:
00738 Vector_divfree(const Map& map, const Base_vect& triad_i,
00739 const Metric& met) ;
00740
00741 Vector_divfree(const Vector_divfree& ) ;
00742
00754 Vector_divfree(const Map& map, const Base_vect& triad_i,
00755 const Metric& met, FILE* fich) ;
00756
00757 virtual ~Vector_divfree() ;
00758
00759
00760
00761
00762 protected:
00763 virtual void del_deriv() const;
00764
00766 void set_der_0x0() const ;
00767
00768
00769
00770
00771
00772 public:
00774 void operator=(const Vector_divfree& a) ;
00775
00777 virtual void operator=(const Vector& a) ;
00778
00780 virtual void operator=(const Tensor& a) ;
00781
00793 void set_vr_mu(const Scalar& vr_i, const Scalar& mu_i) ;
00794
00803 void set_vr_eta_mu(const Scalar& vr_i, const Scalar& eta_i, const Scalar& mu_i) ;
00804
00812 void set_A_mu(const Scalar& A_i, const Scalar& mu_i, const Param* par_bc) ;
00813
00814
00815
00816 public:
00829 virtual const Scalar& eta() const ;
00830
00840 Vector_divfree poisson() const ;
00841
00853 void update_etavr() ;
00854
00864 Vector_divfree poisson(Param& par) const ;
00865 protected:
00866
00878 void sol_Dirac_A(const Scalar& aaa, Scalar& eta, Scalar& vr,
00879 const Param* par_bc = 0x0) const ;
00880
00892 void sol_Dirac_A_tau(const Scalar& aaa, Scalar& eta, Scalar& vr,
00893 const Param* par_bc = 0x0) const ;
00894
00906 void sol_Dirac_A_poisson(const Scalar& aaa, Scalar& eta, Scalar& vr,
00907 const Param* par_bc = 0x0) const ;
00908
00920 void sol_Dirac_A_1z(const Scalar& aaa, Scalar& eta, Scalar& vr,
00921 const Param* par_bc = 0x0) const ;
00922
00923 };
00924
00925
00926
00927
00928
00929 #endif