/* * Methods of Bin_star::helical * * (see file star.h for documentation) * */ /* * Copyright (c) 2006 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_helical_C[] = "$Header: /cvsroot/Lorene/C++/Source/Binary/binary_helical.C,v 1.6 2014/10/13 08:52:45 j_novak Exp $" ; /* * $Id: binary_helical.C,v 1.6 2014/10/13 08:52:45 j_novak Exp $ * $Log: binary_helical.C,v $ * Revision 1.6 2014/10/13 08:52:45 j_novak * Lorene classes and functions now belong to the namespace Lorene. * * Revision 1.5 2014/10/06 15:12:59 j_novak * Modified #include directives to use c++ syntax. * * Revision 1.4 2008/08/19 06:41:59 j_novak * Minor modifications to avoid warnings with gcc 4.3. Most of them concern * cast-type operations, and constant strings that must be defined as const char* * * Revision 1.3 2006/08/01 14:26:50 f_limousin * Small changes * * Revision 1.2 2006/06/05 17:05:57 f_limousin * *** empty log message *** * * Revision 1.1 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... * * * $Header: /cvsroot/Lorene/C++/Source/Binary/binary_helical.C,v 1.6 2014/10/13 08:52:45 j_novak Exp $ * */ // C headers #include // Lorene headers #include "cmp.h" #include "tenseur.h" #include "metrique.h" #include "binary.h" #include "param.h" #include "graphique.h" #include "utilitaires.h" #include "tensor.h" #include "nbr_spx.h" #include "unites.h" namespace Lorene { void Binary::helical(){ // Fundamental constants and units // ------------------------------- using namespace Unites ; Sym_tensor lie_aij_1 (star1.mp, CON, star1.mp.get_bvect_cart()) ; Sym_tensor lie_aij_2 (star2.mp, CON, star2.mp.get_bvect_cart()) ; Scalar lie_K_1 (star1.mp) ; Scalar lie_K_2 (star2.mp) ; for (int ll=1; ll<=2; ll++) { Star_bin star_i (*et[ll-1]) ; Map& mp = star_i.mp ; const Mg3d* mg = mp.get_mg() ; int nz = mg->get_nzone() ; // total number of domains Metric_flat flat = star_i.flat ; Metric gtilde = star_i.gtilde ; Scalar nn = star_i.nn ; Scalar psi4 = star_i.psi4 ; // ------------------------------- // AUXILIARY QUANTITIES // ------------------------------- // Derivatives of N and logN //-------------------------- const Vector dcov_logn_auto = star_i.logn_auto.derive_cov(flat) ; Tensor dcovdcov_logn_auto = (star_i.logn_auto.derive_cov(flat)) .derive_cov(flat) ; dcovdcov_logn_auto.inc_dzpuis() ; // Derivatives of lnq, phi and Q //------------------------------- const Scalar phi (0.5 * (star_i.lnq - star_i.logn)) ; const Scalar phi_auto (0.5 * (star_i.lnq_auto - star_i.logn_auto)) ; const Vector dcov_phi_auto = phi_auto.derive_cov(flat) ; const Vector dcov_lnq = 2*star_i.dcov_phi + star_i.dcov_logn ; const Vector dcon_lnq = 2*star_i.dcon_phi + star_i.dcon_logn ; const Vector dcov_lnq_auto = star_i.lnq_auto.derive_cov(flat) ; Tensor dcovdcov_lnq_auto = dcov_lnq_auto.derive_cov(flat) ; dcovdcov_lnq_auto.inc_dzpuis() ; Scalar qq = exp(star_i.lnq) ; qq.std_spectral_base() ; const Vector& dcov_qq = qq.derive_cov(flat) ; Tensor dcovdcov_beta_auto = star_i.beta_auto.derive_cov(flat) .derive_cov(flat) ; dcovdcov_beta_auto.inc_dzpuis() ; // Derivatives of hij, gtilde... //------------------------------ Scalar psi2 (pow(star_i.psi4, 0.5)) ; psi2.std_spectral_base() ; const Tensor& dcov_hij = star_i.hij.derive_cov(flat) ; const Tensor& dcon_hij = star_i.hij.derive_con(flat) ; const Tensor& dcov_hij_auto = star_i.hij_auto.derive_cov(flat) ; const Sym_tensor& gtilde_cov = star_i.gtilde.cov() ; const Sym_tensor& gtilde_con = star_i.gtilde.con() ; const Tensor& dcov_gtilde = gtilde_cov.derive_cov(flat) ; // H^i and its derivatives ( = O in Dirac gauge) // --------------------------------------------- double lambda_dirac = 0. ; const Vector hdirac = lambda_dirac * star_i.hij.divergence(flat) ; const Vector hdirac_auto = lambda_dirac * star_i.hij_auto.divergence(flat) ; Tensor dcov_hdirac = lambda_dirac * hdirac.derive_cov(flat) ; dcov_hdirac.inc_dzpuis() ; Tensor dcov_hdirac_auto = lambda_dirac * hdirac_auto.derive_cov(flat) ; dcov_hdirac_auto.inc_dzpuis() ; Tensor dcon_hdirac_auto = lambda_dirac * hdirac_auto.derive_con(flat) ; dcon_hdirac_auto.inc_dzpuis() ; // Function exp(-(r-r_0)^2/sigma^2) // -------------------------------- double r0 = mp.val_r(nz-2, 1, 0, 0) ; double sigma = 1.*r0 ; double om = omega ; Scalar rr (mp) ; rr = mp.r ; Scalar ff (mp) ; ff = exp( -(rr - r0)*(rr - r0)/sigma/sigma ) ; for (int ii=0; iiget_nzone() ; // Construction of an auxiliar grid and mapping (Last domain is at lambda) double* bornes = new double [6] ; bornes[nz] = __infinity ; bornes[4] = M_PI / omega ; bornes[3] = M_PI / omega * 0.5 ; bornes[2] = M_PI / omega * 0.2 ; bornes[1] = M_PI / omega * 0.1 ; bornes[0] = 0 ; Map_af mapping (*(star1.mp.get_mg()), bornes) ; delete [] bornes ; Sym_tensor lie_aij2_1 (star1.mp, CON, star1.mp.get_bvect_cart()) ; Sym_tensor lie_aij_tot_1 (star1.mp, CON, star1.mp.get_bvect_cart()) ; Sym_tensor lie_aij_tot (mapping, CON, mapping.get_bvect_cart()) ; Scalar lie_K2_1 (star1.mp) ; lie_K2_1.set_etat_qcq() ; Scalar lie_K_tot_1 (star1.mp) ; // Importation on the mapping 1 // ------------------------------- lie_K2_1.import(lie_K_2) ; lie_K_tot_1 = lie_K_1 + lie_K2_1 ; lie_K_tot_1.inc_dzpuis(2) ; lie_aij_2.change_triad(star1.mp.get_bvect_cart()) ; for(int i=1; i<=3; i++) for(int j=1; j<=i; j++) { lie_aij2_1.set(i,j).import(lie_aij_2(i,j)) ; lie_aij2_1.set(i,j).set_spectral_va().set_base(lie_aij_2(i,j). get_spectral_va().get_base()) ; } lie_aij_tot_1 = lie_aij_1 + lie_aij2_1 ; lie_aij_tot_1.inc_dzpuis(2) ; Sym_tensor lie_kij_tot (star1.mp, CON, star1.mp.get_bvect_cart()) ; lie_kij_tot = lie_aij_tot_1/star1.psi4 + 1./3.*star1.gamma.con()* lie_K_tot_1 ; cout << " IN THE CENTER OF STAR 1 " << endl << " ----------------------- " << endl ; /* cout << " components xx, xy, yy, xz, yz, zz" << endl ; for(int i=1; i<=3; i++) for(int j=1; j<=i; j++) { Scalar resu(lie_kij_tot(i,j)*lie_kij_tot(i,j)) ; cout << "i = " << i << ", j = " << j << endl ; cout << "norme de la diff " << endl << norme(resu)/(nr*nt*np) << endl ; // Computation of the integral // ----------------------------- Tbl integral (nz) ; integral.annule_hard() ; Tbl integ (resu.integrale_domains()) ; for (int mm=0; mm