/* * Methods of class Isol_hor * * (see file isol_hor.h for documentation). * */ /* * Copyright (c) 2004 Jose Luis Jaramillo * Francois Limousin * * This file is part of LORENE. * * LORENE is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 * as published by the Free Software Foundation. * * LORENE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with LORENE; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ char isol_hor_C[] = "$Header: /cvsroot/Lorene/C++/Source/Isol_hor/isol_hor.C,v 1.35 2014/10/13 08:53:01 j_novak Exp $" ; /* * $Id: isol_hor.C,v 1.35 2014/10/13 08:53:01 j_novak Exp $ * $Log: isol_hor.C,v $ * Revision 1.35 2014/10/13 08:53:01 j_novak * Lorene classes and functions now belong to the namespace Lorene. * * Revision 1.34 2014/10/06 15:13:11 j_novak * Modified #include directives to use c++ syntax. * * Revision 1.33 2009/05/18 22:04:27 j_novak * Changed pow(psi_in, 6) to psi*...*psi in the call to Time_slice_conf constructor. This is to get a well-defined basis. * * Revision 1.32 2008/12/02 15:02:21 j_novak * Implementation of the new constrained formalism, following Cordero et al. 2009 * paper. The evolution eqs. are solved as a first-order system. Not tested yet! * * Revision 1.31 2006/05/24 16:55:31 f_limousin * Improvement of dn_comp() and dpsi_comp() * * Revision 1.30 2005/10/21 16:20:55 jl_jaramillo * Version for the paper JaramL05 * * Revision 1.29 2005/09/13 18:33:17 f_limousin * New function vv_bound_cart_bin(double) for computing binaries with * berlin condition for the shift vector. * Suppress all the symy and asymy in the importations. * * Revision 1.28 2005/09/12 12:33:54 f_limousin * Compilation Warning - Change of convention for the angular velocity * Add Berlin boundary condition in the case of binary horizons. * * Revision 1.27 2005/07/08 13:15:23 f_limousin * Improvements of boundary_vv_cart(), boundary_nn_lapl(). * Add a fonction to compute the departure of axisymmetry. * * Revision 1.26 2005/05/12 14:48:07 f_limousin * New boundary condition for the lapse : boundary_nn_lapl(). * * Revision 1.25 2005/04/15 09:34:16 jl_jaramillo * Function "adapt_hor" for adapting the the excised surface to * a given surface. The zero expansion surface is not properly implemented * * Revision 1.24 2005/04/08 12:16:52 f_limousin * Function set_psi(). And dependance in phi. * * Revision 1.23 2005/04/03 19:48:22 f_limousin * Implementation of set_psi(psi_in). And minor changes to avoid warnings. * * Revision 1.22 2005/04/02 15:49:21 f_limousin * New choice (Lichnerowicz) for aaquad. New member data nz. * * Revision 1.21 2005/03/31 09:45:31 f_limousin * New functions compute_ww(...) and aa_kerr_ww(). * * Revision 1.20 2005/03/30 12:08:20 f_limousin * Implementation of K^{ij} (Eq.(13) Of Sergio (2002)). * * Revision 1.19 2005/03/28 19:42:39 f_limousin * Implement the metric and A^{ij}A_{ij} of Sergio for pertubations * of Kerr black holes. * * Revision 1.18 2005/03/24 17:05:34 f_limousin * Small change * * Revision 1.17 2005/03/24 16:50:28 f_limousin * Add parameters solve_shift and solve_psi in par_isol.d and in function * init_dat(...). Implement Isolhor::kerr_perturb(). * * Revision 1.16 2005/03/10 10:19:42 f_limousin * Add the regularisation of the shift in the case of a single black hole * and lapse zero on the horizon. * * Revision 1.15 2005/03/09 10:29:53 f_limousin * New function update_aa(). * * Revision 1.14 2005/03/06 16:59:14 f_limousin * New function Isol_hor::aa() (the one belonging to the class * Time_slice_conf need to compute the time derivative of hh and thus * cannot work in the class Isol_hor). * * Revision 1.13 2005/03/03 15:12:17 f_limousin * Implement function operator>> * * Revision 1.12 2005/03/03 10:05:36 f_limousin * Introduction of members boost_x and boost_z. * * Revision 1.11 2005/02/07 10:35:05 f_limousin * Add the regularisation of the shift for the case N=0 on the horizon. * * Revision 1.10 2004/12/31 15:36:43 f_limousin * Add the constructor from a file and change the standard constructor. * * Revision 1.9 2004/12/29 16:14:22 f_limousin * Add new function beta_comp(const Isol_hor& comp). * * Revision 1.7 2004/11/05 10:57:03 f_limousin * Delete argument partial_save in the function sauve. * * Revision 1.6 2004/11/05 10:10:21 f_limousin * Construction of an isolhor with the Metric met_gamt instead * of a Sym_tensor. * * Revision 1.5 2004/11/03 17:16:06 f_limousin * Change the standart constructor. Add 4 memebers : trK, trK_point, * gamt and gamt_point. * Add also a constructor from a file. * * Revision 1.3 2004/10/29 15:44:45 jl_jaramillo * Remove two members * * Revision 1.2 2004/09/28 16:07:16 f_limousin * Remove all unused functions. * * Revision 1.1 2004/09/09 14:07:26 jl_jaramillo * First version * * Revision 1.1 2004/03/30 14:00:31 jl_jaramillo * New class Isol_hor (first version). * * * $Header: /cvsroot/Lorene/C++/Source/Isol_hor/isol_hor.C,v 1.35 2014/10/13 08:53:01 j_novak Exp $ * */ // C headers #include #include // Lorene headers #include "param.h" #include "utilitaires.h" #include "time_slice.h" #include "isol_hor.h" #include "tensor.h" #include "metric.h" #include "evolution.h" //#include "graphique.h" //--------------// // Constructors // //--------------// // Standard constructor // -------------------- namespace Lorene { Isol_hor::Isol_hor(Map_af& mpi, int depth_in) : Time_slice_conf(mpi, mpi.get_bvect_spher(), mpi.flat_met_spher()), mp(mpi), nz(mpi.get_mg()->get_nzone()), radius ((mpi.get_alpha())[0]), omega(0), boost_x(0), boost_z(0), regul(0), n_auto_evol(depth_in), n_comp_evol(depth_in), psi_auto_evol(depth_in), psi_comp_evol(depth_in), dn_evol(depth_in), dpsi_evol(depth_in), beta_auto_evol(depth_in), beta_comp_evol(depth_in), aa_auto_evol(depth_in), aa_comp_evol(depth_in), aa_nn(depth_in), aa_quad_evol(depth_in), met_gamt(mpi.flat_met_spher()), gamt_point(mpi, CON, mpi.get_bvect_spher()), trK(mpi), trK_point(mpi), decouple(mpi){ } // Constructor from conformal decomposition // ---------------------------------------- Isol_hor::Isol_hor(Map_af& mpi, const Scalar& lapse_in, const Scalar& psi_in, const Vector& shift_in, const Sym_tensor& aa_in, const Metric& metgamt, const Sym_tensor& gamt_point_in, const Scalar& trK_in, const Scalar& trK_point_in, const Metric_flat& ff_in, int depth_in) : Time_slice_conf(lapse_in, shift_in, ff_in, psi_in, metgamt.con() - ff_in.con(), psi_in*psi_in*psi_in*psi_in*psi_in*psi_in*aa_in, trK_in, depth_in), mp(mpi), nz(mpi.get_mg()->get_nzone()), radius ((mpi.get_alpha())[0]), omega(0), boost_x(0), boost_z(0), regul(0), n_auto_evol(depth_in), n_comp_evol(depth_in), psi_auto_evol(depth_in), psi_comp_evol(depth_in), dn_evol(depth_in), dpsi_evol(depth_in), beta_auto_evol(depth_in), beta_comp_evol(depth_in), aa_auto_evol(depth_in), aa_comp_evol(depth_in), aa_nn(depth_in), aa_quad_evol(depth_in), met_gamt(metgamt), gamt_point(gamt_point_in), trK(trK_in), trK_point(trK_point_in), decouple(lapse_in.get_mp()){ // hh_evol, trk_evol hh_evol.update(met_gamt.con() - ff.con(), jtime, the_time[jtime]) ; trk_evol.update(trK, jtime, the_time[jtime]) ; } // Copy constructor // ---------------- Isol_hor::Isol_hor(const Isol_hor& isolhor_in) : Time_slice_conf(isolhor_in), mp(isolhor_in.mp), nz(isolhor_in.nz), radius(isolhor_in.radius), omega(isolhor_in.omega), boost_x(isolhor_in.boost_x), boost_z(isolhor_in.boost_z), regul(isolhor_in.regul), n_auto_evol(isolhor_in.n_auto_evol), n_comp_evol(isolhor_in.n_comp_evol), psi_auto_evol(isolhor_in.psi_auto_evol), psi_comp_evol(isolhor_in.psi_comp_evol), dn_evol(isolhor_in.dn_evol), dpsi_evol(isolhor_in.dpsi_evol), beta_auto_evol(isolhor_in.beta_auto_evol), beta_comp_evol(isolhor_in.beta_comp_evol), aa_auto_evol(isolhor_in.aa_auto_evol), aa_comp_evol(isolhor_in.aa_comp_evol), aa_nn(isolhor_in.aa_nn), aa_quad_evol(isolhor_in.aa_quad_evol), met_gamt(isolhor_in.met_gamt), gamt_point(isolhor_in.gamt_point), trK(isolhor_in.trK), trK_point(isolhor_in.trK_point), decouple(isolhor_in.decouple){ } // Constructor from a file // ----------------------- Isol_hor::Isol_hor(Map_af& mpi, FILE* fich, bool partial_read, int depth_in) : Time_slice_conf(mpi, mpi.get_bvect_spher(), mpi.flat_met_spher(), fich, partial_read, depth_in), mp(mpi), nz(mpi.get_mg()->get_nzone()), radius ((mpi.get_alpha())[0]), omega(0), boost_x(0), boost_z(0), regul(0), n_auto_evol(depth_in), n_comp_evol(depth_in), psi_auto_evol(depth_in), psi_comp_evol(depth_in), dn_evol(depth_in), dpsi_evol(depth_in), beta_auto_evol(depth_in), beta_comp_evol(depth_in), aa_auto_evol(depth_in), aa_comp_evol(depth_in), aa_nn(depth_in), aa_quad_evol(depth_in), met_gamt(mpi.flat_met_spher()), gamt_point(mpi, CON, mpi.get_bvect_spher()), trK(mpi), trK_point(mpi), decouple(mpi){ fread_be(&omega, sizeof(double), 1, fich) ; fread_be(&boost_x, sizeof(double), 1, fich) ; fread_be(&boost_z, sizeof(double), 1, fich) ; int jmin = jtime - depth + 1 ; int indicator ; // psi_evol for (int j=jmin; j<=jtime; j++) { fread_be(&indicator, sizeof(int), 1, fich) ; if (indicator == 1) { Scalar psi_file(mp, *(mp.get_mg()), fich) ; psi_evol.update(psi_file, j, the_time[j]) ; } } // n_auto_evol for (int j=jmin; j<=jtime; j++) { fread_be(&indicator, sizeof(int), 1, fich) ; if (indicator == 1) { Scalar nn_auto_file(mp, *(mp.get_mg()), fich) ; n_auto_evol.update(nn_auto_file, j, the_time[j]) ; } } // psi_auto_evol for (int j=jmin; j<=jtime; j++) { fread_be(&indicator, sizeof(int), 1, fich) ; if (indicator == 1) { Scalar psi_auto_file(mp, *(mp.get_mg()), fich) ; psi_auto_evol.update(psi_auto_file, j, the_time[j]) ; } } // beta_auto_evol for (int j=jmin; j<=jtime; j++) { fread_be(&indicator, sizeof(int), 1, fich) ; if (indicator == 1) { Vector beta_auto_file(mp, mpi.get_bvect_spher(), fich) ; beta_auto_evol.update(beta_auto_file, j, the_time[j]) ; } } // met_gamt, gamt_point, trK, trK_point Sym_tensor met_file (mp, mp.get_bvect_spher(), fich) ; met_gamt = met_file ; Sym_tensor gamt_point_file (mp, mp.get_bvect_spher(), fich) ; gamt_point = gamt_point_file ; Scalar trK_file (mp, *(mp.get_mg()), fich) ; trK = trK_file ; Scalar trK_point_file (mp, *(mp.get_mg()), fich) ; trK_point = trK_point_file ; // hh_evol, trk_evol hh_evol.update(met_gamt.con() - ff.con(), jtime, the_time[jtime]) ; trk_evol.update(trK, jtime, the_time[jtime]) ; } //--------------// // Destructor // //--------------// Isol_hor::~Isol_hor(){} //-----------------------// // Mutators / assignment // //-----------------------// void Isol_hor::operator=(const Isol_hor& isolhor_in) { Time_slice_conf::operator=(isolhor_in) ; mp = isolhor_in.mp ; nz = isolhor_in.nz ; radius = isolhor_in.radius ; omega = isolhor_in.omega ; boost_x = isolhor_in.boost_x ; boost_z = isolhor_in.boost_z ; regul = isolhor_in.regul ; n_auto_evol = isolhor_in.n_auto_evol ; n_comp_evol = isolhor_in.n_comp_evol ; psi_auto_evol = isolhor_in.psi_auto_evol ; psi_comp_evol = isolhor_in.psi_comp_evol ; dn_evol = isolhor_in.dn_evol ; dpsi_evol = isolhor_in.dpsi_evol ; beta_auto_evol = isolhor_in.beta_auto_evol ; beta_comp_evol = isolhor_in.beta_comp_evol ; aa_auto_evol = isolhor_in.aa_auto_evol ; aa_comp_evol = isolhor_in.aa_comp_evol ; aa_nn = isolhor_in.aa_nn ; aa_quad_evol = isolhor_in.aa_quad_evol ; met_gamt = isolhor_in.met_gamt ; gamt_point = isolhor_in.gamt_point ; trK = isolhor_in.trK ; trK_point = isolhor_in.trK_point ; decouple = isolhor_in.decouple ; } //------------------// // output // //------------------// ostream& Isol_hor::operator>>(ostream& flux) const { Time_slice_conf::operator>>(flux) ; flux << '\n' << "radius of the horizon : " << radius << '\n' ; flux << "boost in x-direction : " << boost_x << '\n' ; flux << "boost in z-direction : " << boost_z << '\n' ; flux << "angular velocity omega : " << omega_hor() << '\n' ; flux << "area of the horizon : " << area_hor() << '\n' ; flux << "ang. mom. of horizon : " << ang_mom_hor() << '\n' ; flux << "ADM ang. mom. : " << ang_mom_adm() << '\n' ; flux << "Mass of the horizon : " << mass_hor() << '\n' ; flux << "ADM Mass : " << adm_mass() << '\n' ; return flux ; } //--------------------------// // Save in a file // //--------------------------// void Isol_hor::sauve(FILE* fich, bool partial_save) const { // Writing of quantities common to all derived classes of Time_slice // ----------------------------------------------------------------- Time_slice_conf::sauve(fich, partial_save) ; fwrite_be (&omega, sizeof(double), 1, fich) ; fwrite_be (&boost_x, sizeof(double), 1, fich) ; fwrite_be (&boost_z, sizeof(double), 1, fich) ; // Writing of quantities common to Isol_hor // ----------------------------------------- int jmin = jtime - depth + 1 ; // psi_evol for (int j=jmin; j<=jtime; j++) { int indicator = (psi_evol.is_known(j)) ? 1 : 0 ; fwrite_be(&indicator, sizeof(int), 1, fich) ; if (indicator == 1) psi_evol[j].sauve(fich) ; } // n_auto_evol for (int j=jmin; j<=jtime; j++) { int indicator = (n_auto_evol.is_known(j)) ? 1 : 0 ; fwrite_be(&indicator, sizeof(int), 1, fich) ; if (indicator == 1) n_auto_evol[j].sauve(fich) ; } // psi_auto_evol for (int j=jmin; j<=jtime; j++) { int indicator = (psi_auto_evol.is_known(j)) ? 1 : 0 ; fwrite_be(&indicator, sizeof(int), 1, fich) ; if (indicator == 1) psi_auto_evol[j].sauve(fich) ; } // beta_auto_evol for (int j=jmin; j<=jtime; j++) { int indicator = (beta_auto_evol.is_known(j)) ? 1 : 0 ; fwrite_be(&indicator, sizeof(int), 1, fich) ; if (indicator == 1) beta_auto_evol[j].sauve(fich) ; } met_gamt.con().sauve(fich) ; gamt_point.sauve(fich) ; trK.sauve(fich) ; trK_point.sauve(fich) ; } // Accessors // --------- const Scalar& Isol_hor::n_auto() const { assert( n_auto_evol.is_known(jtime) ) ; return n_auto_evol[jtime] ; } const Scalar& Isol_hor::n_comp() const { assert( n_comp_evol.is_known(jtime) ) ; return n_comp_evol[jtime] ; } const Scalar& Isol_hor::psi_auto() const { assert( psi_auto_evol.is_known(jtime) ) ; return psi_auto_evol[jtime] ; } const Scalar& Isol_hor::psi_comp() const { assert( psi_comp_evol.is_known(jtime) ) ; return psi_comp_evol[jtime] ; } const Vector& Isol_hor::dnn() const { assert( dn_evol.is_known(jtime) ) ; return dn_evol[jtime] ; } const Vector& Isol_hor::dpsi() const { assert( dpsi_evol.is_known(jtime) ) ; return dpsi_evol[jtime] ; } const Vector& Isol_hor::beta_auto() const { assert( beta_auto_evol.is_known(jtime) ) ; return beta_auto_evol[jtime] ; } const Vector& Isol_hor::beta_comp() const { assert( beta_comp_evol.is_known(jtime) ) ; return beta_comp_evol[jtime] ; } const Sym_tensor& Isol_hor::aa_auto() const { assert( aa_auto_evol.is_known(jtime) ) ; return aa_auto_evol[jtime] ; } const Sym_tensor& Isol_hor::aa_comp() const { assert( aa_comp_evol.is_known(jtime) ) ; return aa_comp_evol[jtime] ; } void Isol_hor::set_psi(const Scalar& psi_in) { psi_evol.update(psi_in, jtime, the_time[jtime]) ; // Reset of quantities depending on Psi: if (p_psi4 != 0x0) { delete p_psi4 ; p_psi4 = 0x0 ; } if (p_ln_psi != 0x0) { delete p_ln_psi ; p_ln_psi = 0x0 ; } if (p_gamma != 0x0) { delete p_gamma ; p_gamma = 0x0 ; } gam_dd_evol.downdate(jtime) ; gam_uu_evol.downdate(jtime) ; k_dd_evol.downdate(jtime) ; k_uu_evol.downdate(jtime) ; adm_mass_evol.downdate(jtime) ; } void Isol_hor::set_nn(const Scalar& nn_in) { n_evol.update(nn_in, jtime, the_time[jtime]) ; hata_evol.downdate(jtime) ; aa_quad_evol.downdate(jtime) ; k_dd_evol.downdate(jtime) ; k_uu_evol.downdate(jtime) ; } void Isol_hor::set_gamt(const Metric& gam_tilde) { if (p_tgamma != 0x0) { delete p_tgamma ; p_tgamma = 0x0 ; } if (p_gamma != 0x0) { delete p_gamma ; p_gamma = 0x0 ; } met_gamt = gam_tilde ; gam_dd_evol.downdate(jtime) ; gam_uu_evol.downdate(jtime) ; k_dd_evol.downdate(jtime) ; k_uu_evol.downdate(jtime) ; hh_evol.downdate(jtime) ; hh_evol.update(gam_tilde.con() - ff.con(), jtime, the_time[jtime]) ; } // Import the lapse from the companion (Bhole case) void Isol_hor::n_comp(const Isol_hor& comp) { double ttime = the_time[jtime] ; Scalar temp (mp) ; temp.import(comp.n_auto()) ; temp.std_spectral_base() ; n_comp_evol.update(temp, jtime, ttime) ; n_evol.update(temp + n_auto(), jtime, ttime) ; Vector dn_comp (mp, COV, mp.get_bvect_cart()) ; dn_comp.set_etat_qcq() ; Vector auxi (comp.n_auto().derive_cov(comp.ff)) ; auxi.dec_dzpuis(2) ; auxi.change_triad(auxi.get_mp().get_bvect_cart()) ; for (int i=1 ; i<=3 ; i++){ if (auxi(i).get_etat() != ETATZERO) auxi.set(i).raccord(3) ; } auxi.change_triad(mp.get_bvect_cart()) ; assert ( *(auxi.get_triad()) == *(dn_comp.get_triad())) ; for (int i=1 ; i<=3 ; i++){ dn_comp.set(i).import(auxi(i)) ; dn_comp.set(i).set_spectral_va().set_base(auxi(i).get_spectral_va(). get_base()) ; } dn_comp.inc_dzpuis(2) ; dn_comp.change_triad(mp.get_bvect_spher()) ; /* Vector dn_comp_zec (n_comp().derive_cov(ff)) ; for (int i=1 ; i<=3 ; i++) for (int l=nz-1 ; l<=nz-1 ; l++) { if (dn_comp.set(i).get_etat() == ETATQCQ) dn_comp.set(i).set_domain(l) = dn_comp_zec(i).domain(l) ; } */ dn_evol.update(n_auto().derive_cov(ff) + dn_comp, jtime, ttime) ; /* Scalar tr_K (mp) ; Mtbl mxabs (mp.xa) ; Mtbl myabs (mp.ya) ; Mtbl mzabs (mp.za) ; Scalar comp_r (mp) ; comp_r.annule_hard() ; for (int l=1 ; lget_nzone() ; l++) { int nr = mp.get_mg()->get_nr (l) ; if (l==mp.get_mg()->get_nzone()-1) nr -- ; int np = mp.get_mg()->get_np (l) ; int nt = mp.get_mg()->get_nt (l) ; double xabs, yabs, zabs, air, theta, phi ; for (int k=0 ; kget_nt(1) ; int nnp = mp.get_mg()->get_np(1) ; int check ; check = 0 ; for (int k=0; kget_nt(1); nt++) for (int np=0; npget_np(1); np++) { double theta = mp.get_mg()->get_grille3d(1)->tet[nt] ; double phi = mp.get_mg()->get_grille3d(1)->phi[np] ; Param par_expansion ; par_expansion.add_scalar(expa, 0) ; par_expansion.add_double(theta, 0) ; par_expansion.add_double(phi, 1) ; double r_app_hor = zerosec_b(fonc_expansion, par_expansion, c_min, c_max, precis, nitmax, nit) ; app_hor.set_grid_point(1, np, nt, 0) = r_app_hor ; } // Transformation of the 3-metric and extrinsic curvature // ------------------------------------------------------ Scalar rr (mp) ; rr = mp.r ; Scalar trans_11 (mp) ; Scalar r_new (mp) ; r_new.annule_hard() ; // trans_11.annule_hard() ; for (int l=1; lget_nr(1); nr++) for (int nt=0; ntget_nt(1); nt++) for (int np=0; npget_np(1); np++) { r_new.set_grid_point(l, np, nt, nr) = rr.val_grid_point(l, np, nt, nr) - app_hor.val_grid_point(1, np, nt, 0) + 1 ; // trans_11.set_grid_point(l, np, nt, nr) = 1. / // app_hor.val_grid_point(1, np, nt, 0) ; // ! } r_new.std_spectral_base() ; Itbl comp(2) ; comp.set(0) = CON ; comp.set(1) = COV ; Scalar trans_12 (r_new.dsdt()) ; trans_12.div_r() ; Scalar trans_13 (r_new.stdsdp()) ; trans_13.div_r() ; for (int nr=0; nrget_nr(1); nr++) for (int nt=0; ntget_nt(1); nt++) for (int np=0; npget_np(1); np++) { trans_12.set_grid_point(nz-1, np, nt, nr) = trans_12.val_grid_point(1, np, nt, nr) ; trans_13.set_grid_point(nz-1, np, nt, nr) = trans_13.val_grid_point(1, np, nt, nr) ; } // Transformation matrix Tensor trans (mp, 2, comp, mp.get_bvect_spher()) ; trans.set(1,1) = 1 ; trans.set(1,2) = 0;//trans_12 ; trans.set(1,3) = 0;//trans_13 ; trans.set(2,2) = 1. ; trans.set(3,3) = 1. ; trans.set(2,1) = 0. ; trans.set(3,1) = 0. ; trans.set(3,2) = 0. ; trans.set(2,3) = 0. ; trans.std_spectral_base() ; cout << "trans(1,3)" << endl << norme(trans(1,3)) << endl ; Sym_tensor gamma_uu (gam().con()) ; Sym_tensor kk_uu (k_uu()) ; gamma_uu = contract(gamma_uu, 0, 1, trans * trans, 1, 3) ; kk_uu = contract(kk_uu, 0, 1, trans * trans, 1, 3) ; Sym_tensor copie_gamma (gamma_uu) ; Sym_tensor copie_kk (kk_uu) ; // dz_puis set to zero kk_uu.dec_dzpuis(2) ; for(int i=1; i<=3; i++) for(int j=i; j<=3; j++){ kk_uu.set(i,j).annule_hard() ; gamma_uu.set(i,j).annule_hard() ; } copie_kk.dec_dzpuis(2) ; Scalar expa_trans(mp) ; expa_trans.annule_hard() ; expa.dec_dzpuis(2) ; /* copie_gamma.set(2,2).div_r() ; copie_gamma.set(2,2).div_r() ; copie_gamma.set(3,3).div_rsint() ; copie_gamma.set(3,3).div_rsint() ; copie_gamma.set(1,2).div_r() ; copie_gamma.set(1,3).div_rsint() ; // gamma_uu.set(2,3).div_r() ; // gamma_uu.set(2,3).div_rsint() ; */ //Importation for(int i=1; i<=3; i++) for(int j=i; j<=3; j++) for (int l=1; lget_nr(1); nr++) for (int nt=0; ntget_nt(1); nt++) for (int np=0; npget_np(1); np++) { double theta = mp.get_mg()->get_grille3d(1)->tet[nt] ; double phi = mp.get_mg()->get_grille3d(1)->phi[np] ; double r_inv = rr.val_grid_point(l, np, nt, nr) + app_hor.val_grid_point(1, np, nt, 0) - 1. ; gamma_uu.set(i,j).set_grid_point(l, np, nt, nr) = copie_gamma(i,j).val_point(r_inv, theta, phi) ; kk_uu.set(i,j).set_grid_point(l, np, nt, nr) = copie_kk(i,j).val_point(r_inv, theta, phi) ; expa_trans.set_grid_point(l, np, nt, nr) = expa.val_point(r_inv, theta, phi) ; } kk_uu.std_spectral_base() ; // Save the base? gamma_uu.std_spectral_base() ; expa_trans.std_spectral_base() ; for (int l=1; lget_nr(1); nr++) for (int nt=0; ntget_nt(1); nt++) for (int np=0; npget_np(1); np++) { gamma_uu.set(1,2).set_grid_point(l,np,nt,nr) = gamma_uu.set(1,2).val_grid_point(l,np,nt,nr) / (1 +app_hor.val_grid_point(1, np, nt, 0)/ rr.val_grid_point(l, np, nt, nr) - 1 / rr.val_grid_point(l, np, nt, nr) ) ; gamma_uu.set(1,3).set_grid_point(l,np,nt,nr) = gamma_uu.set(1,3).val_grid_point(l,np,nt,nr) / (1 +app_hor.val_grid_point(1, np, nt, 0)/ rr.val_grid_point(l, np, nt, nr) - 1 / rr.val_grid_point(l, np, nt, nr) ) ; gamma_uu.set(2,2).set_grid_point(l,np,nt,nr) = gamma_uu.set(2,2).val_grid_point(l,np,nt,nr) / (1 +app_hor.val_grid_point(1, np, nt, 0)/ rr.val_grid_point(l, np, nt, nr) - 1 / rr.val_grid_point(l, np, nt, nr) ) / (1 +app_hor.val_grid_point(1, np, nt, 0)/ rr.val_grid_point(l, np, nt, nr) - 1 / rr.val_grid_point(l, np, nt, nr) ) ; gamma_uu.set(2,3).set_grid_point(l,np,nt,nr) = gamma_uu.set(2,3).val_grid_point(l,np,nt,nr) / (1 +app_hor.val_grid_point(1, np, nt, 0)/ rr.val_grid_point(l, np, nt, nr) - 1 / rr.val_grid_point(l, np, nt, nr) ) / (1 +app_hor.val_grid_point(1, np, nt, 0)/ rr.val_grid_point(l, np, nt, nr) - 1 / rr.val_grid_point(l, np, nt, nr) ) ; gamma_uu.set(3,3).set_grid_point(l,np,nt,nr) = gamma_uu.set(3,3).val_grid_point(l,np,nt,nr) / (1 +app_hor.val_grid_point(1, np, nt, 0)/ rr.val_grid_point(l, np, nt, nr) - 1 / rr.val_grid_point(l, np, nt, nr) ) / (1 +app_hor.val_grid_point(1, np, nt, 0)/ rr.val_grid_point(l, np, nt, nr) - 1 / rr.val_grid_point(l, np, nt, nr) ) ; } /* gamma_uu.set(2,2).mult_r() ; gamma_uu.set(2,2).mult_r() ; gamma_uu.set(3,3).mult_rsint() ; gamma_uu.set(3,3).mult_rsint() ; gamma_uu.set(1,2).mult_r() ; gamma_uu.set(1,3).mult_rsint() ; // gamma_uu.set(2,3).mult_r() ; // gamma_uu.set(2,3).mult_rsint() ; */ cout << "gamma_uu(1,1)" << endl << norme(gamma_uu(1,1)) << endl ; cout << "gamma_uu(2,1)" << endl << norme(gamma_uu(2,1)) << endl ; cout << "gamma_uu(3,1)" << endl << norme(gamma_uu(3,1)) << endl ; cout << "gamma_uu(2,2)" << endl << norme(gamma_uu(2,2)) << endl ; cout << "gamma_uu(3,2)" << endl << norme(gamma_uu(3,2)) << endl ; cout << "gamma_uu(3,3)" << endl << norme(gamma_uu(3,3)) << endl ; kk_uu.inc_dzpuis(2) ; expa_trans.inc_dzpuis(2) ; Metric gamm (gamma_uu) ; // Updates gam_uu_evol.update(gamma_uu, jtime, the_time[jtime]) ; gam_dd_evol.update(gamm.cov(), jtime, the_time[jtime]) ; k_uu_evol.update(kk_uu, jtime, the_time[jtime]) ; if (p_psi4 != 0x0) { delete p_psi4 ; p_psi4 = 0x0 ; } if (p_ln_psi != 0x0) { delete p_ln_psi ; p_ln_psi = 0x0 ; } if (p_gamma != 0x0) { delete p_gamma ; p_gamma = 0x0 ; } if (p_tgamma != 0x0) { delete p_tgamma ; p_tgamma = 0x0 ; } if (p_hdirac != 0x0) { delete p_hdirac ; p_hdirac = 0x0 ; } k_dd_evol.downdate(jtime) ; psi_evol.downdate(jtime) ; hata_evol.downdate(jtime) ; aa_quad_evol.downdate(jtime) ; beta_evol.downdate(jtime) ; n_evol.downdate(jtime) ; hh_evol.downdate(jtime) ; Scalar new_expa (expansion()) ; //des_meridian(expa_trans, 1., 6., "Expansion trans", 1) ; //des_meridian(new_expa, 1.000000001, 6., "Expansion new", 2) ; //des_meridian(expa_trans- new_expa, 1.000000001, 4., "diff Expansion trans", 3) ; } }