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
69namespace Lorene {
71
72 // Computation of quantities coming from the companion
73 // ---------------------------------------------------
74
75 if ( (comp.Psi_auto).get_etat() == ETATZERO ) {
76 Psi_comp.set_etat_zero() ;
77
78 } else {
79 Psi_comp.set_etat_qcq() ;
80 Psi_comp.import( comp.Psi_auto ) ;
81 Psi_comp.std_spectral_base() ;
82 }
83
84 beta_comp.set_etat_qcq() ;
85 beta_comp.set_triad(mp.get_bvect_cart()) ;
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
96 beta_comp.std_spectral_base() ;
97
98 if ( (comp.chi_auto).get_etat() == ETATZERO ) {
99 chi_comp.set_etat_zero() ;
100
101 } else {
102 chi_comp.set_etat_qcq() ;
103 chi_comp.import( comp.chi_auto ) ;
104 chi_comp.std_spectral_base() ;
105 }
106
107// Conformal factor Psi
108// --------------------
109
110 Psi = Psi_auto + Psi_comp + 1.;
111
112 psi4 = pow(Psi, 4.) ;
113 psi4.std_spectral_base() ;
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) ;
130 logn.std_spectral_base() ;
131
132// Shift vector
133// -------------
134
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 ) {
164 Psi_comp.set_etat_zero() ;
165
166 } else {
167
168 Psi_comp.set_etat_qcq() ;
169 Psi_comp.import( comp.Psi_auto ) ;
170 Psi_comp.std_spectral_base() ;
171
172 }
173
174 beta_comp.set_etat_qcq() ;
175 beta_comp.set_triad(mp.get_bvect_cart()) ;
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
186 beta_comp.std_spectral_base() ;
187
188 if ( (comp.chi_auto).get_etat() == ETATZERO ) {
189 chi_comp.set_etat_zero() ;
190
191 } else {
192
193 chi_comp.set_etat_qcq() ;
194 chi_comp.import( comp.chi_auto ) ;
195 chi_comp.std_spectral_base() ;
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.) ;
213 psi4.std_spectral_base() ;
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) ;
230 logn.std_spectral_base() ;
231
232// Shift vector
233// ------------
234
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 Psi
Total conformal factor .
Definition star.h:1152
void extrinsic_curvature()
Computes haij_auto and hacar_auto from beta_auto, nn and Psi .
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
Star_bin_xcts(Map &mp_i, int nzet_i, const Eos &eos_i, bool irrot)
Standard constructor.
Scalar Psi_comp
Scalar field generated principally by the companion star.
Definition star.h:1149
Vector beta_comp
Part of the shift vector generated principally by the star (Spherical components with respect to the ...
Definition star.h:1187
Vector beta_auto
Part of the shift vector generated principally by the star (Spherical components with respect to the ...
Definition star.h:1182
Scalar Psi_auto
Scalar field generated principally by the star.
Definition star.h:1144
Scalar chi
Total function .
Definition star.h:1155
Scalar chi_auto
Scalar field generated principally by the star.
Definition star.h:1134
void update_metric(const Star_bin_xcts &comp)
Computes metric coefficients from known potentials, when the companion is another star.
Scalar chi_comp
Scalar field generated principally by the companion star.
Definition star.h:1139
virtual void del_deriv() const
Deletes all the derived quantities.
Scalar logn
Logarithm of the lapse N .
Definition star.h:222
Scalar nn
Lapse function N .
Definition star.h:225
Metric gamma
3-metric
Definition star.h:235
Map & mp
Mapping associated with the star.
Definition star.h:180
Vector beta
Shift vector.
Definition star.h:228
Tensor field of valence 1.
Definition vector.h:188
virtual void change_triad(const Base_vect &)
Sets a new vectorial basis (triad) of decomposition and modifies the components accordingly.
Cmp pow(const Cmp &, int)
Power .
Definition cmp_math.C:351
Cmp log(const Cmp &)
Neperian logarithm.
Definition cmp_math.C:299
const Base_vect * get_triad() const
Returns the vectorial basis (triad) on which the components are defined.
Definition tensor.h:879
Lorene prototypes.
Definition app_hor.h:67