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 #ifndef __STAR_H_
00033 #define __STAR_H_
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 #include "tensor.h"
00135 #include "metric.h"
00136
00137 class Eos ;
00138
00139
00140
00141
00142
00171 class Star {
00172
00173
00174
00175 protected:
00176 Map& mp ;
00177
00179 int nzet ;
00180
00181 const Eos& eos ;
00182
00183
00184
00185
00186 Scalar ent ;
00187
00188 Scalar nbar ;
00189 Scalar ener ;
00190 Scalar press ;
00191
00192
00193
00194 Scalar ener_euler ;
00195
00197 Scalar s_euler ;
00198
00200 Scalar gam_euler ;
00201
00203 Vector u_euler ;
00204
00208 Sym_tensor stress_euler ;
00209
00210
00211
00212
00218 Scalar logn ;
00219
00221 Scalar nn ;
00222
00224 Vector beta ;
00225
00226
00227
00228 Scalar lnq ;
00229
00231 Metric gamma ;
00232
00233
00234
00235
00236 protected:
00238 mutable double* p_ray_eq ;
00239
00241 mutable double* p_ray_eq_pis2 ;
00242
00244 mutable double* p_ray_eq_pi ;
00245
00247 mutable double* p_ray_eq_3pis2 ;
00248
00250 mutable double* p_ray_pole ;
00251
00256 mutable Itbl* p_l_surf ;
00257
00262 mutable Tbl* p_xi_surf ;
00263
00264 mutable double* p_mass_b ;
00265 mutable double* p_mass_g ;
00266
00267
00268
00269
00270 public:
00271
00279 Star(Map& mp_i, int nzet_i, const Eos& eos_i) ;
00280
00281
00282 Star(const Star& ) ;
00283
00291 Star(Map& mp_i, const Eos& eos_i, FILE* fich) ;
00292
00293 virtual ~Star() ;
00294
00295
00296
00297
00298 protected:
00300 virtual void del_deriv() const ;
00301
00303 virtual void set_der_0x0() const ;
00304
00308 virtual void del_hydro_euler() ;
00309
00310
00311
00312
00313 public:
00315 void operator=(const Star&) ;
00316
00318 Map& set_mp() {return mp; } ;
00319
00321 void set_enthalpy(const Scalar& ) ;
00322
00326 void equation_of_state() ;
00327
00332 virtual void hydro_euler() ;
00333
00344 virtual void equilibrium_spher(double ent_c, double precis = 1.e-14,
00345 const Tbl* pent_limit = 0x0 ) ;
00346
00347
00348
00349 public:
00351 const Map& get_mp() const {return mp; } ;
00352
00354 int get_nzet() const {return nzet; } ;
00355
00357 const Eos& get_eos() const {return eos; } ;
00358
00360 const Scalar& get_ent() const {return ent;} ;
00361
00363 const Scalar& get_nbar() const {return nbar;} ;
00364
00366 const Scalar& get_ener() const {return ener;} ;
00367
00369 const Scalar& get_press() const {return press;} ;
00370
00372 const Scalar& get_ener_euler() const {return ener_euler;} ;
00373
00375 const Scalar& get_s_euler() const {return s_euler;} ;
00376
00378 const Scalar& get_gam_euler() const {return gam_euler;} ;
00379
00381 const Vector& get_u_euler() const {return u_euler;} ;
00382
00386 const Tensor& get_stress_euler() const {return stress_euler;} ;
00387
00392 const Scalar& get_logn() const {return logn;} ;
00393
00395 const Scalar& get_nn() const {return nn;} ;
00396
00398 const Vector& get_beta() const {return beta;} ;
00399
00400
00401
00402 const Scalar& get_lnq() const {return lnq;} ;
00403
00405 const Metric& get_gamma() const {return gamma;} ;
00406
00407
00408
00409 public:
00410 virtual void sauve(FILE* ) const ;
00411
00413 friend ostream& operator<<(ostream& , const Star& ) ;
00414
00415 protected:
00417 virtual ostream& operator>>(ostream& ) const ;
00418
00419
00420
00421 public:
00423 double ray_eq() const ;
00424
00426 double ray_eq_pis2() const ;
00427
00429 double ray_eq_pi() const ;
00430
00432 double ray_eq_3pis2() const ;
00433
00435 double ray_pole() const ;
00436
00444 virtual const Itbl& l_surf() const ;
00445
00453 const Tbl& xi_surf() const ;
00454
00456 virtual double mass_b() const = 0 ;
00457
00459 virtual double mass_g() const = 0 ;
00460
00461 };
00462 ostream& operator<<(ostream& , const Star& ) ;
00463
00464
00465
00466
00467
00468
00479 class Star_bin : public Star {
00480
00481
00482
00483 protected:
00487 bool irrotational ;
00488
00492 Scalar psi0 ;
00493
00497 Vector d_psi ;
00498
00503 Vector wit_w ;
00504
00508 Scalar loggam ;
00509
00514 Vector bsn ;
00515
00517 Scalar pot_centri ;
00518
00519
00523 Scalar logn_auto ;
00524
00528 Scalar logn_comp ;
00529
00531 Vector dcov_logn ;
00532
00534 Vector dcon_logn ;
00535
00539 Scalar lnq_auto ;
00540
00544 Scalar lnq_comp ;
00545
00546
00548 Scalar psi4 ;
00549
00551 Vector dcov_phi ;
00553 Vector dcon_phi ;
00554
00558 Metric_flat flat ;
00559
00561 Metric gtilde ;
00562
00566 Vector beta_auto ;
00567
00571 Vector beta_comp ;
00572
00573
00577 Sym_tensor hij ;
00578
00579
00584 Sym_tensor hij_auto ;
00585
00590 Sym_tensor hij_comp ;
00591
00596 Sym_tensor tkij_auto ;
00597
00602 Sym_tensor tkij_comp ;
00603
00608 Scalar kcar_auto ;
00609
00614 Scalar kcar_comp ;
00615
00619 Scalar ssjm1_logn ;
00620
00624 Scalar ssjm1_lnq ;
00625
00630 Scalar ssjm1_khi ;
00631
00632 Vector ssjm1_wbeta ;
00633
00637 Scalar ssjm1_h11 ;
00638
00642 Scalar ssjm1_h21 ;
00643
00647 Scalar ssjm1_h31 ;
00648
00652 Scalar ssjm1_h22 ;
00653
00657 Scalar ssjm1_h32 ;
00658
00662 Scalar ssjm1_h33 ;
00663
00672 Scalar decouple ;
00673
00677 bool conf_flat ;
00678
00679
00680
00681 protected:
00683 mutable double* p_xa_barycenter ;
00684
00685
00686
00687
00688 public:
00699 Star_bin(Map& mp_i, int nzet_i, const Eos& eos_i,
00700 bool irrot, bool conf_flat) ;
00701
00702
00703 Star_bin(const Star_bin& ) ;
00704
00712 Star_bin(Map& mp_i, const Eos& eos_i, FILE* fich) ;
00713
00714 virtual ~Star_bin() ;
00715
00716
00717
00718
00719 protected:
00721 virtual void del_deriv() const ;
00722
00724 virtual void set_der_0x0() const ;
00725
00729 virtual void del_hydro_euler() ;
00730
00731
00732
00733
00734 public:
00736 void operator=(const Star_bin& ) ;
00737
00739 Scalar& set_pot_centri() ;
00740
00744 Scalar& set_logn_comp() ;
00745
00747 void set_logn_auto(const Scalar& logn_auto_new) {logn_auto = logn_auto_new ;
00748 return ;}
00749
00751 void set_lnq_auto(const Scalar& lnq_auto_new) {lnq_auto = lnq_auto_new ;
00752 return ;}
00753
00755 Vector& set_beta_auto() ;
00756
00758 Vector& set_beta() ;
00759
00761 void set_conf_flat(bool confflat) {conf_flat = confflat ; return ;}
00762
00763
00764
00765 public:
00769 bool is_irrotational() const {return irrotational; } ;
00770
00772 const Scalar& get_psi0() const {return psi0;} ;
00773
00777 const Vector& get_d_psi() const {return d_psi;} ;
00778
00783 const Vector& get_wit_w() const {return wit_w;} ;
00784
00788 const Scalar& get_loggam() const {return loggam;} ;
00789
00794 const Vector& get_bsn() const {return bsn;} ;
00795
00797 const Scalar& get_pot_centri() const {return pot_centri;} ;
00798
00802 const Scalar& get_logn_auto() const {return logn_auto;} ;
00803
00807 const Scalar& get_logn_comp() const {return logn_comp;} ;
00808
00813 const Vector& get_beta_auto() const {return beta_auto;} ;
00814
00819 const Vector& get_beta_comp() const {return beta_comp;} ;
00820
00824 const Scalar& get_lnq_auto() const {return lnq_auto;} ;
00825
00829 const Scalar& get_lnq_comp() const {return lnq_comp;} ;
00830
00833 const Vector& get_dcov_logn() const {return dcov_logn;} ;
00834
00837 const Vector& get_dcon_logn() const {return dcon_logn;} ;
00838
00842 const Vector& get_dcov_phi() const {return dcov_phi;} ;
00843
00847 const Vector& get_dcon_phi() const {return dcon_phi;} ;
00848
00850 const Scalar& get_psi4() const {return psi4;} ;
00851
00855 const Metric& get_flat() const {return flat;} ;
00856
00858 const Metric& get_gtilde() const {return gtilde;} ;
00859
00863 const Sym_tensor& get_hij() const {return hij;} ;
00864
00869 const Sym_tensor& get_hij_auto() const {return hij_auto;} ;
00870
00875 const Sym_tensor& get_hij_comp() const {return hij_comp;} ;
00876
00877
00882 const Sym_tensor& get_tkij_auto() const {return tkij_auto;} ;
00883
00888 const Sym_tensor& get_tkij_comp() const {return tkij_comp;} ;
00889
00893 const Scalar& get_kcar_auto() const {return kcar_auto;} ;
00894
00898 const Scalar& get_kcar_comp() const {return kcar_comp;} ;
00899
00904 const Scalar get_decouple() const {return decouple ;}
00905
00906 bool is_conf_flat() const {return conf_flat; } ;
00907
00908
00909
00910 public:
00911 virtual void sauve(FILE* ) const ;
00912
00913 protected:
00915 virtual ostream& operator>>(ostream& ) const ;
00916
00917
00918
00919 public:
00921 virtual double mass_b() const ;
00922
00924 virtual double mass_g() const ;
00925
00927 virtual double xa_barycenter() const ;
00928
00929
00930
00931
00932 public:
00933
00947 virtual void hydro_euler() ;
00948
00965 void update_metric(const Star_bin& comp, double omega) ;
00966
00976 void update_metric(const Star_bin& comp, const Star_bin& star_prev,
00977 double relax, double omega) ;
00978
00984 void update_metric_der_comp(const Star_bin& comp, double omega) ;
00985
00996 void kinematics(double omega, double x_axe) ;
00997
01001 void fait_d_psi() ;
01002
01008 void extrinsic_curvature(double omega) ;
01009
01010
01027 void equilibrium(double ent_c, int mermax, int mermax_potvit,
01028 int mermax_poisson, double relax_poisson,
01029 double relax_potvit, double thres_adapt, Tbl& diff,
01030 double om) ;
01031
01032
01046 double velocity_potential(int mermax, double precis, double relax) ;
01047
01059 void relaxation(const Star_bin& star_prev, double relax_ent,
01060 double relax_met, int mer, int fmer_met) ;
01061
01062
01064 void test_K_Hi() const ;
01065
01067 void helical(double omega) const ;
01068
01069 friend class Binary ;
01070
01071 };
01072
01073
01074
01075
01076
01087 class Star_bin_xcts : public Star {
01088
01089
01090
01091 protected:
01095 bool irrotational ;
01096
01100 Scalar psi0 ;
01101
01105 Vector d_psi ;
01106
01111 Vector wit_w ;
01112
01116 Scalar loggam ;
01117
01122 Vector bsn ;
01123
01125 Scalar pot_centri ;
01126
01130 Scalar chi_auto ;
01131
01135 Scalar chi_comp ;
01136
01140 Scalar Psi_auto ;
01141
01145 Scalar Psi_comp ;
01146
01148 Scalar Psi ;
01149
01151 Scalar chi ;
01152
01154 Scalar psi4 ;
01155
01159 Vector w_beta ;
01160
01164 Scalar khi ;
01165
01167 Vector dcov_Psi ;
01168
01170 Vector dcov_chi ;
01171
01173 Metric_flat flat ;
01174
01178 Vector beta_auto ;
01179
01183 Vector beta_comp ;
01184
01189 Sym_tensor haij_auto ;
01190
01195 Sym_tensor haij_comp ;
01196
01201 Scalar hacar_auto ;
01202
01207 Scalar hacar_comp ;
01208
01212 Scalar ssjm1_chi ;
01213
01217 Scalar ssjm1_psi ;
01218
01223 Scalar ssjm1_khi ;
01224
01230 Vector ssjm1_wbeta ;
01231
01232
01233
01234 protected:
01236 mutable double* p_xa_barycenter ;
01237
01238
01239
01240 public:
01249 Star_bin_xcts(Map& mp_i, int nzet_i, const Eos& eos_i, bool irrot) ;
01250
01251 Star_bin_xcts(const Star_bin_xcts& ) ;
01252
01260 Star_bin_xcts(Map& mp_i, const Eos& eos_i, FILE* fich) ;
01261
01262 virtual ~Star_bin_xcts() ;
01263
01264
01265
01266
01267 protected:
01269 virtual void del_deriv() const ;
01270
01272 virtual void set_der_0x0() const ;
01273
01277 virtual void del_hydro_euler() ;
01278
01279
01280
01281
01282 public:
01284 void operator=(const Star_bin_xcts& ) ;
01285
01287 Scalar& set_pot_centri() ;
01288
01290 Scalar& set_Psi_auto() ;
01291
01293 Scalar& set_Psi_comp() ;
01294
01296 Scalar& set_chi_auto() ;
01297
01299 Scalar& set_chi_comp() ;
01300
01302 Vector& set_beta_auto() ;
01303
01305 Vector& set_beta() ;
01306
01307
01308
01309 public:
01313 bool is_irrotational() const { return irrotational; } ;
01314
01316 const Scalar& get_psi0() const {return psi0 ; } ;
01317
01321 const Vector& get_d_psi() const {return d_psi ; } ;
01322
01327 const Vector& get_wit_w() const {return wit_w ; } ;
01328
01332 const Scalar& get_loggam() const {return loggam ; } ;
01333
01338 const Vector& get_bsn() const {return bsn ; } ;
01339
01341 const Scalar& get_pot_centri() const {return pot_centri ; } ;
01342
01347 const Vector& get_beta_auto() const {return beta_auto ; } ;
01348
01353 const Vector& get_beta_comp() const {return beta_comp ; } ;
01354
01358 const Scalar& get_Psi_auto() const {return Psi_auto ; } ;
01359
01363 const Scalar& get_Psi_comp() const {return Psi_comp ; } ;
01364
01368 const Scalar& get_chi_auto() const {return chi_auto ; } ;
01369
01373 const Scalar& get_chi_comp() const {return chi_comp ; } ;
01374
01377 const Vector& get_dcov_chi() const {return dcov_chi ; } ;
01378
01382 const Vector& get_dcov_Psi() const {return dcov_Psi ; } ;
01383
01385 const Scalar& get_Psi() const {return Psi ; } ;
01386
01388 const Scalar& get_chi() const {return chi ; } ;
01389
01391 const Scalar& get_psi4() const {return psi4 ; } ;
01392
01396 const Metric& get_flat() const {return flat ; } ;
01397
01402 const Sym_tensor& get_haij_auto() const {return haij_auto ; } ;
01403
01408 const Sym_tensor& get_haij_comp() const {return haij_comp ; } ;
01409
01413 const Scalar& get_hacar_auto() const {return hacar_auto ; } ;
01414
01418 const Scalar& get_hacar_comp() const {return hacar_comp ; } ;
01419
01420
01421
01422 public:
01423 virtual void sauve(FILE* ) const ;
01424
01425 protected:
01427 virtual ostream& operator>>(ostream& ) const ;
01428
01429
01430
01431 public:
01433 virtual double mass_b() const ;
01434
01436 virtual double mass_g() const ;
01437
01439 virtual double xa_barycenter() const ;
01440
01441
01442
01443
01444 public:
01445
01459 virtual void hydro_euler() ;
01460
01477 void update_metric(const Star_bin_xcts& comp) ;
01478
01488 void update_metric(const Star_bin_xcts& comp,
01489 const Star_bin_xcts& star_prev,
01490 double relax) ;
01491
01495 void update_metric_der_comp(const Star_bin_xcts& comp) ;
01496
01507 void kinematics(double omega, double x_axe) ;
01508
01512 void fait_d_psi() ;
01513
01517 void extrinsic_curvature() ;
01518
01540 void equilibrium(double ent_c, int mermax, int mermax_potvit,
01541 int mermax_poisson, double relax_poisson,
01542 double relax_potvit, double thres_adapt,
01543 const Tbl& fact, const Tbl* pent_limit,
01544 Tbl& diff) ;
01545
01559 double velocity_potential(int mermax, double precis, double relax) ;
01560
01572 void relaxation(const Star_bin_xcts& star_prev, double relax_ent,
01573 double relax_met, int mer, int fmer_met) ;
01574
01575 friend class Binary_xcts ;
01576
01577 };
01578
01579 #endif