Debian Codegraph @

C++/Include/et_bin_bhns_extr.h

raw symbols SCIP
1 /*
2 * Definition of Lorene class Et_bin_bhns_extr
3 *
4 */
5
6 /*
7 * Copyright (c) 2004-2005 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_BHNS_EXTR_H_
27 #define __ET_BIN_BHNS_EXTR_H_
28
29 /*
30 * $Id: et_bin_bhns_extr.h,v 1.5 2014/10/13 08:52:34 j_novak Exp $
31 * $Log: et_bin_bhns_extr.h,v $
32 * Revision 1.5 2014/10/13 08:52:34 j_novak
33 * Lorene classes and functions now belong to the namespace Lorene.
34 *
35 * Revision 1.4 2005/02/28 23:04:56 k_taniguchi
36 * Addition of two indicators for the backfround metric and the boundary
37 * condition, and some codes for the conformally flat case
38 *
39 * Revision 1.3 2005/01/31 20:25:22 k_taniguchi
40 * Change the argument of equil_bhns_extr_ylm.
41 *
42 * Revision 1.2 2004/12/29 16:26:02 k_taniguchi
43 * Addition of a comutational method to calculate equilibrium figures
44 * with a multipole falloff condition at the outer boundary.
45 *
46 * Revision 1.1 2004/11/30 20:36:31 k_taniguchi
47 * *** empty log message ***
48 *
49 *
50 * $Header: /cvsroot/Lorene/C++/Include/et_bin_bhns_extr.h,v 1.5 2014/10/13 08:52:34 j_novak Exp $
51 *
52 */
53
54 // Lorene headers
55 #include "etoile.h"
56
57 namespace Lorene {
58 /**
59 * Class for a neutron star in black hole - neutron star binary systems.
60 * \ingroup(star)
61 *
62 * In this class, we assume that the mass ratio of NS to BH is extreme,
63 * and the effect from a black hole is treated as the external,
64 * background field of the Kerr-Schild metric or the conformally flat metric.
65 * They are splitted by the boolian indicator.
66 *
67 */
68 class Et_bin_bhns_extr : public Etoile_bin {
69
70 // Data
71 // ----
72 protected:
73
74 /** Indicator of the background metric:
75 * \c true for the Kerr-Shild metric,
76 * \c false for the conformally flat one
77 */
78 bool kerrschild ;
79
80 /** Indicator of the boundary condition:
81 * \c true for the multipole falloff condition,
82 * \c false for the \f$1/r\f$ one
83 */
84 bool multipole ;
85
86 // Constructors - Destructor
87 // -------------------------
88 public:
89 /** Standard constructor.
90 *
91 * @param mp_i Mapping on which the star will be defined
92 * @param nzet_i Number of domains occupied by the star
93 * @param relat should be \c true for a relativistic
94 * star, \c false for a Newtonian one
95 * @param eos_i Equation of state of the stellar matter
96 * @param irrot should be \c true for an irrotational star,
97 * \c false for a corotating one
98 * @param ref_triad_i Reference triad ("absolute frame"), with
99 * respect to which the components of all the member
100 * \c Tenseur 's are defined, except for \c w_shift
101 * and \c ssjm1_wshift whose components are defined
102 * with respect to the mapping \c mp Cartesian triad.
103 * @param kerrs should be \c true for the Kerr-Schild background
104 * metric, \c false for the conformally flat one
105 * @param multi should be \c true for the multipol falloff boundary
106 * condition, \c false for the \f$1/r\f$ one
107 */
108 Et_bin_bhns_extr(Map& mp_i, int nzet_i, bool relat, const Eos& eos_i,
109 bool irrot, const Base_vect& ref_triad_i,
110 bool kerrs, bool multi) ;
111
112 Et_bin_bhns_extr(const Et_bin_bhns_extr& ) ; ///< Copy constructor
113
114 /** Constructor from a file (see \c sauve(FILE*) ).
115 *
116 * @param mp_i Mapping on which the star will be defined
117 * @param eos_i Equation of state of the stellar matter
118 * @param ref_triad_i Reference triad ("absolute frame"), with
119 * respect to which the components of all the member
120 * \c Tenseur 's are defined, except for \c w_shift
121 * and \c ssjm1_wshift whose components are defined
122 * with respect to the mapping \c mp Cartesian triad.
123 * @param fich input file (must have been created by the function
124 * \c sauve )
125 */
126 Et_bin_bhns_extr(Map& mp_i, const Eos& eos_i,
127 const Base_vect& ref_triad_i, FILE* fich) ;
128
129 virtual ~Et_bin_bhns_extr() ; ///< Destructor
130
131
132 // Mutators / assignment
133 // ---------------------
134 public:
135 /// Assignment to another \c Et_bin_bhns_extr
136 void operator=(const Et_bin_bhns_extr&) ;
137
138 // Accessors
139 // ---------
140 public:
141
142 /** Returns \c true for the Kerr-Schild background metric,
143 * \c false for the conformally flat one
144 */
145 bool in_kerrschild() const {return kerrschild ;} ;
146
147 /** Returns \c true for the multipole falloff boundary condition,
148 * \c false for the \f$1/r\f$ one
149 */
150 bool with_multipole() const {return multipole ;} ;
151
152 // Outputs
153 // -------
154 public:
155 virtual void sauve(FILE *) const ; ///< Save in a file
156
157 // Computational routines
158 // ----------------------
159 public:
160 /** Computes the hydrodynamical quantities relative to the Eulerian
161 * observer from those in the fluid frame, as well as
162 * \c wit_w and \c loggam in the Kerr-Schild background metric
163 * or in the conformally flat one
164 *
165 * The calculation is performed starting from the quantities
166 * \c ent , \c ener , \c press , \c a_car and \c bsn ,
167 * which are supposed to be up to date.
168 * From these, the following fields are updated:
169 * \c gam_euler , \c u_euler , \c ener_euler , \c s_euler ,
170 * \c wit_w and \c loggam .
171 *
172 * @param mass mass of the BH
173 * @param sepa separation between NS and BH
174 *
175 */
176 void hydro_euler_extr(const double& mass, const double& sepa) ;
177
178 /** Computes metric coefficients from known potentials,
179 * when the companion is a black hole with the Kerr-Schild metric
180 * or with the conformally flat one
181 *
182 * The calculation is performed starting from the quantities
183 * \c logn_auto , \c beta_auto , \c shift_auto
184 * which are supposed to be up to date.
185 * Using the analytical form of the lapse of BH,
186 * the conformal factor of BH, and the shift vector of BH,
187 * the following fields are updated:
188 * \c nnn , \c a_car , \c shift ,
189 * \c d_logn_auto , \c d_beta_auto , \c tkij_auto ,
190 * \c akcar_auto .
191 *
192 * @param mass mass of the BH
193 * @param sepa separation between NS and BH
194 *
195 */
196 void update_metric_extr(const double& mass, const double& sepa) ;
197
198 /** Computes the derivative of metric functions related to the
199 * companion black hole with the Kerr-Schild metric
200 * or with the conformally flat one
201 *
202 * The calculation is performed starting from the quantities
203 * \c comp.d_logn_auto , \c comp.d_beta_auto ,
204 * \c comp.tkij_auto
205 * which are supposed to be up to date.
206 * From these, the following fields are updated:
207 * \c d_logn_comp , \c d_beta_comp , \c tkij_comp ,
208 * \c akcar_comp .
209 *
210 * @param mass mass of the BH
211 * @param sepa separation between NS and BH
212 *
213 */
214 void update_metric_der_comp_extr(const double& mass,
215 const double& sepa) ;
216
217 /** Computes the quantities \c bsn and \c pot_centri
218 * in the Kerr-Schild background metric
219 * or in the conformally flat one
220 *
221 * The calculation is performed starting from the quantities
222 * \c nnn , \c shift , \c a_car ,
223 * which are supposed to be up to date.
224 *
225 * @param omega angular velocity with respect to an asymptotically
226 * inertial observer
227 * @param mass mass of the BH
228 * @param sepa separation between NS and BH
229 *
230 */
231 void kinematics_extr(double omega, const double& mass,
232 const double& sepa) ;
233
234 /** Computes \c tkij_auto and \c akcar_auto from
235 * \c shift_auto , \c nnn and \c a_car .
236 * in the Kerr-Schild background metric
237 * or in the conformally flat one
238 *
239 * @param mass mass of the BH
240 * @param sepa separation between NS and BH
241 *
242 */
243 void extrinsic_curv_extr(const double& mass, const double& sepa) ;
244
245 /** Computes an equilibrium configuration of a BH-NS binary system
246 * in the Kerr-Schild background metric using the \f$1/r\f$
247 * falloff boundary condition
248 *
249 * The values of \c logn_comp , \c beta_comp , \c pot_centri
250 * are held fixed during the iteration.
251 *
252 * @param ent_c [input] Central enthalpy
253 * @param mass [input] Mass of BH
254 * @param sepa [input] Orbital separation
255 * @param mermax [input] Maximum number of steps
256 * @param mermax_poisson [input] Maximum number of steps in
257 * Map_et::poisson
258 * @param relax_poisson [input] Relaxation factor in Map_et::poisson
259 * @param mermax_potvit [input] Maximum number of steps in
260 * Map_radial::poisson_compact
261 * @param relax_potvit [input] Relaxation factor in
262 * Map_radial::poisson_compact
263 * @param np_filter [input] Number of coefficients in phi which are
264 * deleted by filter
265 * @param thres_adapt [input] Threshold on dH/dr for the adaptation
266 * of the mapping
267 * @param diff [output] 1-D \c Tbl for the storage of some
268 * error indicators :
269 * \li \c diff(0) : Relative change in the enthalpy field
270 * between two successive steps
271 * \li \c diff(1) : Relative error returned by the routine
272 * \c Etoile_bin::velocity_potential
273 * \li \c diff(2) : Relative error in the resolution of the
274 * Poisson equation for \c logn_auto
275 * \li \c diff(3) : Relative error in the resolution of the
276 * Poisson equation for \c beta_auto
277 * \li \c diff(4) : Relative error in the resolution of the
278 * equation for \c shift_auto (x comp.)
279 * \li \c diff(5) : Relative error in the resolution of the
280 * equation for \c shift_auto (y comp.)
281 * \li \c diff(6) : Relative error in the resolution of the
282 * equation for \c shift_auto (z comp.)
283 */
284 void equil_bhns_extr_ks(double ent_c, const double& mass,
285 const double& sepa, int mermax,
286 int mermax_poisson,
287 double relax_poisson, int mermax_potvit,
288 double relax_potvit, int np_filter,
289 double thres_adapt, Tbl& diff) ;
290
291 /** Computes an equilibrium configuration of a BH-NS binary system
292 * in the conformally flat background metric using the \f$1/r\f$
293 * falloff boundary condition
294 *
295 * The values of \c logn_comp , \c beta_comp , \c pot_centri
296 * are held fixed during the iteration.
297 *
298 * @param ent_c [input] Central enthalpy
299 * @param mass [input] Mass of BH
300 * @param sepa [input] Orbital separation
301 * @param mermax [input] Maximum number of steps
302 * @param mermax_poisson [input] Maximum number of steps in
303 * Map_et::poisson
304 * @param relax_poisson [input] Relaxation factor in Map_et::poisson
305 * @param mermax_potvit [input] Maximum number of steps in
306 * Map_radial::poisson_compact
307 * @param relax_potvit [input] Relaxation factor in
308 * Map_radial::poisson_compact
309 * @param np_filter [input] Number of coefficients in phi which are
310 * deleted by filter
311 * @param thres_adapt [input] Threshold on dH/dr for the adaptation
312 * of the mapping
313 * @param diff [output] 1-D \c Tbl for the storage of some
314 * error indicators :
315 * \li \c diff(0) : Relative change in the enthalpy field
316 * between two successive steps
317 * \li \c diff(1) : Relative error returned by the routine
318 * \c Etoile_bin::velocity_potential
319 * \li \c diff(2) : Relative error in the resolution of the
320 * Poisson equation for \c logn_auto
321 * \li \c diff(3) : Relative error in the resolution of the
322 * Poisson equation for \c beta_auto
323 * \li \c diff(4) : Relative error in the resolution of the
324 * equation for \c shift_auto (x comp.)
325 * \li \c diff(5) : Relative error in the resolution of the
326 * equation for \c shift_auto (y comp.)
327 * \li \c diff(6) : Relative error in the resolution of the
328 * equation for \c shift_auto (z comp.)
329 */
330 void equil_bhns_extr_cf(double ent_c, const double& mass,
331 const double& sepa, int mermax,
332 int mermax_poisson,
333 double relax_poisson, int mermax_potvit,
334 double relax_potvit, int np_filter,
335 double thres_adapt, Tbl& diff) ;
336
337 /** Computes an equilibrium configuration of a BH-NS binary system
338 * in the Kerr-Schild background metric using the multipole falloff
339 * boundary condition
340 *
341 * The values of \c logn_comp , \c beta_comp , \c pot_centri
342 * are held fixed during the iteration.
343 *
344 * @param ent_c [input] Central enthalpy
345 * @param mass [input] Mass of BH
346 * @param sepa [input] Orbital separation
347 * @param nu_int [input] Multipole moment for logn in the previous
348 * step
349 * @param beta_int [input] Multipole moment for beta in the
350 * previous step
351 * @param shift_int [input] Multipole moment for shift in the
352 * previous step
353 * @param mermax [input] Maximum number of steps
354 * @param mermax_poisson [input] Maximum number of steps in
355 * Map_et::poisson
356 * @param relax_poisson [input] Relaxation factor in Map_et::poisson
357 * @param relax_ylm [input] Relaxation factor on the outer boundary
358 condition
359 * @param mermax_potvit [input] Maximum number of steps in
360 * Map_radial::poisson_compact
361 * @param relax_potvit [input] Relaxation factor in
362 * Map_radial::poisson_compact
363 * @param np_filter [input] Number of coefficients in phi which are
364 * deleted by filter
365 * @param thres_adapt [input] Threshold on dH/dr for the adaptation
366 * of the mapping
367 * @param diff [output] 1-D \c Tbl for the storage of some
368 * error indicators :
369 * \li \c diff(0) : Relative change in the enthalpy field
370 * between two successive steps
371 * \li \c diff(1) : Relative error returned by the routine
372 * \c Etoile_bin::velocity_potential
373 * \li \c diff(2) : Relative error in the resolution of the
374 * Poisson equation for \c logn_auto
375 * \li \c diff(3) : Relative error in the resolution of the
376 * Poisson equation for \c beta_auto
377 * \li \c diff(4) : Relative error in the resolution of the
378 * equation for \c shift_auto (x comp.)
379 * \li \c diff(5) : Relative error in the resolution of the
380 * equation for \c shift_auto (y comp.)
381 * \li \c diff(6) : Relative error in the resolution of the
382 * equation for \c shift_auto (z comp.)
383 */
384 void equil_bhns_extr_ylm_ks(double ent_c, const double& mass,
385 const double& sepa, double* nu_int,
386 double* beta_int, double* shift_int,
387 int mermax, int mermax_poisson,
388 double relax_poisson, double relax_ylm,
389 int mermax_potvit, double relax_potvit,
390 int np_filter,
391 double thres_adapt, Tbl& diff) ;
392
393 /** Computes an equilibrium configuration of a BH-NS binary system
394 * in the conformally flat background metric using the multipole
395 * falloff boundary condition
396 *
397 * The values of \c logn_comp , \c beta_comp , \c pot_centri
398 * are held fixed during the iteration.
399 *
400 * @param ent_c [input] Central enthalpy
401 * @param mass [input] Mass of BH
402 * @param sepa [input] Orbital separation
403 * @param nu_int [input] Multipole moment for logn in the previous
404 * step
405 * @param beta_int [input] Multipole moment for beta in the
406 * previous step
407 * @param shift_int [input] Multipole moment for shift in the
408 * previous step
409 * @param mermax [input] Maximum number of steps
410 * @param mermax_poisson [input] Maximum number of steps in
411 * Map_et::poisson
412 * @param relax_poisson [input] Relaxation factor in Map_et::poisson
413 * @param relax_ylm [input] Relaxation factor on the outer boundary
414 condition
415 * @param mermax_potvit [input] Maximum number of steps in
416 * Map_radial::poisson_compact
417 * @param relax_potvit [input] Relaxation factor in
418 * Map_radial::poisson_compact
419 * @param np_filter [input] Number of coefficients in phi which are
420 * deleted by filter
421 * @param thres_adapt [input] Threshold on dH/dr for the adaptation
422 * of the mapping
423 * @param diff [output] 1-D \c Tbl for the storage of some
424 * error indicators :
425 * \li \c diff(0) : Relative change in the enthalpy field
426 * between two successive steps
427 * \li \c diff(1) : Relative error returned by the routine
428 * \c Etoile_bin::velocity_potential
429 * \li \c diff(2) : Relative error in the resolution of the
430 * Poisson equation for \c logn_auto
431 * \li \c diff(3) : Relative error in the resolution of the
432 * Poisson equation for \c beta_auto
433 * \li \c diff(4) : Relative error in the resolution of the
434 * equation for \c shift_auto (x comp.)
435 * \li \c diff(5) : Relative error in the resolution of the
436 * equation for \c shift_auto (y comp.)
437 * \li \c diff(6) : Relative error in the resolution of the
438 * equation for \c shift_auto (z comp.)
439 */
440 void equil_bhns_extr_ylm_cf(double ent_c, const double& mass,
441 const double& sepa, double* nu_int,
442 double* beta_int, double* shift_int,
443 int mermax, int mermax_poisson,
444 double relax_poisson, double relax_ylm,
445 int mermax_potvit, double relax_potvit,
446 int np_filter,
447 double thres_adapt, Tbl& diff) ;
448
449 /** Tests the resolution of the Poisson equations
450 * when the NS has no matter source.
451 * The solution should be the same as the Kerr-Schild metric
452 *
453 * @param mass [input] Mass of BH
454 * @param sepa [input] Orbital separation
455 * @param mermax_poisson [input] Maximum number of steps in
456 * Map_et::poisson
457 * @param relax_poisson [input] Relaxation factor in Map_et::poisson
458 * @param mermax_potvit [input] Maximum number of steps in
459 * Map_radial::poisson_compact
460 * @param relax_potvit [input] Relaxation factor in
461 * Map_radial::poisson_compact
462 * @param diff [output] 1-D \c Tbl for the storage of some
463 * error indicators :
464 * \li \c diff(0) : Relative error returned by the routine
465 * \c Etoile_bin::velocity_potential
466 * \li \c diff(1) : Relative error in the resolution of the
467 * Poisson equation for \c logn_auto
468 * \li \c diff(2) : Relative error in the resolution of the
469 * Poisson equation for \c beta_auto
470 * \li \c diff(3) : Relative error in the resolution of the
471 * equation for \c shift_auto (x comp.)
472 * \li \c diff(4) : Relative error in the resolution of the
473 * equation for \c shift_auto (y comp.)
474 * \li \c diff(5) : Relative error in the resolution of the
475 * equation for \c shift_auto (z comp.)
476 */
477 void test_bhns_extr(const double& mass,
478 const double& sepa, int mermax_poisson,
479 double relax_poisson, int mermax_potvit,
480 double relax_potvit, Tbl& diff) ;
481
482 /** Computes the non-translational part of the velocity scalar
483 * potential \f$\psi0\f$ by solving the continuity equation
484 * in the Kerr-Schild background metric
485 * or in the conformally flat one
486 *
487 * @param mass [input] Mass of BH
488 * @param sepa [input] Orbital separation
489 * @param mermax [input] Maximum number of steps in the iteration
490 * @param precis [input] Required precision: the iteration will
491 * be stopped when the relative difference
492 * on \f$\psi0\f$ between two successive steps
493 * is lower than \c precis .
494 * @param relax [input] Relaxation factor.
495 *
496 * @return Relative error of the resolution obtained by comparing
497 * the operator acting on the solution with the source.
498 */
499 double velocity_pot_extr(const double& mass, const double& sepa,
500 int mermax, double precis, double relax) ;
501
502 /** Searches the position of the maximum enthalpy
503 * @param xx [output] x-coordinate of the maximum enthalpy
504 * @param yy [output] y-coordinate of the maximum enthalpy
505 */
506 void ent_max_search(double& xx, double& yy) const ;
507
508 /** Searches the position (phi) of the longest radius of NS
509 * from the position of the maximum enthalpy
510 * @param x_max [input] x-coordinate of the maximum enthalpy
511 * @param y_max [input] y-coordinate of the maximum enthalpy
512 */
513 double phi_longest_rad(double x_max, double y_max) const ;
514
515 /// Constructs spherical harmonics
516 void get_ylm(int nylm, Cmp** ylmvec) const ;
517
518 /// Computes multipole moments
519 void get_integrals(int nylm, double* intvec, Cmp** ylmvec,
520 Cmp source) const ;
521
522 friend class Bin_bhns_extr ;
523
524 };
525
526 }
527 #endif