binary.h
/*
* Definition of Lorene class Binary
*
*/
/*
* Copyright (c) 2004 Limousin Francois
*
* This file is part of LORENE.
*
* LORENE is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2
* as published by the Free Software Foundation.
*
* LORENE is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with LORENE; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#ifndef __BINARY_H_
#define __BINARY_H_
/*
* $Id: binary.h,v 1.10 2014/10/13 08:52:32 j_novak Exp $
* $Log: binary.h,v $
* Revision 1.10 2014/10/13 08:52:32 j_novak
* Lorene classes and functions now belong to the namespace Lorene.
*
* Revision 1.9 2006/04/11 14:26:12 f_limousin
* New version of the code : improvement of the computation of some
* critical sources, estimation of the dirac gauge, helical symmetry...
*
* Revision 1.8 2005/11/08 20:17:55 f_limousin
* Add function dirac_gauge() used to impose Dirac gauge during an iteration.
*
* Revision 1.7 2005/09/15 15:56:28 e_gourgoulhon
* Made the documentation compliant with Doxygen.
*
* Revision 1.6 2005/09/13 19:38:32 f_limousin
* Reintroduction of the resolution of the equations in cartesian coordinates.
*
* Revision 1.5 2004/07/21 11:45:20 f_limousin
* Add function mass_adm_vol() to compute the ADM mass of the system
* with a volume integral instead of a surface one.
*
* Revision 1.4 2004/05/25 14:50:06 f_limousin
* Add the virial theorem for conformally flat configurations.
*
* Revision 1.3 2004/01/20 15:25:39 f_limousin
* Nex class binary
*
*
* $Header: /cvsroot/Lorene/C++/Include/binary.h,v 1.10 2014/10/13 08:52:32 j_novak Exp $
*
*/
// Lorene headers
#include "star.h"
namespace Lorene {
class Binary {
// Data :
// -----
protected:
Star_bin star1 ;
Star_bin star2 ;
Star_bin* et[2] ;
double omega ;
double x_axe ;
// Derived data :
// ------------
protected:
mutable double* p_mass_adm ;
mutable double* p_mass_kom ;
mutable Tbl* p_angu_mom ;
mutable double* p_total_ener ;
mutable double* p_virial ;
mutable double* p_ham_constr ;
mutable Tbl* p_mom_constr ;
// Constructors - Destructor
// -------------------------
public:
Binary(Map& mp1, int nzet1, const Eos& eos1, int irrot1,
Map& mp2, int nzet2, const Eos& eos2, int irrot2,
int conf_flat) ;
Binary(const Binary& ) ;
Binary(Map& mp1, const Eos& eos1, Map& mp2, const Eos& eos2,
FILE* fich) ;
~Binary() ;
// Memory management
// -----------------
protected:
void del_deriv() const ;
void set_der_0x0() const ;
// Mutators / assignment
// ---------------------
public:
void operator=(const Binary&) ;
Star_bin& set(int i)
{ assert( (i==1) || (i==2) );
del_deriv() ;
return *et[i-1] ;} ;
double& set_omega() {return omega; } ;
double& set_x_axe() {return x_axe; } ;
// Accessors
// ---------
public:
const Star_bin& operator()(int i) const
{ assert( (i==1) || (i==2) );
return *et[i-1] ;} ;
double get_omega() const {return omega; } ;
double get_x_axe() const {return x_axe; } ;
double separation() const ;
// Outputs
// -------
public:
void sauve(FILE *) const ;
friend ostream& operator<<(ostream& , const Binary& ) ;
void display_poly(ostream& ) const ;
void write_global(ostream& ) const ;
private:
ostream& operator>>(ostream& ) const ;
// Computational routines
// ----------------------
public:
double mass_adm() const ;
double mass_adm_vol() const ;
double mass_kom() const ;
double mass_kom_vol() const ;
const Tbl& angu_mom() const ;
double total_ener() const ;
double virial() const ;
double ham_constr() const ;
const Tbl& mom_constr() const ;
void orbit(double fact_omeg_min, double fact_omeg_max, double& xgg1,
double& xgg2) ;
void analytical_omega() ;
void analytical_shift() ;
void fait_decouple () ;
void dirac_gauge() ;
void helical() ;
};
ostream& operator<<(ostream& , const Binary& ) ;
}
#endif
Lorene::Binary
Binary systems.
Definition binary.h:73
Lorene::Binary::set_omega
double & set_omega()
Sets the orbital angular velocity [f_unit].
Definition binary.h:192
Lorene::Binary::operator()
const Star_bin & operator()(int i) const
Returns a reference to the star no. i.
Definition binary.h:202
Lorene::Binary::get_x_axe
double get_x_axe() const
Returns the absolute coordinate X of the rotation axis [r_unit].
Definition binary.h:210
Lorene::Binary::mass_adm_vol
double mass_adm_vol() const
Total ADM mass (computed by a volume integral).
Definition binary_global.C:135
Lorene::Binary::ham_constr
double ham_constr() const
Estimates the relative error on the Hamiltonian constraint.
Lorene::Binary::sauve
void sauve(FILE *) const
Save in a file.
Definition binary.C:215
Lorene::Binary::display_poly
void display_poly(ostream &) const
Display in polytropic units.
Definition binary.C:260
Lorene::Binary::mass_kom_vol
double mass_kom_vol() const
Total Komar mass (computed by a volume integral).
Definition binary_global.C:229
Lorene::Binary::write_global
void write_global(ostream &) const
Write global quantities in a formatted file.
Definition binary.C:478
Lorene::Binary::mom_constr
const Tbl & mom_constr() const
Estimates the relative error on the momentum constraint.
Lorene::Binary::set_x_axe
double & set_x_axe()
Sets the absolute coordinate X of the rotation axis [r_unit].
Definition binary.h:195
Lorene::Binary::del_deriv
void del_deriv() const
Deletes all the derived quantities.
Definition binary.C:161
Lorene::Binary::et
Star_bin * 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.h:89
Lorene::Binary::analytical_shift
void analytical_shift()
Sets some analytical template for the shift vector (via the members w_shift and khi_shift of the two ...
Definition binary_anashift.C:71
Lorene::Binary::omega
double omega
Angular velocity with respect to an asymptotically inertial observer.
Definition binary.h:94
Lorene::Binary::p_total_ener
double * p_total_ener
Total energy of the system.
Definition binary.h:114
Lorene::Binary::analytical_omega
void analytical_omega()
Sets the orbital angular velocity to some 2-PN analytical value (Keplerian value in the Newtonian cas...
Definition binary_omegaana.C:56
Lorene::Binary::p_angu_mom
Tbl * p_angu_mom
Total angular momentum of the system.
Definition binary.h:111
Lorene::Binary::total_ener
double total_ener() const
Total energy (excluding the rest mass energy).
Definition binary_global.C:607
Lorene::Binary::dirac_gauge
void dirac_gauge()
Function used to impose Dirac gauge during an iteration.
Definition binary_dirac.C:59
Lorene::Binary::star2
Star_bin star2
Second star of the system.
Definition binary.h:83
Lorene::Binary::angu_mom
const Tbl & angu_mom() const
Total angular momentum.
Definition binary_global.C:285
Lorene::Binary::operator<<
friend ostream & operator<<(ostream &, const Binary &)
Display.
Definition binary.C:227
Lorene::Binary::fait_decouple
void fait_decouple()
Calculates decouple which is used to obtain qq_auto by the formula : qq_auto = decouple * qq.
Definition binary.C:312
Lorene::Binary::star1
Star_bin star1
First star of the system.
Definition binary.h:80
Lorene::Binary::p_mass_adm
double * p_mass_adm
Total ADM mass of the system.
Definition binary.h:105
Lorene::Binary::p_virial
double * p_virial
Virial theorem error.
Definition binary.h:117
Lorene::Binary::mass_adm
double mass_adm() const
Total ADM mass.
Definition binary_global.C:103
Lorene::Binary::orbit
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.
Definition binary_orbite.C:87
Lorene::Binary::~Binary
~Binary()
Destructor.
Definition binary.C:151
Lorene::Binary::operator=
void operator=(const Binary &)
Assignment to another Binary.
Definition binary.C:197
Lorene::Binary::set_der_0x0
void set_der_0x0() const
Sets to 0x0 all the pointers on derived quantities.
Definition binary.C:177
Lorene::Binary::virial
double virial() const
Estimates the relative error on the virial theorem.
Definition binary_global.C:627
Lorene::Binary::set
Star_bin & set(int i)
Read/write of the star no. i.
Definition binary.h:186
Lorene::Binary::x_axe
double x_axe
Absolute X coordinate of the rotation axis.
Definition binary.h:98
Lorene::Binary::p_mom_constr
Tbl * p_mom_constr
Relative error on the momentum constraint.
Definition binary.h:123
Lorene::Binary::Binary
Binary(Map &mp1, int nzet1, const Eos &eos1, int irrot1, Map &mp2, int nzet2, const Eos &eos2, int irrot2, int conf_flat)
Standard constructor.
Definition binary.C:96
Lorene::Binary::p_mass_kom
double * p_mass_kom
Total Komar mass of the system.
Definition binary.h:108
Lorene::Binary::mass_kom
double mass_kom() const
Total Komar mass.
Definition binary_global.C:201
Lorene::Binary::separation
double separation() const
Returns the coordinate separation of the two stellar centers [r_unit].
Definition binary.C:604
Lorene::Binary::helical
void helical()
Function testing the helical symmetry.
Definition binary_helical.C:76
Lorene::Binary::p_ham_constr
double * p_ham_constr
Relative error on the Hamiltonian constraint.
Definition binary.h:120
Lorene::Binary::operator>>
ostream & operator>>(ostream &) const
Operator >> (function called by the operator <<).
Definition binary.C:233
Lorene::Binary::get_omega
double get_omega() const
Returns the orbital angular velocity [f_unit].
Definition binary.h:207
Lorene::Eos
Equation of state base class.
Definition eos.h:190
Lorene::Star_bin
Class for stars in binary system.
Definition star.h:483
Lorene::Tbl
Basic array class.
Definition tbl.h:161
Lorene
Lorene prototypes.
Definition app_hor.h:64
Lorene::Map
Map(const Mg3d &)
Constructor from a multi-domain 3D grid.
Definition map.C:139