LORENE
et_bin_upmetr_der.C
1 /*
2  * Methods Etoile_bin::update_metric_der_comp
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_der.C,v 1.8 2016/12/05 16:17:53 j_novak Exp $
34  * $Log: et_bin_upmetr_der.C,v $
35  * Revision 1.8 2016/12/05 16:17:53 j_novak
36  * Suppression of some global variables (file names, loch, ...) to prevent redefinitions
37  *
38  * Revision 1.7 2014/10/13 08:52:56 j_novak
39  * Lorene classes and functions now belong to the namespace Lorene.
40  *
41  * Revision 1.6 2003/10/24 12:27:16 k_taniguchi
42  * Suppress the method of update metric for NS-BH
43  *
44  * Revision 1.5 2003/10/24 11:47:02 k_taniguchi
45  * Change some notations
46  *
47  * Revision 1.4 2002/12/19 14:53:38 e_gourgoulhon
48  * Added the new function
49  * void update_metric_der_comp(const Bhole& comp)
50  * to treat the case where the companion is a black hole
51  *
52  * Revision 1.3 2002/12/10 15:12:07 k_taniguchi
53  * Change the multiplication "*" to "%".
54  *
55  * Revision 1.2 2001/12/14 15:15:30 k_taniguchi
56  * Change of the method to calculate derivatives with respect to the companion star
57  *
58  * Revision 1.1.1.1 2001/11/20 15:19:28 e_gourgoulhon
59  * LORENE
60  *
61  * Revision 2.4 2000/03/13 14:03:38 eric
62  * Modif commentaires.
63  *
64  * Revision 2.3 2000/03/07 14:54:54 eric
65  * Ajout du calcul de akcar_comp.
66  *
67  * Revision 2.2 2000/03/07 08:34:04 eric
68  * Appel de Cmp::import_sym / asym (pour tenir compte de la symetrie /
69  * plan y=0).
70  *
71  * Revision 2.1 2000/02/10 18:56:38 eric
72  * Traitement du cas ETATZERO.
73  *
74  * Revision 2.0 2000/02/04 16:38:11 eric
75  * *** empty log message ***
76  *
77  *
78  * $Header: /cvsroot/Lorene/C++/Source/Etoile/et_bin_upmetr_der.C,v 1.8 2016/12/05 16:17:53 j_novak Exp $
79  *
80  */
81 
82 // Headers Lorene
83 #include "etoile.h"
84 #include "bhole.h"
85 
86 namespace Lorene {
88 
89  // Computation of d_logn_comp
90  // --------------------------
91 
92  if ( (comp.d_logn_auto).get_etat() == ETATZERO ) {
94  }
95  else{
97  }
98 
100 
101  // Computation of d_beta_comp
102  // --------------------------
103 
104  if ( (comp.d_beta_auto).get_etat() == ETATZERO ) {
106  }
107  else {
109  }
110 
112 
113  // Computation of tkij_comp
114  // ------------------------
115 
116  if ( (comp.tkij_auto).get_etat() == ETATZERO ) {
118  }
119  else{
120 
121  // Components of shift_comp with respect to the Cartesian triad
122  // (d/dx, d/dy, d/dz) of the mapping :
123  Tenseur shift_comp_local = shift_comp ;
124  shift_comp_local.change_triad( mp.get_bvect_cart() ) ;
125 
126  // Gradient (partial derivatives with respect to
127  // the Cartesian coordinates of the mapping)
128  // D_j N^i
129 
130  Tenseur dn_comp = shift_comp_local.gradient() ;
131 
132  // Return to the absolute reference frame
133  dn_comp.change_triad(ref_triad) ;
134 
135  // Trace of D_j N^i = divergence of N^i :
136  Tenseur divn_comp = contract(dn_comp, 0, 1) ;
137 
138  // Computation of A^2 K^{ij}
139  // -------------------------
141 
142  for (int i=0; i<3; i++) {
143  for (int j=i; j<3; j++) {
144  tkij_comp.set(i, j) = dn_comp(i, j) + dn_comp(j, i) ;
145  }
146  tkij_comp.set(i, i) -= double(2)/double(3) * divn_comp() ;
147  }
148 
149  tkij_comp = - 0.5 * tkij_comp / nnn ;
150 
151  }
152 
153  tkij_comp.set_triad( *((comp.tkij_auto).get_triad()) ) ;
155 
156  if (relativistic) {
157  // Computation of akcar_comp
158  // -------------------------
159 
161 
162  akcar_comp.set() = 0 ;
163 
164  for (int i=0; i<3; i++) {
165  for (int j=0; j<3; j++) {
166 
167  akcar_comp.set() += tkij_auto(i, j) % tkij_comp(i, j) ;
168 
169  }
170  }
171 
174 
175  }
176 
177  // The derived quantities are obsolete
178  // -----------------------------------
179 
180  del_deriv() ;
181 
182 
183  //-----------------------------------------------------
184  // The previous way to calculate d_logn_comp and so on
185  // which we do not use
186  //-----------------------------------------------------
187 
188  //#################################
189  /*
190  int nz = mp.get_mg()->get_nzone() ;
191  int nzm1 = nz - 1 ;
192 
193  // Computation of d_logn_comp
194  // --------------------------
195 
196  if ( (comp.d_logn_auto).get_etat() == ETATZERO ) {
197  d_logn_comp.set_etat_zero() ;
198  }
199  else{
200 
201  // 1/ Division by r^2 of comp.d_logn_auto in the ZEC
202  Tenseur vecttmp = comp.d_logn_auto ;
203  vecttmp.dec2_dzpuis() ;
204 
205  // 2/ Interpolation of the result
206  //## OUTSIDE THE ZEC
207 
208  d_logn_comp.set_etat_qcq() ;
209  (d_logn_comp.set(0)).import_symy(nzm1, vecttmp(0) ) ; // d/dx sym.
210  (d_logn_comp.set(1)).import_asymy(nzm1, vecttmp(1) ) ; // d/dy antisym.
211  (d_logn_comp.set(2)).import_symy(nzm1, vecttmp(2) ) ; // d/dz sym.
212 
213  }
214 
215  d_logn_comp.set_triad( *((comp.d_logn_auto).get_triad()) ) ;
216 
217 
218  // Computation of d_beta_comp
219  // --------------------------
220 
221  if ( (comp.d_beta_auto).get_etat() == ETATZERO ) {
222  d_beta_comp.set_etat_zero() ;
223  }
224  else {
225  // 1/ Division by r^2 of comp.d_logn_auto in the ZEC
226  Tenseur vecttmp = comp.d_beta_auto ;
227  vecttmp.dec2_dzpuis() ;
228 
229  // 2/ Interpolation of the result
230  //## OUTSIDE THE ZEC
231 
232  d_beta_comp.set_etat_qcq() ;
233 
234  (d_beta_comp.set(0)).import_symy(nzm1, vecttmp(0) ) ; // d/dx sym.
235  (d_beta_comp.set(1)).import_asymy(nzm1, vecttmp(1) ) ; // d/dy antisym.
236  (d_beta_comp.set(2)).import_symy(nzm1, vecttmp(2) ) ; // d/dz sym.
237 
238  }
239 
240  d_beta_comp.set_triad( *((comp.d_beta_auto).get_triad()) ) ;
241 
242  // Computation of tkij_comp
243  // ------------------------
244 
245  if ( (comp.tkij_auto).get_etat() == ETATZERO ) {
246  tkij_comp.set_etat_zero() ;
247  }
248  else{
249 
250  // 1/ Division by r^2 of comp.d_logn_auto in the ZEC
251  Tenseur_sym tenstmp = comp.tkij_auto ;
252  tenstmp.dec2_dzpuis() ;
253 
254  // 2/ Interpolation of the result
255  //## OUTSIDE THE ZEC
256 
257  tkij_comp.set_etat_qcq() ;
258 
259  (tkij_comp.set(0, 0)).import_asymy(nzm1, tenstmp(0, 0) ) ; // K_xx antisym
260  (tkij_comp.set(0, 1)).import_symy(nzm1, tenstmp(0, 1) ) ; // K_xy sym.
261  (tkij_comp.set(0, 2)).import_asymy(nzm1, tenstmp(0, 2) ) ; // K_xz antisym
262  (tkij_comp.set(1, 1)).import_asymy(nzm1, tenstmp(1, 1) ) ; // K_yy antisym.
263  (tkij_comp.set(1, 2)).import_symy(nzm1, tenstmp(1, 2) ) ; // K_yz sym
264  (tkij_comp.set(2, 2)).import_asymy(nzm1, tenstmp(2, 2) ) ; // K_zz antisym.
265 
266  }
267 
268  tkij_comp.set_triad( *((comp.tkij_auto).get_triad()) ) ;
269 
270  if (relativistic) {
271  // Computation of akcar_comp
272  // -------------------------
273 
274  akcar_comp.set_etat_qcq() ;
275 
276  akcar_comp.set() = 0 ;
277 
278  for (int i=0; i<3; i++) {
279  for (int j=0; j<3; j++) {
280 
281  akcar_comp.set() += tkij_auto(i, j) * tkij_comp(i, j) ;
282 
283  }
284  }
285 
286  akcar_comp = a_car * akcar_comp ;
287  }
288 
289 
290  // The derived quantities are obsolete
291  // -----------------------------------
292 
293  del_deriv() ;
294  */
295  //#################################
296 
297 }
298 }
Tenseur shift_comp
Part of the shift vector generated principaly by the companion star.
Definition: etoile.h:898
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:831
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
Lorene prototypes.
Definition: app_hor.h:67
Tenseur nnn
Total lapse function.
Definition: etoile.h:512
Class for stars in binary system.
Definition: etoile.h:817
Tenseur d_beta_auto
Gradient of beta_auto (Cartesian components with respect to ref_triad )
Definition: etoile.h:882
Cmp & set()
Read/write for a scalar (see also operator=(const Cmp&) ).
Definition: tenseur.C:840
Tenseur d_beta_comp
Gradient of beta_comp (Cartesian components with respect to ref_triad )
Definition: etoile.h:887
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
Tenseur akcar_comp
Part of the scalar generated by shift_auto and shift_comp , i.e.
Definition: etoile.h:947
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 contract(const Tenseur &, int id1, int id2)
Self contraction of two indices of a Tenseur .
Tenseur_sym tkij_auto
Part of the extrinsic curvature tensor generated by shift_auto .
Definition: etoile.h:928
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
void update_metric_der_comp(const Etoile_bin &comp)
Computes the derivative of metric functions related to the companion star.
void set_etat_qcq()
Sets the logical state to ETATQCQ (ordinary state).
Definition: tenseur.C:652
void set_etat_zero()
Sets the logical state to ETATZERO (zero state).
Definition: tenseur.C:661
Tenseur d_logn_comp
Gradient of logn_comp (Cartesian components with respect to ref_triad )
Definition: etoile.h:872
Tenseur_sym tkij_comp
Part of the extrinsic curvature tensor generated by shift_comp .
Definition: etoile.h:935
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