LORENE
star_bin_upmetr_xcts.C
1 /*
2  * Methods of Star_bin_xcts::update_metric
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_xcts_C[] = "$Header: /cvsroot/Lorene/C++/Source/Star/star_bin_upmetr_xcts.C,v 1.7 2014/10/13 08:53:38 j_novak Exp $" ;
27 
28 /*
29  * $Id: star_bin_upmetr_xcts.C,v 1.7 2014/10/13 08:53:38 j_novak Exp $
30  * $Log: star_bin_upmetr_xcts.C,v $
31  * Revision 1.7 2014/10/13 08:53:38 j_novak
32  * Lorene classes and functions now belong to the namespace Lorene.
33  *
34  * Revision 1.6 2010/12/09 10:46:50 m_bejger
35  * Re-definition of psi4, N, log(N)
36  *
37  * Revision 1.5 2010/10/26 20:08:56 m_bejger
38  * Cleanup
39  *
40  * Revision 1.4 2010/06/17 15:08:42 m_bejger
41  * Correcting previous corrections that were, in fact, incorrect
42  *
43  * Revision 1.3 2010/06/15 08:13:01 m_bejger
44  * Some more corrections: Psi, chi
45  *
46  * Revision 1.2 2010/06/04 20:01:59 m_bejger
47  * Corrected definitions of lapse, Psi4; added definition of gamma
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_xcts.C,v 1.7 2014/10/13 08:53:38 j_novak Exp $
53  *
54  */
55 
56 // Headers Lorene
57 #include "cmp.h"
58 #include "star.h"
59 #include "graphique.h"
60 #include "utilitaires.h"
61 
62 //----------------------------------//
63 // Version without relaxation //
64 //----------------------------------//
65 
66 namespace Lorene {
68 
69  // Computation of quantities coming from the companion
70  // ---------------------------------------------------
71 
72  if ( (comp.Psi_auto).get_etat() == ETATZERO ) {
74 
75  } else {
77  Psi_comp.import( comp.Psi_auto ) ;
79  }
80 
83 
84  Vector comp_beta(comp.beta_auto) ;
85  comp_beta.change_triad(mp.get_bvect_cart()) ;
86 
87  assert ( *(beta_comp.get_triad()) == *(comp_beta.get_triad())) ;
88 
89  (beta_comp.set(1)).import( comp_beta(1) ) ;
90  (beta_comp.set(2)).import( comp_beta(2) ) ;
91  (beta_comp.set(3)).import( comp_beta(3) ) ;
92 
94 
95  if ( (comp.chi_auto).get_etat() == ETATZERO ) {
97 
98  } else {
100  chi_comp.import( comp.chi_auto ) ;
102  }
103 
104 // Conformal factor Psi
105 // --------------------
106 
107  Psi = Psi_auto + Psi_comp + 1.;
108 
109  psi4 = pow(Psi, 4.) ;
111 
112 // Function chi = NPsi
113 // --------------------
114 
115  chi = chi_auto + chi_comp + 1.;
116 
117 // Lapse function N
118 // ----------------
119 
120  nn = chi/Psi ;
121  nn.std_spectral_base() ;
122 
123 // logarithm of lapse function N
124 // ----------------
125 
126  logn = log(nn) ;
128 
129 // Shift vector
130 // -------------
131 
132  beta = beta_auto + beta_comp ;
133 
134  gamma = flat.con() / psi4 ;
135 
136 // Extrinsic curvature (haij_auto and hacar_auto)
137 //-----------------------------------------------
138 
140 
141 // The derived quantities are obsolete
142 // -----------------------------------
143 
144  del_deriv() ;
145 
146 }
147 
148 //----------------------------------//
149 // Version with relaxation //
150 //----------------------------------//
151 
153  const Star_bin_xcts& star_jm1,
154  double relax) {
155 
156 
157  // Computation of quantities coming from the companion
158  // ---------------------------------------------------
159 
160  if ( (comp.Psi_auto).get_etat() == ETATZERO ) {
162 
163  } else {
164 
166  Psi_comp.import( comp.Psi_auto ) ;
168 
169  }
170 
173 
174  Vector comp_beta(comp.beta_auto) ;
175  comp_beta.change_triad(mp.get_bvect_cart()) ;
176 
177  assert ( *(beta_comp.get_triad()) == *(comp_beta.get_triad())) ;
178 
179  (beta_comp.set(1)).import( comp_beta(1) ) ;
180  (beta_comp.set(2)).import( comp_beta(2) ) ;
181  (beta_comp.set(3)).import( comp_beta(3) ) ;
182 
184 
185  if ( (comp.chi_auto).get_etat() == ETATZERO ) {
187 
188  } else {
189 
191  chi_comp.import( comp.chi_auto ) ;
193 
194  }
195 
196 // Relaxation on Psi_comp, beta_comp, chi_comp
197 // -------------------------------------------
198  double relaxjm1 = 1. - relax ;
199 
200  Psi_comp = relax * Psi_comp + relaxjm1 * (star_jm1.Psi_comp) ;
201  beta_comp = relax * beta_comp + relaxjm1 * (star_jm1.beta_comp) ;
202  chi_comp = relax * chi_comp + relaxjm1 * (star_jm1.chi_comp) ;
203 
204 // Conformal factor Psi
205 // --------------------
206 
207  Psi = Psi_auto + Psi_comp + 1.;
208 
209  psi4 = pow(Psi, 4.) ;
211 
212 // Function chi = NPsi
213 // --------------------
214 
215  chi = chi_auto + chi_comp + 1.;
216 
217 // Lapse function N
218 // ----------------
219 
220  nn = chi/Psi ;
221  nn.std_spectral_base() ;
222 
223 // logarithm of lapse function N
224 // ----------------
225 
226  logn = log(nn) ;
228 
229 // Shift vector
230 // ------------
231 
232  beta = beta_auto + beta_comp ;
233 
234  gamma = flat.con() / psi4 ;
235 
236 // Extrinsic curvature (haij_auto and hacar_auto)
237 //-----------------------------------------------
238 
240 
241 // The derived quantities are obsolete
242 // -----------------------------------
243 
244  del_deriv() ;
245 
246 }
247 
248 }
Lorene::Star::logn
Scalar logn
Logarithm of the lapse N .
Definition: star.h:222
Lorene::Metric_flat::con
virtual const Sym_tensor & con() const
Read-only access to the contravariant representation.
Definition: metric_flat.C:153
Lorene::Star_bin_xcts::extrinsic_curvature
void extrinsic_curvature()
Computes haij_auto and hacar_auto from beta_auto, nn and Psi .
Definition: star_bin_extr_curv_xcts.C:55
Lorene::Star_bin_xcts::beta_auto
Vector beta_auto
Part of the shift vector generated principally by the star (Spherical components with respect to the ...
Definition: star.h:1182
Lorene::log
Cmp log(const Cmp &)
Neperian logarithm.
Definition: cmp_math.C:296
Lorene::Star_bin_xcts::update_metric
void update_metric(const Star_bin_xcts &comp)
Computes metric coefficients from known potentials, when the companion is another star.
Definition: star_bin_upmetr_xcts.C:67
Lorene::Star_bin_xcts::chi_comp
Scalar chi_comp
Scalar field generated principally by the companion star.
Definition: star.h:1139
Lorene
Lorene prototypes.
Definition: app_hor.h:64
Lorene::Star_bin_xcts::chi
Scalar chi
Total function .
Definition: star.h:1155
Lorene::Scalar::import
void import(const Scalar &ci)
Assignment to another Scalar defined on a different mapping.
Definition: scalar_import.C:68
Lorene::Star::nn
Scalar nn
Lapse function N .
Definition: star.h:225
Lorene::pow
Cmp pow(const Cmp &, int)
Power .
Definition: cmp_math.C:348
Lorene::Vector::change_triad
virtual void change_triad(const Base_vect &)
Sets a new vectorial basis (triad) of decomposition and modifies the components accordingly.
Definition: vector_change_triad.C:75
Lorene::Tensor::set_etat_qcq
virtual void set_etat_qcq()
Sets the logical state of all components to ETATQCQ (ordinary state).
Definition: tensor.C:481
Lorene::Star_bin_xcts::psi4
Scalar psi4
Conformal factor .
Definition: star.h:1158
Lorene::Star_bin_xcts::Psi_comp
Scalar Psi_comp
Scalar field generated principally by the companion star.
Definition: star.h:1149
Lorene::Star::mp
Map & mp
Mapping associated with the star.
Definition: star.h:180
Lorene::Vector::set
Scalar & set(int)
Read/write access to a component.
Definition: vector.C:296
Lorene::Star_bin_xcts::chi_auto
Scalar chi_auto
Scalar field generated principally by the star.
Definition: star.h:1134
Lorene::Star::gamma
Metric gamma
3-metric
Definition: star.h:235
Lorene::Scalar::set_etat_qcq
virtual void set_etat_qcq()
Sets the logical state to ETATQCQ (ordinary state).
Definition: scalar.C:353
Lorene::Map::get_bvect_cart
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
Lorene::Scalar::set_etat_zero
virtual void set_etat_zero()
Sets the logical state to ETATZERO (zero).
Definition: scalar.C:324
Lorene::Vector
Tensor field of valence 1.
Definition: vector.h:188
Lorene::Star_bin_xcts::flat
Metric_flat flat
Flat metric defined on the mapping (Spherical components with respect to the mapping of the star) .
Definition: star.h:1177
Lorene::Star_bin_xcts::del_deriv
virtual void del_deriv() const
Deletes all the derived quantities.
Definition: star_bin_xcts.C:304
Lorene::Tensor::get_triad
const Base_vect * get_triad() const
Returns the vectorial basis (triad) on which the components are defined.
Definition: tensor.h:866
Lorene::Star_bin_xcts::Psi_auto
Scalar Psi_auto
Scalar field generated principally by the star.
Definition: star.h:1144
Lorene::Star_bin_xcts::Psi
Scalar Psi
Total conformal factor .
Definition: star.h:1152
Lorene::Scalar::std_spectral_base
virtual void std_spectral_base()
Sets the spectral bases of the Valeur va to the standard ones for a scalar field.
Definition: scalar.C:784
Lorene::Star_bin_xcts
Class for stars in binary system in eXtended Conformal Thin Sandwich formulation.
Definition: star.h:1091
Lorene::Tensor::set_triad
void set_triad(const Base_vect &new_triad)
Assigns a new vectorial basis (triad) of decomposition.
Definition: tensor.C:519
Lorene::Star::beta
Vector beta
Shift vector.
Definition: star.h:228
Lorene::Star_bin_xcts::beta_comp
Vector beta_comp
Part of the shift vector generated principally by the star (Spherical components with respect to the ...
Definition: star.h:1187
Lorene::Vector::std_spectral_base
virtual void std_spectral_base()
Sets the standard spectal bases of decomposition for each component.
Definition: vector.C:316