LORENE
star_bin_upmetr_der_xcts.C
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 
27 
28 /*
29  * $Id: star_bin_upmetr_der_xcts.C,v 1.7 2016/12/05 16:18:15 j_novak Exp $
30  * $Log: star_bin_upmetr_der_xcts.C,v $
31  * Revision 1.7 2016/12/05 16:18:15 j_novak
32  * Suppression of some global variables (file names, loch, ...) to prevent redefinitions
33  *
34  * Revision 1.6 2014/10/13 08:53:38 j_novak
35  * Lorene classes and functions now belong to the namespace Lorene.
36  *
37  * Revision 1.5 2014/10/06 15:13:17 j_novak
38  * Modified #include directives to use c++ syntax.
39  *
40  * Revision 1.4 2010/12/09 10:44:42 m_bejger
41  * Cosmetic changes
42  *
43  * Revision 1.3 2010/06/15 14:58:19 m_bejger
44  * Companion D^j beta^i computed in companion frame and imported
45  *
46  * Revision 1.2 2010/06/15 08:09:43 m_bejger
47  * *** empty log message ***
48  *
49  * Revision 1.1 2010/05/04 07:51:05 m_bejger
50  * Initial version
51  *
52  * $Header: /cvsroot/Lorene/C++/Source/Star/star_bin_upmetr_der_xcts.C,v 1.7 2016/12/05 16:18:15 j_novak Exp $
53  *
54  */
55 
56 // C headers
57 #include <cmath>
58 
59 // Headers Lorene
60 #include "star.h"
61 #include "utilitaires.h"
62 #include "graphique.h"
63 
64 namespace Lorene {
66 
67  // Derivatives of metric coefficients
68  // ----------------------------------
69 
70  // Computation of dcov_Psi
71  Vector temp = (comp.Psi_auto).derive_cov(comp.flat) ;
72 
73  temp.dec_dzpuis(2) ;
75 
76  assert ( *(temp.get_triad()) == *(dcov_Psi.get_triad())) ;
77 
78  for(int i=1; i<=3; i++) {
79 
80  dcov_Psi.set(i).import(temp(i)) ;
81  dcov_Psi.set(i).set_spectral_va().set_base(temp(i).get_spectral_va().get_base()) ;
82 
83  }
84  dcov_Psi.inc_dzpuis(2) ;
85 
87 
88  // Computation of dcov_chi
89  temp = (comp.chi_auto).derive_cov(comp.flat) ;
90 
91  temp.dec_dzpuis(2) ;
93 
94  assert ( *(temp.get_triad()) == *(dcov_chi.get_triad())) ;
95 
96  for(int i=1; i<=3; i++) {
97 
98  dcov_chi.set(i).import(temp(i)) ;
99  dcov_chi.set(i).set_spectral_va().set_base(temp(i).get_spectral_va().get_base()) ;
100 
101  }
102  dcov_chi.inc_dzpuis(2) ;
103 
105 
106  // Computation of \hat{A}^{ij}_{comp}
107  // ----------------------------------
108 
109  // D^j beta^i
110 
111  Tensor temp_beta = (comp.beta_auto).derive_con(comp.flat) ;
112  temp_beta.dec_dzpuis(2) ;
113  temp_beta.change_triad(mp.get_bvect_cart()) ;
114 
115  Tensor dbeta_comp(mp, 2, CON, mp.get_bvect_cart()) ;
116 
117  assert ( *(temp_beta.get_triad()) == *(dbeta_comp.get_triad()) ) ;
118 
119  for(int i=1; i<=3; i++)
120  for(int j=1; j<=3; j++) {
121 
122  // importing
123  (dbeta_comp.set(i,j)).import( (temp_beta)(i,j) );
124  // setting appropriate bases
125  (dbeta_comp.set(i,j)).set_spectral_va().set_base(temp_beta(i,j).get_spectral_va().get_base()) ;
126 
127  }
128 
129  dbeta_comp.inc_dzpuis(2) ;
130 
131  // Trace of D_j beta^i :
132  Scalar divbeta_comp = beta_comp.divergence(flat) ;
133 
134  for (int i=1; i<=3; i++)
135  for (int j=1; j<=i; j++) {
136 //##
137 // for (int j=i; j<=3; j++) {
138 
139  haij_comp.set(i, j) = dbeta_comp(i, j) + dbeta_comp(j, i)
140  - double(2) /double(3) * divbeta_comp * (flat.con())(i,j) ;
141 
142  }
143 
144  // Computation of (\hat{A}_{ij}\hat{A}^{ij})_{comp}
145  // ------------------------------------------------
146 
147  Sym_tensor haij_auto_cov = haij_auto.up_down(flat) ;
148 
149  haij_comp = 0.5 * pow(Psi, 7.) / chi * haij_comp ;
150  //## for comparison: old formulation
151  //haij_comp = 0.5 * haij_comp / nn ;
153 
154  hacar_comp = contract(haij_auto_cov, 0, 1, haij_comp, 0, 1, true) ;
155 
156  // The derived quantities are obsolete
157  // -----------------------------------
158 
159  del_deriv() ;
160 
161 }
162 }
Scalar chi
Total function .
Definition: star.h:1155
Vector dcov_chi
Covariant derivative of the function .
Definition: star.h:1174
Map & mp
Mapping associated with the star.
Definition: star.h:180
Lorene prototypes.
Definition: app_hor.h:67
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 .
Vector dcov_Psi
Covariant derivative of the conformal factor .
Definition: star.h:1171
Class for stars in binary system in eXtended Conformal Thin Sandwich formulation. ...
Definition: star.h:1091
virtual void change_triad(const Base_vect &)
Sets a new vectorial basis (triad) of decomposition and modifies the components accordingly.
Tensor field of valence 1.
Definition: vector.h:188
Sym_tensor haij_auto
Part of the extrinsic curvature tensor generated by beta_auto.
Definition: star.h:1193
void set_base(const Base_val &)
Sets the bases for spectral expansions (member base )
Definition: valeur.C:813
virtual void dec_dzpuis(int dec=1)
Decreases by dec units the value of dzpuis and changes accordingly the values in the compactified ext...
Definition: tensor.C:817
virtual const Sym_tensor & con() const
Read-only access to the contravariant representation.
Definition: metric_flat.C:156
Sym_tensor haij_comp
Part of the extrinsic curvature tensor generated by beta_comp.
Definition: star.h:1199
Scalar Psi_auto
Scalar field generated principally by the star.
Definition: star.h:1144
const Base_vect * get_triad() const
Returns the vectorial basis (triad) on which the components are defined.
Definition: tensor.h:879
Vector beta_comp
Part of the shift vector generated principally by the star (Spherical components with respect to the ...
Definition: star.h:1187
const Scalar & divergence(const Metric &) const
The divergence of this with respect to a Metric .
Definition: vector.C:387
Cmp pow(const Cmp &, int)
Power .
Definition: cmp_math.C:351
Scalar chi_auto
Scalar field generated principally by the star.
Definition: star.h:1134
Tensor handling.
Definition: tensor.h:294
Tenseur contract(const Tenseur &, int id1, int id2)
Self contraction of two indices of a Tenseur .
virtual void inc_dzpuis(int inc=1)
Increases by inc units the value of dzpuis and changes accordingly the values in the compactified ext...
Definition: tensor.C:825
Metric_flat flat
Flat metric defined on the mapping (Spherical components with respect to the mapping of the star) ...
Definition: star.h:1177
void import(const Scalar &ci)
Assignment to another Scalar defined on a different mapping.
Definition: scalar_import.C:71
Scalar Psi
Total conformal factor .
Definition: star.h:1152
void update_metric_der_comp(const Star_bin_xcts &comp)
Computes the derivative of metric functions related to the companion star.
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
Scalar & set(const Itbl &ind)
Returns the value of a component (read/write version).
Definition: tensor.C:663
Vector beta_auto
Part of the shift vector generated principally by the star (Spherical components with respect to the ...
Definition: star.h:1182
virtual void del_deriv() const
Deletes all the derived quantities.
virtual void change_triad(const Base_vect &new_triad)
Sets a new vectorial basis (triad) of decomposition and modifies the components accordingly.
Scalar hacar_comp
Part of the scalar generated by beta_auto and beta_comp, i.e.
Definition: star.h:1211
Valeur & set_spectral_va()
Returns va (read/write version)
Definition: scalar.h:610
Scalar & set(int)
Read/write access to a component.
Definition: vector.C:302
const Vector & derive_cov(const Metric &gam) const
Returns the gradient (1-form = covariant vector) of *this
Definition: scalar_deriv.C:390
virtual void std_spectral_base()
Sets the standard spectal bases of decomposition for each component.
Definition: tensor.C:935
Class intended to describe valence-2 symmetric tensors.
Definition: sym_tensor.h:226