| 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 |
char 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 |
|
| 74 |
namespace Lorene { |
| 75 |
void Star_bin::extrinsic_curvature(double om){ |
| 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 |
|
| 113 |
const Tensor& dbeta = beta_auto.derive_con(gtilde) ; |
| 114 |
|
| 115 |
// Trace of D~_j beta^i : |
| 116 |
Scalar div_beta = beta_auto.divergence(gtilde) ; |
| 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} |
| 130 |
tkij_auto = tkij_auto - 0*hij_auto.derive_lie(omdsdp) ; |
| 131 |
|
| 132 |
tkij_auto = 0.5 * tkij_auto / nn ; |
| 133 |
|
| 134 |
// Computation of K_{ij} K^{ij} |
| 135 |
// ---------------------------- |
| 136 |
|
| 137 |
Sym_tensor tkij_auto_cov = tkij_auto.up_down(gtilde) ; |
| 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 |
} |