LORENE
star_bin_extr_curv.C
1 /*
2  * Method of class Star_bin to compute the extrinsic curvature tensor
3  *
4  */
5 
6 /*
7  * Copyright (c) 2004 Francois Limousin
8  *
9  * This file is part of LORENE.
10  *
11  * LORENE is free software; you can redistribute it and/or modify
12  * it under the terms of the GNU General Public License as published by
13  * the Free Software Foundation; either version 2 of the License, or
14  * (at your option) any later version.
15  *
16  * LORENE is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU General Public License for more details.
20  *
21  * You should have received a copy of the GNU General Public License
22  * along with LORENE; if not, write to the Free Software
23  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24  *
25  */
26 
27 
28 
29 
30 /*
31  * $Id: star_bin_extr_curv.C,v 1.11 2016/12/05 16:18:14 j_novak Exp $
32  * $Log: star_bin_extr_curv.C,v $
33  * Revision 1.11 2016/12/05 16:18:14 j_novak
34  * Suppression of some global variables (file names, loch, ...) to prevent redefinitions
35  *
36  * Revision 1.10 2014/10/13 08:53:38 j_novak
37  * Lorene classes and functions now belong to the namespace Lorene.
38  *
39  * Revision 1.9 2014/10/06 15:13:16 j_novak
40  * Modified #include directives to use c++ syntax.
41  *
42  * Revision 1.8 2005/09/13 19:38:31 f_limousin
43  * Reintroduction of the resolution of the equations in cartesian coordinates.
44  *
45  * Revision 1.7 2005/02/24 16:04:44 f_limousin
46  * Change the name of some variables (for instance dcov_logn --> dlogn).
47  *
48  * Revision 1.6 2005/02/17 17:33:38 f_limousin
49  * Change the name of some quantities to be consistent with other classes
50  * (for instance nnn is changed to nn, shift to beta, beta to lnq...)
51  *
52  * Revision 1.5 2004/05/25 14:19:01 f_limousin
53  * Correction of an error : kcar_comp was computed instead
54  * ok kcar_auto.
55  *
56  * Revision 1.4 2004/03/23 09:57:57 f_limousin
57  * We now make the derivation with respect to the metric tilde
58  * instead of the flat metric for the computation of dshift.
59  *
60  * Revision 1.3 2004/02/27 09:52:41 f_limousin
61  * Correction of an error on the computation of kcar_auto.
62  *
63  * Revision 1.2 2004/01/20 15:18:00 f_limousin
64  * First version
65  *
66  *
67  * $Header: /cvsroot/Lorene/C++/Source/Star/star_bin_extr_curv.C,v 1.11 2016/12/05 16:18:14 j_novak Exp $
68  *
69  */
70 
71 // C headers
72 #include <cmath>
73 
74 // Headers Lorene
75 #include "star.h"
76 
77 namespace Lorene {
79 
80  // Construction of Omega d/dphi
81  // ----------------------------
82 
83  const Mg3d* mg = mp.get_mg() ;
84  int nz = mg->get_nzone() ; // total number of domains
85  Vector omdsdp (mp, CON, mp.get_bvect_cart()) ;
86  Scalar yya (mp) ;
87  yya = mp.ya ;
88  Scalar xxa (mp) ;
89  xxa = mp.xa ;
90 
91  if (fabs(mp.get_rot_phi()) < 1e-10){
92  omdsdp.set(1) = - om * yya ;
93  omdsdp.set(2) = om * xxa ;
94  omdsdp.set(3).annule_hard() ;
95  }
96  else{
97  omdsdp.set(1) = om * yya ;
98  omdsdp.set(2) = - om * xxa ;
99  omdsdp.set(3).annule_hard() ;
100  }
101 
102  omdsdp.set(1).set_spectral_va()
103  .set_base(*(mp.get_mg()->std_base_vect_cart()[0])) ;
104  omdsdp.set(2).set_spectral_va()
105  .set_base(*(mp.get_mg()->std_base_vect_cart()[1])) ;
106  omdsdp.set(3).set_spectral_va()
107  .set_base(*(mp.get_mg()->std_base_vect_cart()[2])) ;
108 
109  omdsdp.annule_domain(nz-1) ;
110 
111 
112  // Gradient tilde (with respect to the cartesian coordinates
113  // of the mapping)
114  // D~_j beta^i
115 
116  const Tensor& dbeta = beta_auto.derive_con(gtilde) ;
117 
118  // Trace of D~_j beta^i :
119  Scalar div_beta = beta_auto.divergence(gtilde) ;
120 
121  // Computation of K^{ij}
122  // See Eq (49) from Gourgoulhon et al. (2001)
123  // ------------------------------------------
124 
125  for (int i=1; i<=3; i++)
126  for (int j=1; j<=i; j++) {
127  tkij_auto.set(i, j) = dbeta(i, j) + dbeta(j, i) -
128  double(2) /double(3) * div_beta * (gtilde.con())(i,j) ;
129  }
130 
131 
132  // Addition (or not !) of u^{ij}
133  tkij_auto = tkij_auto - 0*hij_auto.derive_lie(omdsdp) ;
134 
135  tkij_auto = 0.5 * tkij_auto / nn ;
136 
137  // Computation of K_{ij} K^{ij}
138  // ----------------------------
139 
140  Sym_tensor tkij_auto_cov = tkij_auto.up_down(gtilde) ;
141 
142  kcar_auto = contract(tkij_auto_cov, 0, 1, tkij_auto, 0, 1,true) ;
143 
144  // The derived quantities are obsolete
145  // -----------------------------------
146 
147  del_deriv() ;
148 }
149 }
Coord xa
Absolute x coordinate.
Definition: map.h:748
Base_val ** std_base_vect_cart() const
Returns the standard spectral bases for the Cartesian components of a vector.
virtual const Sym_tensor & con() const
Read-only access to the contravariant representation.
Definition: metric.C:293
Map & mp
Mapping associated with the star.
Definition: star.h:180
Sym_tensor hij_auto
Deviation of the inverse conformal metric from the inverse flat metric generated principally by the ...
Definition: star.h:588
Lorene prototypes.
Definition: app_hor.h:67
const Mg3d * get_mg() const
Gives the Mg3d on which the mapping is defined.
Definition: map.h:783
Tensor field of valence 0 (or component of a tensorial field).
Definition: scalar.h:393
Tensor up_down(const Metric &gam) const
Computes a new tensor by raising or lowering all the indices of *this .
Scalar kcar_auto
Part of the scalar generated by beta_auto, i.e.
Definition: star.h:612
double get_rot_phi() const
Returns the angle between the x –axis and X –axis.
Definition: map.h:793
void set(const Map *mp, Mtbl *(*construct)(const Map *))
Semi-constructor from a mapping and a method.
Definition: coord.C:137
Tensor field of valence 1.
Definition: vector.h:188
void annule_hard()
Sets the Scalar to zero in a hard way.
Definition: scalar.C:386
int get_nzone() const
Returns the number of domains.
Definition: grilles.h:465
void extrinsic_curvature(double omega)
Computes tkij_auto and akcar_auto from beta_auto, nn and Q.
virtual void del_deriv() const
Deletes all the derived quantities.
Definition: star_bin.C:372
const Scalar & divergence(const Metric &) const
The divergence of this with respect to a Metric .
Definition: vector.C:387
Tensor handling.
Definition: tensor.h:294
Tenseur contract(const Tenseur &, int id1, int id2)
Self contraction of two indices of a Tenseur .
Metric gtilde
Conformal metric .
Definition: star.h:565
Coord ya
Absolute y coordinate.
Definition: map.h:749
const Tensor & derive_con(const Metric &gam) const
Returns the "contravariant" derivative of this with respect to some metric , by raising the last inde...
Definition: tensor.C:1023
Multi-domain grid.
Definition: grilles.h:279
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:809
Scalar & set(const Itbl &ind)
Returns the value of a component (read/write version).
Definition: tensor.C:663
Scalar nn
Lapse function N .
Definition: star.h:225
Sym_tensor tkij_auto
Part of the extrinsic curvature tensor generated by beta_auto.
Definition: star.h:600
Vector beta_auto
Part of the shift vector generated principally by the star (Spherical components with respect to the ...
Definition: star.h:570
Sym_tensor derive_lie(const Vector &v) const
Computes the Lie derivative of this with respect to some vector field v.
Definition: sym_tensor.C:363
Class intended to describe valence-2 symmetric tensors.
Definition: sym_tensor.h:226