bhole_solve_phi.C
/*
* 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_solve_phi_C[] = "$Header: /cvsroot/Lorene/C++/Source/Bhole_binaire/bhole_solve_phi.C,v 1.4 2014/10/13 08:52:40 j_novak Exp $" ;
/*
* $Id: bhole_solve_phi.C,v 1.4 2014/10/13 08:52:40 j_novak Exp $
* $Log: bhole_solve_phi.C,v $
* Revision 1.4 2014/10/13 08:52:40 j_novak
* Lorene classes and functions now belong to the namespace Lorene.
*
* Revision 1.3 2014/10/06 15:12:58 j_novak
* Modified #include directives to use c++ syntax.
*
* 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.3 2001/04/26 12:06:44 phil
* *** empty log message ***
*
* Revision 2.2 2001/04/06 08:56:49 phil
* *** empty log message ***
*
* Revision 2.1 2001/04/05 13:42:46 phil
* *** empty log message ***
*
* Revision 2.0 2001/04/05 13:35:14 phil
* *** empty log message ***
*
*
* $Header: /cvsroot/Lorene/C++/Source/Bhole_binaire/bhole_solve_phi.C,v 1.4 2014/10/13 08:52:40 j_novak Exp $
*
*/
//standard
#include <cstdlib>
#include <cmath>
// Lorene
#include "nbr_spx.h"
#include "tenseur.h"
#include "bhole.h"
#include "proto.h"
#include "utilitaires.h"
#include "graphique.h"
namespace Lorene {
void Bhole::init_bhole_phi () {
Cmp auxi(mp) ;
auxi = 1./2.-2*rayon/mp.r ;
auxi.annule(0);
auxi.set_dzpuis(0) ;
n_auto = auxi;
n_comp = 0 ; n_tot = 0;
n_auto.set_std_base() ;
n_auto.set().raccord(1) ;
auxi = log (1+rayon/mp.r) ;
auxi.annule(0);
auxi.set_dzpuis(0) ;
psi_auto = auxi;
psi_comp = 0 ; psi_tot = 0;
psi_auto.set_std_base() ;
psi_auto.set().raccord(1) ;
grad_n_tot = n_auto.gradient() ;
grad_psi_tot = psi_auto.gradient() ;
shift_auto.set_etat_zero() ;
taij_auto.set_etat_zero();
taij_comp.set_etat_zero();
taij_tot.set_etat_zero() ;
tkij_auto.set_etat_zero() ;
tkij_tot.set_etat_zero();
decouple.set_etat_zero() ;
}
void Bhole_binaire::solve_phi (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) ;
// Les sources totales, raccordees dans les zec
Cmp source_un (-flat_scalar_prod(hole1.grad_psi_tot,
hole1.psi_auto.gradient())()) ;
source_un.std_base_scal() ;
Cmp source_deux (-flat_scalar_prod(hole2.grad_psi_tot,
hole2.psi_auto.gradient())()) ;
source_deux.std_base_scal() ;
// Les valeurs limites :
Valeur lim_un (hole1.mp.get_mg()->get_angu()) ;
lim_un = -0.5/hole1.rayon ;
lim_un.std_base_scal() ;
Valeur lim_deux (hole2.mp.get_mg()->get_angu()) ;
lim_deux = -0.5/hole2.rayon ;
lim_deux.std_base_scal() ;
//On resout
neumann_binaire (source_un, source_deux, lim_un, lim_deux,
hole1.psi_auto.set(), hole2.psi_auto.set(), 0, precision) ;
hole1.psi_auto.set().raccord(1) ;
hole2.psi_auto.set().raccord(1) ;
//On verifie qu on a bien resolu :
cout << diffrelmax (source_un, hole1.psi_auto().laplacien(4)) << endl ;
cout << diffrelmax (source_deux, hole2.psi_auto().laplacien(4)) << endl ;
// La relaxation :
hole1.psi_auto.set() = relax*hole1.psi_auto() + (1-relax)*psi_un_old() ;
hole2.psi_auto.set() = relax*hole2.psi_auto() + (1-relax)*psi_deux_old() ;
hole1.fait_psi_comp (hole2) ;
hole2.fait_psi_comp (hole1) ;
}
void Bhole_binaire::init_phi() {
set_omega (0) ;
hole1.init_bhole_phi() ;
hole2.init_bhole_phi() ;
hole1.fait_psi_comp(hole2) ;
hole2.fait_psi_comp(hole1) ;
}
}
Lorene::Bhole_binaire::hole1
Bhole hole1
Black hole one.
Definition bhole.h:762
Lorene::Bhole_binaire::set_omega
void set_omega(double ome)
Sets the orbital velocity to ome.
Definition bhole.h:791
Lorene::Bhole_binaire::solve_phi
void solve_phi(double precision, double relax)
Solve the equation for the logarithm of .
Definition bhole_solve_phi.C:108
Lorene::Bhole_binaire::hole2
Bhole hole2
Black hole two.
Definition bhole.h:763
Lorene::Bhole_binaire::init_phi
void init_phi()
Initiates the system for a resolution using the logarithm of .
Definition bhole_solve_phi.C:155
Lorene::Bhole::psi_auto
Tenseur psi_auto
Part of generated by the hole.
Definition bhole.h:290
Lorene::Bhole::shift_auto
Tenseur shift_auto
Part of generated by the hole.
Definition bhole.h:297
Lorene::Bhole::psi_tot
Tenseur psi_tot
Total .
Definition bhole.h:292
Lorene::Bhole::psi_comp
Tenseur psi_comp
Part of generated by the companion hole.
Definition bhole.h:291
Lorene::Bhole::tkij_auto
Tenseur_sym tkij_auto
Auto .
Definition bhole.h:307
Lorene::Bhole::init_bhole_phi
void init_bhole_phi()
Initiates the black hole for a resolution with .
Definition bhole_solve_phi.C:75
Lorene::Bhole::grad_psi_tot
Tenseur grad_psi_tot
Total gradient of .
Definition bhole.h:295
Lorene::Bhole::taij_auto
Tenseur_sym taij_auto
Part of generated by the hole.
Definition bhole.h:299
Lorene::Bhole::grad_n_tot
Tenseur grad_n_tot
Total gradient of N .
Definition bhole.h:294
Lorene::Bhole::n_auto
Tenseur n_auto
Part of N generated by the hole.
Definition bhole.h:286
Lorene::Bhole::taij_comp
Tenseur_sym taij_comp
Part of generated by the companion hole.
Definition bhole.h:300
Lorene::Bhole::rayon
double rayon
Radius of the horizon in LORENE's units.
Definition bhole.h:274
Lorene::Bhole::n_comp
Tenseur n_comp
Part of N generated by the companion hole.
Definition bhole.h:287
Lorene::Bhole::mp
Map_af & mp
Affine mapping.
Definition bhole.h:273
Lorene::Bhole::taij_tot
Tenseur_sym taij_tot
Total , which must be zero on the horizon of the regularisation on the shift has been done.
Definition bhole.h:305
Lorene::Bhole::n_tot
Tenseur n_tot
Total N .
Definition bhole.h:288
Lorene::Bhole::tkij_tot
Tenseur_sym tkij_tot
Total .
Definition bhole.h:308
Lorene::Bhole::decouple
Cmp decouple
Function used to construct the part of generated by the hole from the total .
Definition bhole.h:318
Lorene::Cmp
Component of a tensorial field *** DEPRECATED : use class Scalar instead ***.
Definition cmp.h:446
Lorene::Cmp::std_base_scal
void std_base_scal()
Sets the spectral bases of the Valeur va to the standard ones for a scalar.
Definition cmp.C:644
Lorene::Cmp::annule
void annule(int l)
Sets the Cmp to zero in a given domain.
Definition cmp.C:348
Lorene::Cmp::set_dzpuis
void set_dzpuis(int)
Set a value to dzpuis.
Definition cmp.C:654
Lorene::Tenseur
Tensor handling *** DEPRECATED : use class Tensor instead ***.
Definition tenseur.h:301
Lorene::Valeur
Values and coefficients of a (real-value) function.
Definition valeur.h:287
Lorene::Valeur::std_base_scal
void std_base_scal()
Sets the bases for spectral expansions (member base ) to the standard ones for a scalar.
Definition valeur.C:824
Lorene::diffrelmax
Tbl diffrelmax(const Cmp &a, const Cmp &b)
Relative difference between two Cmp (max version).
Definition cmp_math.C:539
Lorene::log
Cmp log(const Cmp &)
Neperian logarithm.
Definition cmp_math.C:296
Lorene::flat_scalar_prod
Tenseur flat_scalar_prod(const Tenseur &t1, const Tenseur &t2)
Scalar product of two Tenseur when the metric is : performs the contraction of the last index of t1 w...
Definition tenseur_operateur.C:653
Lorene
Lorene prototypes.
Definition app_hor.h:64