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.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 {
73 class Bin_ns_ncp {
74 
75  // Data :
76  // -----
77  protected:
78 
80  Et_bin_ncp star1 ;
81 
83  Et_bin_ncp star2 ;
84 
89  Et_bin_ncp* et[2] ;
90 
94  double omega ;
95 
98  double x_axe ;
99 
100 
101  // Derived data :
102  // ------------
103  protected:
105  mutable double* p_mass_adm ;
106 
108  mutable double* p_mass_kom ;
109 
111  mutable Tbl* p_angu_mom ;
112 
114  mutable double* p_total_ener ;
115 
117  mutable double* p_virial ;
118 
120  mutable double* p_virial_gb ;
121 
123  mutable double* p_virial_fus ;
124 
126  mutable double* p_ham_constr ;
127 
129  mutable Tbl* p_mom_constr ;
130 
131 
132 
133  // Constructors - Destructor
134  // -------------------------
135  public:
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& ) ;
159 
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() ;
173 
174 
175 
176  // Memory management
177  // -----------------
178  protected:
179 
181  void del_deriv() const ;
182 
184  void set_der_0x0() const ;
185 
186 
187  // Mutators / assignment
188  // ---------------------
189  public:
191  void operator=(const Bin_ns_ncp&) ;
192 
194  Et_bin_ncp& set(int i)
195  { assert( (i==1) || (i==2) );
196  del_deriv() ;
197  return *et[i-1] ;} ;
198 
200  double& set_omega() {return omega; } ;
201 
203  double& set_x_axe() {return x_axe; } ;
204 
205 
206  // Accessors
207  // ---------
208  public:
210  const Et_bin_ncp& operator()(int i) const
211  { assert( (i==1) || (i==2) );
212  return *et[i-1] ;} ;
213 
215  double get_omega() const {return omega; } ;
216 
218  double get_x_axe() const {return x_axe; } ;
219 
223  double separation() const ;
224 
225 
226  // Outputs
227  // -------
228  public:
229  void sauve(FILE *) const ;
230 
232  friend ostream& operator<<(ostream& , const Bin_ns_ncp& ) ;
233 
235  void display_poly(ostream& ) const ;
236 
240  void write_global(ostream& ) const ;
241 
242  private:
244  ostream& operator>>(ostream& ) const ;
245 
246 
247  // Computational routines
248  // ----------------------
249  public:
250 
252  double mass_adm() const ;
253 
255  double mass_kom() const ;
256 
264  const Tbl& angu_mom() const ;
265 
274  double total_ener() const ;
275 
280  double virial() const ;
281 
287  double virial_gb() const ;
288 
296  double virial_fus() const ;
297 
305  double ham_constr() const ;
306 
313  const Tbl& mom_constr() const ;
314 
341  void orbit(double fact_omeg_min, double fact_omeg_max, double& xgg1,
342  double& xgg2) ;
343 
347  void analytical_omega() ;
348 
353  void analytical_shift() ;
354 
361  void fait_decouple () ;
362 
363 };
364 ostream& operator<<(ostream& , const Bin_ns_ncp& ) ;
365 
366 }
367 #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:89
const Et_bin_ncp & operator()(int i) const
Returns a reference to the star no. i.
Definition: bin_ns_ncp.h:210
Et_bin_ncp star1
First star ncp of the system.
Definition: bin_ns_ncp.h:80
Class intended to describe tensors with a symmetry on the two last indices *** DEPRECATED : use class...
Definition: tenseur.h:1253
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:64
Tbl * p_angu_mom
Total angular momentum of the system.
Definition: bin_ns_ncp.h:111
Equation of state base class.
Definition: eos.h:190
Base class for coordinate mappings.
Definition: map.h:670
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:108
double omega
Angular velocity with respect to an asymptotically inertial observer.
Definition: bin_ns_ncp.h:94
double * p_ham_constr
Relative error on the Hamiltonian constraint.
Definition: bin_ns_ncp.h:126
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:218
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:117
double * p_virial_fus
Virial theorem error by J.L.Friedman, K.Uryu, and M.Shibata.
Definition: bin_ns_ncp.h:123
double & set_x_axe()
Sets the absolute coordinate X of the rotation axis [{ r_unit}].
Definition: bin_ns_ncp.h:203
double * p_mass_adm
Total ADM mass of the system.
Definition: bin_ns_ncp.h:105
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:200
double x_axe
Absolute X coordinate of the rotation axis.
Definition: bin_ns_ncp.h:98
Extended description of the class for Doc++ documentation.
Definition: bin_ns_ncp.h:73
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:120
Tbl * p_mom_constr
Relative error on the momentum constraint.
Definition: bin_ns_ncp.h:129
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:161
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:114
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:215
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:83