/* * Copyright (c) 2001 Philippe Grandclement * * 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 bhole_equations_bin_C[] = "$Header: /cvsroot/Lorene/C++/Source/Bhole_binaire/bhole_equations_bin.C,v 1.5 2014/10/13 08:52:40 j_novak Exp $" ; /* * $Id: bhole_equations_bin.C,v 1.5 2014/10/13 08:52:40 j_novak Exp $ * $Log: bhole_equations_bin.C,v $ * Revision 1.5 2014/10/13 08:52:40 j_novak * Lorene classes and functions now belong to the namespace Lorene. * * Revision 1.4 2014/10/06 15:12:58 j_novak * Modified #include directives to use c++ syntax. * * Revision 1.3 2006/04/27 09:12:32 p_grandclement * First try at irrotational black holes * * Revision 1.2 2002/10/16 14:36:33 j_novak * Reorganization of #include instructions of standard C++, in order to * use experimental version 3 of gcc. * * Revision 1.1.1.1 2001/11/20 15:19:28 e_gourgoulhon * LORENE * * Revision 2.6 2001/05/07 09:11:56 phil * *** empty log message *** * * Revision 2.5 2001/04/30 09:30:50 phil * filtre pour poisson vectoriel * * Revision 2.4 2001/04/26 12:04:34 phil * *** empty log message *** * * Revision 2.3 2001/04/25 15:08:48 phil * vire fait_tkij * * Revision 2.2 2001/04/02 12:16:11 phil * *** empty log message *** * * Revision 2.1 2001/03/22 10:41:36 phil * modification prototypage * * Revision 2.0 2001/03/01 08:18:04 phil * *** empty log message *** * * * $Header: /cvsroot/Lorene/C++/Source/Bhole_binaire/bhole_equations_bin.C,v 1.5 2014/10/13 08:52:40 j_novak Exp $ * */ //standard #include #include // Lorene #include "nbr_spx.h" #include "tenseur.h" #include "bhole.h" #include "proto.h" #include "utilitaires.h" #include "graphique.h" // Resolution pour le lapse namespace Lorene { void Bhole_binaire::solve_lapse (double precision, double relax) { assert ((relax >0) && (relax<=1)) ; cout << "-----------------------------------------------" << endl ; cout << "Resolution LAPSE" << endl ; Tenseur lapse_un_old (hole1.n_auto) ; Tenseur lapse_deux_old (hole2.n_auto) ; Tenseur auxi_un (flat_scalar_prod(hole1.tkij_tot, hole1.tkij_auto)) ; Cmp kk_un (auxi_un(0, 0)+auxi_un(1, 1)+auxi_un(2, 2)) ; Tenseur auxi_deux (flat_scalar_prod(hole2.tkij_tot, hole2.tkij_auto)) ; Cmp kk_deux (auxi_deux(0, 0)+auxi_deux(1, 1)+auxi_deux(2, 2)) ; // Les sources Cmp source_un (-2*flat_scalar_prod(hole1.grad_n_tot, hole1.psi_auto.gradient())()/hole1.psi_tot() +hole1.n_tot()*pow(hole1.psi_tot(), 4.)*kk_un) ; source_un.std_base_scal() ; Cmp source_deux (-2*flat_scalar_prod(hole2.grad_n_tot, hole2.psi_auto.gradient())()/hole2.psi_tot() +hole2.n_tot()*pow(hole2.psi_tot(), 4.)*kk_deux) ; source_deux.std_base_scal() ; //On resout hole1.n_auto.set() = hole1.n_auto() - 1./2. ; hole2.n_auto.set() = hole2.n_auto() - 1./2. ; dirichlet_binaire (source_un, source_deux, -1., -1., hole1.n_auto.set(), hole2.n_auto.set(), 0, precision) ; hole1.n_auto.set() = hole1.n_auto() + 1./2. ; hole2.n_auto.set() = hole2.n_auto() + 1./2. ; hole1.n_auto.set().raccord(1) ; hole2.n_auto.set().raccord(1) ; // La relaxation : hole1.n_auto.set() = relax*hole1.n_auto() + (1-relax)*lapse_un_old() ; hole2.n_auto.set() = relax*hole2.n_auto() + (1-relax)*lapse_deux_old() ; hole1.fait_n_comp (hole2) ; hole2.fait_n_comp (hole1) ; } //Resolution sur Psi void Bhole_binaire::solve_psi (double precision, double relax) { assert ((relax>0) && (relax<=1)) ; cout << "-----------------------------------------------" << endl ; cout << "Resolution PSI" << endl ; Tenseur psi_un_old (hole1.psi_auto) ; Tenseur psi_deux_old (hole2.psi_auto) ; Tenseur auxi_un (flat_scalar_prod(hole1.tkij_tot, hole1.tkij_auto)) ; Cmp kk_un (auxi_un(0, 0)+auxi_un(1, 1)+auxi_un(2, 2)) ; Tenseur auxi_deux (flat_scalar_prod(hole2.tkij_tot, hole2.tkij_auto)) ; Cmp kk_deux (auxi_deux(0, 0)+auxi_deux(1, 1)+auxi_deux(2, 2)) ; // Les sources Cmp source_un (-pow(hole1.psi_tot(), 5.)*kk_un/8.) ; source_un.std_base_scal() ; Cmp source_deux (-pow(hole2.psi_tot(), 5.)*kk_deux/8.) ; source_deux.std_base_scal() ; // Les valeurs limites : int np_un = hole1.mp.get_mg()->get_np(1) ; int nt_un = hole1.mp.get_mg()->get_nt(1) ; Valeur lim_un (hole1.mp.get_mg()->get_angu()) ; lim_un = 1 ; for (int k=0 ; kget_np(1) ; int nt_deux = hole2.mp.get_mg()->get_nt(1) ; Valeur lim_deux (hole2.mp.get_mg()->get_angu()) ; lim_deux = 1 ; for (int k=0 ; k