Debian Codegraph @

C++/Source/Star/star_bin_upmetr_xcts.C

raw
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 {
67 void Star_bin_xcts::update_metric(const Star_bin_xcts& comp) {
68
69 // Computation of quantities coming from the companion
70 // ---------------------------------------------------
71
72 if ( (comp.Psi_auto).get_etat() == ETATZERO ) {
73 Psi_comp.set_etat_zero() ;
74
75 } else {
76 Psi_comp.set_etat_qcq() ;
77 Psi_comp.import( comp.Psi_auto ) ;
78 Psi_comp.std_spectral_base() ;
79 }
80
81 beta_comp.set_etat_qcq() ;
82 beta_comp.set_triad(mp.get_bvect_cart()) ;
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
93 beta_comp.std_spectral_base() ;
94
95 if ( (comp.chi_auto).get_etat() == ETATZERO ) {
96 chi_comp.set_etat_zero() ;
97
98 } else {
99 chi_comp.set_etat_qcq() ;
100 chi_comp.import( comp.chi_auto ) ;
101 chi_comp.std_spectral_base() ;
102 }
103
104 // Conformal factor Psi
105 // --------------------
106
107 Psi = Psi_auto + Psi_comp + 1.;
108
109 psi4 = pow(Psi, 4.) ;
110 psi4.std_spectral_base() ;
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) ;
127 logn.std_spectral_base() ;
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
139 extrinsic_curvature() ;
140
141 // The derived quantities are obsolete
142 // -----------------------------------
143
144 del_deriv() ;
145
146 }
147
148 //----------------------------------//
149 // Version with relaxation //
150 //----------------------------------//
151
152 void Star_bin_xcts::update_metric(const Star_bin_xcts& comp,
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 ) {
161 Psi_comp.set_etat_zero() ;
162
163 } else {
164
165 Psi_comp.set_etat_qcq() ;
166 Psi_comp.import( comp.Psi_auto ) ;
167 Psi_comp.std_spectral_base() ;
168
169 }
170
171 beta_comp.set_etat_qcq() ;
172 beta_comp.set_triad(mp.get_bvect_cart()) ;
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
183 beta_comp.std_spectral_base() ;
184
185 if ( (comp.chi_auto).get_etat() == ETATZERO ) {
186 chi_comp.set_etat_zero() ;
187
188 } else {
189
190 chi_comp.set_etat_qcq() ;
191 chi_comp.import( comp.chi_auto ) ;
192 chi_comp.std_spectral_base() ;
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.) ;
210 psi4.std_spectral_base() ;
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) ;
227 logn.std_spectral_base() ;
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
239 extrinsic_curvature() ;
240
241 // The derived quantities are obsolete
242 // -----------------------------------
243
244 del_deriv() ;
245
246 }
247
248 }