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 char blackhole_eq_spher_C[] = "$Header: /cvsroot/Lorene/C++/Source/Black_hole/blackhole_eq_spher.C,v 1.3 2008/07/02 20:42:53 k_taniguchi Exp $" ;
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051 #include <math.h>
00052
00053
00054 #include "blackhole.h"
00055 #include "cmp.h"
00056 #include "tenseur.h"
00057 #include "param.h"
00058 #include "unites.h"
00059 #include "proto.h"
00060 #include "utilitaires.h"
00061 #include "graphique.h"
00062
00063 void Black_hole::equilibrium_spher(bool neumann, bool first,
00064 double spin_omega, double precis,
00065 double precis_shift) {
00066
00067
00068
00069 using namespace Unites ;
00070
00071
00072
00073
00074 const Mg3d* mg = mp.get_mg() ;
00075 int nz = mg->get_nzone() ;
00076
00077 double mass = ggrav * mass_bh ;
00078
00079
00080
00081
00082 Valeur bc_lpcnf(mg->get_angu()) ;
00083 Valeur bc_conf(mg->get_angu()) ;
00084
00085 Valeur bc_shif_x(mg->get_angu()) ;
00086 Valeur bc_shif_y(mg->get_angu()) ;
00087 Valeur bc_shif_z(mg->get_angu()) ;
00088
00089 Scalar rr(mp) ;
00090 rr = mp.r ;
00091 rr.std_spectral_base() ;
00092 Scalar st(mp) ;
00093 st = mp.sint ;
00094 st.std_spectral_base() ;
00095 Scalar ct(mp) ;
00096 ct = mp.cost ;
00097 ct.std_spectral_base() ;
00098 Scalar sp(mp) ;
00099 sp = mp.sinp ;
00100 sp.std_spectral_base() ;
00101 Scalar cp(mp) ;
00102 cp = mp.cosp ;
00103 cp.std_spectral_base() ;
00104
00105 Vector ll(mp, CON, mp.get_bvect_cart()) ;
00106 ll.set_etat_qcq() ;
00107 ll.set(1) = st * cp ;
00108 ll.set(2) = st * sp ;
00109 ll.set(3) = ct ;
00110 ll.std_spectral_base() ;
00111
00112
00113
00114 double cc ;
00115
00116 if (neumann) {
00117 if (first) {
00118
00119
00120 cc = 2. * (sqrt(13.) - 1.) / 3. ;
00121 }
00122 else {
00123
00124
00125 cc = 4. / 3. ;
00126 }
00127 }
00128 else {
00129 if (first) {
00130
00131
00132 cout << "!!!!! WARNING: Not yet prepared !!!!!" << endl ;
00133 abort() ;
00134 }
00135 else {
00136
00137
00138 cout << "!!!!! WARNING: Not yet prepared !!!!!" << endl ;
00139 abort() ;
00140
00141 }
00142 }
00143
00144
00145
00146 if (kerrschild) {
00147
00148 lapconf_bh = 1. / sqrt(1. + 2. * mass / rr) ;
00149 lapconf_bh.std_spectral_base() ;
00150 lapconf_bh.annule_domain(0) ;
00151 lapconf_bh.raccord(1) ;
00152
00153 lapconf = lapconf_bh ;
00154 lapconf.std_spectral_base() ;
00155 lapconf_rs = 0. ;
00156 lapconf_rs.std_spectral_base() ;
00157
00158 lapse = lapconf ;
00159 lapse.std_spectral_base() ;
00160
00161 confo = 1. ;
00162 confo.std_spectral_base() ;
00163
00164 Scalar lapse_bh(mp) ;
00165 lapse_bh = 1. / sqrt(1. + 2. * mass / rr) ;
00166 lapse_bh.std_spectral_base() ;
00167 lapse_bh.annule_domain(0) ;
00168 lapse_bh.raccord(1) ;
00169
00170 for (int i=1; i<=3; i++) {
00171 shift_bh.set(i) = 2. * lapse_bh * lapse_bh * mass * ll(i) / rr ;
00172 }
00173 shift_bh.std_spectral_base() ;
00174
00175 shift = shift_bh ;
00176 shift.std_spectral_base() ;
00177 shift_rs.set_etat_zero() ;
00178
00179 }
00180 else {
00181
00182 Scalar r_are(mp) ;
00183 r_are = r_coord(neumann, first) ;
00184 r_are.std_spectral_base() ;
00185 r_are.annule_domain(0) ;
00186 r_are.raccord(1) ;
00187
00188
00189
00190
00191
00192
00193
00194
00195
00196
00197
00198
00199
00200 lapconf = sqrt(1. - 1.9*mass/r_are/rr
00201 + cc*cc*pow(mass/r_are/rr,4.))
00202 * sqrt(r_are) ;
00203 lapconf.std_spectral_base() ;
00204 lapconf.annule_domain(0) ;
00205 lapconf.raccord(1) ;
00206
00207
00208
00209
00210
00211 lapse = sqrt(1. - 1.9*mass/r_are/rr
00212 + cc*cc*pow(mass/r_are/rr,4.)) ;
00213 lapse.std_spectral_base() ;
00214 lapse.annule_domain(0) ;
00215 lapse.raccord(1) ;
00216
00217
00218 confo = sqrt(0.9*r_are) ;
00219 confo.std_spectral_base() ;
00220 confo.annule_domain(0) ;
00221 confo.raccord(1) ;
00222
00223 for (int i=1; i<=3; i++) {
00224 shift.set(i) = mass * mass * cc * ll(i) / rr / rr
00225 / pow(r_are,3.) ;
00226 }
00227
00228 shift.std_spectral_base() ;
00229
00230 for (int i=1; i<=3; i++) {
00231 shift.set(i).annule_domain(0) ;
00232 shift.set(i).raccord(1) ;
00233 }
00234
00235
00236
00237
00238
00239
00240
00241
00242
00243
00244
00245
00246
00247
00248
00249
00250
00251
00252
00253
00254
00255 }
00256
00257
00258
00259
00260 Scalar source_lapconf(mp) ;
00261 Scalar source_confo(mp) ;
00262 Vector source_shift(mp, CON, mp.get_bvect_cart()) ;
00263
00264 Scalar lapconf_m1(mp) ;
00265 Scalar confo_m1(mp) ;
00266
00267 Scalar lapconf_jm1(mp) ;
00268 Scalar confo_jm1(mp) ;
00269 Vector shift_jm1(mp, CON, mp.get_bvect_cart()) ;
00270
00271 double diff_lp = 1. ;
00272 double diff_cf = 1. ;
00273 double diff_sx = 1. ;
00274 double diff_sy = 1. ;
00275 double diff_sz = 1. ;
00276
00277 int mermax = 200 ;
00278
00279
00280
00281
00282
00283
00284
00285
00286
00287
00288
00289
00290 for (int mer=0; (diff_lp > precis) && (diff_cf > precis) && (diff_sx > precis) && (diff_sy > precis) && (diff_sz > precis) && (mer < mermax); mer++) {
00291
00292 cout << "--------------------------------------------------" << endl ;
00293 cout << "step: " << mer << endl ;
00294 cout << "diff_lapconf = " << diff_lp << endl ;
00295 cout << "diff_confo = " << diff_cf << endl ;
00296 cout << "diff_shift : x = " << diff_sx
00297 << " y = " << diff_sy << " z = " << diff_sz << endl ;
00298
00299 if (kerrschild) {
00300 lapconf_jm1 = lapconf_rs ;
00301 confo_jm1 = confo ;
00302 shift_jm1 = shift_rs ;
00303 }
00304 else {
00305 lapconf_jm1 = lapconf ;
00306 confo_jm1 = confo ;
00307 shift_jm1 = shift ;
00308 }
00309
00310
00311
00312
00313
00314 extr_curv_bh() ;
00315
00316
00317
00318
00319
00320
00321
00322
00323 if (kerrschild) {
00324
00325 cout << "!!!!! WARNING: Not yet available !!!!!" << endl ;
00326 abort() ;
00327
00328 }
00329 else {
00330
00331 source_lapconf = 7. * lapconf_jm1 % taij_quad
00332 / pow(confo_jm1, 8.) / 8. ;
00333
00334 }
00335
00336 source_lapconf.annule_domain(0) ;
00337 source_lapconf.set_dzpuis(4) ;
00338 source_lapconf.std_spectral_base() ;
00339
00340
00341
00342
00343
00344
00345
00346
00347
00348
00349
00350 bc_lpcnf = bc_lapconf(neumann, first) ;
00351
00352
00353 if (kerrschild) {
00354
00355 cout << "!!!!! WARNING: Not yet available !!!!!" << endl ;
00356 abort() ;
00357
00358
00359
00360
00361
00362
00363
00364
00365
00366
00367
00368
00369
00370
00371
00372
00373
00374
00375
00376 }
00377 else {
00378
00379 lapconf_m1.set_etat_qcq() ;
00380
00381 if (neumann) {
00382 lapconf_m1 = source_lapconf.poisson_neumann(bc_lpcnf, 0) ;
00383 }
00384 else {
00385 lapconf_m1 = source_lapconf.poisson_dirichlet(bc_lpcnf, 0) ;
00386 }
00387
00388
00389
00390 lapconf = lapconf_m1 + 1. ;
00391 lapconf.annule_domain(0) ;
00392 lapconf.raccord(1) ;
00393
00394
00395
00396
00397
00398 }
00399
00400
00401
00402
00403
00404
00405
00406
00407 if (kerrschild) {
00408
00409 cout << "!!!!! WARNING: Not yet available !!!!!" << endl ;
00410 abort() ;
00411
00412 }
00413 else {
00414
00415 Scalar tmp1 = - 0.125 * taij_quad / pow(confo_jm1, 7.) ;
00416 tmp1.std_spectral_base() ;
00417 tmp1.inc_dzpuis(4-tmp1.get_dzpuis()) ;
00418
00419 source_confo = tmp1 ;
00420
00421 }
00422
00423 source_confo.annule_domain(0) ;
00424 source_confo.set_dzpuis(4) ;
00425 source_confo.std_spectral_base() ;
00426
00427 bc_conf = bc_confo() ;
00428
00429 confo_m1.set_etat_qcq() ;
00430
00431 confo_m1 = source_confo.poisson_neumann(bc_conf, 0) ;
00432
00433
00434
00435
00436 confo = confo_m1 + 1. ;
00437 confo.annule_domain(0) ;
00438 confo.raccord(1) ;
00439
00440
00441
00442
00443
00444
00445
00446
00447 Scalar confo7(mp) ;
00448 confo7 = pow(confo_jm1, 7.) ;
00449 confo7.std_spectral_base() ;
00450
00451 Vector dlappsi(mp, COV, mp.get_bvect_cart()) ;
00452 for (int i=1; i<=3; i++)
00453 dlappsi.set(i) = (lapconf_jm1.deriv(i)
00454 - 7.*lapconf*confo_jm1.deriv(i)/confo_jm1)
00455 / confo7 ;
00456
00457 dlappsi.std_spectral_base() ;
00458 dlappsi.annule_domain(0) ;
00459
00460
00461 if (kerrschild) {
00462
00463 cout << "!!!!! WARNING: Not yet available !!!!!" << endl ;
00464 abort() ;
00465
00466 }
00467 else {
00468
00469 source_shift = 2. * contract(taij, 1, dlappsi, 0) ;
00470
00471 }
00472
00473 source_shift.annule_domain(0) ;
00474
00475
00476
00477
00478
00479
00480
00481
00482
00483 source_shift.std_spectral_base() ;
00484
00485 for (int i=1; i<=3; i++) {
00486 if (source_shift(i).get_etat() != ETATZERO)
00487 source_shift.set(i).filtre(4) ;
00488 }
00489
00490
00491
00492
00493
00494
00495
00496
00497
00498
00499
00500
00501 Tenseur source_p(mp, 1, CON, mp.get_bvect_cart()) ;
00502 source_p.set_etat_qcq() ;
00503 for (int i=0; i<3; i++) {
00504 source_p.set(i) = Cmp(source_shift(i+1)) ;
00505 }
00506
00507 Tenseur resu_p(mp, 1, CON, mp.get_bvect_cart()) ;
00508 resu_p.set_etat_qcq() ;
00509
00510 for (int i=0; i<3; i++) {
00511 resu_p.set(i) = Cmp(shift_jm1(i+1)) ;
00512 }
00513
00514 bc_shif_x = bc_shift_x(spin_omega) ;
00515 bc_shif_y = bc_shift_y(spin_omega) ;
00516 bc_shif_z = bc_shift_z() ;
00517
00518
00519
00520
00521
00522
00523
00524
00525 poisson_vect_frontiere(1./3., source_p, resu_p,
00526 bc_shif_x, bc_shif_y, bc_shif_z,
00527 0, precis_shift, 14) ;
00528
00529
00530 if (kerrschild) {
00531 for (int i=1; i<=3; i++)
00532 shift_rs.set(i) = resu_p(i-1) ;
00533
00534 for (int i=1; i<=3; i++)
00535 shift.set(i) = shift_rs(i) + shift_bh(i) ;
00536
00537 shift_rs.annule_domain(0) ;
00538 }
00539 else {
00540 for (int i=1; i<=3; i++)
00541 shift.set(i) = resu_p(i-1) ;
00542 }
00543
00544 shift.annule_domain(0) ;
00545
00546 for (int i=1; i<=3; i++)
00547 shift.set(i).raccord(1) ;
00548
00549
00550
00551
00552
00553
00554
00555
00556
00557
00558
00559
00560
00561
00562
00563
00564
00565
00566
00567
00568
00569
00570
00571
00572
00573
00574
00575
00576
00577
00578
00579
00580
00581 Tbl diff_lapconf(nz) ;
00582
00583 if (kerrschild) {
00584
00585 diff_lapconf = diffrel(lapconf_rs, lapconf_jm1) ;
00586
00587 }
00588 else {
00589
00590 diff_lapconf = diffrel(lapconf, lapconf_jm1) ;
00591
00592 }
00593
00594
00595
00596
00597
00598
00599
00600
00601
00602
00603
00604
00605 cout << "Relative difference in the lapconf function : " << endl ;
00606 for (int l=0; l<nz; l++) {
00607 cout << diff_lapconf(l) << " " ;
00608 }
00609 cout << endl ;
00610
00611 diff_lp = diff_lapconf(1) ;
00612 for (int l=2; l<nz; l++) {
00613 diff_lp += diff_lapconf(l) ;
00614 }
00615 diff_lp /= nz ;
00616
00617
00618
00619 Tbl diff_confo = diffrel(confo, confo_jm1) ;
00620
00621 cout << "Relative difference in the conformal factor : " << endl ;
00622 for (int l=0; l<nz; l++) {
00623 cout << diff_confo(l) << " " ;
00624 }
00625 cout << endl ;
00626
00627 diff_cf = diff_confo(1) ;
00628 for (int l=2; l<nz; l++) {
00629 diff_cf += diff_confo(l) ;
00630 }
00631 diff_cf /= nz ;
00632
00633
00634
00635 Tbl diff_shift_x(nz) ;
00636 Tbl diff_shift_y(nz) ;
00637 Tbl diff_shift_z(nz) ;
00638
00639 if (kerrschild) {
00640
00641 diff_shift_x = diffrel(shift_rs(1), shift_jm1(1)) ;
00642
00643 }
00644 else {
00645
00646 diff_shift_x = diffrel(shift(1), shift_jm1(1)) ;
00647
00648 }
00649
00650 cout << "Relative difference in the shift vector (x) : " << endl ;
00651 for (int l=0; l<nz; l++) {
00652 cout << diff_shift_x(l) << " " ;
00653 }
00654 cout << endl ;
00655
00656 diff_sx = diff_shift_x(1) ;
00657 for (int l=2; l<nz; l++) {
00658 diff_sx += diff_shift_x(l) ;
00659 }
00660 diff_sx /= nz ;
00661
00662 if (kerrschild) {
00663
00664 diff_shift_y = diffrel(shift_rs(2), shift_jm1(2)) ;
00665
00666 }
00667 else {
00668
00669 diff_shift_y = diffrel(shift(2), shift_jm1(2)) ;
00670
00671 }
00672
00673 cout << "Relative difference in the shift vector (y) : " << endl ;
00674 for (int l=0; l<nz; l++) {
00675 cout << diff_shift_y(l) << " " ;
00676 }
00677 cout << endl ;
00678
00679 diff_sy = diff_shift_y(1) ;
00680 for (int l=2; l<nz; l++) {
00681 diff_sy += diff_shift_y(l) ;
00682 }
00683 diff_sy /= nz ;
00684
00685 if (kerrschild) {
00686
00687 diff_shift_z = diffrel(shift_rs(3), shift_jm1(3)) ;
00688
00689 }
00690 else {
00691
00692 diff_shift_z = diffrel(shift(3), shift_jm1(3)) ;
00693
00694 }
00695
00696 cout << "Relative difference in the shift vector (z) : " << endl ;
00697 for (int l=0; l<nz; l++) {
00698 cout << diff_shift_z(l) << " " ;
00699 }
00700 cout << endl ;
00701
00702 diff_sz = diff_shift_z(1) ;
00703 for (int l=2; l<nz; l++) {
00704 diff_sz += diff_shift_z(l) ;
00705 }
00706 diff_sz /= nz ;
00707
00708
00709 if (kerrschild) {
00710
00711 cout << "Mass_bh : " << mass_bh / msol << " [M_sol]" << endl ;
00712 double rad_apphor = rad_ah() ;
00713 cout << " : " << 0.5 * rad_apphor / ggrav / msol
00714 << " [M_sol]" << endl ;
00715
00716 }
00717 else {
00718
00719 cout << "Mass_bh : " << mass_bh / msol
00720 << " [M_sol]" << endl ;
00721
00722 }
00723
00724
00725
00726
00727 double irr_gm, adm_gm, kom_gm ;
00728 irr_gm = mass_irr() / mass_bh - 1. ;
00729 adm_gm = mass_adm() / mass_bh - 1. ;
00730 kom_gm = mass_kom() / mass_bh - 1. ;
00731 cout << "Irreducible mass : " << mass_irr() / msol << endl ;
00732 cout << "Gravitaitonal mass : " << mass_bh / msol << endl ;
00733 cout << "ADM mass : " << mass_adm() / msol << endl ;
00734 cout << "Komar mass : " << mass_kom() / msol << endl ;
00735 cout << "Diff. (Madm-Mirr)/Mirr : " << mass_adm()/mass_irr() - 1.
00736 << endl ;
00737 cout << "Diff. (Mkom-Mirr)/Mirr : " << mass_kom()/mass_irr() - 1.
00738 << endl ;
00739 cout << "Diff. (Madm-Mkom)/Madm : " << 1. - mass_kom()/mass_adm()
00740 << endl ;
00741 cout << "Diff. (Mirr-Mg)/Mg : " << irr_gm << endl ;
00742 cout << "Diff. (Madm-Mg)/Mg : " << adm_gm << endl ;
00743 cout << "Diff. (Mkom-Mg)/Mg : " << kom_gm << endl ;
00744
00745 cout << endl ;
00746
00747 del_deriv() ;
00748
00749
00750
00751
00752
00753
00754
00755
00756
00757
00758
00759
00760
00761
00762
00763
00764
00765
00766
00767
00768
00769 }
00770
00771
00772
00773
00774
00775
00776
00777 Scalar lapconf_exact(mp) ;
00778 Scalar confo_exact(mp) ;
00779 Vector shift_exact(mp, CON, mp.get_bvect_cart()) ;
00780
00781 if (kerrschild) {
00782
00783 lapconf_exact = 1./sqrt(1.+2.*mass/rr) ;
00784
00785 confo_exact = 1. ;
00786
00787 for (int i=1; i<=3; i++)
00788 shift_exact.set(i) =
00789 2.*mass*lapconf_exact%lapconf_exact%ll(i)/rr ;
00790
00791 }
00792 else {
00793
00794 Scalar rare(mp) ;
00795 rare = r_coord(neumann, first) ;
00796 rare.std_spectral_base() ;
00797
00798 lapconf_exact = sqrt(1. - 2.*mass/rare/rr
00799 + cc*cc*pow(mass/rare/rr,4.)) * sqrt(rare) ;
00800
00801 confo_exact = sqrt(rare) ;
00802
00803 for (int i=1; i<=3; i++) {
00804 shift_exact.set(i) = mass * mass * cc * ll(i) / rr / rr
00805 / pow(rare,3.) ;
00806 }
00807
00808 }
00809
00810 lapconf_exact.annule_domain(0) ;
00811 lapconf_exact.std_spectral_base() ;
00812 lapconf_exact.raccord(1) ;
00813
00814 confo_exact.annule_domain(0) ;
00815 confo_exact.std_spectral_base() ;
00816 confo_exact.raccord(1) ;
00817
00818 shift_exact.annule_domain(0) ;
00819 shift_exact.std_spectral_base() ;
00820 for (int i=1; i<=3; i++)
00821 shift_exact.set(i).raccord(1) ;
00822
00823 Scalar lapconf_resi = lapconf - lapconf_exact ;
00824 Scalar confo_resi = confo - confo_exact ;
00825 Vector shift_resi = shift - shift_exact ;
00826
00827
00828
00829
00830
00831
00832
00833
00834
00835
00836
00837
00838
00839
00840
00841
00842
00843
00844
00845
00846
00847
00848
00849
00850
00851
00852
00853
00854
00855
00856
00857
00858
00859
00860
00861
00862
00863
00864
00865
00866
00867
00868
00869 Tbl diff_lapconf_exact = diffrel(lapconf, lapconf_exact) ;
00870 diff_lapconf_exact.set(0) = 0. ;
00871 cout << "Relative difference in the lapconf function : " << endl ;
00872 for (int l=0; l<nz; l++) {
00873 cout << diff_lapconf_exact(l) << " " ;
00874 }
00875 cout << endl ;
00876
00877
00878 Tbl diff_confo_exact = diffrel(confo, confo_exact) ;
00879 diff_confo_exact.set(0) = 0. ;
00880 cout << "Relative difference in the conformal factor : " << endl ;
00881 for (int l=0; l<nz; l++) {
00882 cout << diff_confo_exact(l) << " " ;
00883 }
00884 cout << endl ;
00885
00886
00887 Tbl diff_shift_exact_x = diffrel(shift(1), shift_exact(1)) ;
00888 Tbl diff_shift_exact_y = diffrel(shift(2), shift_exact(2)) ;
00889 Tbl diff_shift_exact_z = diffrel(shift(3), shift_exact(3)) ;
00890
00891 cout << "Relative difference in the shift vector (x) : " << endl ;
00892 for (int l=0; l<nz; l++) {
00893 cout << diff_shift_exact_x(l) << " " ;
00894 }
00895 cout << endl ;
00896 cout << "Relative difference in the shift vector (y) : " << endl ;
00897 for (int l=0; l<nz; l++) {
00898 cout << diff_shift_exact_y(l) << " " ;
00899 }
00900 cout << endl ;
00901 cout << "Relative difference in the shift vector (z) : " << endl ;
00902 for (int l=0; l<nz; l++) {
00903 cout << diff_shift_exact_z(l) << " " ;
00904 }
00905 cout << endl ;
00906
00907
00908
00909
00910
00911
00912 }