/* * Method of class Isol_Hole to compute metric data associated to a quasistationary single * black hole spacetime slice. * * (see file isol_hole.h for documentation). * */ /* * Copyright (c) 2009 Nicolas Vasset * * 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 as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * 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 * */ // Headers Lorene #include "param_elliptic.h" #include "proto.h" #include "excised_slice.h" #include "unites.h" namespace Lorene { void Excised_slice::compute_stat_metric(double precis, double Omega, bool NorKappa, Scalar boundNoK, bool isCF,double relax, int mer_max, int mer_max2, bool isvoid) { // Fundamental constants and units // ------------------------------- using namespace Unites ; // Verifying that we are in the right case assert(type_hor==1); // Noticing the user that the iteration has started cout << "================================================================" << endl; cout << "STARTING THE MAIN ITERATION FOR COMPUTING METRIC FIELDS" << endl; cout << " iteration parameters are the following: " << endl; cout << " convergence precision required:" << precis << endl; cout << " max number of global steps :" << mer_max << endl; cout << " relaxation parameter :" << relax << endl; cout << "================================================================" << endl; // Construction of a multi-grid (Mg3d) and an affine mapping from the class mapping // -------------------------------------------------------------------------------- const Map_af* map = dynamic_cast(&mp) ; const Mg3d* mgrid = (*map).get_mg(); // Construct angular grid for h(theta,phi) const Mg3d* g_angu = (*mgrid).get_angu_1dom() ; const int nz = (*mgrid).get_nzone(); // Number of domains int nt = (*mgrid).get_nt(1); // Number of collocation points in theta in each domain const int np = (*mgrid).get_np(1); const Coord& rr = (*map).r; Scalar rrr (*map) ; rrr = rr ; rrr.std_spectral_base(); // For now the code handles only horizons at r=1, corresponding to the first shell // inner boundary. This test assures this is the case with our mapping. assert((rrr.val_grid_point(1,0,0,0) - 1.) <= 1.e-9); // Angular mapping defined as well //-------------------------------- double r_limits2[] = {rrr.val_grid_point(1,0,0,0), rrr.val_grid_point(2,0,0,0)} ; const Map_af map_2(*g_angu, r_limits2); //2D mapping; check if this is useful. const Metric_flat& mets = (*map).flat_met_spher() ; //---------------- // Initializations // --------------- Scalar logn (*map) ; logn = log(lapse) ; logn.std_spectral_base(); Scalar logpsi(*map) ; logpsi = log(conf_fact) ; logpsi.std_spectral_base(); Scalar psi4 (*map) ; psi4 = conf_fact*conf_fact*conf_fact*conf_fact ; Scalar npsi (*map) ; npsi =conf_fact*lapse ; Scalar conf_fact_new(*map) ; conf_fact_new.annule_hard(); conf_fact_new.std_spectral_base(); Scalar npsi_new(*map); npsi_new.annule_hard(); npsi_new.std_spectral_base(); Vector shift_new (*map, CON, (*map).get_bvect_spher()); for(int i=1; i<=3; i++){ shift_new.set(i)=0; } shift_new.std_spectral_base(); // Non conformally flat variables //------------------------------- Sym_tensor gamtuu = mets.con() + hij; Metric gamt(gamtuu); Metric gam(gamt.cov()*psi4) ; Sym_tensor gamma = gam.cov(); // Extrinsic curvature variables //------------------------------ Sym_tensor aa(*map, CON, (*map).get_bvect_spher()); for (int iii= 1; iii<=3; iii++){ for(int j=1; j<=3; j++){ aa.set(iii,j)= 0; } } aa.std_spectral_base(); Scalar aa_quad_scal(*map) ; aa_quad_scal = 0. ; Sym_tensor aa_hat(*map, CON, (*map).get_bvect_spher()); for (int iii= 1; iii<=3; iii++){ for(int j=1; j<=3; j++){ aa_hat.set(iii,j)= 0; } } Sym_tensor kuu = aa/psi4 ; Sym_tensor kuu2 = aa_hat/(psi4*psi4*sqrt(psi4)); Sym_tensor kdd = contract (gamma, 0, contract(gamma, 1, kuu, 0),1); // (2,1)-rank delta tensor: difference between ricci rotation coefficients. //------------------------------------------------------------------------- Tensor delta = -0.5*contract( hij, 1, gamt.cov().derive_cov(mets), 2); Scalar tmp(*map); for (int i=1; i<=3; i++) { for (int j=1; j<=3; j++) { for (int k=1; k<=3; k++) { tmp = 0.; tmp = -0.5 *(gamt.cov().derive_con(mets))(i,j,k); for (int l=1; l<=3; l++) { tmp += -0.5*( gamt.cov()(i,l)*(hij.derive_cov(mets))(k,l,j) + gamt.cov()(l,j)*(hij.derive_cov(mets))(k,l,i)); } delta.set(k,i,j) += tmp ; } } } // Conformal Rstar scalar(eq 61, Bonazzola et al. 2003) Scalar Rstar = 0.25 * contract(gamt.con(), 0, 1, contract(hij.derive_cov(mets), 0, 1, gamt.cov().derive_cov(mets), 0, 1), 0, 1 ) - 0.5 * contract(gamt.con(), 0, 1, contract(hij.derive_cov(mets), 0, 1, gamt.cov().derive_cov(mets), 0, 2), 0, 1 ) ; Scalar norm(*map); Scalar norm3(*map); if (isvoid == false){ cout <<"FAIL: case of non-void spacetime not treated yet" << endl; } else { // Parameters for the iteration //----------------------------- double diff_ent = 1 ; // initialization of difference marker between two iterations; int util = 0; // Tool used to stop tensorial iteration at any wished step "util" ////////////////////////////////////////////////////////////////////////////////////////////////// ///////////// ITERATION //////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////// for(int mer=0 ;(diff_ent > precis) && (mer precis2) && (mer2