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 char et_rot_mag_equil_C[] = "$Header: /cvsroot/Lorene/C++/Source/Etoile/et_rot_mag_equil.C,v 1.17 2004/03/25 10:43:04 j_novak Exp $" ;
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 #include <math.h>
00095
00096
00097 #include "et_rot_mag.h"
00098 #include "param.h"
00099 #include "unites.h"
00100
00101 void Et_rot_mag::equilibrium_mag(double ent_c, double omega0,
00102 double fact_omega, int nzadapt, const Tbl& ent_limit,
00103 const Itbl& icontrol, const Tbl& control, double mbar_wanted,
00104 double aexp_mass, Tbl& diff, const double Q0, const double a_j0,
00105 Cmp (*f_j)(const Cmp&, const double),
00106 Cmp (*M_j)(const Cmp& x, const double)) {
00107
00108
00109
00110 using namespace Unites_mag ;
00111
00112
00113
00114 char display_bold[]="x[1m" ; display_bold[0] = 27 ;
00115 char display_normal[] = "x[0m" ; display_normal[0] = 27 ;
00116
00117
00118
00119
00120 const Mg3d* mg = mp.get_mg() ;
00121 int nz = mg->get_nzone() ;
00122 int nzm1 = nz - 1 ;
00123
00124
00125 Map_et& mp_et = dynamic_cast<Map_et&>(mp) ;
00126
00127
00128 assert(mg->get_type_t() == SYM) ;
00129 int l_b = nzet - 1 ;
00130 int i_b = mg->get_nr(l_b) - 1 ;
00131 int j_b = mg->get_nt(l_b) - 1 ;
00132 int k_b = 0 ;
00133
00134
00135 double ent_b = ent_limit(nzet-1) ;
00136
00137
00138
00139
00140 int mer_max = icontrol(0) ;
00141 int mer_rot = icontrol(1) ;
00142 int mer_change_omega = icontrol(2) ;
00143 int mer_fix_omega = icontrol(3) ;
00144 int mer_mass = icontrol(4) ;
00145 int mermax_poisson = icontrol(5) ;
00146 int delta_mer_kep = icontrol(6) ;
00147 int mer_mag = icontrol(7) ;
00148 int mer_change_mag = icontrol(8) ;
00149 int mer_fix_mag = icontrol(9) ;
00150
00151
00152 if (mer_change_omega < mer_rot) {
00153 cout << "Etoile_rot::equilibrium: mer_change_omega < mer_rot !" << endl ;
00154 cout << " mer_change_omega = " << mer_change_omega << endl ;
00155 cout << " mer_rot = " << mer_rot << endl ;
00156 abort() ;
00157 }
00158 if (mer_fix_omega < mer_change_omega) {
00159 cout << "Etoile_rot::equilibrium: mer_fix_omega < mer_change_omega !"
00160 << endl ;
00161 cout << " mer_fix_omega = " << mer_fix_omega << endl ;
00162 cout << " mer_change_omega = " << mer_change_omega << endl ;
00163 abort() ;
00164 }
00165
00166
00167
00168 bool change_ent = true ;
00169 if (mer_mass < 0) {
00170 change_ent = false ;
00171 mer_mass = abs(mer_mass) ;
00172 }
00173
00174 double precis = control(0) ;
00175 double omega_ini = control(1) ;
00176 double relax = control(2) ;
00177 double relax_prev = double(1) - relax ;
00178 double relax_poisson = control(3) ;
00179 double thres_adapt = control(4) ;
00180 double precis_adapt = control(5) ;
00181 double Q_ini = control(6) ;
00182 double a_j_ini = control (7) ;
00183
00184
00185
00186
00187 diff.set_etat_qcq() ;
00188 double& diff_ent = diff.set(0) ;
00189
00190
00191
00192
00193 Param par_adapt ;
00194 int nitermax = 100 ;
00195 int niter ;
00196 int adapt_flag = 1 ;
00197
00198
00199 int nz_search = nzet + 1 ;
00200
00201 double alpha_r ;
00202 double reg_map = 1. ;
00203
00204 par_adapt.add_int(nitermax, 0) ;
00205
00206 par_adapt.add_int(nzadapt, 1) ;
00207
00208
00209 par_adapt.add_int(nz_search, 2) ;
00210
00211 par_adapt.add_int(adapt_flag, 3) ;
00212
00213
00214 par_adapt.add_int(j_b, 4) ;
00215
00216 par_adapt.add_int(k_b, 5) ;
00217
00218
00219 par_adapt.add_int_mod(niter, 0) ;
00220
00221
00222 par_adapt.add_double(precis_adapt, 0) ;
00223
00224
00225 par_adapt.add_double(reg_map, 1) ;
00226
00227 par_adapt.add_double(alpha_r, 2) ;
00228
00229
00230 par_adapt.add_tbl(ent_limit, 0) ;
00231
00232
00233
00234
00235
00236 double precis_poisson = 1.e-16 ;
00237
00238 Param par_poisson_nuf ;
00239 par_poisson_nuf.add_int(mermax_poisson, 0) ;
00240 par_poisson_nuf.add_double(relax_poisson, 0) ;
00241 par_poisson_nuf.add_double(precis_poisson, 1) ;
00242 par_poisson_nuf.add_int_mod(niter, 0) ;
00243 par_poisson_nuf.add_cmp_mod( ssjm1_nuf ) ;
00244
00245 Param par_poisson_nuq ;
00246 par_poisson_nuq.add_int(mermax_poisson, 0) ;
00247 par_poisson_nuq.add_double(relax_poisson, 0) ;
00248 par_poisson_nuq.add_double(precis_poisson, 1) ;
00249 par_poisson_nuq.add_int_mod(niter, 0) ;
00250 par_poisson_nuq.add_cmp_mod( ssjm1_nuq ) ;
00251
00252 Param par_poisson_tggg ;
00253 par_poisson_tggg.add_int(mermax_poisson, 0) ;
00254 par_poisson_tggg.add_double(relax_poisson, 0) ;
00255 par_poisson_tggg.add_double(precis_poisson, 1) ;
00256 par_poisson_tggg.add_int_mod(niter, 0) ;
00257 par_poisson_tggg.add_cmp_mod( ssjm1_tggg ) ;
00258 double lambda_tggg ;
00259 par_poisson_tggg.add_double_mod( lambda_tggg ) ;
00260
00261 Param par_poisson_dzeta ;
00262 double lbda_grv2 ;
00263 par_poisson_dzeta.add_double_mod( lbda_grv2 ) ;
00264
00265
00266
00267
00268 Param par_poisson_vect ;
00269
00270 par_poisson_vect.add_int(mermax_poisson, 0) ;
00271 par_poisson_vect.add_double(relax_poisson, 0) ;
00272 par_poisson_vect.add_double(precis_poisson, 1) ;
00273 par_poisson_vect.add_cmp_mod( ssjm1_khi ) ;
00274 par_poisson_vect.add_tenseur_mod( ssjm1_wshift ) ;
00275 par_poisson_vect.add_int_mod(niter, 0) ;
00276
00277
00278
00279
00280
00281 Param par_poisson_At ;
00282 Cmp ssjm1_At(mp) ;
00283 ssjm1_At.set_etat_zero() ;
00284 par_poisson_At.add_int(mermax_poisson, 0) ;
00285 par_poisson_At.add_double(relax_poisson, 0) ;
00286 par_poisson_At.add_double(precis_poisson, 1) ;
00287 par_poisson_At.add_int_mod(niter, 0) ;
00288 par_poisson_At.add_cmp_mod( ssjm1_At ) ;
00289
00290 Param par_poisson_Avect ;
00291
00292 Cmp ssjm1_khi_mag(ssjm1_khi) ;
00293 Tenseur ssjm1_w_mag(ssjm1_wshift) ;
00294
00295 par_poisson_Avect.add_int(mermax_poisson, 0) ;
00296 par_poisson_Avect.add_double(relax_poisson, 0) ;
00297 par_poisson_Avect.add_double(precis_poisson, 1) ;
00298 par_poisson_Avect.add_cmp_mod( ssjm1_khi_mag ) ;
00299 par_poisson_Avect.add_tenseur_mod( ssjm1_w_mag ) ;
00300 par_poisson_Avect.add_int_mod(niter, 0) ;
00301
00302
00303
00304
00305
00306
00307 omega = 0 ;
00308 Q = 0 ;
00309 a_j = 0 ;
00310
00311 double accrois_omega = (omega0 - omega_ini) /
00312 double(mer_fix_omega - mer_change_omega) ;
00313 double accrois_Q = (Q0 - Q_ini) /
00314 double(mer_fix_mag - mer_change_mag);
00315 double accrois_a_j = (a_j0 - a_j_ini) /
00316 double(mer_fix_mag - mer_change_mag);
00317
00318 update_metric() ;
00319
00320 equation_of_state() ;
00321
00322 hydro_euler() ;
00323
00324
00325 MHD_comput() ;
00326
00327
00328
00329 Map_et mp_prev = mp_et ;
00330 Tenseur ent_prev = ent ;
00331 Tenseur logn_prev = logn ;
00332 Tenseur dzeta_prev = dzeta ;
00333
00334
00335 Tenseur source_nuf(mp) ;
00336 Tenseur source_nuq(mp) ;
00337 Tenseur source_dzf(mp) ;
00338 Tenseur source_dzq(mp) ;
00339 Tenseur source_tggg(mp) ;
00340 Tenseur source_shift(mp, 1, CON, mp.get_bvect_cart()) ;
00341
00342 Tenseur mlngamma(mp) ;
00343
00344
00345
00346 if (nuf.get_etat() == ETATZERO) {
00347 nuf.set_etat_qcq() ;
00348 nuf.set() = 0 ;
00349 }
00350
00351 if (relativistic) {
00352 if (nuq.get_etat() == ETATZERO) {
00353 nuq.set_etat_qcq() ;
00354 nuq.set() = 0 ;
00355 }
00356
00357 if (tggg.get_etat() == ETATZERO) {
00358 tggg.set_etat_qcq() ;
00359 tggg.set() = 0 ;
00360 }
00361
00362 if (dzeta.get_etat() == ETATZERO) {
00363 dzeta.set_etat_qcq() ;
00364 dzeta.set() = 0 ;
00365 }
00366 }
00367
00368 ofstream fichconv("convergence.d") ;
00369 fichconv << "# diff_ent GRV2 " << endl ;
00370
00371 ofstream fichfreq("frequency.d") ;
00372 fichfreq << "# f [Hz]" << endl ;
00373
00374 ofstream fichevol("evolution.d") ;
00375 fichevol <<
00376 "# |dH/dr_eq/dH/dr_pole| r_pole/r_eq ent_c"
00377 << endl ;
00378
00379 diff_ent = 1 ;
00380 double err_grv2 = 1 ;
00381
00382
00383
00384
00385
00386 for(int mer=0 ; (diff_ent > precis) && (mer<mer_max) ; mer++ ) {
00387
00388 cout << "-----------------------------------------------" << endl ;
00389 cout << "step: " << mer << endl ;
00390 cout << "diff_ent = " << display_bold << diff_ent << display_normal
00391 << endl ;
00392 cout << "err_grv2 = " << err_grv2 << endl ;
00393 fichconv << mer ;
00394 fichfreq << mer ;
00395 fichevol << mer ;
00396
00397 if (mer >= mer_rot) {
00398
00399 if (mer < mer_change_omega) {
00400 omega = omega_ini ;
00401 }
00402 else {
00403 if (mer <= mer_fix_omega) {
00404 omega = omega_ini + accrois_omega *
00405 (mer - mer_change_omega) ;
00406 }
00407 }
00408
00409 }
00410
00411 if (mer >= mer_mag) {
00412 if (mer < mer_change_mag) {
00413 Q = Q_ini ;
00414 a_j = a_j_ini ;
00415 }
00416 else {
00417 if (mer <= mer_fix_mag) {
00418 Q = Q_ini + accrois_Q * (mer - mer_change_mag) ;
00419 a_j = a_j_ini + accrois_a_j * (mer - mer_change_mag) ;
00420 }
00421 }
00422 }
00423
00424
00425
00426
00427
00428 magnet_comput(adapt_flag,
00429 f_j, par_poisson_At, par_poisson_Avect) ;
00430
00431 MHD_comput() ;
00432
00433
00434
00435
00436
00437
00438
00439 Tenseur beta = log(bbb) ;
00440 beta.set_std_base() ;
00441
00442 if (relativistic) {
00443 source_nuf = qpig * a_car *( ener_euler + s_euler) ;
00444
00445 source_nuq = ak_car - flat_scalar_prod(logn.gradient_spher(),
00446 logn.gradient_spher() + beta.gradient_spher())
00447 + qpig * a_car * 2*E_em ;
00448 }
00449 else {
00450 source_nuf = qpig * nbar ;
00451
00452 source_nuq = 0 ;
00453 }
00454 source_nuf.set_std_base() ;
00455 source_nuq.set_std_base() ;
00456
00457
00458
00459 source_dzf = 2 * qpig * a_car * (press + (ener_euler+press) * uuu*uuu ) ;
00460 source_dzf.set_std_base() ;
00461
00462 source_dzq = 2 * qpig * a_car * E_em + 1.5 * ak_car -
00463 flat_scalar_prod(logn.gradient_spher(), logn.gradient_spher() ) ;
00464 source_dzq.set_std_base() ;
00465
00466
00467
00468
00469 source_tggg = 4 * qpig * nnn * a_car * bbb * press ;
00470 source_tggg.set_std_base() ;
00471
00472 (source_tggg.set()).mult_rsint() ;
00473
00474
00475
00476
00477
00478
00479
00480 Cmp tjpem(Jp_em()) ;
00481 tjpem.div_rsint() ;
00482
00483 source_shift = (-4*qpig) * nnn * a_car * (ener_euler + press)
00484 * u_euler ;
00485
00486
00487 Tenseur vtmp = 6 * beta.gradient_spher() - 2 * logn.gradient_spher() ;
00488 Tenseur mtmp(mp, 1, COV, mp.get_bvect_spher()) ;
00489 if (tjpem.get_etat() == ETATZERO) mtmp.set_etat_zero() ;
00490 else {
00491 mtmp.set_etat_qcq() ;
00492 mtmp.set(0) = 0 ;
00493 mtmp.set(1) = 0 ;
00494 mtmp.set(2) = (-4*qpig)*tjpem*nnn()*a_car()/b_car() ;
00495 }
00496 mtmp.change_triad(mp.get_bvect_cart()) ;
00497
00498 vtmp.change_triad(mp.get_bvect_cart()) ;
00499
00500 Tenseur squad = nnn * flat_scalar_prod(tkij, vtmp) ;
00501
00502
00503
00504
00505
00506 if (squad.get_etat() == ETATQCQ) {
00507 for (int i=0; i<3; i++) {
00508 source_shift.set(i) += squad(i) ;
00509 }
00510 }
00511 if (mtmp.get_etat() == ETATQCQ) {
00512 if (source_shift.get_etat() == ETATZERO) {
00513 source_shift.set_etat_qcq() ;
00514 for (int i=0; i<3; i++) {
00515 source_shift.set(i) = mtmp(i) ;
00516 source_shift.set(i).va.coef_i() ;
00517 }
00518 }
00519 else
00520 for (int i=0; i<3; i++)
00521 source_shift.set(i) += mtmp(i) ;
00522 }
00523
00524 source_shift.set_std_base() ;
00525
00526
00527
00528
00529
00530 source_nuf().poisson(par_poisson_nuf, nuf.set()) ;
00531
00532 if (relativistic) {
00533
00534
00535
00536
00537
00538 source_nuq().poisson(par_poisson_nuq, nuq.set()) ;
00539
00540
00541
00542
00543
00544
00545 if (source_shift.get_etat() != ETATZERO) {
00546
00547 for (int i=0; i<3; i++) {
00548 if(source_shift(i).dz_nonzero()) {
00549 assert( source_shift(i).get_dzpuis() == 4 ) ;
00550 }
00551 else{
00552 (source_shift.set(i)).set_dzpuis(4) ;
00553 }
00554 }
00555
00556 }
00557
00558
00559
00560 double lambda_shift = double(1) / double(3) ;
00561
00562 if ( mg->get_np(0) == 1 ) {
00563 lambda_shift = 0 ;
00564 }
00565
00566 source_shift.poisson_vect(lambda_shift, par_poisson_vect,
00567 shift, w_shift, khi_shift) ;
00568
00569
00570
00571
00572
00573 fait_nphi() ;
00574
00575
00576
00577
00578
00579
00580 }
00581
00582
00583
00584
00585
00586 if (mer > mer_fix_omega + delta_mer_kep) {
00587
00588 omega *= fact_omega ;
00589 }
00590
00591 bool omega_trop_grand = false ;
00592 bool kepler = true ;
00593
00594 while ( kepler ) {
00595
00596
00597
00598 bool superlum = true ;
00599
00600 while ( superlum ) {
00601
00602
00603
00604 Cmp tmp = omega - nphi() ;
00605 tmp.annule(nzm1) ;
00606 tmp.std_base_scal() ;
00607
00608 tmp.mult_rsint() ;
00609
00610 uuu = bbb() / nnn() * tmp ;
00611
00612 if (uuu.get_etat() == ETATQCQ) {
00613
00614 ((uuu.set()).va).set_base( (tmp.va).base ) ;
00615 }
00616
00617
00618
00619
00620 superlum = false ;
00621
00622 for (int l=0; l<nzet; l++) {
00623 for (int i=0; i<mg->get_nr(l); i++) {
00624
00625 double u1 = uuu()(l, 0, j_b, i) ;
00626 if (u1 >= 1.) {
00627 superlum = true ;
00628 cout << "U > c for l, i : " << l << " " << i
00629 << " U = " << u1 << endl ;
00630 }
00631 }
00632 }
00633 if ( superlum ) {
00634 cout << "**** VELOCITY OF LIGHT REACHED ****" << endl ;
00635 omega /= fact_omega ;
00636 cout << "New rotation frequency : "
00637 << omega/(2.*M_PI) * f_unit << " Hz" << endl ;
00638 omega_trop_grand = true ;
00639 }
00640 }
00641
00642
00643
00644
00645
00646
00647 hydro_euler() ;
00648
00649
00650
00651
00652
00653
00654
00655 if (relativistic) {
00656 mlngamma = - log( gam_euler ) ;
00657 }
00658 else {
00659 mlngamma = - 0.5 * uuu*uuu ;
00660 }
00661
00662 Tenseur mag(mp) ;
00663 if (is_conduct()) {
00664 mag = mu0*M_j(A_phi, a_j) ;}
00665 else{
00666 mag = mu0*M_j(omega*A_phi-A_t, a_j) ;}
00667
00668
00669 double nuf_b = nuf()(l_b, k_b, j_b, i_b) ;
00670 double nuq_b = nuq()(l_b, k_b, j_b, i_b) ;
00671 double mlngamma_b = mlngamma()(l_b, k_b, j_b, i_b) ;
00672 double mag_b = mag()(l_b, k_b, j_b, i_b) ;
00673
00674
00675 double nuf_c = nuf()(0,0,0,0) ;
00676 double nuq_c = nuq()(0,0,0,0) ;
00677 double mlngamma_c = 0 ;
00678 double mag_c = mag()(0,0,0,0) ;
00679
00680
00681
00682 double alpha_r2 = ( ent_c - ent_b + mlngamma_c - mlngamma_b
00683 + nuq_c - nuq_b + mag_c - mag_b)
00684 / ( nuf_b - nuf_c ) ;
00685 alpha_r = sqrt(alpha_r2) ;
00686 cout << "alpha_r = " << alpha_r << endl ;
00687
00688
00689
00690
00691 logn = alpha_r2 * nuf + nuq ;
00692 double nu_c = logn()(0,0,0,0) ;
00693
00694
00695
00696
00697 ent = (ent_c + nu_c + mlngamma_c + mag_c) - logn - mlngamma
00698 - mag ;
00699
00700
00701
00702
00703
00704 kepler = false ;
00705 for (int l=0; l<nzet; l++) {
00706 int imax = mg->get_nr(l) - 1 ;
00707 if (l == l_b) imax-- ;
00708 for (int i=0; i<imax; i++) {
00709 if ( ent()(l, 0, j_b, i) < 0. ) {
00710 kepler = true ;
00711 cout << "ent < 0 for l, i : " << l << " " << i
00712 << " ent = " << ent()(l, 0, j_b, i) << endl ;
00713 }
00714 }
00715 }
00716
00717 if ( kepler ) {
00718 cout << "**** KEPLERIAN VELOCITY REACHED ****" << endl ;
00719 omega /= fact_omega ;
00720 cout << "New rotation frequency : "
00721 << omega/(2.*M_PI) * f_unit << " Hz" << endl ;
00722 omega_trop_grand = true ;
00723 }
00724
00725 }
00726
00727 if ( omega_trop_grand ) {
00728
00729 fact_omega = sqrt( fact_omega ) ;
00730 cout << "**** New fact_omega : " << fact_omega << endl ;
00731 }
00732
00733
00734
00735
00736
00737
00738
00739
00740 double dent_eq = ent().dsdr()(l_b, k_b, j_b, i_b) ;
00741 double dent_pole = ent().dsdr()(l_b, k_b, 0, i_b) ;
00742 double rap_dent = fabs( dent_eq / dent_pole ) ;
00743 cout << "| dH/dr_eq / dH/dr_pole | = " << rap_dent << endl ;
00744
00745 if ( rap_dent < thres_adapt ) {
00746 adapt_flag = 0 ;
00747 cout << "******* FROZEN MAPPING *********" << endl ;
00748 }
00749 else{
00750 adapt_flag = 1 ;
00751
00752 }
00753
00754 mp_prev = mp_et ;
00755
00756 mp.adapt(ent(), par_adapt) ;
00757
00758
00759
00760
00761
00762 mp_prev.homothetie(alpha_r) ;
00763
00764 mp.reevaluate(&mp_prev, nzet+1, ent.set()) ;
00765
00766
00767
00768
00769
00770 equation_of_state() ;
00771
00772
00773
00774
00775
00776
00777
00778
00779
00780 fait_nphi() ;
00781
00782 hydro_euler() ;
00783
00784
00785 if (relativistic) {
00786
00787
00788
00789
00790
00791 mp.poisson2d(source_tggg(), mp.cmp_zero(), par_poisson_tggg,
00792 tggg.set()) ;
00793
00794
00795
00796
00797
00798 mp.poisson2d(source_dzf(), source_dzq(), par_poisson_dzeta,
00799 dzeta.set()) ;
00800
00801 err_grv2 = lbda_grv2 - 1;
00802 cout << "GRV2: " << err_grv2 << endl ;
00803
00804 }
00805 else {
00806 err_grv2 = grv2() ;
00807 }
00808
00809
00810
00811
00812
00813
00814
00815
00816 if (mer >= 10) {
00817 logn = relax * logn + relax_prev * logn_prev ;
00818
00819 dzeta = relax * dzeta + relax_prev * dzeta_prev ;
00820 }
00821
00822
00823
00824 update_metric() ;
00825
00826
00827
00828
00829
00830
00831 fichfreq << " " << omega / (2*M_PI) * f_unit ;
00832 fichevol << " " << rap_dent ;
00833 fichevol << " " << ray_pole() / ray_eq() ;
00834 fichevol << " " << ent_c ;
00835
00836
00837
00838
00839
00840 if (mer > mer_mass) {
00841
00842 double xx ;
00843 if (mbar_wanted > 0.) {
00844 xx = mass_b() / mbar_wanted - 1. ;
00845 cout << "Discrep. baryon mass <-> wanted bar. mass : " << xx
00846 << endl ;
00847 }
00848 else{
00849 xx = mass_g() / fabs(mbar_wanted) - 1. ;
00850 cout << "Discrep. grav. mass <-> wanted grav. mass : " << xx
00851 << endl ;
00852 }
00853 double xprog = ( mer > 2*mer_mass) ? 1. :
00854 double(mer-mer_mass)/double(mer_mass) ;
00855 xx *= xprog ;
00856 double ax = .5 * ( 2. + xx ) / (1. + xx ) ;
00857 double fact = pow(ax, aexp_mass) ;
00858 cout << " xprog, xx, ax, fact : " << xprog << " " <<
00859 xx << " " << ax << " " << fact << endl ;
00860
00861 if ( change_ent ) {
00862 ent_c *= fact ;
00863 }
00864 else {
00865 if (mer%4 == 0) omega *= fact ;
00866 }
00867 }
00868
00869
00870
00871
00872
00873
00874 Tbl diff_ent_tbl = diffrel( ent(), ent_prev() ) ;
00875 diff_ent = diff_ent_tbl(0) ;
00876 for (int l=1; l<nzet; l++) {
00877 diff_ent += diff_ent_tbl(l) ;
00878 }
00879 diff_ent /= nzet ;
00880
00881 fichconv << " " << log10( fabs(diff_ent) + 1.e-16 ) ;
00882 fichconv << " " << log10( fabs(err_grv2) + 1.e-16 ) ;
00883
00884
00885
00886
00887
00888 ent_prev = ent ;
00889 logn_prev = logn ;
00890 dzeta_prev = dzeta ;
00891
00892 fichconv << endl ;
00893 fichfreq << endl ;
00894 fichevol << endl ;
00895 fichconv.flush() ;
00896 fichfreq.flush() ;
00897 fichevol.flush() ;
00898
00899 }
00900
00901
00902
00903
00904
00905 fichconv.close() ;
00906 fichfreq.close() ;
00907 fichevol.close() ;
00908
00909
00910 }