Debian Codegraph @

C++/Include/et_bin_nsbh.h

raw symbols SCIP
1 /*
2 * Definition of Lorene class Etoile_bin_nsbh
3 *
4 */
5
6 /*
7 * Copyright (c) 2003 Keisuke Taniguchi
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 #ifndef __ET_BIN_NSBH_H_
27 #define __ET_BIN_NSBH_H_
28
29 /*
30 * $Id: et_bin_nsbh.h,v 1.9 2014/10/13 08:52:34 j_novak Exp $
31 * $Log: et_bin_nsbh.h,v $
32 * Revision 1.9 2014/10/13 08:52:34 j_novak
33 * Lorene classes and functions now belong to the namespace Lorene.
34 *
35 * Revision 1.8 2006/09/25 10:01:45 p_grandclement
36 * Addition of N-dimensional Tbl
37 *
38 * Revision 1.7 2006/06/01 12:47:50 p_grandclement
39 * update of the Bin_ns_bh project
40 *
41 * Revision 1.6 2006/04/25 07:21:54 p_grandclement
42 * Various changes for the NS_BH project
43 *
44 * Revision 1.5 2005/10/18 13:12:31 p_grandclement
45 * update of the mixted binary codes
46 *
47 * Revision 1.4 2005/08/29 15:10:12 p_grandclement
48 * Addition of things needed :
49 * 1) For BBH with different masses
50 * 2) Provisory files for the mixted binaries (Bh and NS) : THIS IS NOT
51 * WORKING YET !!!
52 *
53 * Revision 1.3 2004/06/09 06:32:51 k_taniguchi
54 * Introduce set_n_auto() and set_confpsi_auto().
55 *
56 * Revision 1.2 2003/10/24 12:25:19 k_taniguchi
57 * Introduce the method of update metric for NS-BH
58 *
59 * Revision 1.1 2003/10/21 11:46:13 k_taniguchi
60 * Definition of class Et_bin_nsbh
61 *
62 *
63 * $Header: /cvsroot/Lorene/C++/Include/et_bin_nsbh.h,v 1.9 2014/10/13 08:52:34 j_novak Exp $
64 *
65 */
66
67 // Lorene headers
68 #include "etoile.h"
69 #include "bhole.h"
70
71 namespace Lorene {
72 /**
73 * Class for a star in a NS-BH binary system
74 *
75 * This class is a derived class from {\tt Etoile\_bin}
76 *
77 * @version #$Id: et_bin_nsbh.h,v 1.9 2014/10/13 08:52:34 j_novak Exp $#
78 */
79 class Et_bin_nsbh : public Etoile_bin {
80
81 // Data :
82 // -----
83 protected:
84 /// Part of the lapse {\it N} generated principaly by the star.
85 Tenseur n_auto ;
86
87 /// Part of the lapse {\it N} generated principaly by the companion star.
88 Tenseur n_comp ;
89
90 /** Gradient of {\tt n\_auto}
91 * (Cartesian components with respect to {\tt ref\_triad})
92 */
93 Tenseur d_n_auto ;
94
95 /** Gradient of {\tt n\_comp}
96 * (Cartesian components with respect to {\tt ref\_triad})
97 */
98 Tenseur d_n_comp ;
99
100 /// Total conformal factor $\Psi$
101 Tenseur confpsi ;
102
103 /// Part of the conformal factor $\Psi$ generated principaly by the star.
104 Tenseur confpsi_auto ;
105
106 /** Part of the conformal factor $\Psi$ generated principaly
107 * by the companion star.
108 */
109 Tenseur confpsi_comp ;
110
111 /** Gradient of {\tt confpsi\_auto}
112 * (Cartesian components with respect to {\tt ref\_triad})
113 */
114 Tenseur d_confpsi_auto ;
115
116 /** Gradient of {\tt confpsi\_comp}
117 * (Cartesian components with respect to {\tt ref\_triad})
118 */
119 Tenseur d_confpsi_comp ;
120
121 /** Part of the extrinsic curvature tensor
122 * $\tilde A^{ij} = 2 N K^{ij}$
123 * generated by {\tt shift\_auto}.
124 * (Cartesian components with respect to {\tt ref\_triad})
125 */
126 Tenseur_sym taij_auto ;
127
128 /** Part of the extrinsic curvature tensor
129 * $\tilde A^{ij} = 2 N K^{ij}$
130 * generated by {\tt shift\_comp}.
131 * (Cartesian components with respect to {\tt ref\_triad})
132 */
133 Tenseur_sym taij_comp ;
134
135 /** Total extrinsic curvature tensor
136 * $\tilde A^{ij} = 2 N K^{ij}$
137 * generated by {\tt shift\_auto} and {\tt shift\_comp}.
138 * (Cartesian components with respect to {\tt ref\_triad})
139 */
140 Tenseur_sym taij_tot ;
141
142 /** Part of the extrinsic curvature tensor $K^{ij}$
143 * generated by {\tt shift\_auto}.
144 * (Cartesian components with respect to {\tt ref\_triad})
145 */
146 Tenseur_sym tkij_auto ;
147
148 /** Total extrinsic curvature tensor $K^{ij}$
149 * generated by {\tt shift\_auto} and {\tt shift\_comp}.
150 * (Cartesian components with respect to {\tt ref\_triad})
151 */
152 Tenseur_sym tkij_tot ;
153
154 /** Effective source at the previous step for the resolution of
155 * the Poisson equation for {\tt n\_auto} by means of
156 * {\tt Map\_et::poisson}.
157 */
158 Cmp ssjm1_lapse ;
159
160 /** Effective source at the previous step for the resolution of
161 * the Poisson equation for {\tt confpsi\_auto} by means of
162 * {\tt Map\_et::poisson}.
163 */
164 Cmp ssjm1_confpsi ;
165
166 // Constructors - Destructor
167 // -------------------------
168 public:
169 /** Standard constructor.
170 *
171 * @param mp_i Mapping on which the star will be defined
172 * @param nzet_i Number of domains occupied by the star
173 * @param relat should be {\tt true} for a relativistic star,
174 * {\tt false} for a Newtonian one
175 * @param eos_i Equation of state of the stellar matter
176 * @param irrot should be {\tt true} for an irrotational star,
177 * {\tt false} for a corotating one
178 * @param ref_triad_i Reference triad ("absolute frame"),
179 * with respect to which the components of all the member
180 * {\tt Tenseur}'s are defined, except for {\tt w\_shift}
181 * and {\tt ssjm1\_wshift} whose components are defined
182 * with respect to the mapping {\tt mp} Cartesian triad.
183 */
184 Et_bin_nsbh(Map& mp_i, int nzet_i, bool relat, const Eos& eos_i,
185 bool irrot, const Base_vect& ref_triad_i) ;
186
187 Et_bin_nsbh(const Et_bin_nsbh& ) ; /// Copy constructor
188
189 /** Constructor from a file (see {\tt sauve(FILE* )})
190 *
191 * @param mp_i Mapping on which the star will be defined
192 * @param eos_i Equation of state of the stellar matter
193 * @param ref_triad_i Reference triad ("absolute frame"),
194 * with respect to which the components of all the member
195 * {\tt Tenseur}'s are defined, except for {\tt w\_shift}
196 * and {\tt ssjm1\_wshift} whose components are defined
197 * with respect to the mapping {\tt mp} Cartesian triad.
198 * @param fich input file (must have been created by the function
199 * {\tt sauve})
200 */
201 Et_bin_nsbh(Map& mp_i, const Eos& eos_i, const Base_vect& ref_triad_i,
202 FILE* fich, bool old = false) ;
203
204 virtual ~Et_bin_nsbh() ; /// Destructor
205
206
207 // Mutators / assignment
208 // ---------------------
209 public:
210 /// Assignment to another {\tt Et\_bin\_nsbh}
211 void operator=(const Et_bin_nsbh&) ;
212
213 /** Read/write the lapse {\it N} generated principaly
214 * by the star.
215 */
216 Tenseur& set_n_auto() ;
217
218 /** Read/write the lapse {\it N} generated principaly
219 * by the companion star.
220 */
221 Tenseur& set_n_comp() ;
222
223 /** Read/write the conformal factor $\Psi$ generated principaly
224 * by the star.
225 */
226 Tenseur& set_confpsi_auto() ;
227
228 /** Read/write the conformal factor $\Psi$ generated principaly
229 * by the companion star.
230 */
231 Tenseur& set_confpsi_comp() ;
232
233 // Accessors
234 // ---------
235 public:
236 /** Returns the part of the lapse {\it N} generated principaly
237 * by the star.
238 */
239 const Tenseur& get_n_auto() const {return n_auto;} ;
240
241 /** Returns the part of the lapse {\it N} generated principaly
242 * by the companion star.
243 */
244 const Tenseur& get_n_comp() const {return n_comp;} ;
245
246 /** Returns the gradient of {\tt n\_auto}
247 * (Cartesian components with respect to {\tt ref\_triad})
248 */
249 const Tenseur& get_d_n_auto() const {return d_n_auto;} ;
250
251 /** Returns the gradient of {\tt n\_comp}
252 * (Cartesian components with respect to {\tt ref\_triad})
253 */
254 const Tenseur& get_d_n_comp() const {return d_n_comp;} ;
255
256 /// Returns the part of the conformal factor $\Psi$
257 const Tenseur& get_confpsi() const {return confpsi;} ;
258
259 /** Returns the part of the conformal factor $\Psi$
260 * generated principaly by the star.
261 */
262 const Tenseur& get_confpsi_auto() const {return confpsi_auto;} ;
263
264 /** Returns the part of the conformal factor $\Psi$
265 * generated principaly by the companion star.
266 */
267 const Tenseur& get_confpsi_comp() const {return confpsi_comp;} ;
268
269 /** Returns the gradient of {\tt confpsi\_auto}
270 * (Cartesian components with respect to {\tt ref\_triad})
271 */
272 const Tenseur& get_d_confpsi_auto() const {return d_confpsi_auto;} ;
273
274 /** Returns the gradient of {\tt confpsi\_comp}
275 * (Cartesian components with respect to {\tt ref\_triad})
276 */
277 const Tenseur& get_d_confpsi_comp() const {return d_confpsi_comp;} ;
278
279 /** Returns the part of the extrinsic curvature tensor
280 * $\tilde A^{ij} = 2 N K^{ij}$ generated by {\tt shift\_auto}.
281 * (Cartesian components with respect to {\tt ref\_triad})
282 */
283 const Tenseur_sym& get_taij_auto() const {return taij_auto;} ;
284
285 /** Returns the part of the extrinsic curvature tensor
286 * $\tilde A^{ij} = 2 N K^{ij}$ generated by {\tt shift\_comp}.
287 * (Cartesian components with respect to {\tt ref\_triad})
288 */
289 const Tenseur_sym& get_taij_comp() const {return tkij_comp;} ;
290
291 /** Returns the total extrinsic curvature tensor
292 * $\tilde A^{ij} = 2 N K^{ij}$
293 * generated by {\tt shift\_auto} and {\tt shift\_comp}.
294 * (Cartesian components with respect to {\tt ref\_triad})
295 */
296 const Tenseur_sym& get_taij_tot() const {return taij_tot;} ;
297
298 /** Returns the part of the extrinsic curvature tensor $K^{ij}$
299 * generated by {\tt shift\_auto}.
300 * (Cartesian components with respect to {\tt ref\_triad})
301 */
302 const Tenseur_sym& get_tkij_auto() const {return tkij_auto;} ;
303
304 /** Returns the total extrinsic curvature tensor $K^{ij}$
305 * generated by {\tt shift\_auto} and {\tt shift\_comp}.
306 * (Cartesian components with respect to {\tt ref\_triad})
307 */
308 const Tenseur_sym& get_tkij_tot() const {return tkij_tot;} ;
309
310
311 // Outputs
312 // -------
313 public:
314 virtual void sauve(FILE *) const ; /// Save in a file
315
316 protected:
317 /// Operator >> (virtual function called by the operator <<).
318 virtual ostream& operator>>(ostream& ) const ;
319
320
321 // Global quantities
322 // -----------------
323
324 // Computational routines
325 // ----------------------
326 public:
327
328 void fait_taij_auto() ;
329 /** Computes metric coefficients from known potentials,
330 * when the companion is a black hole.
331 *
332 * @param comp companion black hole
333 *
334 */
335 void update_metric(const Bhole& comp) ;
336
337 /** Computes the derivative of metric functions related to the
338 * companion black hole.
339 *
340 * @param comp companion BH.
341 *
342 */
343 void update_metric_der_comp(const Bhole& comp) ;
344
345 /** Computes an equilibrium configuration in a NS-BH binary system.
346 *
347 * The values of {\tt n\_comp}, {\tt confpsi\_comp}, {\tt pot\_centri}
348 * are held fixed during the iteration.
349 *
350 * @param ent_c [input] Central enthalpy
351 * @param mermax [input] Maximum number of steps
352 * @param mermax_poisson [input] Maximum number of steps in
353 * Map\_et::poisson
354 * @param relax_poisson [input] Relaxation factor in Map\_et::poisson
355 * @param mermax_potvit [input] Maximum number of steps in
356 * Map\_radial::poisson\_compact
357 * @param relax_potvit [input] Relaxation factor in
358 * Map\_radial::poisson\_compact
359 * @param thres_adapt [input] Threshold on dH/dr for the adaptation
360 * of the mapping
361 * @param fact [input] 1-D {\tt Tbl} for the input
362 * of some factors : \\
363 * {\tt fact(0)} : A resizing factor for the first shell
364 * @param diff [output] 1-D {\tt Tbl} for the storage of some
365 * error indicators : \\
366 * {\tt diff(0)} : Relative change in the enthalpy field
367 * between two successive steps \\
368 * {\tt diff(1)} : Relative error returned by the routine
369 * {\tt Etoile\_bin::velocity\_potential}
370 * {\tt diff(2)} : Relative error in the resolution of the
371 * Poisson equation for {\tt n\_auto} \\
372 * {\tt diff(3)} : Relative error in the resolution of the
373 * Poisson equation for {\tt confpsi\_auto} \\
374 * {\tt diff(4)} : Relative error in the resolution of the
375 * equation for {\tt shift\_auto} (x comp.) \\
376 * {\tt diff(5)} : Relative error in the resolution of the
377 * equation for {\tt shift\_auto} (y comp.) \\
378 * {\tt diff(6)} : Relative error in the resolution of the
379 * equation for {\tt shift\_auto} (z comp.)
380 */
381 virtual void equilibrium_nsbh(double ent_c, int mermax,
382 int mermax_poisson, double relax_poisson,
383 int mermax_potvit, double relax_potvit,
384 double thres_adapt,
385 const Tbl& fact, Tbl& diff) ;
386
387 void equilibrium_nsbh (bool, double, int&, int, int, double, int, double, Tbl&) ;
388
389 /** Computes the quantities \c bsn and \c pot_centri .
390 *
391 * The calculation is performed starting from the quantities
392 * \c nnn , \c shift , \c a_car ,
393 * which are supposed to be up to date.
394 *
395 * @param omega angular velocity with respect to an asymptotically
396 * inertial observer
397 * @param x_axe absolute X coordinate of the rotation axis
398 */
399 virtual void kinematics(double omega, double x_axe) ;
400
401 double compute_angul() const ;
402 double compute_axe(double) const ;
403
404 friend class Bin_ns_bh ;
405
406 };
407
408 }
409 #endif