LORENE
bin_ns_ncp.h
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.9 2017/02/24 15:34:59 j_novak Exp $
31  * $Log: bin_ns_ncp.h,v $
32  * Revision 1.9 2017/02/24 15:34:59 j_novak
33  * Removal of spurious comments
34  *
35  * Revision 1.8 2016/09/19 15:26:22 j_novak
36  * Correction of several bugs preventing the shared library compilation.
37  *
38  * Revision 1.7 2014/10/13 08:52:32 j_novak
39  * Lorene classes and functions now belong to the namespace Lorene.
40  *
41  * Revision 1.6 2004/01/14 15:48:03 f_limousin
42  * Initial revision
43  *
44  * Revision 1.5 2003/06/20 14:06:54 f_limousin
45  * Add a new argument conf_flat for the constructors and a new function fait_decouple().
46  *
47  * Revision 1.4 2003/03/03 19:07:55 f_limousin
48  * Suppress the member ref_triad.
49  *
50  * Revision 1.3 2003/02/12 18:52:53 f_limousin
51  * Change the arguments of the standard constructor.
52  *
53  * Revision 1.2 2003/01/20 09:38:59 f_limousin
54  * Modification of the standard constructor
55  *
56  * Revision 1.1 2003/01/14 14:13:25 f_limousin
57  * Binary NS with Nonconformally flat metric.
58  *
59  * Revision 1.2 2001/12/11 06:44:41 e_gourgoulhon
60  * template files
61  *
62  * $Header: /cvsroot/Lorene/C++/Include/bin_ns_ncp.h,v 1.9 2017/02/24 15:34:59 j_novak Exp $
63  *
64  */
65 
66 // Lorene headers
67 //#include "et_bin_ncp.h"
68 #include "binaire.h"
69 
70 namespace Lorene {
76 class Bin_ns_ncp {
77 
78  // Data :
79  // -----
80  protected:
81 
83  Et_bin_ncp star1 ;
84 
86  Et_bin_ncp star2 ;
87 
92  Et_bin_ncp* et[2] ;
93 
97  double omega ;
98 
101  double x_axe ;
102 
103 
104  // Derived data :
105  // ------------
106  protected:
108  mutable double* p_mass_adm ;
109 
111  mutable double* p_mass_kom ;
112 
114  mutable Tbl* p_angu_mom ;
115 
117  mutable double* p_total_ener ;
118 
120  mutable double* p_virial ;
121 
123  mutable double* p_virial_gb ;
124 
126  mutable double* p_virial_fus ;
127 
129  mutable double* p_ham_constr ;
130 
132  mutable Tbl* p_mom_constr ;
133 
134 
135 
136  // Constructors - Destructor
137  // -------------------------
138  public:
155  Bin_ns_ncp(Map& mp1, int nzet1, const Eos& eos1, int irrot1,
156  Map& mp2, int nzet2, const Eos& eos2, int irrot2,
157  int relat, int conf_flat, const Metrique& flat1, const Metrique& flat2,
158  const Tenseur_sym &source1, const Tenseur_sym &source2) ;
159 
160 
161  Bin_ns_ncp(const Bin_ns_ncp& ) ;
162 
172  Bin_ns_ncp(Map& mp1, const Eos& eos1, Map& mp2, const Eos& eos2,
173  const Metrique& flat1, const Metrique& flat2, FILE* fich) ;
174 
175  ~Bin_ns_ncp() ;
176 
177 
178 
179  // Memory management
180  // -----------------
181  protected:
182 
184  void del_deriv() const ;
185 
187  void set_der_0x0() const ;
188 
189 
190  // Mutators / assignment
191  // ---------------------
192  public:
194  void operator=(const Bin_ns_ncp&) ;
195 
197  Et_bin_ncp& set(int i)
198  { assert( (i==1) || (i==2) );
199  del_deriv() ;
200  return *et[i-1] ;} ;
201 
203  double& set_omega() {return omega; } ;
204 
206  double& set_x_axe() {return x_axe; } ;
207 
208 
209  // Accessors
210  // ---------
211  public:
213  const Et_bin_ncp& operator()(int i) const
214  { assert( (i==1) || (i==2) );
215  return *et[i-1] ;} ;
216 
218  double get_omega() const {return omega; } ;
219 
221  double get_x_axe() const {return x_axe; } ;
222 
226  double separation() const ;
227 
228 
229  // Outputs
230  // -------
231  public:
232  void sauve(FILE *) const ;
233 
234  // Display
235  friend ostream& operator<<(ostream& , const Bin_ns_ncp& ) ;
236 
238  void display_poly(ostream& ) const ;
239 
243  void write_global(ostream& ) const ;
244 
245  private:
247  ostream& operator>>(ostream& ) const ;
248 
249 
250  // Computational routines
251  // ----------------------
252  public:
253 
255  double mass_adm() const ;
256 
258  double mass_kom() const ;
259 
267  const Tbl& angu_mom() const ;
268 
277  double total_ener() const ;
278 
283  double virial() const ;
284 
290  double virial_gb() const ;
291 
299  double virial_fus() const ;
300 
308  double ham_constr() const ;
309 
316  const Tbl& mom_constr() const ;
317 
344  void orbit(double fact_omeg_min, double fact_omeg_max, double& xgg1,
345  double& xgg2) ;
346 
350  void analytical_omega() ;
351 
356  void analytical_shift() ;
357 
364  void fait_decouple () ;
365 
366 };
367 ostream& operator<<(ostream& , const Bin_ns_ncp& ) ;
368 
369 }
370 #endif
Et_bin_ncp * et[2]
Array of the two stars (to perform loops on the stars): { et[0]} contains the address of { star1} and...
Definition: bin_ns_ncp.h:92
const Et_bin_ncp & operator()(int i) const
Returns a reference to the star no. i.
Definition: bin_ns_ncp.h:213
Et_bin_ncp star1
First star ncp of the system.
Definition: bin_ns_ncp.h:83
Class intended to describe tensors with a symmetry on the two last indices *** DEPRECATED : use class...
Definition: tenseur.h:1256
void orbit(double fact_omeg_min, double fact_omeg_max, double &xgg1, double &xgg2)
Computes the orbital angular velocity { omega} and the position of the rotation axis { x_axe}...
Lorene prototypes.
Definition: app_hor.h:67
Tbl * p_angu_mom
Total angular momentum of the system.
Definition: bin_ns_ncp.h:114
Equation of state base class.
Definition: eos.h:209
Base class for coordinate mappings.
Definition: map.h:688
double virial() const
Estimates the relative error on the virial theorem (for a relativistic one, it returns $|1 - M_{ Koma...
double mass_adm() const
Total ADM mass.
double * p_mass_kom
Total Komar mass of the system.
Definition: bin_ns_ncp.h:111
double omega
Angular velocity with respect to an asymptotically inertial observer.
Definition: bin_ns_ncp.h:97
double * p_ham_constr
Relative error on the Hamiltonian constraint.
Definition: bin_ns_ncp.h:129
double total_ener() const
Total energy (excluding the rest mass energy).
double mass_kom() const
Total Komar mass.
void del_deriv() const
Destructor.
const Tbl & mom_constr() const
Estimates the relative error on the momentum constraint equation by comparing ${}_j K^{ij}$ with {equ...
double get_x_axe() const
Returns the absolute coordinate X of the rotation axis [{ r_unit}].
Definition: bin_ns_ncp.h:221
void set_der_0x0() const
Sets to { 0x0} all the pointers on derived quantities.
double virial_gb() const
Estimates the relative error on the virial theorem calculated by E.Gourgoulhon and S...
friend ostream & operator<<(ostream &, const Bin_ns_ncp &)
Save in a file.
void write_global(ostream &) const
Write global quantities in a formatted file.
double * p_virial
Virial theorem error.
Definition: bin_ns_ncp.h:120
double * p_virial_fus
Virial theorem error by J.L.Friedman, K.Uryu, and M.Shibata.
Definition: bin_ns_ncp.h:126
double & set_x_axe()
Sets the absolute coordinate X of the rotation axis [{ r_unit}].
Definition: bin_ns_ncp.h:206
double * p_mass_adm
Total ADM mass of the system.
Definition: bin_ns_ncp.h:108
void analytical_shift()
Sets some analytical template for the shift vector (via the members { w_shift} and { khi_shift} of th...
ostream & operator>>(ostream &) const
Operator >> (function called by the operator <<).
double & set_omega()
Sets the orbital angular velocity [{ f_unit}].
Definition: bin_ns_ncp.h:203
double x_axe
Absolute X coordinate of the rotation axis.
Definition: bin_ns_ncp.h:101
Extended description of the class for Doc++ documentation.
Definition: bin_ns_ncp.h:76
void fait_decouple()
Calculates {tt decouple} which is used to obtain { a_car_auto} by the formula : { a_car_auto} = { dec...
double * p_virial_gb
Virial theorem error by E.Gourgoulhon and S.Bonazzola.
Definition: bin_ns_ncp.h:123
Tbl * p_mom_constr
Relative error on the momentum constraint.
Definition: bin_ns_ncp.h:132
void operator=(const Bin_ns_ncp &)
Assignment to another { Bin_ns_ncp}.
Bin_ns_ncp(Map &mp1, int nzet1, const Eos &eos1, int irrot1, Map &mp2, int nzet2, const Eos &eos2, int irrot2, int relat, int conf_flat, const Metrique &flat1, const Metrique &flat2, const Tenseur_sym &source1, const Tenseur_sym &source2)
Standard constructor.
double separation() const
Returns the coordinate separation of the two stellar centers [{ r_unit}].
Basic array class.
Definition: tbl.h:164
const Tbl & angu_mom() const
Total angular momentum.
void display_poly(ostream &) const
Display in polytropic units.
double * p_total_ener
Total energy of the system.
Definition: bin_ns_ncp.h:117
void analytical_omega()
Sets the orbital angular velocity to some 2-PN analytical value (Keplerian value in the Newtonian cas...
double virial_fus() const
Estimates the relative error on the virial theorem calculated by J.L.Friedman, K.Uryu, and M.Shibata (PRD accepted, gr-qc/0108070)
double get_omega() const
Returns the orbital angular velocity [{ f_unit}].
Definition: bin_ns_ncp.h:218
double ham_constr() const
Estimates the relative error on the Hamiltonian constraint equation by comparing $ A$ with {equation}...
Et_bin_ncp star2
Second star ncp of the system.
Definition: bin_ns_ncp.h:86