hole_bhns_upmetr.C
/*
* Method of class Hole_bhns to compute metric quantities from
* the companion neutron-star and total metric quantities
*
* (see file hole_bhns.h for documentation).
*
*/
/*
* Copyright (c) 2005-2007 Keisuke Taniguchi
*
* 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 version 2
* as published by the Free Software Foundation.
*
* 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 hole_bhns_upmetr_C[] = "$Header: /cvsroot/Lorene/C++/Source/Hole_bhns/hole_bhns_upmetr.C,v 1.3 2014/10/13 08:53:00 j_novak Exp $" ;
/*
* $Id: hole_bhns_upmetr.C,v 1.3 2014/10/13 08:53:00 j_novak Exp $
* $Log: hole_bhns_upmetr.C,v $
* Revision 1.3 2014/10/13 08:53:00 j_novak
* Lorene classes and functions now belong to the namespace Lorene.
*
* Revision 1.2 2008/05/15 19:08:15 k_taniguchi
* Change of some parameters.
*
* Revision 1.1 2007/06/22 01:25:31 k_taniguchi
* *** empty log message ***
*
*
* $Header: /cvsroot/Lorene/C++/Source/Hole_bhns/hole_bhns_upmetr.C,v 1.3 2014/10/13 08:53:00 j_novak Exp $
*
*/
// C++ headers
//#include <>
// C headers
//#include <>
// Lorene headers
#include "hole_bhns.h"
#include "star_bhns.h"
#include "utilitaires.h"
#include "unites.h"
namespace Lorene {
void Hole_bhns::update_metric_bhns(const Star_bhns& star,
const Hole_bhns& hole_prev,
double relax) {
// Fundamental constants and units
// -------------------------------
using namespace Unites ;
//-----------------------------------------------------
// Computation of quantities coming from the companion
//-----------------------------------------------------
const Map& mp_ns (star.get_mp()) ;
double mass = ggrav * mass_bh ;
// Lapconf function
// ----------------
if ( (star.get_lapconf_auto()).get_etat() == ETATZERO ) {
lapconf_comp.set_etat_zero() ;
}
else {
lapconf_comp.set_etat_qcq() ;
lapconf_comp.import( star.get_lapconf_auto() ) ;
lapconf_comp.std_spectral_base() ;
}
// Shift vector
// ------------
if ( (star.get_shift_auto())(2).get_etat() == ETATZERO ) {
assert( (star.get_shift_auto())(1).get_etat() == ETATZERO ) ;
assert( (star.get_shift_auto())(3).get_etat() == ETATZERO ) ;
shift_comp.set_etat_zero() ;
}
else {
shift_comp.set_etat_qcq() ;
shift_comp.set_triad(mp.get_bvect_cart()) ;
Vector comp_shift(star.get_shift_auto()) ;
comp_shift.change_triad(mp_ns.get_bvect_cart()) ;
comp_shift.change_triad(mp.get_bvect_cart()) ;
assert( *(shift_comp.get_triad()) == *(comp_shift.get_triad()) ) ;
(shift_comp.set(1)).import( comp_shift(1) ) ;
(shift_comp.set(2)).import( comp_shift(2) ) ;
(shift_comp.set(3)).import( comp_shift(3) ) ;
shift_comp.std_spectral_base() ;
}
// Conformal factor
// ----------------
if ( (star.get_confo_auto()).get_etat() == ETATZERO ) {
confo_comp.set_etat_zero() ;
}
else {
confo_comp.set_etat_qcq() ;
confo_comp.import( star.get_confo_auto() ) ;
confo_comp.std_spectral_base() ;
}
//----------------------------------------------------
// Relaxation on lapconf_comp, shift_comp, confo_comp
//----------------------------------------------------
double relax_jm1 = 1. - relax ;
lapconf_comp = relax * lapconf_comp
+ relax_jm1 * (hole_prev.lapconf_comp) ;
shift_comp = relax * shift_comp + relax_jm1 * (hole_prev.shift_comp) ;
confo_comp = relax * confo_comp + relax_jm1 * (hole_prev.confo_comp) ;
// Coordinates
// -----------
Scalar rr(mp) ;
rr = mp.r ;
rr.std_spectral_base() ;
Scalar st(mp) ;
st = mp.sint ;
st.std_spectral_base() ;
Scalar ct(mp) ;
ct = mp.cost ;
ct.std_spectral_base() ;
Scalar sp(mp) ;
sp = mp.sinp ;
sp.std_spectral_base() ;
Scalar cp(mp) ;
cp = mp.cosp ;
cp.std_spectral_base() ;
Vector ll(mp, CON, mp.get_bvect_cart()) ;
ll.set_etat_qcq() ;
ll.set(1) = st % cp ;
ll.set(2) = st % sp ;
ll.set(3) = ct ;
ll.std_spectral_base() ;
if (kerrschild) {
//----------------------------------------------
// Metric quantities from the analytic solution
//----------------------------------------------
lapconf_auto_bh = 1. / sqrt(1.+2.*mass/rr) ;
lapconf_auto_bh.std_spectral_base() ;
lapconf_auto_bh.annule_domain(0) ;
lapconf_auto_bh.raccord(1) ;
confo_auto_bh = 1. ;
confo_auto_bh.std_spectral_base() ;
shift_auto_bh = 2. * lapconf_auto_bh*lapconf_auto_bh*mass * ll / rr ;
shift_auto_bh.std_spectral_base() ;
shift_auto_bh.annule_domain(0) ;
//---------------------------------
// Derivative of metric quantities
//---------------------------------
d_lapconf_auto_rs.set_etat_qcq() ;
for (int i=1; i<=3; i++)
d_lapconf_auto_rs.set(i) = lapconf_auto_rs.deriv(i) ;
d_lapconf_auto_rs.std_spectral_base() ;
d_lapconf_auto_bh.set_etat_qcq() ;
for (int i=1; i<=3; i++) {
d_lapconf_auto_bh.set(i) = pow(lapconf_auto_bh,3.) * mass * ll(i)
/ rr / rr ;
}
d_lapconf_auto_bh.std_spectral_base() ;
d_lapconf_auto_bh.annule_domain(0) ;
d_lapconf_auto_bh.inc_dzpuis(2) ;
d_lapconf_auto = d_lapconf_auto_rs + d_lapconf_auto_bh ;
d_lapconf_auto.std_spectral_base() ;
d_shift_auto_rs.set_etat_qcq() ;
for (int i=1; i<=3; i++) {
for (int j=1; j<=3; j++) {
d_shift_auto_rs.set(i,j) = shift_auto_rs(j).deriv(i) ;
}
}
d_shift_auto_rs.std_spectral_base() ;
d_shift_auto_bh.set_etat_qcq() ;
for (int i=1; i<=3; i++) {
for (int j=1; j<=3; j++) {
d_shift_auto_bh.set(i,j) = 2.*lapconf_auto_bh
*lapconf_auto_bh*mass
* (flat.con()(i,j)
- 2.*lapconf_auto_bh*lapconf_auto_bh*(1.+mass/rr)
* ll(i) * ll(j))
/ rr / rr ;
}
}
d_shift_auto_bh.std_spectral_base() ;
d_shift_auto_bh.annule_domain(0) ;
d_shift_auto_bh.inc_dzpuis(2) ;
d_shift_auto = d_shift_auto_rs + d_shift_auto_bh ;
d_shift_auto.std_spectral_base() ;
d_confo_auto_rs.set_etat_qcq() ;
for (int i=1; i<=3; i++)
d_confo_auto_rs.set(i) = confo_auto_rs.deriv(i) ;
d_confo_auto_rs.std_spectral_base() ;
d_confo_auto_bh.set_etat_qcq() ;
for (int i=1; i<=3; i++)
d_confo_auto_bh.set(i) = 0. ;
d_confo_auto_bh.std_spectral_base() ;
d_confo_auto = d_confo_auto_rs + d_confo_auto_bh ;
d_confo_auto.std_spectral_base() ;
}
else { // Isotropic coordinates with the maximal slicing
// Sets C/M^2 for each case of the lapse boundary condition
// --------------------------------------------------------
double cc ;
if (bc_lapconf_nd) { // Neumann boundary condition
if (bc_lapconf_fs) { // First condition
// d(\alpha \psi)/dr = 0
// ---------------------
cc = 2. * (sqrt(13.) - 1.) / 3. ;
}
else { // Second condition
// d(\alpha \psi)/dr = (\alpha \psi)/(2 rah)
// -----------------------------------------
cc = 4. / 3. ;
}
}
else { // Dirichlet boundary condition
if (bc_lapconf_fs) { // First condition
// (\alpha \psi) = 1/2
// -------------------
cout << "!!!!! WARNING: Not yet prepared !!!!!" << endl ;
abort() ;
}
else { // Second condition
// (\alpha \psi) = 1/sqrt(2.) \psi_KS
// -----------------------------------
cout << "!!!!! WARNING: Not yet prepared !!!!!" << endl ;
abort() ;
// cc = 2. * sqrt(2.) ;
}
}
//----------------------------------------------
// Metric quantities from the analytic solution
//----------------------------------------------
Scalar r_are(mp) ;
r_are = r_coord(bc_lapconf_nd, bc_lapconf_fs) ;
r_are.std_spectral_base() ;
lapconf_auto_bh = sqrt(1. - 2.*mass/r_are/rr
+ cc*cc*pow(mass/r_are/rr, 4.)) * sqrt(r_are) ;
lapconf_auto_bh.std_spectral_base() ;
lapconf_auto_bh.annule_domain(0) ;
lapconf_auto_bh.raccord(1) ;
confo_auto_bh = sqrt(r_are) ;
confo_auto_bh.std_spectral_base() ;
confo_auto_bh.annule_domain(0) ;
confo_auto_bh.raccord(1) ;
shift_auto_bh = mass * mass * cc * ll / rr / rr / pow(r_are, 3.) ;
shift_auto_bh.std_spectral_base() ;
shift_auto_bh.annule_domain(0) ;
for (int i=1; i<=3; i++)
shift_auto_bh.set(i).raccord(1) ;
//---------------------------------
// Derivative of metric quantities
//---------------------------------
d_lapconf_auto_rs.set_etat_qcq() ;
for (int i=1; i<=3; i++)
d_lapconf_auto_rs.set(i) = lapconf_auto_rs.deriv(i) ;
d_lapconf_auto_rs.std_spectral_base() ;
d_lapconf_auto_bh.set_etat_qcq() ;
for (int i=1; i<=3; i++) {
d_lapconf_auto_bh.set(i) = sqrt(r_are)
* (mass/r_are/rr - 2.*cc*cc*pow(mass/r_are/rr,4.))
* ll(i) / rr
+ 0.5 * sqrt(r_are)
* (sqrt(1. - 2.*mass/r_are/rr + cc*cc*pow(mass/r_are/rr,4.))-1.)
* sqrt(1. - 2.*mass/r_are/rr + cc*cc*pow(mass/r_are/rr,4.))
* ll(i) / rr ;
}
d_lapconf_auto_bh.std_spectral_base() ;
d_lapconf_auto_bh.annule_domain(0) ;
d_lapconf_auto_bh.inc_dzpuis(2) ;
d_lapconf_auto = d_lapconf_auto_rs + d_lapconf_auto_bh ;
d_lapconf_auto.std_spectral_base() ;
d_lapconf_auto.annule_domain(0) ;
for (int i=1; i<=3; i++)
d_lapconf_auto.set(i).raccord(1) ;
d_shift_auto_rs.set_etat_qcq() ;
for (int i=1; i<=3; i++) {
for (int j=1; j<=3; j++) {
d_shift_auto_rs.set(i,j) = shift_auto_rs(j).deriv(i) ;
}
}
d_shift_auto_rs.std_spectral_base() ;
d_shift_auto_bh.set_etat_qcq() ;
for (int i=1; i<=3; i++) {
for (int j=1; j<=3; j++) {
d_shift_auto_bh.set(i,j) =
mass*mass*cc*(flat.con()(i,j)
-3.*sqrt(1. - 2.*mass/r_are/rr
+cc*cc*pow(mass/r_are/rr,4.))
*ll(i)*ll(j))
/ pow(r_are*rr,3.) ;
}
}
d_shift_auto_bh.std_spectral_base() ;
d_shift_auto_bh.annule_domain(0) ;
d_shift_auto_bh.inc_dzpuis(2) ;
d_shift_auto = d_shift_auto_rs + d_shift_auto_bh ;
d_shift_auto.std_spectral_base() ;
d_shift_auto.annule_domain(0) ;
for (int i=1; i<=3; i++) {
for (int j=1; j<=3; j++) {
d_shift_auto.set(i,j).raccord(1) ;
}
}
d_confo_auto_rs.set_etat_qcq() ;
for (int i=1; i<=3; i++)
d_confo_auto_rs.set(i) = confo_auto_rs.deriv(i) ;
d_confo_auto_rs.std_spectral_base() ;
d_confo_auto_bh.set_etat_qcq() ;
for (int i=1; i<=3; i++) {
d_confo_auto_bh.set(i) = 0.5*sqrt(r_are)
*(sqrt(1. - 2.*mass/r_are/rr +cc*cc*pow(mass/r_are/rr,4.)) - 1.)
* ll(i) / rr ;
}
d_confo_auto_bh.std_spectral_base() ;
d_confo_auto_bh.annule_domain(0) ;
d_confo_auto_bh.inc_dzpuis(2) ;
d_confo_auto = d_confo_auto_rs + d_confo_auto_bh ;
d_confo_auto.std_spectral_base() ;
d_confo_auto.annule_domain(0) ;
for (int i=1; i<=3; i++)
d_confo_auto.set(i).raccord(1) ;
}
//-------------------------
// Total metric quantities
//-------------------------
lapconf_auto = lapconf_auto_rs + lapconf_auto_bh ;
lapconf_auto.std_spectral_base() ;
lapconf_auto.annule_domain(0) ;
lapconf_auto.raccord(1) ;
lapconf_tot = lapconf_auto_rs + lapconf_auto_bh + lapconf_comp ;
lapconf_tot.std_spectral_base() ;
lapconf_tot.annule_domain(0) ;
lapconf_tot.raccord(1) ;
shift_auto = shift_auto_rs + shift_auto_bh ;
shift_auto.std_spectral_base() ;
shift_auto.annule_domain(0) ;
for (int i=1; i<=3; i++) {
shift_auto.set(i).raccord(1) ;
}
shift_tot = shift_auto_rs + shift_auto_bh + shift_comp ;
shift_tot.std_spectral_base() ;
shift_tot.annule_domain(0) ;
for (int i=1; i<=3; i++) {
shift_tot.set(i).raccord(1) ;
}
confo_auto = confo_auto_rs + confo_auto_bh ;
confo_auto.std_spectral_base() ;
confo_auto.annule_domain(0) ;
confo_auto.raccord(1) ;
confo_tot = confo_auto_rs + confo_auto_bh + confo_comp ;
confo_tot.std_spectral_base() ;
confo_tot.annule_domain(0) ;
confo_tot.raccord(1) ;
lapse_auto = lapconf_auto / confo_tot ;
lapse_auto.std_spectral_base() ;
lapse_tot = lapconf_tot / confo_tot ;
lapse_tot.std_spectral_base() ;
// The derived quantities are obsolete
// -----------------------------------
del_deriv() ;
}
}
Lorene::Black_hole::r_coord
const Scalar r_coord(bool neumann, bool first) const
Expresses the areal radial coordinate by that in spatially isotropic coordinates.
Definition blackhole_r_coord.C:66
Lorene::Black_hole::mp
Map & mp
Mapping associated with the black hole.
Definition blackhole.h:80
Lorene::Black_hole::flat
Metric_flat flat
Flat metric defined on the mapping (Spherical components with respect to the mapping of the black hol...
Definition blackhole.h:143
Lorene::Black_hole::kerrschild
bool kerrschild
true for a Kerr-Schild background, false for a conformally flat background
Definition blackhole.h:85
Lorene::Black_hole::mass_bh
double mass_bh
Gravitational mass of BH.
Definition blackhole.h:88
Lorene::Hole_bhns::confo_auto
Scalar confo_auto
Conformal factor generated by the black hole.
Definition hole_bhns.h:163
Lorene::Hole_bhns::lapconf_auto
Scalar lapconf_auto
Lapconf function generated by the black hole.
Definition hole_bhns.h:95
Lorene::Hole_bhns::shift_tot
Vector shift_tot
Total shift vector ;.
Definition hole_bhns.h:138
Lorene::Hole_bhns::d_lapconf_auto
Vector d_lapconf_auto
Derivative of the lapconf function generated by the black hole.
Definition hole_bhns.h:120
Lorene::Hole_bhns::d_shift_auto
Tensor d_shift_auto
Derivative of the shift vector generated by the black hole.
Definition hole_bhns.h:151
Lorene::Hole_bhns::d_lapconf_auto_rs
Vector d_lapconf_auto_rs
Derivative of the part of the lapconf function from the numerical computation.
Definition hole_bhns.h:112
Lorene::Hole_bhns::confo_auto_bh
Scalar confo_auto_bh
Part of the conformal factor from the analytic background.
Definition hole_bhns.h:160
Lorene::Hole_bhns::d_shift_auto_rs
Tensor d_shift_auto_rs
Derivative of the part of the shift vector from the numerical computation.
Definition hole_bhns.h:143
Lorene::Hole_bhns::Hole_bhns
Hole_bhns(Map &mp_i, bool kerrschild_i, bool bc_lapconf_nd, bool bc_lapconf_fs, bool irrotational, double massbh)
Standard constructor.
Definition hole_bhns.C:68
Lorene::Hole_bhns::shift_auto_rs
Vector shift_auto_rs
Part of the shift vector from the numerical computation.
Definition hole_bhns.h:126
Lorene::Hole_bhns::del_deriv
virtual void del_deriv() const
Deletes all the derived quantities.
Definition hole_bhns.C:392
Lorene::Hole_bhns::d_shift_auto_bh
Tensor d_shift_auto_bh
Derivative of the part of the shift vector from the analytic background.
Definition hole_bhns.h:148
Lorene::Hole_bhns::bc_lapconf_fs
bool bc_lapconf_fs
true for the first type BC for the lapconf function, false for the second type BH
Definition hole_bhns.h:78
Lorene::Hole_bhns::update_metric_bhns
void update_metric_bhns(const Star_bhns &star, const Hole_bhns &hole_prev, double relax)
Computes metric coefficients from known potentials with relaxation when the companion is a black hole...
Definition hole_bhns_upmetr.C:61
Lorene::Hole_bhns::d_lapconf_auto_bh
Vector d_lapconf_auto_bh
Derivative of the part of the lapconf function from the analytic background.
Definition hole_bhns.h:117
Lorene::Hole_bhns::d_confo_auto_rs
Vector d_confo_auto_rs
Derivative of the part of the conformal factor from the numerical computation.
Definition hole_bhns.h:174
Lorene::Hole_bhns::confo_auto_rs
Scalar confo_auto_rs
Part of the conformal factor from the numerical computation.
Definition hole_bhns.h:157
Lorene::Hole_bhns::lapse_tot
Scalar lapse_tot
Total lapse function.
Definition hole_bhns.h:107
Lorene::Hole_bhns::lapse_auto
Scalar lapse_auto
Lapse function of the "black hole" part.
Definition hole_bhns.h:104
Lorene::Hole_bhns::shift_auto_bh
Vector shift_auto_bh
Part of the shift vector from the analytic background.
Definition hole_bhns.h:129
Lorene::Hole_bhns::confo_comp
Scalar confo_comp
Conformal factor generated by the companion star.
Definition hole_bhns.h:166
Lorene::Hole_bhns::lapconf_comp
Scalar lapconf_comp
Lapconf function generated by the companion star.
Definition hole_bhns.h:98
Lorene::Hole_bhns::lapconf_auto_bh
Scalar lapconf_auto_bh
Part of the lapconf function from the analytic background.
Definition hole_bhns.h:92
Lorene::Hole_bhns::d_confo_auto
Vector d_confo_auto
Derivative of the conformal factor generated by the black hole.
Definition hole_bhns.h:182
Lorene::Hole_bhns::shift_auto
Vector shift_auto
Shift vector generated by the black hole.
Definition hole_bhns.h:132
Lorene::Hole_bhns::lapconf_auto_rs
Scalar lapconf_auto_rs
Part of the lapconf function from the numerical computation.
Definition hole_bhns.h:89
Lorene::Hole_bhns::bc_lapconf_nd
bool bc_lapconf_nd
true for the Neumann type BC for the lapconf function, false for the Dirichlet type BH
Definition hole_bhns.h:73
Lorene::Hole_bhns::lapconf_tot
Scalar lapconf_tot
Total lapconf function.
Definition hole_bhns.h:101
Lorene::Hole_bhns::d_confo_auto_bh
Vector d_confo_auto_bh
Derivative of the part of the conformal factor from the analytic background.
Definition hole_bhns.h:179
Lorene::Hole_bhns::shift_comp
Vector shift_comp
Shift vector generated by the companion star.
Definition hole_bhns.h:135
Lorene::Hole_bhns::confo_tot
Scalar confo_tot
Total conformal factor.
Definition hole_bhns.h:169
Lorene::Scalar
Tensor field of valence 0 (or component of a tensorial field).
Definition scalar.h:387
Lorene::Scalar::std_spectral_base
virtual void std_spectral_base()
Sets the spectral bases of the Valeur va to the standard ones for a scalar field.
Definition scalar.C:784
Lorene::Star_bhns
Class for stars in black hole-neutron star binaries.
Definition star_bhns.h:59
Lorene::Star_bhns::get_confo_auto
const Scalar & get_confo_auto() const
Returns the part of the conformal factor generated by the star.
Definition star_bhns.h:383
Lorene::Star_bhns::get_shift_auto
const Vector & get_shift_auto() const
Returns the part of the shift vector generated by the star.
Definition star_bhns.h:364
Lorene::Star_bhns::get_lapconf_auto
const Scalar & get_lapconf_auto() const
Returns the part of the lapconf function generated by the star.
Definition star_bhns.h:339
Lorene::Star::get_mp
const Map & get_mp() const
Returns the mapping.
Definition star.h:355
Lorene::Vector
Tensor field of valence 1.
Definition vector.h:188
Lorene::Vector::std_spectral_base
virtual void std_spectral_base()
Sets the standard spectal bases of decomposition for each component.
Definition vector.C:316
Lorene::Vector::change_triad
virtual void change_triad(const Base_vect &)
Sets a new vectorial basis (triad) of decomposition and modifies the components accordingly.
Definition vector_change_triad.C:75
Lorene::Vector::set
Scalar & set(int)
Read/write access to a component.
Definition vector.C:296
Lorene::sqrt
Cmp sqrt(const Cmp &)
Square root.
Definition cmp_math.C:220
Lorene::pow
Cmp pow(const Cmp &, int)
Power .
Definition cmp_math.C:348
Lorene::Tensor::get_triad
const Base_vect * get_triad() const
Returns the vectorial basis (triad) on which the components are defined.
Definition tensor.h:866
Lorene::Tensor::set_etat_qcq
virtual void set_etat_qcq()
Sets the logical state of all components to ETATQCQ (ordinary state).
Definition tensor.C:481
Lorene
Lorene prototypes.
Definition app_hor.h:64
Lorene::Map
Map(const Mg3d &)
Constructor from a multi-domain 3D grid.
Definition map.C:139
Unites
Standard units of space, time and mass.