tslice_dirac_max.C

00001  /*
00002  *  Methods of class Tslice_dirac_max
00003  *
00004  *    (see file time_slice.h for documentation).
00005  *
00006  */
00007 
00008 /*
00009  *   Copyright (c) 2004 Eric Gourgoulhon, Jose Luis Jaramillo & Jerome Novak
00010  *
00011  *   This file is part of LORENE.
00012  *
00013  *   LORENE is free software; you can redistribute it and/or modify
00014  *   it under the terms of the GNU General Public License version 2
00015  *   as published by the Free Software Foundation.
00016  *
00017  *   LORENE is distributed in the hope that it will be useful,
00018  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
00019  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00020  *   GNU General Public License for more details.
00021  *
00022  *   You should have received a copy of the GNU General Public License
00023  *   along with LORENE; if not, write to the Free Software
00024  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00025  *
00026  */
00027 
00028 char tslice_dirac_max_C[] = "$Header: /cvsroot/Lorene/C++/Source/Time_slice/tslice_dirac_max.C,v 1.24 2008/12/04 18:22:49 j_novak Exp $" ;
00029 
00030 /*
00031  * $Id: tslice_dirac_max.C,v 1.24 2008/12/04 18:22:49 j_novak Exp $
00032  * $Log: tslice_dirac_max.C,v $
00033  * Revision 1.24  2008/12/04 18:22:49  j_novak
00034  * Enhancement of the dzpuis treatment + various bug fixes.
00035  *
00036  * Revision 1.23  2008/12/02 15:02:22  j_novak
00037  * Implementation of the new constrained formalism, following Cordero et al. 2009
00038  * paper. The evolution eqs. are solved as a first-order system. Not tested yet!
00039  *
00040  * Revision 1.22  2007/11/06 14:47:07  j_novak
00041  * New constructor from a rotating star in Dirac gauge (class Star_rot_Dirac).
00042  * Evolution can take into account matter terms.
00043  *
00044  * Revision 1.21  2007/09/25 16:54:11  j_novak
00045  * *** empty log message ***
00046  *
00047  * Revision 1.20  2007/09/25 16:52:15  j_novak
00048  * *** empty log message ***
00049  *
00050  * Revision 1.19  2007/06/05 07:38:37  j_novak
00051  * Better treatment of dzpuis for A and tilde(B) potentials. Some errors in the bases manipulation have been also corrected.
00052  *
00053  * Revision 1.18  2007/04/25 15:21:01  j_novak
00054  * Corrected an error in the initialization of tildeB in
00055  * Tslice_dirac_max::initial_dat_cts. + New method for solve_hij_AB.
00056  *
00057  * Revision 1.17  2007/03/21 14:51:50  j_novak
00058  * Introduction of potentials A and tilde(B) of h^{ij} into Tslice_dirac_max.
00059  *
00060  * Revision 1.16  2004/12/28 14:21:48  j_novak
00061  * Added the method Sym_tensor_trans::trace_from_det_one
00062  *
00063  * Revision 1.15  2004/07/08 12:29:01  j_novak
00064  * use of new method Tensor::annule_extern_cn
00065  *
00066  * Revision 1.14  2004/06/30 08:02:40  j_novak
00067  * Added filtering in l of khi_new and mu_new. ki_source is forced to go to
00068  * zero at least as r^2.
00069  *
00070  * Revision 1.13  2004/06/17 06:59:41  e_gourgoulhon
00071  * -- Method initial_data_cts: re-organized treatment of vanishing uu.
00072  * -- Method hh_det_one: replaced the attenuation with tempo by a call
00073  *    to the new method Tensor::annule_extern_c2.
00074  *
00075  * Revision 1.12  2004/06/08 14:05:06  j_novak
00076  * Added the attenuation of khi and mu in the last domain in ::det_one(). They are set to zero in the CED.
00077  *
00078  * Revision 1.11  2004/05/31 20:31:31  e_gourgoulhon
00079  * -- Method hh_det_one takes now a time step as argument, to compute
00080  *    h^{ij} from khi and mu at some arbitrary time step and not only at
00081  *    the latest one.
00082  * -- h^{ij} is no longer saved in binary files (method sauve);
00083  *    accordingly, the constructor from file calls the new version of
00084  *    hh_det_one to restore h^{ij}.
00085  *
00086  * Revision 1.10  2004/05/31 09:08:18  e_gourgoulhon
00087  * Method sauve and constructor from binary file are now operational.
00088  *
00089  * Revision 1.9  2004/05/27 15:25:04  e_gourgoulhon
00090  * Added constructors from binary file, as well as corresponding
00091  * functions sauve and save.
00092  *
00093  * Revision 1.8  2004/05/17 19:54:10  e_gourgoulhon
00094  * Method initial_data_cts: added arguments graph_device and method_poisson_vect.
00095  *
00096  * Revision 1.7  2004/05/12 15:24:20  e_gourgoulhon
00097  * Reorganized the #include 's, taking into account that
00098  * time_slice.h contains now an #include "metric.h".
00099  *
00100  * Revision 1.6  2004/05/10 09:16:32  e_gourgoulhon
00101  * -- Method initial_data_cts: added a call to del_deriv() at the end.
00102  * -- Methods set_trh and hh_det_one: added "adm_mass_evol.downdate(jtime)".
00103  * -- Method trh() : the update is now performed via a call to hh_det_one().
00104  *
00105  * Revision 1.5  2004/05/06 15:23:55  e_gourgoulhon
00106  * Added method initial_data_cts.
00107  *
00108  * Revision 1.4  2004/05/03 08:15:48  e_gourgoulhon
00109  * Method hh_det_one(): added check at the end (deviation from det = 1).
00110  *
00111  * Revision 1.3  2004/04/08 16:44:19  e_gourgoulhon
00112  * Added methods set_* and hh_det_one().
00113  *
00114  * Revision 1.2  2004/04/05 21:22:49  e_gourgoulhon
00115  * Added constructor as standard time slice of Minkowski spacetime.
00116  *
00117  * Revision 1.1  2004/03/30 14:00:31  j_novak
00118  * New class Tslide_dirac_max (first version).
00119  *
00120  *
00121  * $Header: /cvsroot/Lorene/C++/Source/Time_slice/tslice_dirac_max.C,v 1.24 2008/12/04 18:22:49 j_novak Exp $
00122  *
00123  */
00124 
00125 // C headers
00126 #include <assert.h>
00127 
00128 // Lorene headers
00129 #include "time_slice.h"
00130 #include "utilitaires.h"
00131 
00132 
00133 
00134                 //--------------//
00135                 // Constructors //
00136                 //--------------//
00137 
00138 
00139 // Constructor from conformal decomposition
00140 // ----------------------------------------
00141 
00142 Tslice_dirac_max::Tslice_dirac_max(const Scalar& lapse_in, const Vector& shift_in,
00143             const Metric_flat& ff_in, const Scalar& psi_in, 
00144             const Sym_tensor_trans& hh_in, const Sym_tensor& hata_in, 
00145             int depth_in) 
00146   : Time_slice_conf( lapse_in, shift_in, ff_in, psi_in, hh_in, hata_in, 
00147              0*lapse_in, depth_in), 
00148     A_hh_evol(depth_in), B_hh_evol(depth_in), source_A_hh_evol(depth_in), 
00149     source_B_hh_evol(depth_in), source_A_hata_evol(depth_in) ,
00150     source_B_hata_evol(depth_in), trh_evol(hh_in.the_trace(), depth_in) 
00151 { }              
00152 
00153 // Constructor as standard time slice of flat spacetime (Minkowski) 
00154 // ----------------------------------------------------------------
00155 
00156 Tslice_dirac_max::Tslice_dirac_max(const Map& mp, const Base_vect& triad, 
00157                                    const Metric_flat& ff_in, int depth_in) 
00158         : Time_slice_conf(mp, triad, ff_in, depth_in),
00159           A_hh_evol(depth_in), B_hh_evol(depth_in),   
00160           source_A_hh_evol(depth_in), source_B_hh_evol(depth_in),   
00161           source_A_hata_evol(depth_in), source_B_hata_evol(depth_in),   
00162           trh_evol(depth_in) {
00163 
00164     double time_init = the_time[jtime] ; 
00165     
00166     // All potentials identically zero:
00167     Scalar tmp(mp) ; 
00168     tmp.set_etat_zero() ; 
00169     A_hh_evol.update(tmp, jtime, time_init) ; 
00170     B_hh_evol.update(tmp, jtime, time_init) ; 
00171 
00172     source_A_hh_evol.update(tmp, jtime, time_init) ; 
00173     source_B_hh_evol.update(tmp, jtime, time_init) ; 
00174 
00175     source_A_hata_evol.update(tmp, jtime, time_init) ; 
00176     source_B_hata_evol.update(tmp, jtime, time_init) ; 
00177     
00178     // tr h identically zero:
00179     trh_evol.update(tmp, jtime, time_init) ;     
00180 }   
00181 
00182 
00183 // Constructor from binary file             
00184 // ----------------------------
00185 
00186 Tslice_dirac_max::Tslice_dirac_max(const Map& mp, const Base_vect& triad, 
00187                         const Metric_flat& ff_in, FILE* fich, 
00188                         bool partial_read, int depth_in) 
00189         : Time_slice_conf(mp, triad, ff_in, fich, true, depth_in),
00190           A_hh_evol(depth_in), B_hh_evol(depth_in),   
00191           source_A_hh_evol(depth_in), source_B_hh_evol(depth_in),   
00192           source_A_hata_evol(depth_in), source_B_hata_evol(depth_in),   
00193           trh_evol(depth_in) {
00194 
00195     if (partial_read) {
00196         cout << 
00197         "Constructor of Tslice_dirac_max from file: the case of partial reading\n"
00198         << "  is not ready yet !"
00199             << endl ; 
00200         abort() ; 
00201     }
00202     
00203     // Reading of various fields
00204     // -------------------------
00205     
00206     int jmin = jtime - depth + 1 ; 
00207     int indicator ; 
00208 
00209     // h^{ij}
00210     for (int j=jmin; j<=jtime; j++) {
00211         fread_be(&indicator, sizeof(int), 1, fich) ;    
00212         if (indicator == 1) {
00213             Sym_tensor hh_file(mp, triad, fich) ; 
00214             hh_evol.update(hh_file, j, the_time[j]) ; 
00215         }
00216     }
00217 
00218     // A - hh
00219     for (int j=jmin; j<=jtime; j++) {
00220         fread_be(&indicator, sizeof(int), 1, fich) ;    
00221         if (indicator == 1) {
00222             Scalar A_hh_file(mp, *(mp.get_mg()), fich) ; 
00223             A_hh_evol.update(A_hh_file, j, the_time[j]) ; 
00224         }
00225     }
00226 
00227     // B - hh
00228     for (int j=jmin; j<=jtime; j++) {
00229         fread_be(&indicator, sizeof(int), 1, fich) ;    
00230         if (indicator == 1) {
00231             Scalar B_hh_file(mp, *(mp.get_mg()), fich) ; 
00232             B_hh_evol.update(B_hh_file, j, the_time[j]) ; 
00233         }
00234     }    
00235 }
00236 
00237 // Constructor from a rotating star             
00238 // --------------------------------
00239 
00240 Tslice_dirac_max::Tslice_dirac_max(const Star_rot_Dirac& star, double pdt, int depth_in) 
00241     : Time_slice_conf(star.get_nn(), star.get_beta(), star.get_mp().flat_met_spher(),
00242               0.*star.get_nn(), star.get_hh(), 0.*star.get_aa(),
00243               0.*star.get_nn(), depth_in),
00244           A_hh_evol(depth_in), B_hh_evol(depth_in),   
00245           source_A_hh_evol(depth_in), source_B_hh_evol(depth_in),   
00246           source_A_hata_evol(depth_in), source_B_hata_evol(depth_in),   
00247           trh_evol(depth_in) {
00248 
00249     Scalar tmp = exp(star.get_ln_psi()) ;
00250     tmp.std_spectral_base() ;
00251     psi_evol.downdate(jtime) ;
00252     psi_evol.update(tmp, jtime, the_time[jtime]) ;
00253 
00254     Sym_tensor tmp2 = psi4()*psi()*psi()*star.get_aa() ;
00255     hata_evol.downdate(jtime) ;
00256     hata_evol.update(tmp2, jtime, the_time[jtime]) ;
00257 
00258     A_hh() ;
00259     B_hh() ;
00260     A_hata() ;
00261     B_hata() ;
00262     compute_sources() ;
00263 
00264     // Update of various fields
00265     // -------------------------
00266     double ttime1 = the_time[jtime] ; 
00267     int jtime1 = jtime ; 
00268     for (int j=1; j < depth; j++) {
00269         jtime1++ ; 
00270         ttime1 += pdt ; 
00271         psi_evol.update(psi_evol[jtime], jtime1, ttime1) ;  
00272         n_evol.update(n_evol[jtime], jtime1, ttime1) ;  
00273         beta_evol.update(beta_evol[jtime], jtime1, ttime1) ;  
00274         hh_evol.update(hh_evol[jtime], jtime1, ttime1) ;
00275         trk_evol.update(trk_evol[jtime], jtime1, ttime1) ;
00276     A_hh_evol.update(A_hh_evol[jtime], jtime1, ttime1) ;
00277     B_hh_evol.update(B_hh_evol[jtime], jtime1, ttime1) ;
00278     A_hata_evol.update(A_hata_evol[jtime], jtime1, ttime1) ;
00279     B_hata_evol.update(B_hata_evol[jtime], jtime1, ttime1) ;
00280     trh_evol.update(trh_evol[jtime], jtime1, ttime1) ;
00281     k_dd_evol.update(k_dd_evol[jtime], jtime1, ttime1) ;
00282         the_time.update(ttime1, jtime1, ttime1) ;         
00283     } 
00284     jtime += depth - 1 ;
00285 
00286     initialize_sources_copy() ;
00287 }
00288 
00289 // Copy constructor
00290 // ----------------
00291 
00292 Tslice_dirac_max::Tslice_dirac_max(const Tslice_dirac_max& tin) 
00293                     : Time_slice_conf(tin), 
00294                       A_hh_evol(tin.A_hh_evol), 
00295                       B_hh_evol(tin.B_hh_evol),
00296                       source_A_hh_evol(tin.source_A_hh_evol), 
00297                       source_B_hh_evol(tin.source_B_hh_evol),
00298                       source_A_hata_evol(tin.source_A_hata_evol), 
00299                       source_B_hata_evol(tin.source_B_hata_evol),
00300                       trh_evol(tin.trh_evol) { }
00301                       
00302                       
00303                 //--------------//
00304                 //  Destructor  //
00305                 //--------------//
00306 
00307 Tslice_dirac_max::~Tslice_dirac_max(){ }
00308 
00309 
00310                     //-----------------------//
00311                     // Mutators / assignment //
00312                     //-----------------------//
00313 
00314 void Tslice_dirac_max::operator=(const Tslice_dirac_max& tin) {
00315 
00316     Time_slice_conf::operator=(tin) ; 
00317 
00318     A_hh_evol = tin.A_hh_evol ; 
00319     B_hh_evol = tin.B_hh_evol ;
00320     source_A_hh_evol = tin.source_A_hh_evol ; 
00321     source_B_hh_evol = tin.source_B_hh_evol ;
00322     source_A_hata_evol = tin.source_A_hata_evol ; 
00323     source_B_hata_evol = tin.source_B_hata_evol ;
00324     trh_evol = tin.trh_evol ; 
00325        
00326 }
00327 
00328 
00329 void Tslice_dirac_max::set_hh(const Sym_tensor& hh_in) {
00330 
00331     Time_slice_conf::set_hh(hh_in) ; 
00332 
00333     // Reset of quantities depending on h^{ij}:
00334     A_hh_evol.downdate(jtime) ; 
00335     B_hh_evol.downdate(jtime) ; 
00336     source_A_hh_evol.downdate(jtime) ; 
00337     source_B_hh_evol.downdate(jtime) ; 
00338     source_A_hata_evol.downdate(jtime) ; 
00339     source_B_hata_evol.downdate(jtime) ; 
00340     trh_evol.downdate(jtime) ; 
00341          
00342 }
00343 
00344 
00345 void Tslice_dirac_max::initial_data_cts(const Sym_tensor& uu, 
00346                 const Scalar& trk_in, const Scalar& trk_point, 
00347                 double pdt, double precis, int method_poisson_vect,
00348                 const char* graph_device, const Scalar* p_ener_dens, 
00349                 const Vector* p_mom_dens, const Scalar* p_trace_stress) {
00350 
00351     
00352     Time_slice_conf::initial_data_cts(uu, trk_in, trk_point, pdt, precis,
00353                                       method_poisson_vect, graph_device, 
00354                                       p_ener_dens, p_mom_dens, p_trace_stress) ;
00355 
00356     int nz = trk_in.get_mp().get_mg()->get_nzone() ;
00357     // Setting khi and mu for j <= jtime, taking into account u^{ij} = dh^{ij}/dt
00358     //--------------------------------------------------------------------------
00359     for (int j = jtime-depth+1 ; j <= jtime; j++) {
00360             
00361     // A and tildeB are computed from the value of hh
00362     Scalar tmp = hh_evol[j].compute_A(true) ;
00363     assert (tmp.get_etat() != ETATNONDEF) ;
00364     if (tmp.get_etat() != ETATZERO) {
00365         assert(tmp.get_mp().get_mg()->get_type_r(nz-1) == UNSURR) ;
00366         tmp.annule_domain(nz-1) ;
00367     }
00368     tmp.set_dzpuis(0) ;
00369     A_hh_evol.update(tmp, j, the_time[j]) ;
00370 
00371     tmp = hh_evol[jtime].compute_tilde_B_tt(true) ;
00372     assert (tmp.get_etat() != ETATNONDEF) ;
00373     if (tmp.get_etat() != ETATZERO) {
00374         assert(tmp.get_mp().get_mg()->get_type_r(nz-1) == UNSURR) ;
00375         tmp.annule_domain(nz-1) ;
00376     }
00377     tmp.set_dzpuis(0) ;
00378     B_hh_evol.update(tmp, j, the_time[j]) ;
00379     }
00380   
00381     cout << endl << 
00382     "Tslice_dirac_max::initial_data_cts : variation of A and tilde(B) for J = " 
00383     << jtime << " :\n" ;  
00384     maxabs(A_hh_evol[jtime] - A_hh_evol[jtime-1], "A(h)^J - A(h)^{J-1}") ; 
00385     
00386     maxabs(B_hh_evol[jtime] - B_hh_evol[jtime-1], "B(h)^J - B(h)^{J-1}") ; 
00387     
00388     maxabs(A_hata_evol[jtime] - A_hata_evol[jtime-1], "A(hat{A})^J - A(hat{A})^{J-1}") ; 
00389     
00390     maxabs(B_hata_evol[jtime] - B_hata_evol[jtime-1], "B(hat{A})^J - B(hat{A})^{J-1}") ; 
00391     
00392     // Reset of derived quantities (at the new time step jtime)
00393     // ---------------------------
00394     del_deriv() ; 
00395     
00396     compute_sources() ;
00397     initialize_sources_copy() ; //## should be a call to the Runge-Kutta integrator
00398 }
00399 
00400 
00401 void Tslice_dirac_max::set_khi_mu(const Scalar& khi_in, const Scalar& mu_in) {
00402 
00403     const Map& mp = khi_in.get_mp() ;
00404 
00405     Sym_tensor_tt hh_tt(mp, mp.get_bvect_spher(), mp.flat_met_spher());
00406     hh_tt.set_khi_mu(khi_in, mu_in, 2) ;
00407 
00408     Sym_tensor_trans hh_tmp(mp, mp.get_bvect_spher(), mp.flat_met_spher());
00409     hh_tmp.trace_from_det_one(hh_tt) ;
00410 
00411     // Result set to trh_evol and hh_evol
00412     // ----------------------------------
00413     Scalar tmp = hh_tmp.the_trace() ;
00414     tmp.dec_dzpuis(4) ;
00415     trh_evol.update(tmp, jtime, the_time[jtime]) ;
00416     
00417     // The longitudinal part of h^{ij}, which is zero by virtue of Dirac gauge :
00418     Vector wzero(mp, CON,  *(ff.get_triad())) ; 
00419     wzero.set_etat_zero() ;                   
00420 
00421     // Temporary Sym_tensor with longitudinal part set to zero : 
00422     Sym_tensor hh_new(mp, CON, *(ff.get_triad())) ;
00423     
00424     hh_new.set_longit_trans(wzero, hh_tmp) ;
00425     
00426     hh_evol.update(hh_new, jtime, the_time[jtime]) ;
00427 
00428 } 
00429 
00430 void Tslice_dirac_max::set_trh(const Scalar& trh_in) {
00431 
00432     trh_evol.update(trh_in, jtime, the_time[jtime]) ; 
00433     cout << "Tslice_dirac_max::set_trh : #### WARNING : \n"
00434         << "   this method does not check whether det(tilde gamma) = 1"
00435         << endl ; 
00436         
00437     // Reset of quantities depending on the trace:
00438     hh_evol.downdate(jtime) ; 
00439     if (p_tgamma != 0x0) {
00440         delete p_tgamma ;
00441         p_tgamma = 0x0 ; 
00442     } 
00443     if (p_hdirac != 0x0) {
00444         delete p_hdirac ; 
00445         p_hdirac = 0x0 ; 
00446     }
00447     if (p_gamma != 0x0) {
00448         delete p_gamma ; 
00449         p_gamma = 0x0 ;
00450     }
00451     source_A_hh_evol.downdate(jtime) ; 
00452     source_B_hh_evol.downdate(jtime) ; 
00453     source_A_hata_evol.downdate(jtime) ; 
00454     source_B_hata_evol.downdate(jtime) ; 
00455     gam_dd_evol.downdate(jtime) ; 
00456     gam_uu_evol.downdate(jtime) ; 
00457     adm_mass_evol.downdate(jtime) ;  
00458      
00459 } 
00460 
00461 
00462                 //----------------------------------------------------//
00463                 //  Update of fields from base class Time_slice_conf  //
00464                 //----------------------------------------------------//
00465 
00466 
00467 const Sym_tensor& Tslice_dirac_max::hh(Param* par_bc, Param* par_mat) const {
00468 
00469     if (!( hh_evol.is_known(jtime) ) ) {
00470 
00471         assert (A_hh_evol.is_known(jtime)) ;
00472         assert (B_hh_evol.is_known(jtime)) ;
00473     
00474         // Computation of h^{ij} to ensure det tgam_{ij} = det f_{ij} :
00475 
00476         hh_det_one(jtime, par_bc, par_mat) ;
00477     }
00478   
00479     return hh_evol[jtime] ; 
00480 
00481 }
00482 
00483 
00484 const Scalar& Tslice_dirac_max::trk() const {
00485 
00486     if( !(trk_evol.is_known(jtime)) ) {
00487 
00488       Scalar resu(ff.get_mp()) ;
00489       resu.set_etat_zero() ;
00490       
00491       trk_evol.update(resu, jtime, the_time[jtime]) ;
00492 
00493     } 
00494     
00495     return trk_evol[jtime] ; 
00496 
00497 }
00498 
00499 
00500 const Vector& Tslice_dirac_max::hdirac() const {
00501 
00502     if (p_hdirac == 0x0) {
00503         p_hdirac = new Vector(ff.get_mp(), CON, ff.get_triad() ) ;
00504     p_hdirac->set_etat_zero() ;
00505     }
00506     
00507     return *p_hdirac ; 
00508 
00509 }
00510 
00511 
00512 
00513 
00514                 //-----------------------------------//
00515                 //  Update of fields from this class //
00516                 //-----------------------------------//
00517 
00518 const Scalar& Tslice_dirac_max::A_hh() const {
00519 
00520     if (!( A_hh_evol.is_known(jtime) ) ) {
00521     assert( hh_evol.is_known(jtime) ) ;
00522 
00523     A_hh_evol.update( hh_evol[jtime].compute_A(true), jtime, the_time[jtime] ) ;
00524 
00525     }
00526     return A_hh_evol[jtime] ;
00527 } 
00528 
00529 const Scalar& Tslice_dirac_max::B_hh() const {
00530 
00531     if (!( B_hh_evol.is_known(jtime) ) ) {
00532     assert( hh_evol.is_known(jtime) ) ;
00533 
00534     B_hh_evol.update( hh_evol[jtime].compute_tilde_B_tt(true), jtime, the_time[jtime] ) ;
00535 
00536     }
00537     return B_hh_evol[jtime] ;
00538 } 
00539 
00540 const Scalar& Tslice_dirac_max::trh() const {
00541 
00542     if( !(trh_evol.is_known(jtime)) ) {
00543     
00544         // Computation of tr(h) to ensure det tgam_{ij} = det f_{ij} :
00545         hh_det_one(jtime) ;
00546         
00547     }
00548     
00549     return trh_evol[jtime] ; 
00550 
00551 }
00552 
00553 
00554 
00555                 //------------------//
00556                 //      output      //
00557                 //------------------//
00558 
00559 ostream& Tslice_dirac_max::operator>>(ostream& flux) const {
00560 
00561     Time_slice_conf::operator>>(flux) ; 
00562 
00563     flux << "Dirac gauge and maximal slicing" << '\n' ;
00564 
00565     if (A_hh_evol.is_known(jtime)) {
00566         maxabs( A_hh_evol[jtime], "A_hh", flux) ;
00567     }
00568     if (B_hh_evol.is_known(jtime)) {
00569         maxabs( B_hh_evol[jtime], "B_hh", flux) ;
00570     }
00571     if (trh_evol.is_known(jtime)) {
00572         maxabs( trh_evol[jtime], "tr h", flux) ;
00573     }
00574     
00575     return flux ; 
00576 
00577 }
00578 
00579 
00580 void Tslice_dirac_max::sauve(FILE* fich, bool partial_save) const {
00581     
00582     if (partial_save) {
00583         cout << 
00584         "Tslice_dirac_max::sauve : the partial_save case is not ready yet !"
00585             << endl ; 
00586         abort() ; 
00587     }
00588     
00589     // Writing of quantities common to all derived classes of Time_slice_conf
00590     // ----------------------------------------------------------------------
00591     
00592     Time_slice_conf::sauve(fich, true) ; 
00593     
00594     // Writing of the other fields
00595     // ---------------------------
00596         
00597     int jmin = jtime - depth + 1 ; 
00598 
00599     // h^{ij}
00600     assert( hh_evol.is_known(jtime) ) ;
00601     for (int j=jmin; j<=jtime; j++) {
00602         int indicator = (hh_evol.is_known(j)) ? 1 : 0 ; 
00603         fwrite_be(&indicator, sizeof(int), 1, fich) ;
00604         if (indicator == 1) hh_evol[j].sauve(fich) ; 
00605     }   
00606 
00607     // A_hh
00608     A_hh() ;     // forces the update at the current time step
00609     for (int j=jmin; j<=jtime; j++) {
00610         int indicator = (A_hh_evol.is_known(j)) ? 1 : 0 ; 
00611         fwrite_be(&indicator, sizeof(int), 1, fich) ;
00612         if (indicator == 1) A_hh_evol[j].sauve(fich) ; 
00613     }
00614 
00615     // B_hh
00616     B_hh() ;     // forces the update at the current time step
00617     for (int j=jmin; j<=jtime; j++) {
00618         int indicator = (B_hh_evol.is_known(j)) ? 1 : 0 ; 
00619         fwrite_be(&indicator, sizeof(int), 1, fich) ;
00620         if (indicator == 1) B_hh_evol[j].sauve(fich) ; 
00621     }
00622 }
00623 
00624 
00625                 
00626                 
00627                 
00628                 
00629 

Generated on Tue Feb 7 01:35:21 2012 for LORENE by  doxygen 1.4.6