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.7 2014/10/13 08:52:32 j_novak Exp $
31  * $Log: bin_ns_ncp.h,v $
32  * Revision 1.7 2014/10/13 08:52:32 j_novak
33  * Lorene classes and functions now belong to the namespace Lorene.
34  *
35  * Revision 1.6 2004/01/14 15:48:03 f_limousin
36  * Initial revision
37  *
38  * Revision 1.5 2003/06/20 14:06:54 f_limousin
39  * Add a new argument conf_flat for the constructors and a new function fait_decouple().
40  *
41  * Revision 1.4 2003/03/03 19:07:55 f_limousin
42  * Suppress the member ref_triad.
43  *
44  * Revision 1.3 2003/02/12 18:52:53 f_limousin
45  * Change the arguments of the standard constructor.
46  *
47  * Revision 1.2 2003/01/20 09:38:59 f_limousin
48  * Modification of the standard constructor
49  *
50  * Revision 1.1 2003/01/14 14:13:25 f_limousin
51  * Binary NS with Nonconformally flat metric.
52  *
53  * Revision 1.2 2001/12/11 06:44:41 e_gourgoulhon
54  * template files
55  *
56  * $Header: /cvsroot/Lorene/C++/Include/bin_ns_ncp.h,v 1.7 2014/10/13 08:52:32 j_novak Exp $
57  *
58  */
59 
60 // Lorene headers
61 #include "et_bin_ncp.h"
62 #include "binaire.h"
63 
64 namespace Lorene {
70 class Bin_ns_ncp {
71 
72  // Data :
73  // -----
74  protected:
75 
77  Et_bin_ncp star1 ;
78 
80  Et_bin_ncp star2 ;
81 
86  Et_bin_ncp* et[2] ;
87 
91  double omega ;
92 
95  double x_axe ;
96 
97 
98  // Derived data :
99  // ------------
100  protected:
102  mutable double* p_mass_adm ;
103 
105  mutable double* p_mass_kom ;
106 
108  mutable Tbl* p_angu_mom ;
109 
111  mutable double* p_total_ener ;
112 
114  mutable double* p_virial ;
115 
117  mutable double* p_virial_gb ;
118 
120  mutable double* p_virial_fus ;
121 
123  mutable double* p_ham_constr ;
124 
126  mutable Tbl* p_mom_constr ;
127 
128 
129 
130  // Constructors - Destructor
131  // -------------------------
132  public:
149  Bin_ns_ncp(Map& mp1, int nzet1, const Eos& eos1, int irrot1,
150  Map& mp2, int nzet2, const Eos& eos2, int irrot2,
151  int relat, int conf_flat, const Metrique& flat1, const Metrique& flat2,
152  const Tenseur_sym &source1, const Tenseur_sym &source2) ;
153 
154 
155  Bin_ns_ncp(const Bin_ns_ncp& ) ;
156 
166  Bin_ns_ncp(Map& mp1, const Eos& eos1, Map& mp2, const Eos& eos2,
167  const Metrique& flat1, const Metrique& flat2, FILE* fich) ;
168 
169  ~Bin_ns_ncp() ;
170 
171 
172 
173  // Memory management
174  // -----------------
175  protected:
176 
178  void del_deriv() const ;
179 
181  void set_der_0x0() const ;
182 
183 
184  // Mutators / assignment
185  // ---------------------
186  public:
188  void operator=(const Bin_ns_ncp&) ;
189 
191  Et_bin_ncp& set(int i)
192  { assert( (i==1) || (i==2) );
193  del_deriv() ;
194  return *et[i-1] ;} ;
195 
197  double& set_omega() {return omega; } ;
198 
200  double& set_x_axe() {return x_axe; } ;
201 
202 
203  // Accessors
204  // ---------
205  public:
207  const Et_bin_ncp& operator()(int i) const
208  { assert( (i==1) || (i==2) );
209  return *et[i-1] ;} ;
210 
212  double get_omega() const {return omega; } ;
213 
215  double get_x_axe() const {return x_axe; } ;
216 
220  double separation() const ;
221 
222 
223  // Outputs
224  // -------
225  public:
226  void sauve(FILE *) const ;
227 
229  friend ostream& operator<<(ostream& , const Bin_ns_ncp& ) ;
230 
232  void display_poly(ostream& ) const ;
233 
237  void write_global(ostream& ) const ;
238 
239  private:
241  ostream& operator>>(ostream& ) const ;
242 
243 
244  // Computational routines
245  // ----------------------
246  public:
247 
249  double mass_adm() const ;
250 
252  double mass_kom() const ;
253 
261  const Tbl& angu_mom() const ;
262 
271  double total_ener() const ;
272 
277  double virial() const ;
278 
284  double virial_gb() const ;
285 
293  double virial_fus() const ;
294 
302  double ham_constr() const ;
303 
310  const Tbl& mom_constr() const ;
311 
338  void orbit(double fact_omeg_min, double fact_omeg_max, double& xgg1,
339  double& xgg2) ;
340 
344  void analytical_omega() ;
345 
350  void analytical_shift() ;
351 
357  void compare(FILE*) ;
358 
363  void compare(const Binaire&) ;
364 
371  void fait_decouple () ;
372 
373 };
374 ostream& operator<<(ostream& , const Bin_ns_ncp& ) ;
375 
376 }
377 #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:86
const Et_bin_ncp & operator()(int i) const
Returns a reference to the star no. i.
Definition: bin_ns_ncp.h:207
Et_bin_ncp star1
First star ncp of the system.
Definition: bin_ns_ncp.h:77
Class intended to describe tensors with a symmetry on the two last indices *** DEPRECATED : use class...
Definition: tenseur.h:1257
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:108
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:105
double omega
Angular velocity with respect to an asymptotically inertial observer.
Definition: bin_ns_ncp.h:91
double * p_ham_constr
Relative error on the Hamiltonian constraint.
Definition: bin_ns_ncp.h:123
void compare(FILE *)
Performs a comparison between quantities as the shift, lapse and tkij_auto for two two binaries stars...
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:215
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:114
double * p_virial_fus
Virial theorem error by J.L.Friedman, K.Uryu, and M.Shibata.
Definition: bin_ns_ncp.h:120
double & set_x_axe()
Sets the absolute coordinate X of the rotation axis [{ r_unit}].
Definition: bin_ns_ncp.h:200
double * p_mass_adm
Total ADM mass of the system.
Definition: bin_ns_ncp.h:102
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:197
Binary systems.
Definition: binaire.h:104
double x_axe
Absolute X coordinate of the rotation axis.
Definition: bin_ns_ncp.h:95
Extended description of the class for Doc++ documentation.
Definition: bin_ns_ncp.h:70
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:117
Tbl * p_mom_constr
Relative error on the momentum constraint.
Definition: bin_ns_ncp.h:126
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:111
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:212
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:80