LORENE
et_bin_bhns_extr_upmetr.C
1 /*
2  * Methods Et_bin_bhns_extr::update_metric_extr_ks
3  * and Et_bin_bhns_extr::update_metric_extr_cf
4  *
5  * (see file et_bin_bhns_extr.h for documentation).
6  *
7  */
8 
9 /*
10  * Copyright (c) 2004-2005 Keisuke Taniguchi
11  *
12  * This file is part of LORENE.
13  *
14  * LORENE is free software; you can redistribute it and/or modify
15  * it under the terms of the GNU General Public License version 2
16  * as published by the Free Software Foundation.
17  *
18  * LORENE is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21  * GNU General Public License for more details.
22  *
23  * You should have received a copy of the GNU General Public License
24  * along with LORENE; if not, write to the Free Software
25  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
26  *
27  */
28 
29 char et_bin_bhns_extr_upmetr_C[] = "$Header: /cvsroot/Lorene/C++/Source/Etoile/et_bin_bhns_extr_upmetr.C,v 1.4 2014/10/13 08:52:55 j_novak Exp $" ;
30 
31 /*
32  * $Id: et_bin_bhns_extr_upmetr.C,v 1.4 2014/10/13 08:52:55 j_novak Exp $
33  * $Log: et_bin_bhns_extr_upmetr.C,v $
34  * Revision 1.4 2014/10/13 08:52:55 j_novak
35  * Lorene classes and functions now belong to the namespace Lorene.
36  *
37  * Revision 1.3 2014/10/06 15:13:08 j_novak
38  * Modified #include directives to use c++ syntax.
39  *
40  * Revision 1.2 2005/02/28 23:16:37 k_taniguchi
41  * Modification to include the case of the conformally flat background metric
42  *
43  * Revision 1.1 2004/11/30 20:51:32 k_taniguchi
44  * *** empty log message ***
45  *
46  *
47  * $Header: /cvsroot/Lorene/C++/Source/Etoile/et_bin_bhns_extr_upmetr.C,v 1.4 2014/10/13 08:52:55 j_novak Exp $
48  *
49  */
50 
51 // C headers
52 #include <cmath>
53 
54 // Lorene headers
55 #include "et_bin_bhns_extr.h"
56 #include "etoile.h"
57 #include "coord.h"
58 #include "unites.h"
59 
60  //-----------------------------------------------------------//
61  // No relaxation for a fixed BH background //
62  //-----------------------------------------------------------//
63 
64 namespace Lorene {
65 void Et_bin_bhns_extr::update_metric_extr(const double& mass,
66  const double& sepa)
67 {
68 
69  using namespace Unites ;
70 
71  if (kerrschild) {
72 
73  // Computation of quantities coming from the companion (K-S BH)
74  // ------------------------------------------------------------
75 
76  const Coord& xx = mp.x ;
77  const Coord& yy = mp.y ;
78  const Coord& zz = mp.z ;
79 
80  Tenseur r_bh(mp) ;
81  r_bh.set_etat_qcq() ;
82  r_bh.set() = pow( (xx+sepa)*(xx+sepa) + yy*yy + zz*zz, 0.5) ;
83  r_bh.set_std_base() ;
84 
85  Tenseur xx_con(mp, 1, CON, ref_triad) ;
86  xx_con.set_etat_qcq() ;
87  xx_con.set(0) = xx + sepa ;
88  xx_con.set(1) = yy ;
89  xx_con.set(2) = zz ;
90  xx_con.set_std_base() ;
91 
92  Tenseur xsr_con(mp, 1, CON, ref_triad) ;
93  xsr_con = xx_con / r_bh ;
94  xsr_con.set_std_base() ;
95 
96  Tenseur msr(mp) ;
97  msr = ggrav * mass / r_bh ;
98  msr.set_std_base() ;
99 
100  Tenseur lapse_bh(mp) ;
101  lapse_bh = 1. / sqrt( 1.+2.*msr ) ;
102  lapse_bh.set_std_base() ;
103 
105  logn_comp.set() = log( lapse_bh() ) ;
107 
109  beta_comp.set() = log( lapse_bh() ) ;
110  // conformal factor of KS-BH is unity
112 
114 
115  shift_comp.set(0) = -2.*lapse_bh()*lapse_bh()*msr()*xsr_con(0) ;
116  shift_comp.set(1) = -2.*lapse_bh()*lapse_bh()*msr()*xsr_con(1) ;
117  shift_comp.set(2) = -2.*lapse_bh()*lapse_bh()*msr()*xsr_con(2) ;
118 
121 
122  // Lapse function N
123  // ----------------
124 
125  nnn = exp( unsurc2 * logn_auto ) * lapse_bh ;
126 
127  nnn.set_std_base() ;
128 
129  // Conformal factor A^2
130  // --------------------
131 
132  a_car = exp ( 2.*unsurc2*(beta_auto - logn_auto) ) ;
133 
134  a_car.set_std_base() ;
135 
136  // Shift vector N^i
137  // ----------------
138 
140 
141  // Derivative of metric coefficients
142  // ----------------------------------
143 
144  // ... (d/dX,d/dY,d/dZ)(logn_auto) :
145  d_logn_auto_regu = logn_auto_regu.gradient() ; // (d/dx, d/dy, d/dz)
146  d_logn_auto_regu.change_triad(ref_triad) ; // --> (d/dX, d/dY, d/dZ)
147 
148  if ( *(d_logn_auto_div.get_triad()) != ref_triad ) {
149 
150  // Change the basis from spherical coordinate to Cartesian one
152 
153  // Change the basis from mapping coordinate to absolute one
155 
156  }
157 
159 
160  // ... (d/dX,d/dY,d/dZ)(beta_auto) :
161  d_beta_auto = beta_auto.gradient() ; // (d/dx, d/dy, d/dz)
162  d_beta_auto.change_triad(ref_triad) ; // --> (d/dX, d/dY, d/dZ)
163 
164  if (relativistic) {
165  // ... extrinsic curvature (tkij_auto and akcar_auto)
166  extrinsic_curv_extr(mass, sepa) ;
167  }
168 
169  // The derived quantities are obsolete
170  // -----------------------------------
171 
173 
174  }
175  else {
176 
177  // Computation of quantities coming from the companion (CF Sch. BH)
178  // ----------------------------------------------------------------
179 
180  const Coord& xx = mp.x ;
181  const Coord& yy = mp.y ;
182  const Coord& zz = mp.z ;
183 
184  Tenseur r_bh(mp) ;
185  r_bh.set_etat_qcq() ;
186  r_bh.set() = pow( (xx+sepa)*(xx+sepa) + yy*yy + zz*zz, 0.5) ;
187  r_bh.set_std_base() ;
188 
189  Tenseur msr(mp) ;
190  msr = ggrav * mass / r_bh ;
191  msr.set_std_base() ;
192 
193  Tenseur lapse_bh(mp) ;
194  lapse_bh = (1.-0.5*msr) / (1.+0.5*msr) ;
195  lapse_bh.set_std_base() ;
196 
198  logn_comp.set() = log( lapse_bh() ) ;
200 
201  Tenseur lappsi(mp) ;
202  lappsi = 1. - 0.25*msr*msr ;
203  lappsi.set_std_base() ;
204 
206  beta_comp.set() = log( lappsi() ) ;
208 
210 
211  shift_comp.set(0) = 0. ;
212  shift_comp.set(1) = 0. ;
213  shift_comp.set(2) = 0. ;
214 
217 
218  // Lapse function N
219  // ----------------
220 
221  nnn = exp( unsurc2 * logn_auto ) * lapse_bh ;
222 
223  nnn.set_std_base() ;
224 
225  // Conformal factor A^2
226  // --------------------
227 
229  - logn_auto - logn_comp) ) ;
230 
231  a_car.set_std_base() ;
232 
233  // Shift vector N^i
234  // ----------------
235 
237 
238  // Derivative of metric coefficients
239  // ----------------------------------
240 
241  // ... (d/dX,d/dY,d/dZ)(logn_auto) :
242  d_logn_auto_regu = logn_auto_regu.gradient() ; // (d/dx, d/dy, d/dz)
243  d_logn_auto_regu.change_triad(ref_triad) ; // --> (d/dX, d/dY, d/dZ)
244 
245  if ( *(d_logn_auto_div.get_triad()) != ref_triad ) {
246 
247  // Change the basis from spherical coordinate to Cartesian one
249 
250  // Change the basis from mapping coordinate to absolute one
252 
253  }
254 
256 
257  // ... (d/dX,d/dY,d/dZ)(beta_auto) :
258  d_beta_auto = beta_auto.gradient() ; // (d/dx, d/dy, d/dz)
259  d_beta_auto.change_triad(ref_triad) ; // --> (d/dX, d/dY, d/dZ)
260 
261  if (relativistic) {
262  // ... extrinsic curvature (tkij_auto and akcar_auto)
263  extrinsic_curv_extr(mass, sepa) ;
264  }
265 
266  // The derived quantities are obsolete
267  // -----------------------------------
268 
270 
271  }
272 
273 }
274 }
Cmp log(const Cmp &)
Neperian logarithm.
Definition: cmp_math.C:296
Tenseur shift_comp
Part of the shift vector generated principaly by the companion star.
Definition: etoile.h:895
const Base_vect & ref_triad
Reference triad ("absolute frame"), with respect to which the components of all the member Tenseur &#39;s...
Definition: etoile.h:828
Cmp exp(const Cmp &)
Exponential.
Definition: cmp_math.C:270
void set_triad(const Base_vect &new_triad)
Assigns a new vectorial basis (triad) of decomposition.
Definition: tenseur.C:674
Cmp sqrt(const Cmp &)
Square root.
Definition: cmp_math.C:220
void set_std_base()
Set the standard spectal basis of decomposition for each component.
Definition: tenseur.C:1170
Tenseur logn_auto_regu
Regular part of the logarithm of the part of the lapse N generated principaly by the star...
Definition: etoile.h:491
Lorene prototypes.
Definition: app_hor.h:64
Standard units of space, time and mass.
Tenseur nnn
Total lapse function.
Definition: etoile.h:509
void update_metric_extr(const double &mass, const double &sepa)
Computes metric coefficients from known potentials, when the companion is a black hole with the Kerr-...
double unsurc2
: unsurc2=1 for a relativistic star, 0 for a Newtonian one.
Definition: etoile.h:442
bool kerrschild
Indicator of the background metric: true for the Kerr-Shild metric, false for the conformally flat on...
Tenseur d_beta_auto
Gradient of beta_auto (Cartesian components with respect to ref_triad )
Definition: etoile.h:879
Tenseur shift
Total shift vector.
Definition: etoile.h:512
Tenseur shift_auto
Part of the shift vector generated principaly by the star.
Definition: etoile.h:889
Cmp & set()
Read/write for a scalar (see also operator=(const Cmp&) ).
Definition: tenseur.C:824
void change_triad(const Base_vect &new_triad)
Sets a new vectorial basis (triad) of decomposition and modifies the components accordingly.
Definition: tenseur.C:668
virtual void del_deriv() const
Deletes all the derived quantities.
Definition: etoile_bin.C:447
Tenseur logn_comp
Part of the lapse logarithm (gravitational potential at the Newtonian limit) generated principaly by ...
Definition: etoile.h:854
Tenseur d_logn_auto
Gradient of logn_auto (Cartesian components with respect to ref_triad )
Definition: etoile.h:859
const Base_vect * get_triad() const
Returns the vectorial basis (triad) on which the components are defined.
Definition: tenseur.h:701
Tenseur beta_comp
Part of the logarithm of AN generated principaly by the companion star.
Definition: etoile.h:874
Map & mp
Mapping associated with the star.
Definition: etoile.h:429
Cmp pow(const Cmp &, int)
Power .
Definition: cmp_math.C:348
Active physical coordinates and mapping derivatives.
Definition: coord.h:90
void extrinsic_curv_extr(const double &mass, const double &sepa)
Computes tkij_auto and akcar_auto from shift_auto , nnn and a_car .
Tenseur a_car
Total conformal factor .
Definition: etoile.h:515
bool relativistic
Indicator of relativity: true for a relativistic star, false for a Newtonian one. ...
Definition: etoile.h:437
const Base_vect_cart & get_bvect_cart() const
Returns the Cartesian basis associated with the coordinates (x,y,z) of the mapping, i.e.
Definition: map.h:791
Tenseur logn_auto
Total of the logarithm of the part of the lapse N generated principaly by the star.
Definition: etoile.h:484
Tenseur d_logn_auto_regu
Gradient of logn_auto_regu (Cartesian components with respect to ref_triad )
Definition: etoile.h:864
Coord y
y coordinate centered on the grid
Definition: map.h:727
Coord x
x coordinate centered on the grid
Definition: map.h:726
Tenseur beta_auto
Logarithm of the part of the product AN generated principaly by by the star.
Definition: etoile.h:506
void set_etat_qcq()
Sets the logical state to ETATQCQ (ordinary state).
Definition: tenseur.C:636
Tenseur d_logn_auto_div
Gradient of logn_auto_div (if k_div!=0 )
Definition: etoile.h:501
Coord z
z coordinate centered on the grid
Definition: map.h:728
Tensor handling *** DEPRECATED : use class Tensor instead ***.
Definition: tenseur.h:298
const Tenseur & gradient() const
Returns the gradient of *this (Cartesian coordinates)
Definition: tenseur.C:1542