| 1 |
/* |
| 2 |
* Methods Star_bin_xcts::update_metric_der_comp |
| 3 |
* (see file star.h for documentation) |
| 4 |
*/ |
| 5 |
|
| 6 |
/* |
| 7 |
* Copyright (c) 2010 Michal Bejger |
| 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 version 2 |
| 13 |
* as published by the Free Software Foundation. |
| 14 |
* |
| 15 |
* LORENE is distributed in the hope that it will be useful, |
| 16 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 17 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 18 |
* GNU General Public License for more details. |
| 19 |
* |
| 20 |
* You should have received a copy of the GNU General Public License |
| 21 |
* along with LORENE; if not, write to the Free Software |
| 22 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 23 |
* |
| 24 |
*/ |
| 25 |
|
| 26 |
char star_bin_upmetr_der_xcts_C[] = "$Header: /cvsroot/Lorene/C++/Source/Star/star_bin_upmetr_der_xcts.C,v 1.6 2014/10/13 08:53:38 j_novak Exp $" ; |
| 27 |
|
| 28 |
/* |
| 29 |
* $Id: star_bin_upmetr_der_xcts.C,v 1.6 2014/10/13 08:53:38 j_novak Exp $ |
| 30 |
* $Log: star_bin_upmetr_der_xcts.C,v $ |
| 31 |
* Revision 1.6 2014/10/13 08:53:38 j_novak |
| 32 |
* Lorene classes and functions now belong to the namespace Lorene. |
| 33 |
* |
| 34 |
* Revision 1.5 2014/10/06 15:13:17 j_novak |
| 35 |
* Modified #include directives to use c++ syntax. |
| 36 |
* |
| 37 |
* Revision 1.4 2010/12/09 10:44:42 m_bejger |
| 38 |
* Cosmetic changes |
| 39 |
* |
| 40 |
* Revision 1.3 2010/06/15 14:58:19 m_bejger |
| 41 |
* Companion D^j beta^i computed in companion frame and imported |
| 42 |
* |
| 43 |
* Revision 1.2 2010/06/15 08:09:43 m_bejger |
| 44 |
* *** empty log message *** |
| 45 |
* |
| 46 |
* Revision 1.1 2010/05/04 07:51:05 m_bejger |
| 47 |
* Initial version |
| 48 |
* |
| 49 |
* $Header: /cvsroot/Lorene/C++/Source/Star/star_bin_upmetr_der_xcts.C,v 1.6 2014/10/13 08:53:38 j_novak Exp $ |
| 50 |
* |
| 51 |
*/ |
| 52 |
|
| 53 |
// C headers |
| 54 |
#include <cmath> |
| 55 |
|
| 56 |
// Headers Lorene |
| 57 |
#include "star.h" |
| 58 |
#include "utilitaires.h" |
| 59 |
#include "graphique.h" |
| 60 |
|
| 61 |
namespace Lorene { |
| 62 |
void Star_bin_xcts::update_metric_der_comp(const Star_bin_xcts& comp) { |
| 63 |
|
| 64 |
// Derivatives of metric coefficients |
| 65 |
// ---------------------------------- |
| 66 |
|
| 67 |
// Computation of dcov_Psi |
| 68 |
Vector temp = (comp.Psi_auto).derive_cov(comp.flat) ; |
| 69 |
|
| 70 |
temp.dec_dzpuis(2) ; |
| 71 |
temp.change_triad(mp.get_bvect_cart()) ; |
| 72 |
|
| 73 |
assert ( *(temp.get_triad()) == *(dcov_Psi.get_triad())) ; |
| 74 |
|
| 75 |
for(int i=1; i<=3; i++) { |
| 76 |
|
| 77 |
dcov_Psi.set(i).import(temp(i)) ; |
| 78 |
dcov_Psi.set(i).set_spectral_va().set_base(temp(i).get_spectral_va().get_base()) ; |
| 79 |
|
| 80 |
} |
| 81 |
dcov_Psi.inc_dzpuis(2) ; |
| 82 |
|
| 83 |
dcov_Psi += Psi_auto.derive_cov(flat) ; |
| 84 |
|
| 85 |
// Computation of dcov_chi |
| 86 |
temp = (comp.chi_auto).derive_cov(comp.flat) ; |
| 87 |
|
| 88 |
temp.dec_dzpuis(2) ; |
| 89 |
temp.change_triad(mp.get_bvect_cart()) ; |
| 90 |
|
| 91 |
assert ( *(temp.get_triad()) == *(dcov_chi.get_triad())) ; |
| 92 |
|
| 93 |
for(int i=1; i<=3; i++) { |
| 94 |
|
| 95 |
dcov_chi.set(i).import(temp(i)) ; |
| 96 |
dcov_chi.set(i).set_spectral_va().set_base(temp(i).get_spectral_va().get_base()) ; |
| 97 |
|
| 98 |
} |
| 99 |
dcov_chi.inc_dzpuis(2) ; |
| 100 |
|
| 101 |
dcov_chi += chi_auto.derive_cov(flat) ; |
| 102 |
|
| 103 |
// Computation of \hat{A}^{ij}_{comp} |
| 104 |
// ---------------------------------- |
| 105 |
|
| 106 |
// D^j beta^i |
| 107 |
|
| 108 |
Tensor temp_beta = (comp.beta_auto).derive_con(comp.flat) ; |
| 109 |
temp_beta.dec_dzpuis(2) ; |
| 110 |
temp_beta.change_triad(mp.get_bvect_cart()) ; |
| 111 |
|
| 112 |
Tensor dbeta_comp(mp, 2, CON, mp.get_bvect_cart()) ; |
| 113 |
|
| 114 |
assert ( *(temp_beta.get_triad()) == *(dbeta_comp.get_triad()) ) ; |
| 115 |
|
| 116 |
for(int i=1; i<=3; i++) |
| 117 |
for(int j=1; j<=3; j++) { |
| 118 |
|
| 119 |
// importing |
| 120 |
(dbeta_comp.set(i,j)).import( (temp_beta)(i,j) ); |
| 121 |
// setting appropriate bases |
| 122 |
(dbeta_comp.set(i,j)).set_spectral_va().set_base(temp_beta(i,j).get_spectral_va().get_base()) ; |
| 123 |
|
| 124 |
} |
| 125 |
|
| 126 |
dbeta_comp.inc_dzpuis(2) ; |
| 127 |
|
| 128 |
// Trace of D_j beta^i : |
| 129 |
Scalar divbeta_comp = beta_comp.divergence(flat) ; |
| 130 |
|
| 131 |
for (int i=1; i<=3; i++) |
| 132 |
for (int j=1; j<=i; j++) { |
| 133 |
//## |
| 134 |
// for (int j=i; j<=3; j++) { |
| 135 |
|
| 136 |
haij_comp.set(i, j) = dbeta_comp(i, j) + dbeta_comp(j, i) |
| 137 |
- double(2) /double(3) * divbeta_comp * (flat.con())(i,j) ; |
| 138 |
|
| 139 |
} |
| 140 |
|
| 141 |
// Computation of (\hat{A}_{ij}\hat{A}^{ij})_{comp} |
| 142 |
// ------------------------------------------------ |
| 143 |
|
| 144 |
Sym_tensor haij_auto_cov = haij_auto.up_down(flat) ; |
| 145 |
|
| 146 |
haij_comp = 0.5 * pow(Psi, 7.) / chi * haij_comp ; |
| 147 |
//## for comparison: old formulation |
| 148 |
//haij_comp = 0.5 * haij_comp / nn ; |
| 149 |
haij_comp.std_spectral_base() ; |
| 150 |
|
| 151 |
hacar_comp = contract(haij_auto_cov, 0, 1, haij_comp, 0, 1, true) ; |
| 152 |
|
| 153 |
// The derived quantities are obsolete |
| 154 |
// ----------------------------------- |
| 155 |
|
| 156 |
del_deriv() ; |
| 157 |
|
| 158 |
} |
| 159 |
} |