Debian Codegraph @

C++/Include/bin_bhns.h

raw symbols SCIP
1 /*
2 * Definition of Lorene class Bin_bhns
3 *
4 */
5
6 /*
7 * Copyright (c) 2005-2007 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 __BIN_BHNS_H_
27 #define __BIN_BHNS_H_
28
29 /*
30 * $Id: bin_bhns.h,v 1.3 2014/10/13 08:52:32 j_novak Exp $
31 * $Log: bin_bhns.h,v $
32 * Revision 1.3 2014/10/13 08:52:32 j_novak
33 * Lorene classes and functions now belong to the namespace Lorene.
34 *
35 * Revision 1.2 2008/05/15 18:50:06 k_taniguchi
36 * Addition of new global quantities.
37 *
38 * Revision 1.1 2007/06/22 01:03:50 k_taniguchi
39 * *** empty log message ***
40 *
41 *
42 * $Header: /cvsroot/Lorene/C++/Include/bin_bhns.h,v 1.3 2014/10/13 08:52:32 j_novak Exp $
43 *
44 */
45
46 // Lorene headers
47 #include "hole_bhns.h"
48 #include "star_bhns.h"
49
50 namespace Lorene {
51
52 // External classes which appear in the declaration of class Bin_bhns:
53 class Hole_bhns ;
54 class Star_bhns ;
55
56
57 /**
58 * Class for computing a black hole - neutron star binary system
59 * with comparable mass
60 * \ingroup(star)
61 *
62 */
63 class Bin_bhns {
64
65 // Data :
66 // -----
67 protected:
68 /// Cartesian triad of the absolute reference frame
69 const Base_vect_cart ref_triad ;
70
71 /// Black hole
72 Hole_bhns hole ;
73
74 /// Neutron star
75 Star_bhns star ;
76
77 /** Angular velocity with respect to an asymptotically inertial
78 * observer
79 */
80 double omega ;
81
82 /// Absolute orbital separation between two centers of BH and NS
83 double separ ;
84
85 /// Absolute X coordinate of the rotation axis
86 double x_rot ;
87
88 /// Absolute Y coordinate of the rotation axis
89 double y_rot ;
90
91 // Derived data :
92 // ------------
93 protected:
94 /** Total ADM mass of the system calculated by the surface integral
95 * at infinity
96 */
97 mutable double* p_mass_adm_bhns_surf ;
98
99 /** Total ADM mass of the system calculated by the volume integral
100 * and the surface integral at the apparent horizon
101 */
102 mutable double* p_mass_adm_bhns_vol ;
103
104 /** Total Komar mass of the system calculated by the surface integral
105 * at infinity
106 */
107 mutable double* p_mass_kom_bhns_surf ;
108
109 /** Total Komar mass of the system calculated by the volume integral
110 * and the surface integral at the apparent horizon
111 */
112 mutable double* p_mass_kom_bhns_vol ;
113
114 /// Total linear momentum of the system
115 mutable Tbl* p_line_mom_bhns ;
116
117 /// Total angular momentum of the system
118 mutable Tbl* p_angu_mom_bhns ;
119
120 /** Virial theorem error calculated by the ADM mass and the Komar
121 * mass of the surface integral at infinity
122 */
123 mutable double* p_virial_bhns_surf ;
124
125 /** Virial theorem error calculated by the ADM mass and the Komar
126 * mass of the volume integral
127 */
128 mutable double* p_virial_bhns_vol ;
129
130 /// Absolute coordinate X of the barycenter of the baryon density
131 mutable double* p_xa_barycenter ;
132
133 /// Absolute coordinate Y of the barycenter of the baryon density
134 mutable double* p_ya_barycenter ;
135
136 /// Orbital angular velocity derived from another method
137 mutable double* p_omega_two_points ;
138
139 /// Relative error on the Hamiltonian constraint
140 // mutable double* p_ham_constr_bhns ;
141
142 /// Relative error on the momentum constraint
143 // mutable Tbl* p_mom_constr_bhns ;
144
145
146 // Constructors - Destructor
147 // -------------------------
148 public:
149 /** Standard constructor
150 *
151 * @param mp_bh Mapping on which the black hole will be defined
152 * @param mp_ns Mapping on which the neutron star will be defined
153 * @param nzet Number of domains occupied by the neutron star
154 * @param eos Equation of state of the neutron star
155 * @param irrot_ns should be {\tt true} if NS is irrotational,
156 * {\tt false} if NS is corotating
157 * @param kerrschild should be {\tt true} if the background metric
158 * is Kerr-Schild, {\tt false} if the background
159 * metric is conformally flat
160 * @param bc_lapse_nd should be {\tt true} if the BC type for lapse
161 * is Neumann, {\tt false} if the BC type is Dirichlet
162 * @param bc_lapse_fs should be {\tt true} if the BC is first type
163 * {\tt false} if the BC is second one
164 * @param irrot_bh should be {\tt true} if BH is irrotational,
165 * {\tt false} if NS is corotating
166 * @param mass_bh Black hole mass which appears in the background
167 * metric
168 */
169 Bin_bhns(Map& mp_bh, Map& mp_ns, int nzet, const Eos& eos,
170 bool irrot_ns, bool kerrschild,
171 bool bc_lapse_nd, bool bc_lapse_fs, bool irrot_bh,
172 double mass_bh) ;
173
174 Bin_bhns(const Bin_bhns& ) ; ///< Copy constructor
175
176 /// Constructor from a file (see \c sauve(FILE*) )
177 Bin_bhns(Map& mp_bh, Map& mp_ns, const Eos& eos, FILE* fich) ;
178
179 virtual ~Bin_bhns() ; ///< Destructor
180
181
182 // Memory management
183 // -----------------
184 protected:
185 /// Deletes all the derived quantities
186 void del_deriv() const ;
187
188 /// Sets to \c 0x0 all the pointers on derived quantities
189 void set_der_0x0() const ;
190
191
192 // Mutators / assignment
193 // ---------------------
194 public:
195 /// Assignment to another Bin_bhns
196 void operator=(const Bin_bhns&) ;
197
198 /// Read/write of the black hole
199 Hole_bhns& set_bh()
200 { del_deriv() ;
201 return hole ; } ;
202
203 /// Read/write of the neutron star
204 Star_bhns& set_ns()
205 { del_deriv() ;
206 return star ; } ;
207
208 /// Sets the orbital angular velocity [{\tt f\_unit}]
209 double& set_omega() { return omega ; } ;
210
211 /// Sets the orbital separation [{\tt r\_unit}]
212 double& set_separ() { return separ ; } ;
213
214 /// Sets the absolute coordinate X of the rotation axis [{\tt r\_unit}]
215 double& set_x_rot() {return x_rot; } ;
216
217 /// Sets the absolute coordinate Y of the rotation axis [{\tt r\_unit}]
218 double& set_y_rot() {return y_rot; } ;
219
220
221 // Accessors
222 // ---------
223 public:
224 /// Returns a reference to the black hole
225 const Hole_bhns& get_bh() const { return hole ; } ;
226
227 /// Returns a reference to the neutron star
228 const Star_bhns& get_ns() const { return star ; } ;
229
230 /// Returns the orbital angular velocity [{\tt f\_unit}]
231 double get_omega() const { return omega ; } ;
232
233 /** Returns the coordinate separation of the binary system
234 * [{\tt r\_unit}]
235 */
236 double get_separ() const { return separ ; } ;
237
238 /** Returns the absolute coordinate X of the rotation axis
239 * [{\tt r\_unit}]
240 */
241 double get_x_rot() const {return x_rot; } ;
242
243 /** Returns the absolute coordinate Y of the rotation axis
244 * [{\tt r\_unit}]
245 */
246 double get_y_rot() const {return y_rot; } ;
247
248
249 // Outputs
250 // -------
251 public:
252 virtual void sauve(FILE *) const ; ///< Save in a file
253
254 /// Display
255 friend ostream& operator<<(ostream& , const Bin_bhns& ) ;
256
257 /// Display in polytropic units
258 void display_poly(ostream& ) const ;
259
260 private:
261 /// Operator >> (function called by the operator <<)
262 ostream& operator>>(ostream& ) const ;
263
264 // Computational routines
265 // ----------------------
266 public:
267
268 /// Total ADM mass
269 double mass_adm_bhns_surf() const ;
270
271 double mass_adm_bhns_vol() const ;
272
273 /// Total Komar mass
274 double mass_kom_bhns_surf() const ;
275
276 double mass_kom_bhns_vol() const ;
277
278 /** Total linear momentum.
279 *
280 * @return 1-D {\tt Tbl} of size 3, according to \\
281 * {\tt line\_mom()(0)} = $P^x$, \\
282 * {\tt line\_mom()(1)} = $P^y$, \\
283 * {\tt line\_mom()(2)} = $P^z$.
284 */
285 const Tbl& line_mom_bhns() const ;
286
287 /** Total angular momentum.
288 *
289 * @return 1-D {\tt Tbl} of size 3, according to \\
290 * {\tt angu\_mom()(0)} = $J^x$, \\
291 * {\tt angu\_mom()(1)} = $J^y$, \\
292 * {\tt angu\_mom()(2)} = $J^z$.
293 */
294 const Tbl& angu_mom_bhns() const ;
295
296 /** Estimates the relative error on the virial theorem
297 * $|1 - M_{\rm Komar} / M_{\rm ADM}|$
298 */
299 double virial_bhns_surf() const ;
300
301 /** Estimates the relative error on the virial theorem
302 * $|1 - M_{\rm Komar} / M_{\rm ADM}|$
303 */
304 double virial_bhns_vol() const ;
305
306 /// Absolute coordinate X of the barycenter of the baryon density
307 double xa_barycenter() const ;
308
309 /// Absolute coordinate Y of the barycenter of the baryon density
310 double ya_barycenter() const ;
311
312 /// Orbital angular velocity derived from another method
313 double omega_two_points() const ;
314
315 /** Estimates the relative error on the Hamiltonian constraint
316 */
317 // double ham_constr() const ;
318
319 /** Estimates the relative error on the momentum constraint
320 */
321 // const Tbl& mom_constr() const ;
322
323 /** Computes the orbital angular velocity {\tt omega}
324 *
325 * @para fact_omeg_min [input] : determines the lower bound of the
326 * interval {\tt [omega\_min, omega\_max]} in which
327 * {\tt omega} is searched by
328 * {\tt omega\_min = fact\_omeg\_min * omega},
329 * where {\tt omega} is the previous value of the
330 * angular velocity
331 * (typical value : {\tt fact\_omeg\_min = 0.5})
332 *
333 * @param fact_omeg_max [input] : determines the higher bound of the
334 * interval {\tt [omega\_min, omega\_max]} in which
335 * {\tt omega} is searched by
336 * {\tt omega\_max = fact\_omeg\_max * omega},
337 * where {\tt omega} is the previous value of the
338 * angular velocity.
339 * (typical value : {\tt fact\_omeg\_max = 1.5})
340 */
341 void orbit_omega(double fact_omeg_min, double fact_omeg_max) ;
342
343 /** Computes the position of the rotation axis X
344 *
345 * @param rot_exp_x [input] : exponent of the factor which modifies
346 * the position of the two stars from the rotation axis
347 *
348 */
349 void rotation_axis_x(double rot_exp_x) ;
350
351 /** Computes the position of the rotation axis Y
352 *
353 * @param thres_rot [input] : threshold to stop moving to the Y dir.
354 * @param rot_exp_y [input] : exponent of the factor which modifies
355 * the Y position of the neutron star coordinate
356 * @param fact [input] : factor to multiply to Y_NS
357 *
358 */
359 void rotation_axis_y(double thres_rot, double rot_exp_y, double fact) ;
360
361 /** Sets some analytical template for the initial shift vector
362 *
363 * @param reduce_shift_bh [input] : factor to reduce the initial
364 * ansatz
365 * @param reduce_shift_ns [input] : factor to reduce the initial
366 * ansatz
367 *
368 */
369 void shift_analytic(double reduce_shift_bh, double reduce_shift_ns) ;
370
371
372 };
373 ostream& operator<<(ostream& , const Bin_bhns& ) ;
374
375 }
376 #endif