/* * Methods of Bin_star::dirac_gauge * * (see file star.h for documentation) * */ /* * Copyright (c) 2005 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 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 * */ char binary_dirac_C[] = "$Header: /cvsroot/Lorene/C++/Source/Binary/binary_dirac.C,v 1.3 2014/10/13 08:52:44 j_novak Exp $" ; /* * $Id: binary_dirac.C,v 1.3 2014/10/13 08:52:44 j_novak Exp $ * $Log: binary_dirac.C,v $ * Revision 1.3 2014/10/13 08:52:44 j_novak * Lorene classes and functions now belong to the namespace Lorene. * * Revision 1.2 2006/04/11 14:25:15 f_limousin * New version of the code : improvement of the computation of some * critical sources, estimation of the dirac gauge, helical symmetry... * * Revision 1.1 2005/11/08 20:17:01 f_limousin * Function used to impose Dirac gauge during an iteration. * * * $Header: /cvsroot/Lorene/C++/Source/Binary/binary_dirac.C,v 1.3 2014/10/13 08:52:44 j_novak Exp $ * */ // Headers Lorene #include "tenseur.h" #include "binary.h" #include "star.h" #include "graphique.h" #include "utilitaires.h" #include "param.h" namespace Lorene { void Binary::dirac_gauge() { int nz = star1.mp.get_mg()->get_nzone() ; int nr = star1.mp.get_mg()->get_nr(0); int nt = star1.mp.get_mg()->get_nt(0); int np = star1.mp.get_mg()->get_np(0); // Importations // ------------ // Star 1 star1.hij_comp.set_triad(star1.mp.get_bvect_cart()) ; Sym_tensor comp_hij1(star2.hij_auto) ; comp_hij1.change_triad(star2.mp.get_bvect_cart()) ; comp_hij1.change_triad(star1.mp.get_bvect_cart()) ; assert ( *(star1.hij_comp.get_triad()) == *(comp_hij1.get_triad())) ; for(int i=1; i<=3; i++) for(int j=i; j<=3; j++) { star1.hij_comp.set(i,j).set_etat_qcq() ; star1.hij_comp.set(i,j).import( (comp_hij1)(i,j) ) ; } star1.hij_comp.std_spectral_base() ;//set the bases for spectral expansions for(int i=1; i<=3; i++) for(int j=i; j<=3; j++) star1.hij.set(i,j) = star1.hij_auto(i,j) + star1.hij_comp(i,j) ; // Star 2 star2.hij_comp.set_triad(star2.mp.get_bvect_cart()) ; Sym_tensor comp_hij2(star1.hij_auto) ; comp_hij2.change_triad(star1.mp.get_bvect_cart()) ; comp_hij2.change_triad(star2.mp.get_bvect_cart()) ; assert ( *(star2.hij_comp.get_triad()) == *(comp_hij2.get_triad())) ; for(int i=1; i<=3; i++) for(int j=i; j<=3; j++) { star2.hij_comp.set(i,j).set_etat_qcq() ; star2.hij_comp.set(i,j).import( (comp_hij2)(i,j) ) ; } star2.hij_comp.std_spectral_base() ;//set the bases for spectral expansions for(int i=1; i<=3; i++) for(int j=i; j<=3; j++) star2.hij.set(i,j) = star2.hij_auto(i,j) + star2.hij_comp(i,j) ; // ----------------------------------------- // Resolution of the Poisson equation for xi // ----------------------------------------- cout << "Function Binary::dirac_gauge()" << endl ; // Star 1 // ---------- int mermax = 50 ; double precis = 1e-5 ; double precis_poisson = 1e-14 ; double relax_poisson = 1.5 ; int mer_poisson = 4 ; Scalar rr1 (star1.mp) ; rr1 = star1.mp.r ; Scalar rr2 (star2.mp) ; rr2 = star2.mp.r ; Vector xi1(star1.mp, CON, star1.mp.get_bvect_cart()) ; xi1.set(1) = 0. ; xi1.set(2) = 0. ; xi1.set(3) = 0. ; xi1.std_spectral_base() ; Vector xi1_old(xi1) ; Scalar ssjm1_xi11 (xi1(1)) ; Scalar ssjm1_xi12 (xi1(2)) ; Scalar ssjm1_xi13 (xi1(3)) ; for(int mer=0; mer erreur) erreur = diff(i) ; cout << "Step : " << mer << " Difference : " << erreur << endl ; cout << "-------------------------------------" << endl ; if (erreur < precis) mer = mermax ; } // Star 2 // ---------- Vector xi2(star2.mp, CON, star2.mp.get_bvect_cart()) ; xi2.set(1) = 0. ; xi2.set(2) = 0. ; xi2.set(3) = 0. ; xi2.std_spectral_base() ; Vector xi2_old(xi2) ; Scalar ssjm1_xi21 (xi2(1)) ; Scalar ssjm1_xi22 (xi2(2)) ; Scalar ssjm1_xi23 (xi2(3)) ; for(int mer=0; mer erreur) erreur = diff(i) ; cout << "Step : " << mer << " Difference : " << erreur << endl ; cout << "-------------------------------------" << endl ; if (erreur < precis) mer = mermax ; } // ----------------------------- // Computation of the new metric // ----------------------------- // Star 1 // ------- Sym_tensor guu_dirac1 (star1.mp, CON, star1.mp.get_bvect_cart()) ; guu_dirac1 = star1.gamma.con().derive_lie(xi1) ; guu_dirac1.dec_dzpuis(2) ; guu_dirac1 = guu_dirac1 + star1.gamma.con() ; star1.gamma = guu_dirac1 ; Sym_tensor gtilde_con1(star1.mp, CON, star1.mp.get_bvect_cart()) ; Sym_tensor hij_dirac1(star1.mp, CON, star1.mp.get_bvect_cart()) ; gtilde_con1 = pow(star1.gamma.determinant(), 1./3.) * guu_dirac1 ; gtilde_con1.std_spectral_base() ; for(int i=1; i<=3; i++) for(int j=i; j<=3; j++) hij_dirac1.set(i,j) = gtilde_con1(i,j) - star1.flat.con()(i,j) ; star1.gtilde = gtilde_con1 ; star1.psi4 = pow(star1.gamma.determinant(), 1./3.) ; star1.psi4.std_spectral_base() ; cout << "norme de h_uu avant :" << endl ; for (int i=1; i<=3; i++) for (int j=1; j<=i; j++) { cout << " Comp. " << i << " " << j << " : " ; for (int l=0; l