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
28char star_bin_extr_curv_C[] = "$Header: /cvsroot/Lorene/C++/Source/Star/star_bin_extr_curv.C,v 1.10 2014/10/13 08:53:38 j_novak Exp $" ;
29
30/*
31 * $Id: star_bin_extr_curv.C,v 1.10 2014/10/13 08:53:38 j_novak Exp $
32 * $Log: star_bin_extr_curv.C,v $
33 * Revision 1.10 2014/10/13 08:53:38 j_novak
34 * Lorene classes and functions now belong to the namespace Lorene.
35 *
36 * Revision 1.9 2014/10/06 15:13:16 j_novak
37 * Modified #include directives to use c++ syntax.
38 *
39 * Revision 1.8 2005/09/13 19:38:31 f_limousin
40 * Reintroduction of the resolution of the equations in cartesian coordinates.
41 *
42 * Revision 1.7 2005/02/24 16:04:44 f_limousin
43 * Change the name of some variables (for instance dcov_logn --> dlogn).
44 *
45 * Revision 1.6 2005/02/17 17:33:38 f_limousin
46 * Change the name of some quantities to be consistent with other classes
47 * (for instance nnn is changed to nn, shift to beta, beta to lnq...)
48 *
49 * Revision 1.5 2004/05/25 14:19:01 f_limousin
50 * Correction of an error : kcar_comp was computed instead
51 * ok kcar_auto.
52 *
53 * Revision 1.4 2004/03/23 09:57:57 f_limousin
54 * We now make the derivation with respect to the metric tilde
55 * instead of the flat metric for the computation of dshift.
56 *
57 * Revision 1.3 2004/02/27 09:52:41 f_limousin
58 * Correction of an error on the computation of kcar_auto.
59 *
60 * Revision 1.2 2004/01/20 15:18:00 f_limousin
61 * First version
62 *
63 *
64 * $Header: /cvsroot/Lorene/C++/Source/Star/star_bin_extr_curv.C,v 1.10 2014/10/13 08:53:38 j_novak Exp $
65 *
66 */
67
68// C headers
69#include <cmath>
70
71// Headers Lorene
72#include "star.h"
73
74namespace Lorene {
76
77 // Construction of Omega d/dphi
78 // ----------------------------
79
80 const Mg3d* mg = mp.get_mg() ;
81 int nz = mg->get_nzone() ; // total number of domains
82 Vector omdsdp (mp, CON, mp.get_bvect_cart()) ;
83 Scalar yya (mp) ;
84 yya = mp.ya ;
85 Scalar xxa (mp) ;
86 xxa = mp.xa ;
87
88 if (fabs(mp.get_rot_phi()) < 1e-10){
89 omdsdp.set(1) = - om * yya ;
90 omdsdp.set(2) = om * xxa ;
91 omdsdp.set(3).annule_hard() ;
92 }
93 else{
94 omdsdp.set(1) = om * yya ;
95 omdsdp.set(2) = - om * xxa ;
96 omdsdp.set(3).annule_hard() ;
97 }
98
99 omdsdp.set(1).set_spectral_va()
100 .set_base(*(mp.get_mg()->std_base_vect_cart()[0])) ;
101 omdsdp.set(2).set_spectral_va()
102 .set_base(*(mp.get_mg()->std_base_vect_cart()[1])) ;
103 omdsdp.set(3).set_spectral_va()
104 .set_base(*(mp.get_mg()->std_base_vect_cart()[2])) ;
105
106 omdsdp.annule_domain(nz-1) ;
107
108
109 // Gradient tilde (with respect to the cartesian coordinates
110 // of the mapping)
111 // D~_j beta^i
112
114
115 // Trace of D~_j beta^i :
117
118 // Computation of K^{ij}
119 // See Eq (49) from Gourgoulhon et al. (2001)
120 // ------------------------------------------
121
122 for (int i=1; i<=3; i++)
123 for (int j=1; j<=i; j++) {
124 tkij_auto.set(i, j) = dbeta(i, j) + dbeta(j, i) -
125 double(2) /double(3) * div_beta * (gtilde.con())(i,j) ;
126 }
127
128
129 // Addition (or not !) of u^{ij}
131
132 tkij_auto = 0.5 * tkij_auto / nn ;
133
134 // Computation of K_{ij} K^{ij}
135 // ----------------------------
136
138
139 kcar_auto = contract(tkij_auto_cov, 0, 1, tkij_auto, 0, 1,true) ;
140
141 // The derived quantities are obsolete
142 // -----------------------------------
143
144 del_deriv() ;
145}
146}
Time evolution with partial storage (*** under development ***).
Definition evolution.h:371
const Base_vect_cart & get_bvect_cart() const
Returns the Cartesian basis associated with the coordinates (x,y,z) of the mapping,...
Definition map.h:791
Coord ya
Absolute y coordinate.
Definition map.h:731
double get_rot_phi() const
Returns the angle between the x –axis and X –axis.
Definition map.h:775
Coord xa
Absolute x coordinate.
Definition map.h:730
const Mg3d * get_mg() const
Gives the Mg3d on which the mapping is defined.
Definition map.h:765
virtual const Sym_tensor & con() const
Read-only access to the contravariant representation.
Definition metric.C:290
Multi-domain grid.
Definition grilles.h:273
int get_nzone() const
Returns the number of domains.
Definition grilles.h:448
Tensor field of valence 0 (or component of a tensorial field).
Definition scalar.h:387
virtual void del_deriv() const
Deletes all the derived quantities.
Definition star_bin.C:369
void extrinsic_curvature(double omega)
Computes tkij_auto and akcar_auto from beta_auto, nn and Q.
Scalar kcar_auto
Part of the scalar generated by beta_auto, i.e.
Definition star.h:612
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 hij_auto
Deviation of the inverse conformal metric from the inverse flat metric generated principally by the ...
Definition star.h:588
Sym_tensor tkij_auto
Part of the extrinsic curvature tensor generated by beta_auto.
Definition star.h:600
Metric gtilde
Conformal metric .
Definition star.h:565
Scalar nn
Lapse function N .
Definition star.h:225
Map & mp
Mapping associated with the star.
Definition star.h:180
Class intended to describe valence-2 symmetric tensors.
Definition sym_tensor.h:223
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:360
Tensor handling.
Definition tensor.h:288
Tensor field of valence 1.
Definition vector.h:188
const Scalar & divergence(const Metric &) const
The divergence of this with respect to a Metric .
Definition vector.C:381
Tensor up_down(const Metric &gam) const
Computes a new tensor by raising or lowering all the indices of *this .
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:1014
Scalar & set(const Itbl &ind)
Returns the value of a component (read/write version).
Definition tensor.C:654
Tenseur contract(const Tenseur &, int id1, int id2)
Self contraction of two indices of a Tenseur .
Lorene prototypes.
Definition app_hor.h:64