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 
27 
28 /*
29  * $Id: star_bin_upmetr_xcts.C,v 1.8 2016/12/05 16:18:15 j_novak Exp $
30  * $Log: star_bin_upmetr_xcts.C,v $
31  * Revision 1.8 2016/12/05 16:18:15 j_novak
32  * Suppression of some global variables (file names, loch, ...) to prevent redefinitions
33  *
34  * Revision 1.7 2014/10/13 08:53:38 j_novak
35  * Lorene classes and functions now belong to the namespace Lorene.
36  *
37  * Revision 1.6 2010/12/09 10:46:50 m_bejger
38  * Re-definition of psi4, N, log(N)
39  *
40  * Revision 1.5 2010/10/26 20:08:56 m_bejger
41  * Cleanup
42  *
43  * Revision 1.4 2010/06/17 15:08:42 m_bejger
44  * Correcting previous corrections that were, in fact, incorrect
45  *
46  * Revision 1.3 2010/06/15 08:13:01 m_bejger
47  * Some more corrections: Psi, chi
48  *
49  * Revision 1.2 2010/06/04 20:01:59 m_bejger
50  * Corrected definitions of lapse, Psi4; added definition of gamma
51  *
52  * Revision 1.1 2010/05/04 07:51:05 m_bejger
53  * Initial version
54  *
55  * $Header: /cvsroot/Lorene/C++/Source/Star/star_bin_upmetr_xcts.C,v 1.8 2016/12/05 16:18:15 j_novak Exp $
56  *
57  */
58 
59 // Headers Lorene
60 #include "cmp.h"
61 #include "star.h"
62 #include "graphique.h"
63 #include "utilitaires.h"
64 
65 //----------------------------------//
66 // Version without relaxation //
67 //----------------------------------//
68 
69 namespace Lorene {
71 
72  // Computation of quantities coming from the companion
73  // ---------------------------------------------------
74 
75  if ( (comp.Psi_auto).get_etat() == ETATZERO ) {
77 
78  } else {
80  Psi_comp.import( comp.Psi_auto ) ;
82  }
83 
86 
87  Vector comp_beta(comp.beta_auto) ;
88  comp_beta.change_triad(mp.get_bvect_cart()) ;
89 
90  assert ( *(beta_comp.get_triad()) == *(comp_beta.get_triad())) ;
91 
92  (beta_comp.set(1)).import( comp_beta(1) ) ;
93  (beta_comp.set(2)).import( comp_beta(2) ) ;
94  (beta_comp.set(3)).import( comp_beta(3) ) ;
95 
97 
98  if ( (comp.chi_auto).get_etat() == ETATZERO ) {
100 
101  } else {
103  chi_comp.import( comp.chi_auto ) ;
105  }
106 
107 // Conformal factor Psi
108 // --------------------
109 
110  Psi = Psi_auto + Psi_comp + 1.;
111 
112  psi4 = pow(Psi, 4.) ;
114 
115 // Function chi = NPsi
116 // --------------------
117 
118  chi = chi_auto + chi_comp + 1.;
119 
120 // Lapse function N
121 // ----------------
122 
123  nn = chi/Psi ;
124  nn.std_spectral_base() ;
125 
126 // logarithm of lapse function N
127 // ----------------
128 
129  logn = log(nn) ;
131 
132 // Shift vector
133 // -------------
134 
135  beta = beta_auto + beta_comp ;
136 
137  gamma = flat.con() / psi4 ;
138 
139 // Extrinsic curvature (haij_auto and hacar_auto)
140 //-----------------------------------------------
141 
143 
144 // The derived quantities are obsolete
145 // -----------------------------------
146 
147  del_deriv() ;
148 
149 }
150 
151 //----------------------------------//
152 // Version with relaxation //
153 //----------------------------------//
154 
156  const Star_bin_xcts& star_jm1,
157  double relax) {
158 
159 
160  // Computation of quantities coming from the companion
161  // ---------------------------------------------------
162 
163  if ( (comp.Psi_auto).get_etat() == ETATZERO ) {
165 
166  } else {
167 
169  Psi_comp.import( comp.Psi_auto ) ;
171 
172  }
173 
176 
177  Vector comp_beta(comp.beta_auto) ;
178  comp_beta.change_triad(mp.get_bvect_cart()) ;
179 
180  assert ( *(beta_comp.get_triad()) == *(comp_beta.get_triad())) ;
181 
182  (beta_comp.set(1)).import( comp_beta(1) ) ;
183  (beta_comp.set(2)).import( comp_beta(2) ) ;
184  (beta_comp.set(3)).import( comp_beta(3) ) ;
185 
187 
188  if ( (comp.chi_auto).get_etat() == ETATZERO ) {
190 
191  } else {
192 
194  chi_comp.import( comp.chi_auto ) ;
196 
197  }
198 
199 // Relaxation on Psi_comp, beta_comp, chi_comp
200 // -------------------------------------------
201  double relaxjm1 = 1. - relax ;
202 
203  Psi_comp = relax * Psi_comp + relaxjm1 * (star_jm1.Psi_comp) ;
204  beta_comp = relax * beta_comp + relaxjm1 * (star_jm1.beta_comp) ;
205  chi_comp = relax * chi_comp + relaxjm1 * (star_jm1.chi_comp) ;
206 
207 // Conformal factor Psi
208 // --------------------
209 
210  Psi = Psi_auto + Psi_comp + 1.;
211 
212  psi4 = pow(Psi, 4.) ;
214 
215 // Function chi = NPsi
216 // --------------------
217 
218  chi = chi_auto + chi_comp + 1.;
219 
220 // Lapse function N
221 // ----------------
222 
223  nn = chi/Psi ;
224  nn.std_spectral_base() ;
225 
226 // logarithm of lapse function N
227 // ----------------
228 
229  logn = log(nn) ;
231 
232 // Shift vector
233 // ------------
234 
235  beta = beta_auto + beta_comp ;
236 
237  gamma = flat.con() / psi4 ;
238 
239 // Extrinsic curvature (haij_auto and hacar_auto)
240 //-----------------------------------------------
241 
243 
244 // The derived quantities are obsolete
245 // -----------------------------------
246 
247  del_deriv() ;
248 
249 }
250 
251 }
Scalar chi
Total function .
Definition: star.h:1155
Cmp log(const Cmp &)
Neperian logarithm.
Definition: cmp_math.C:299
virtual void set_etat_qcq()
Sets the logical state of all components to ETATQCQ (ordinary state).
Definition: tensor.C:490
Map & mp
Mapping associated with the star.
Definition: star.h:180
virtual void set_etat_zero()
Sets the logical state to ETATZERO (zero).
Definition: scalar.C:330
Metric gamma
3-metric
Definition: star.h:235
Lorene prototypes.
Definition: app_hor.h:67
void update_metric(const Star_bin_xcts &comp)
Computes metric coefficients from known potentials, when the companion is another star...
virtual void std_spectral_base()
Sets the spectral bases of the Valeur va to the standard ones for a scalar field. ...
Definition: scalar.C:790
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.
virtual void set_etat_qcq()
Sets the logical state to ETATQCQ (ordinary state).
Definition: scalar.C:359
Vector beta
Shift vector.
Definition: star.h:228
Tensor field of valence 1.
Definition: vector.h:188
virtual void std_spectral_base()
Sets the standard spectal bases of decomposition for each component.
Definition: vector.C:322
virtual const Sym_tensor & con() const
Read-only access to the contravariant representation.
Definition: metric_flat.C:156
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
Scalar chi_comp
Scalar field generated principally by the companion star.
Definition: star.h:1139
Vector beta_comp
Part of the shift vector generated principally by the star (Spherical components with respect to the ...
Definition: star.h:1187
void extrinsic_curvature()
Computes haij_auto and hacar_auto from beta_auto, nn and Psi .
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
Scalar logn
Logarithm of the lapse N .
Definition: star.h:222
Scalar psi4
Conformal factor .
Definition: star.h:1158
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
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:809
Scalar nn
Lapse function N .
Definition: star.h:225
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.
Scalar Psi_comp
Scalar field generated principally by the companion star.
Definition: star.h:1149
void set_triad(const Base_vect &new_triad)
Assigns a new vectorial basis (triad) of decomposition.
Definition: tensor.C:528
Scalar & set(int)
Read/write access to a component.
Definition: vector.C:302