LORENE
binary_xcts.h
1/*
2 * Definition of Lorene class Binary_xcts
3 *
4 */
5
6/*
7 * Copyright (c) 2010 Michal Bejger
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 __BINARY_XCTS_H_
27#define __BINARY_XCTS_H_
28
29/*
30 * $Id: binary_xcts.h,v 1.4 2014/10/13 08:52:32 j_novak Exp $
31 * $Log: binary_xcts.h,v $
32 * Revision 1.4 2014/10/13 08:52:32 j_novak
33 * Lorene classes and functions now belong to the namespace Lorene.
34 *
35 * Revision 1.3 2010/12/20 09:58:31 m_bejger
36 * Pointer to the linear momentum added
37 *
38 * Revision 1.2 2010/12/09 10:35:56 m_bejger
39 * Declaration of the virial theorem volume version added
40 *
41 * Revision 1.1 2010/05/04 07:44:02 m_bejger
42 * Initial version
43 *
44 *
45 * $Header: /cvsroot/Lorene/C++/Include/binary_xcts.h,v 1.4 2014/10/13 08:52:32 j_novak Exp $
46 *
47 */
48
49// Lorene headers
50#include "star.h"
51
52namespace Lorene {
60
61 // Data :
62 // -----
63 protected:
64
67
70
76
80 double omega ;
81
84 double x_axe ;
85
86
87 // Derived data :
88 // ------------
89 protected:
91 mutable double* p_mass_adm ;
92
94 mutable double* p_mass_kom ;
95
97 mutable Tbl* p_angu_mom ;
98
100 mutable Tbl* p_lin_mom ;
101
103 mutable double* p_total_ener ;
104
106 mutable double* p_virial ;
107
109 mutable double* p_virial_vol ;
110
111 // Constructors - Destructor
112 // -------------------------
113 public:
127 Binary_xcts(Map& mp1, int nzet1, const Eos& eos1, int irrot1,
128 Map& mp2, int nzet2, const Eos& eos2, int irrot2) ;
129
130
131 Binary_xcts(const Binary_xcts& ) ;
132
142 Binary_xcts(Map& mp1, const Eos& eos1, Map& mp2, const Eos& eos2,
143 FILE* fich) ;
144
145 ~Binary_xcts() ;
146
147
148
149 // Memory management
150 // -----------------
151 protected:
152
154 void del_deriv() const ;
155
157 void set_der_0x0() const ;
158
159
160 // Mutators / assignment
161 // ---------------------
162 public:
164 void operator=(const Binary_xcts&) ;
165
168 assert( (i==1) || (i==2) );
169 del_deriv() ;
170 return *et[i-1] ;
171
172 } ;
173
175 double& set_omega() {return omega; } ;
176
178 double& set_x_axe() {return x_axe; } ;
179
180
181 // Accessors
182 // ---------
183 public:
185 const Star_bin_xcts& operator()(int i) const
186 { assert( (i==1) || (i==2) );
187 return *et[i-1] ;} ;
188
190 double get_omega() const {return omega; } ;
191
193 double get_x_axe() const {return x_axe; } ;
194
198 double separation() const ;
199
200
201 // Outputs
202 // -------
203 public:
204 void sauve(FILE *) const ;
205
207 friend ostream& operator<<(ostream&, const Binary_xcts& ) ;
208
210 void display_poly(ostream& ) const ;
211
215 void write_global(ostream& ) const ;
216
217 private:
219 ostream& operator>>(ostream& ) const ;
220
221
222 // Computational routines
223 // ----------------------
224 public:
225
227 double mass_adm() const ;
228
230 double mass_adm_vol() const ;
231
233 double mass_kom() const ;
234
236 double mass_kom_vol() const ;
237
245 const Tbl& angu_mom() const ;
246
249 const Tbl& lin_mom() const ;
250
259 double total_ener() const ;
260
263 double virial() const ;
264
267 double virial_vol() const ;
268
271 double ham_constr() const ;
272
275 const Tbl& mom_constr() const ;
276
303 void orbit(double fact_omeg_min, double fact_omeg_max, double& xgg1,
304 double& xgg2) ;
305
309 void analytical_omega() ;
310
315 void analytical_shift() ;
316
317} ;
318
319ostream& operator<<(ostream& , const Binary_xcts& ) ;
320
321}
322#endif
Binary systems in eXtended Conformal Thin Sandwich formulation.
Definition binary_xcts.h:59
const Tbl & lin_mom() const
Total linear momentum.
void set_der_0x0() const
Sets to 0x0 all the pointers on derived quantities.
double & set_omega()
Sets the orbital angular velocity [f_unit].
double total_ener() const
Total energy (excluding the rest mass energy).
double virial_vol() const
Estimates the relative error on the virial theorem (volume version)
double * p_mass_kom
Total Komar mass of the system.
Definition binary_xcts.h:94
double & set_x_axe()
Sets the absolute coordinate X of the rotation axis [r_unit].
double x_axe
Absolute X coordinate of the rotation axis.
Definition binary_xcts.h:84
void write_global(ostream &) const
Write global quantities in a formatted file.
Star_bin_xcts star2
Second star of the system.
Definition binary_xcts.h:69
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.
void analytical_omega()
Sets the orbital angular velocity to some 2-PN analytical value (Keplerian value in the Newtonian cas...
const Star_bin_xcts & operator()(int i) const
Returns a reference to the star no. i.
double mass_adm_vol() const
Total ADM mass (computed by a volume integral)
double * p_virial_vol
Virial theorem error (volume version)
double get_x_axe() const
Returns the absolute coordinate X of the rotation axis [r_unit].
Tbl * p_lin_mom
Total linear momentum of the system.
void operator=(const Binary_xcts &)
Assignment to another Binary_xcts.
double mass_kom_vol() const
Total Komar mass (computed by a volume integral)
Star_bin_xcts star1
First star of the system.
Definition binary_xcts.h:66
const Tbl & mom_constr() const
Estimates the relative error on the momentum constraint.
void sauve(FILE *) const
Save in a file.
double mass_adm() const
Total ADM mass.
void analytical_shift()
Sets some analytical template for the shift vector (via the members w_shift and khi_shift of the two ...
double separation() const
Returns the coordinate separation of the two stellar centers [r_unit].
void del_deriv() const
Deletes all the derived quantities.
double * p_mass_adm
Total ADM mass of the system.
Definition binary_xcts.h:91
double * p_total_ener
Total energy of the system.
friend ostream & operator<<(ostream &, const Binary_xcts &)
Display.
void display_poly(ostream &) const
Display in polytropic units.
ostream & operator>>(ostream &) const
Operator >> (function called by the operator <<).
double mass_kom() const
Total Komar mass.
~Binary_xcts()
Destructor.
double virial() const
Estimates the relative error on the virial theorem.
Tbl * p_angu_mom
Total angular momentum of the system.
Definition binary_xcts.h:97
Star_bin_xcts * et[2]
Array of the two stars (to perform loops on the stars): et[0] contains the address of star1 and et[1]...
Definition binary_xcts.h:75
double * p_virial
Virial theorem error.
const Tbl & angu_mom() const
Total angular momentum.
double ham_constr() const
Estimates the relative error on the Hamiltonian constraint.
Star_bin_xcts & set(int i)
Read/write of the star no. i.
double get_omega() const
Returns the orbital angular velocity [f_unit].
double omega
Angular velocity with respect to an asymptotically inertial observer.
Definition binary_xcts.h:80
Equation of state base class.
Definition eos.h:190
Base class for coordinate mappings.
Definition map.h:670
Class for stars in binary system in eXtended Conformal Thin Sandwich formulation.
Definition star.h:1091
Basic array class.
Definition tbl.h:161
Lorene prototypes.
Definition app_hor.h:64