LORENE
et_bin_upmetr.C
1 /*
2  * Methods Etoile_bin::update_metric
3  *
4  * (see file etoile.h for documentation)
5  *
6  */
7 
8 /*
9  * Copyright (c) 2000-2001 Eric Gourgoulhon
10  *
11  * This file is part of LORENE.
12  *
13  * LORENE is free software; you can redistribute it and/or modify
14  * it under the terms of the GNU General Public License as published by
15  * the Free Software Foundation; either version 2 of the License, or
16  * (at your option) any later version.
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 
30 
31 
32 /*
33  * $Id: et_bin_upmetr.C,v 1.6 2016/12/05 16:17:53 j_novak Exp $
34  * $Log: et_bin_upmetr.C,v $
35  * Revision 1.6 2016/12/05 16:17:53 j_novak
36  * Suppression of some global variables (file names, loch, ...) to prevent redefinitions
37  *
38  * Revision 1.5 2014/10/13 08:52:56 j_novak
39  * Lorene classes and functions now belong to the namespace Lorene.
40  *
41  * Revision 1.4 2003/10/24 12:26:38 k_taniguchi
42  * Suppress the method of update metric for NS-BH
43  *
44  * Revision 1.3 2003/10/24 11:46:07 k_taniguchi
45  * Change some notations
46  *
47  * Revision 1.2 2002/12/19 14:52:42 e_gourgoulhon
48  * Added the new function
49  * void update_metric(const Bhole& comp)
50  * to treat the case where the companion is a black hole
51  *
52  * Revision 1.1.1.1 2001/11/20 15:19:28 e_gourgoulhon
53  * LORENE
54  *
55  * Revision 2.9 2000/09/27 12:49:57 keisuke
56  * Utilisation de d_logn_auto_div dans le calcul de d_logn_auto dans
57  * la version avec relaxation.
58  *
59  * Revision 2.8 2000/09/22 15:53:06 keisuke
60  * Calcul de d_logn_auto prenant en compte d_logn_auto_div.
61  *
62  * Revision 2.7 2000/03/07 14:55:08 eric
63  * Ajout de l'appel a extrinsic_curvature.
64  *
65  * Revision 2.6 2000/03/07 08:33:24 eric
66  * Appel de Cmp::import_sym / asym (pour tenir compte de la symetrie /
67  * plan y=0).
68  *
69  * Revision 2.5 2000/02/12 18:38:11 eric
70  * Ajout de la version avec relaxation.
71  * Appel de set_std_base() sur nnn et a_car.
72  *
73  * Revision 2.4 2000/02/12 11:42:49 eric
74  * Appel de Tenseur::set_std_base() sur les Tenseurs importes du
75  * compagnon.
76  *
77  * Revision 2.3 2000/02/10 18:54:41 eric
78  * Traitement du cas ETATZERO.
79  *
80  * Revision 2.2 2000/02/10 16:55:10 eric
81  * Appel de change_triad sur d_logn_auto et d_beta_auto.
82  *
83  * Revision 2.1 2000/02/04 17:14:32 eric
84  * *** empty log message ***
85  *
86  * Revision 2.0 2000/02/04 16:38:00 eric
87  * *** empty log message ***
88  *
89  *
90  * $Header: /cvsroot/Lorene/C++/Source/Etoile/et_bin_upmetr.C,v 1.6 2016/12/05 16:17:53 j_novak Exp $
91  *
92  */
93 
94 // Headers Lorene
95 #include "etoile.h"
96 #include "bhole.h"
97 
98  //----------------------------------//
99  // Version without relaxation //
100  //----------------------------------//
101 
102 namespace Lorene {
104 
105  // Computation of quantities coming from the companion
106  // ---------------------------------------------------
107 
108  if ( (comp.logn_auto).get_etat() == ETATZERO ) {
110  }
111  else{
113  (logn_comp.set()).import_symy( comp.logn_auto() ) ;
114  logn_comp.set_std_base() ; // set the bases for spectral expansions
115  }
116 
117 
118  if ( (comp.beta_auto).get_etat() == ETATZERO ) {
120  }
121  else{
123  (beta_comp.set()).import_symy( comp.beta_auto() ) ;
124  beta_comp.set_std_base() ; // set the bases for spectral expansions
125  }
126 
127 
128  if ( (comp.shift_auto).get_etat() == ETATZERO ) {
130  }
131  else{
133 
134  (shift_comp.set(0)).import_asymy( comp.shift_auto(0) ) ; // N^x antisym
135  (shift_comp.set(1)).import_symy( comp.shift_auto(1) ) ; // N^y sym.
136  (shift_comp.set(2)).import_asymy( comp.shift_auto(2) ) ; // N^z anisym
137 
138  shift_comp.set_std_base() ; // set the bases for spectral expansions
139  }
140  shift_comp.set_triad( *((comp.shift_auto).get_triad()) ) ;
141 
142 
143 
144  // Lapse function N
145  // ----------------
146 
147  Tenseur logn_total = logn_auto + logn_comp ;
148 
149  nnn = exp( unsurc2 * logn_total ) ;
150 
151  nnn.set_std_base() ; // set the bases for spectral expansions
152 
153  // Conformal factor A^2
154  // ---------------------
155 
156  a_car = exp( 2*unsurc2*( beta_auto + beta_comp - logn_total ) ) ;
157 
158  a_car.set_std_base() ; // set the bases for spectral expansions
159 
160  // Shift vector N^i
161  // ----------------
162 
164 
165  // Derivatives of metric coefficients
166  // ----------------------------------
167 
168  // ... (d/dX,d/dY,d/dZ)(logn_auto) :
169  d_logn_auto_regu = logn_auto_regu.gradient() ; // (d/dx, d/dy, d/dz)
170  d_logn_auto_regu.change_triad(ref_triad) ; // --> (d/dX, d/dY, d/dZ)
171 
172  if ( *(d_logn_auto_div.get_triad()) != ref_triad ) {
173 
174  // Change the basis from spherical coordinate to Cartesian one
176 
177  // Change the basis from mapping coordinate to absolute one
179 
180  }
181 
183 
184  // ... (d/dX,d/dY,d/dZ)(beta_auto) :
185  d_beta_auto = beta_auto.gradient() ; // (d/dx, d/dy, d/dz)
186  d_beta_auto.change_triad(ref_triad) ; // --> (d/dX, d/dY, d/dZ)
187 
188  if (relativistic) {
189  // ... extrinsic curvature (tkij_auto and akcar_auto)
191  }
192 
193  // The derived quantities are obsolete
194  // -----------------------------------
195 
196  del_deriv() ;
197 
198 
199 }
200 
201 
202 
203  //----------------------------------//
204  // Version with relaxation //
205  //----------------------------------//
206 
208  const Etoile_bin& star_jm1, double relax) {
209 
210 
211  // Computation of quantities coming from the companion
212  // ---------------------------------------------------
213 
214  if ( (comp.logn_auto).get_etat() == ETATZERO ) {
216  }
217  else{
219  (logn_comp.set()).import_symy( comp.logn_auto() ) ;
220  logn_comp.set_std_base() ; // set the bases for spectral expansions
221  }
222 
223 
224  if ( (comp.beta_auto).get_etat() == ETATZERO ) {
226  }
227  else{
229  (beta_comp.set()).import_symy( comp.beta_auto() ) ;
230  beta_comp.set_std_base() ; // set the bases for spectral expansions
231  }
232 
233 
234  if ( (comp.shift_auto).get_etat() == ETATZERO ) {
236  }
237  else{
239 
240  (shift_comp.set(0)).import_asymy( comp.shift_auto(0) ) ; // N^x antisym
241  (shift_comp.set(1)).import_symy( comp.shift_auto(1) ) ; // N^y sym.
242  (shift_comp.set(2)).import_asymy( comp.shift_auto(2) ) ; // N^z anisym
243 
244  shift_comp.set_std_base() ; // set the bases for spectral expansions
245  }
246  shift_comp.set_triad( *((comp.shift_auto).get_triad()) ) ;
247 
248  // Relaxation on logn_comp, beta_comp, shift_comp
249  // ----------------------------------------------
250  double relaxjm1 = 1. - relax ;
251 
252  logn_comp = relax * logn_comp + relaxjm1 * (star_jm1.get_logn_comp()) ;
253 
254  beta_comp = relax * beta_comp + relaxjm1 * (star_jm1.get_beta_comp()) ;
255 
256  shift_comp = relax * shift_comp + relaxjm1 * (star_jm1.get_shift_comp()) ;
257 
258  // Lapse function N
259  // ----------------
260 
261  Tenseur logn_total = logn_auto + logn_comp ;
262 
263  nnn = exp( unsurc2 * logn_total ) ;
264 
265  nnn.set_std_base() ; // set the bases for spectral expansions
266 
267  // Conformal factor A^2
268  // ---------------------
269 
270  a_car = exp( 2*unsurc2*( beta_auto + beta_comp - logn_total ) ) ;
271 
272  a_car.set_std_base() ; // set the bases for spectral expansions
273 
274  // Shift vector N^i
275  // ----------------
276 
278 
279  // Derivatives of metric coefficients
280  // ----------------------------------
281 
282  // ... (d/dX,d/dY,d/dZ)(logn_auto) :
283  d_logn_auto_regu = logn_auto_regu.gradient() ; // (d/dx, d/dy, d/dz)
284  d_logn_auto_regu.change_triad(ref_triad) ; // --> (d/dX, d/dY, d/dZ)
285 
286  if ( *(d_logn_auto_div.get_triad()) != ref_triad ) {
287 
288  // Change the basis from spherical coordinate to Cartesian one
290 
291  // Change the basis from mapping coordinate to absolute one
293 
294  }
295 
297 
298  // ... (d/dX,d/dY,d/dZ)(beta_auto) :
299  d_beta_auto = beta_auto.gradient() ; // (d/dx, d/dy, d/dz)
300  d_beta_auto.change_triad(ref_triad) ; // --> (d/dX, d/dY, d/dZ)
301 
302  // ... extrinsic curvature (tkij_auto and akcar_auto)
304 
305  // The derived quantities are obsolete
306  // -----------------------------------
307 
308  del_deriv() ;
309 
310 
311 }
312 }
Tenseur shift_comp
Part of the shift vector generated principaly by the companion star.
Definition: etoile.h:898
const Tenseur & get_beta_comp() const
Returns the part of the logarithm of AN generated principaly by the companion star.
Definition: etoile.h:1139
const Base_vect & ref_triad
Reference triad ("absolute frame"), with respect to which the components of all the member Tenseur 's...
Definition: etoile.h:831
Cmp exp(const Cmp &)
Exponential.
Definition: cmp_math.C:273
void update_metric(const Etoile_bin &comp)
Computes metric coefficients from known potentials, when the companion is another star...
void set_triad(const Base_vect &new_triad)
Assigns a new vectorial basis (triad) of decomposition.
Definition: tenseur.C:690
void set_std_base()
Set the standard spectal basis of decomposition for each component.
Definition: tenseur.C:1186
Tenseur logn_auto_regu
Regular part of the logarithm of the part of the lapse N generated principaly by the star...
Definition: etoile.h:494
Lorene prototypes.
Definition: app_hor.h:67
Tenseur nnn
Total lapse function.
Definition: etoile.h:512
double unsurc2
: unsurc2=1 for a relativistic star, 0 for a Newtonian one.
Definition: etoile.h:445
Class for stars in binary system.
Definition: etoile.h:817
virtual void extrinsic_curvature()
Computes tkij_auto and akcar_auto from shift_auto , nnn and a_car .
Tenseur d_beta_auto
Gradient of beta_auto (Cartesian components with respect to ref_triad )
Definition: etoile.h:882
Tenseur shift
Total shift vector.
Definition: etoile.h:515
Tenseur shift_auto
Part of the shift vector generated principaly by the star.
Definition: etoile.h:892
const Tenseur & get_logn_comp() const
Returns the part of the lapse logarithm (gravitational potential at the Newtonian limit) generated pr...
Definition: etoile.h:1119
Cmp & set()
Read/write for a scalar (see also operator=(const Cmp&) ).
Definition: tenseur.C:840
void change_triad(const Base_vect &new_triad)
Sets a new vectorial basis (triad) of decomposition and modifies the components accordingly.
Definition: tenseur.C:684
virtual void del_deriv() const
Deletes all the derived quantities.
Definition: etoile_bin.C:450
Tenseur logn_comp
Part of the lapse logarithm (gravitational potential at the Newtonian limit) generated principaly by ...
Definition: etoile.h:857
Tenseur d_logn_auto
Gradient of logn_auto (Cartesian components with respect to ref_triad )
Definition: etoile.h:862
const Base_vect * get_triad() const
Returns the vectorial basis (triad) on which the components are defined.
Definition: tenseur.h:707
Tenseur beta_comp
Part of the logarithm of AN generated principaly by the companion star.
Definition: etoile.h:877
Map & mp
Mapping associated with the star.
Definition: etoile.h:432
Tenseur a_car
Total conformal factor .
Definition: etoile.h:518
bool relativistic
Indicator of relativity: true for a relativistic star, false for a Newtonian one. ...
Definition: etoile.h:440
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:803
Tenseur logn_auto
Total of the logarithm of the part of the lapse N generated principaly by the star.
Definition: etoile.h:487
Tenseur d_logn_auto_regu
Gradient of logn_auto_regu (Cartesian components with respect to ref_triad )
Definition: etoile.h:867
Tenseur beta_auto
Logarithm of the part of the product AN generated principaly by by the star.
Definition: etoile.h:509
void set_etat_qcq()
Sets the logical state to ETATQCQ (ordinary state).
Definition: tenseur.C:652
const Tenseur & get_shift_comp() const
Returns the part of the shift vector generated principaly by the companion star. ...
Definition: etoile.h:1161
void set_etat_zero()
Sets the logical state to ETATZERO (zero state).
Definition: tenseur.C:661
Tenseur d_logn_auto_div
Gradient of logn_auto_div (if k_div!=0 )
Definition: etoile.h:504
Tensor handling *** DEPRECATED : use class Tensor instead ***.
Definition: tenseur.h:304
const Tenseur & gradient() const
Returns the gradient of *this (Cartesian coordinates)
Definition: tenseur.C:1558