Debian Codegraph @

C++/Include/bin_ns_ncp.h

raw symbols SCIP
1 /*
2 * Definition of Lorene class Bin_ns_ncp
3 *
4 */
5
6 /*
7 * Copyright (c) 2002 Limousin Francois
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_NS_NCP_H_
27 #define __BIN_NS_NCP_H_
28
29 /*
30 * $Id: bin_ns_ncp.h,v 1.8 2016/09/19 15:26:22 j_novak Exp $
31 * $Log: bin_ns_ncp.h,v $
32 * Revision 1.8 2016/09/19 15:26:22 j_novak
33 * Correction of several bugs preventing the shared library compilation.
34 *
35 * Revision 1.7 2014/10/13 08:52:32 j_novak
36 * Lorene classes and functions now belong to the namespace Lorene.
37 *
38 * Revision 1.6 2004/01/14 15:48:03 f_limousin
39 * Initial revision
40 *
41 * Revision 1.5 2003/06/20 14:06:54 f_limousin
42 * Add a new argument conf_flat for the constructors and a new function fait_decouple().
43 *
44 * Revision 1.4 2003/03/03 19:07:55 f_limousin
45 * Suppress the member ref_triad.
46 *
47 * Revision 1.3 2003/02/12 18:52:53 f_limousin
48 * Change the arguments of the standard constructor.
49 *
50 * Revision 1.2 2003/01/20 09:38:59 f_limousin
51 * Modification of the standard constructor
52 *
53 * Revision 1.1 2003/01/14 14:13:25 f_limousin
54 * Binary NS with Nonconformally flat metric.
55 *
56 * Revision 1.2 2001/12/11 06:44:41 e_gourgoulhon
57 * template files
58 *
59 * $Header: /cvsroot/Lorene/C++/Include/bin_ns_ncp.h,v 1.8 2016/09/19 15:26:22 j_novak Exp $
60 *
61 */
62
63 // Lorene headers
64 //#include "et_bin_ncp.h"
65 #include "binaire.h"
66
67 namespace Lorene {
68 /**
69 * Extended description of the class for Doc++ documentation
70 *
71 * @version #$Id: bin_ns_ncp.h,v 1.8 2016/09/19 15:26:22 j_novak Exp $#
72 */
73 class Bin_ns_ncp {
74
75 // Data :
76 // -----
77 protected:
78
79 /// First star ncp of the system
80 Et_bin_ncp star1 ;
81
82 /// Second star ncp of the system
83 Et_bin_ncp star2 ;
84
85 /** Array of the two stars (to perform loops on the stars):
86 * {\tt et[0]} contains the address of {\tt star1} and {\tt et[1]}
87 * that of {\tt star2}.
88 */
89 Et_bin_ncp* et[2] ;
90
91 /** Angular velocity with respect to an asymptotically inertial
92 * observer
93 */
94 double omega ;
95
96 /** Absolute X coordinate of the rotation axis
97 */
98 double x_axe ;
99
100
101 // Derived data :
102 // ------------
103 protected:
104 /// Total ADM mass of the system
105 mutable double* p_mass_adm ;
106
107 /// Total Komar mass of the system
108 mutable double* p_mass_kom ;
109
110 /// Total angular momentum of the system
111 mutable Tbl* p_angu_mom ;
112
113 /// Total energy of the system
114 mutable double* p_total_ener ;
115
116 /// Virial theorem error
117 mutable double* p_virial ;
118
119 /// Virial theorem error by E.Gourgoulhon and S.Bonazzola.
120 mutable double* p_virial_gb ;
121
122 /// Virial theorem error by J.L.Friedman, K.Uryu, and M.Shibata.
123 mutable double* p_virial_fus ;
124
125 /// Relative error on the Hamiltonian constraint
126 mutable double* p_ham_constr ;
127
128 /// Relative error on the momentum constraint
129 mutable Tbl* p_mom_constr ;
130
131
132
133 // Constructors - Destructor
134 // -------------------------
135 public:
136 /** Standard constructor.
137 *
138 * @param mp1 Mapping on which {\tt star1} will be defined
139 * @param nzet1 Number of domains occupied by {\tt star1}
140 * @param eos1 Equation of state of {\tt star1}
141 * @param irrot1 should be {\tt true} if {\tt star1} is irrotational,
142 * {\tt false} if {\tt star1} is corotating
143 * @param mp2 Mapping on which {\tt star2} will be defined
144 * @param nzet2 Number of domains occupied by {\tt star2}
145 * @param eos2 Equation of state of {\tt star2}
146 * @param irrot2 should be {\tt true} if {\tt star2} is irrotational,
147 * {\tt false} if {\tt star2} is corotating
148 * @param relat should be {\tt true} for a relativistic configuration,
149 * {\tt false} for a Newtonian one
150 *
151 */
152 Bin_ns_ncp(Map& mp1, int nzet1, const Eos& eos1, int irrot1,
153 Map& mp2, int nzet2, const Eos& eos2, int irrot2,
154 int relat, int conf_flat, const Metrique& flat1, const Metrique& flat2,
155 const Tenseur_sym &source1, const Tenseur_sym &source2) ;
156
157
158 Bin_ns_ncp(const Bin_ns_ncp& ) ; /// Copy constructor
159
160 /** Constructor from a file (see {\tt sauve(FILE* )}).
161 *
162 * @param mp1 Mapping on which {\tt star1} will be defined
163 * @param eos1 Equation of state of {\tt star1}
164 * @param mp2 Mapping on which {\tt star2} will be defined
165 * @param eos2 Equation of state of {\tt star2}
166 * @param fich input file (must have been created by the function
167 * {\tt sauve})
168 */
169 Bin_ns_ncp(Map& mp1, const Eos& eos1, Map& mp2, const Eos& eos2,
170 const Metrique& flat1, const Metrique& flat2, FILE* fich) ;
171
172 ~Bin_ns_ncp() ; /// Destructor
173
174
175
176 // Memory management
177 // -----------------
178 protected:
179
180 /// Deletes all the derived quantities
181 void del_deriv() const ;
182
183 /// Sets to {\tt 0x0} all the pointers on derived quantities
184 void set_der_0x0() const ;
185
186
187 // Mutators / assignment
188 // ---------------------
189 public:
190 /// Assignment to another {\tt Bin_ns_ncp}
191 void operator=(const Bin_ns_ncp&) ;
192
193 /// Read/write of the star no. i
194 Et_bin_ncp& set(int i)
195 { assert( (i==1) || (i==2) );
196 del_deriv() ;
197 return *et[i-1] ;} ;
198
199 /// Sets the orbital angular velocity [{\tt f\_unit}]
200 double& set_omega() {return omega; } ;
201
202 /// Sets the absolute coordinate X of the rotation axis [{\tt r\_unit}]
203 double& set_x_axe() {return x_axe; } ;
204
205
206 // Accessors
207 // ---------
208 public:
209 /// Returns a reference to the star no. i
210 const Et_bin_ncp& operator()(int i) const
211 { assert( (i==1) || (i==2) );
212 return *et[i-1] ;} ;
213
214 /// Returns the orbital angular velocity [{\tt f\_unit}]
215 double get_omega() const {return omega; } ;
216
217 /// Returns the absolute coordinate X of the rotation axis [{\tt r\_unit}]
218 double get_x_axe() const {return x_axe; } ;
219
220 /** Returns the coordinate separation of the two stellar
221 * centers [{\tt r\_unit}]
222 */
223 double separation() const ;
224
225
226 // Outputs
227 // -------
228 public:
229 void sauve(FILE *) const ; /// Save in a file
230
231 /// Display
232 friend ostream& operator<<(ostream& , const Bin_ns_ncp& ) ;
233
234 /// Display in polytropic units
235 void display_poly(ostream& ) const ;
236
237 /** Write global quantities in a formatted file.
238 * This file can be read by an external program.
239 */
240 void write_global(ostream& ) const ;
241
242 private:
243 /// Operator >> (function called by the operator <<).
244 ostream& operator>>(ostream& ) const ;
245
246
247 // Computational routines
248 // ----------------------
249 public:
250
251 /// Total ADM mass
252 double mass_adm() const ;
253
254 /// Total Komar mass
255 double mass_kom() const ;
256
257 /** Total angular momentum.
258 *
259 * @return 1-D {\tt Tbl} of size 3, according to \\
260 * {\tt angu\_mom()(0)} = $J^X$, \\
261 * {\tt angu\_mom()(1)} = $J^Y$, \\
262 * {\tt angu\_mom()(2)} = $J^Z$.
263 */
264 const Tbl& angu_mom() const ;
265
266 /** Total energy (excluding the rest mass energy).
267 *
268 * In the Newtonian case, it is defined as the sum of kinetic,
269 * internal, and gravitational potential energies.
270 *
271 * In the relativistic case, it is defined as
272 * $M_{\rm ADM} - M_{\rm bar,1} - M_{\rm bar,2}$.
273 */
274 double total_ener() const ;
275
276 /** Estimates the relative error on the virial theorem
277 * (for a relativistic one,
278 * it returns $|1 - M_{\rm Komar} / M_{\rm ADM}|$)
279 */
280 double virial() const ;
281
282 /** Estimates the relative error on the virial theorem
283 * calculated by E.Gourgoulhon and S.Bonazzola
284 * (Class. Quantum Grav. 11, 443 (1994): Eq.(29))
285 * normalized by $2 \pi G$.
286 */
287 double virial_gb() const ;
288
289 /** Estimates the relative error on the virial theorem
290 * calculated by J.L.Friedman, K.Uryu, and M.Shibata
291 * (PRD accepted, gr-qc/0108070)
292 *
293 * The expression used in the LORENE is Eq.(5.7) in the paper
294 * by M.Shibata and K.Uryu (PRD64, 104017 (2001))
295 */
296 double virial_fus() const ;
297
298 /** Estimates the relative error on the Hamiltonian constraint
299 * equation by comparing $\underline\Delta\ln A$ with
300 // * \begin{equation}
301 // * -4\pi A^2 E - {A^2\over 4} K_{ij} K^{ij} - {1\over 2}
302 * {\overline\nabla}_i \ln A {\overline\nabla}^i \ln A
303 * \end{equation}
304 */
305 double ham_constr() const ;
306
307 /** Estimates the relative error on the momentum constraint
308 * equation by comparing ${\overline\nabla}_j K^{ij}$ with
309 // * \begin{equation}
310 * 8\pi J^i - 5 K^{ij} {\overline\nabla}_j \ln A
311 * \end{equation}
312 */
313 const Tbl& mom_constr() const ;
314
315 /** Computes the orbital angular velocity {\tt omega} and the
316 * position of the rotation axis {\tt x\_axe}.
317 *
318 * @param fact_omeg_min [input] : determines the lower bound of the
319 * interval {\tt [omega\_min, omega\_max]} in which
320 * {\tt omega} is searched by
321 * {\tt omega\_min = fact\_omeg\_min * omega},
322 * where {\tt omega} is the previous value of the
323 * angular velocity
324 * (typical value : {\tt fact\_omeg\_min = 0.5})
325 *
326 * @param fact_omeg_max [input] : determines the higher bound of the
327 * interval {\tt [omega\_min, omega\_max]} in which
328 * {\tt omega} is searched by
329 * {\tt omega\_max = fact\_omeg\_max * omega},
330 * where {\tt omega} is the previous value of the
331 * angular velocity.
332 * (typical value : {\tt fact\_omeg\_max = 1.5})
333 *
334 * @param xgg1 [output] : x coordinate (relative to star 1 mapping)
335 * of the ``center of mass'' of star 1
336 *
337 * @param xgg2 [output] : x coordinate (relative to star 2 mapping)
338 * of the ``center of mass'' of star 2
339 *
340 */
341 void orbit(double fact_omeg_min, double fact_omeg_max, double& xgg1,
342 double& xgg2) ;
343
344 /** Sets the orbital angular velocity to some 2-PN analytical
345 * value (Keplerian value in the Newtonian case)
346 */
347 void analytical_omega() ;
348
349 /** Sets some analytical template for the shift vector (via the
350 * members {\tt w\_shift} and {\tt khi\_shift} of the two
351 * {\tt Etoile\_bin}.
352 */
353 void analytical_shift() ;
354
355 /**
356 * Calculates {tt decouple} which is used to obtain {\tt a_car\_auto} by the formula :
357 * {\tt a_car\_auto} = {\tt decouple} * {\tt a_car\_tot}.
358 * (see the membre {tt Cmp decouple} for more precisions about its value).
359 *
360 */
361 void fait_decouple () ;
362
363 };
364 ostream& operator<<(ostream& , const Bin_ns_ncp& ) ;
365
366 }
367 #endif