binaire.h
/*
* Definition of Lorene class Binaire
*
*/
/*
* Copyright (c) 2000-2003 Eric Gourgoulhon
*
* 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 as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* 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 __BINAIRE_H_
#define __BINAIRE_H_
/*
* $Id: binaire.h,v 1.6 2014/10/13 08:52:32 j_novak Exp $
* $Log: binaire.h,v $
* Revision 1.6 2014/10/13 08:52:32 j_novak
* Lorene classes and functions now belong to the namespace Lorene.
*
* Revision 1.5 2009/06/18 18:42:13 k_taniguchi
* Defined a slightly modified code to determine
* the orbital angular velocity.
*
* Revision 1.4 2003/09/15 15:09:47 e_gourgoulhon
* Added the member function write_global.
*
* Revision 1.3 2002/06/17 14:05:16 j_novak
* friend functions are now also declared outside the class definition
*
* Revision 1.2 2001/12/20 13:00:31 k_taniguchi
* Addition of the Komar mass, the virial error by Gourgoulhon and Bonazzola, and the virial error by Friedman, Uryu, and Shibata.
*
* Revision 1.1.1.1 2001/11/20 15:19:27 e_gourgoulhon
* LORENE
*
* Revision 2.11 2001/02/28 14:27:32 keisuke
* *** empty log message ***
*
* Revision 2.10 2000/07/07 14:10:04 eric
* AJout de display_poly.
*
* Revision 2.9 2000/03/17 15:26:53 eric
* Ajout de la fonction analytical_omega.
*
* Revision 2.8 2000/03/15 16:43:12 eric
* Ajout de la fonction analytical_shift().
*
* Revision 2.7 2000/03/13 14:24:50 eric
* Ajout des membres p_ham_constr et p_mom_constr ainsi que des
* fonctions de calcul associees (verification des equations de contrainte).
*
* Revision 2.6 2000/02/18 14:52:05 eric
* Ajout des membres p_virial et p_total_ener et des fonctions de calcul
* associees.
*
* Revision 2.5 2000/02/12 17:36:39 eric
* Ajout de la fonction separation().
*
* Revision 2.4 2000/02/12 17:09:02 eric
* Ajout de la fonction orbit.
*
* Revision 2.3 2000/02/04 17:15:05 eric
* Ajout du membre ref_triad.
*
* Revision 2.2 2000/02/02 10:13:08 eric
* Ajout des fonctions de lecture/ecriture omega, x_axe.
*
* Revision 2.1 2000/01/31 17:01:46 eric
* *** empty log message ***
*
* Revision 2.0 2000/01/31 15:57:39 eric
* *** empty log message ***
*
*
* $Header: /cvsroot/Lorene/C++/Include/binaire.h,v 1.6 2014/10/13 08:52:32 j_novak Exp $
*
*/
#include "etoile.h"
namespace Lorene {
class Binaire {
// Data :
// -----
private:
const Base_vect_cart ref_triad ;
Etoile_bin star1 ;
Etoile_bin star2 ;
Etoile_bin* et[2] ;
double omega ;
double x_axe ;
// Derived data :
// ------------
private:
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_virial_gb ;
mutable double* p_virial_fus ;
mutable double* p_ham_constr ;
mutable Tbl* p_mom_constr ;
// Constructors - Destructor
// -------------------------
public:
Binaire(Map& mp1, int nzet1, const Eos& eos1, int irrot1,
Map& mp2, int nzet2, const Eos& eos2, int irrot2,
int relat) ;
Binaire(const Binaire& ) ;
Binaire(Map& mp1, const Eos& eos1, Map& mp2, const Eos& eos2,
FILE* fich) ;
~Binaire() ;
// Memory management
// -----------------
private:
void del_deriv() const ;
void set_der_0x0() const ;
// Mutators / assignment
// ---------------------
public:
void operator=(const Binaire&) ;
Etoile_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 Etoile_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 Binaire& ) ;
void display_poly(ostream& ) const ;
void write_global(ostream& ) const ;
private:
ostream& operator>>(ostream& ) const ;
// Computational routines
// ----------------------
public:
double mass_adm() const ;
double mass_kom() const ;
const Tbl& angu_mom() const ;
double total_ener() const ;
double virial() const ;
double virial_gb() const ;
double virial_fus() 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 orbit_eqmass(double fact_omeg_min, double fact_omeg_max,
double mass1, double mass2,
double& xgg1, double& xgg2) ;
void analytical_omega() ;
void analytical_shift() ;
};
ostream& operator<<(ostream& , const Binaire& ) ;
}
#endif
Lorene::Base_vect_cart
Cartesian vectorial bases (triads).
Definition base_vect.h:201
Lorene::Binaire
Binary systems.
Definition binaire.h:104
Lorene::Binaire::write_global
void write_global(ostream &) const
Write global quantities in a formatted file.
Definition binaire.C:334
Lorene::Binaire::p_ham_constr
double * p_ham_constr
Relative error on the Hamiltonian constraint.
Definition binaire.h:160
Lorene::Binaire::Binaire
Binaire(Map &mp1, int nzet1, const Eos &eos1, int irrot1, Map &mp2, int nzet2, const Eos &eos2, int irrot2, int relat)
Standard constructor.
Definition binaire.C:109
Lorene::Binaire::p_angu_mom
Tbl * p_angu_mom
Total angular momentum of the system.
Definition binaire.h:145
Lorene::Binaire::analytical_shift
void analytical_shift()
Sets some analytical template for the shift vector (via the members {\tt w_shift} and {\tt khi_shift}...
Definition binaire_ana_shift.C:69
Lorene::Binaire::p_virial_gb
double * p_virial_gb
Virial theorem error by E.Gourgoulhon and S.Bonazzola.
Definition binaire.h:154
Lorene::Binaire::mass_adm
double mass_adm() const
Total ADM mass.
Definition binaire_global.C:88
Lorene::Binaire::set_der_0x0
void set_der_0x0() const
Sets to {\tt 0x0} all the pointers on derived quantities.
Definition binaire.C:195
Lorene::Binaire::analytical_omega
void analytical_omega()
Sets the orbital angular velocity to some 2-PN analytical value (Keplerian value in the Newtonian cas...
Definition binaire_omega_ana.C:63
Lorene::Binaire::virial_gb
double virial_gb() const
Estimates the relative error on the virial theorem calculated by E.Gourgoulhon and S....
Definition binaire_global.C:408
Lorene::Binaire::et
Etoile_bin * et[2]
Array of the two stars (to perform loops on the stars): {\tt et[0]} contains the address of {\tt star...
Definition binaire.h:124
Lorene::Binaire::angu_mom
const Tbl & angu_mom() const
Total angular momentum.
Definition binaire_global.C:198
Lorene::Binaire::p_mass_adm
double * p_mass_adm
Total ADM mass of the system.
Definition binaire.h:139
Lorene::Binaire::separation
double separation() const
Returns the coordinate separation of the two stellar centers [{\tt r_unit}].
Definition binaire.C:457
Lorene::Binaire::del_deriv
void del_deriv() const
Destructor.
Definition binaire.C:177
Lorene::Binaire::p_total_ener
double * p_total_ener
Total energy of the system.
Definition binaire.h:148
Lorene::Binaire::p_virial
double * p_virial
Virial theorem error.
Definition binaire.h:151
Lorene::Binaire::p_mom_constr
Tbl * p_mom_constr
Relative error on the momentum constraint.
Definition binaire.h:163
Lorene::Binaire::set_omega
double & set_omega()
Sets the orbital angular velocity [{\tt f_unit}].
Definition binaire.h:229
Lorene::Binaire::orbit_eqmass
void orbit_eqmass(double fact_omeg_min, double fact_omeg_max, double mass1, double mass2, double &xgg1, double &xgg2)
Computes the orbital angular velocity {\tt omega} and the position of the rotation axis {\tt x_axe}...
Definition binaire_orbite.C:464
Lorene::Binaire::operator<<
friend ostream & operator<<(ostream &, const Binaire &)
Save in a file.
Definition binaire.C:251
Lorene::Binaire::get_omega
double get_omega() const
Returns the orbital angular velocity [{\tt f_unit}].
Definition binaire.h:244
Lorene::Binaire::operator()
const Etoile_bin & operator()(int i) const
Returns a reference to the star no. i.
Definition binaire.h:239
Lorene::Binaire::star2
Etoile_bin star2
Second star of the system.
Definition binaire.h:118
Lorene::Binaire::mass_kom
double mass_kom() const
Total Komar mass.
Definition binaire_global.C:136
Lorene::Binaire::p_mass_kom
double * p_mass_kom
Total Komar mass of the system.
Definition binaire.h:142
Lorene::Binaire::ref_triad
const Base_vect_cart ref_triad
Cartesian triad of the absolute reference frame.
Definition binaire.h:112
Lorene::Binaire::virial
double virial() const
Estimates the relative error on the virial theorem (for a relativistic one, it returns $|1 - M_{\rm K...
Definition binaire_global.C:345
Lorene::Binaire::display_poly
void display_poly(ostream &) const
Display in polytropic units.
Definition binaire.C:284
Lorene::Binaire::mom_constr
const Tbl & mom_constr() const
Estimates the relative error on the momentum constraint equation by comparing ${\overline\nabla}...
Definition binaire_constr.C:158
Lorene::Binaire::set_x_axe
double & set_x_axe()
Sets the absolute coordinate X of the rotation axis [{\tt r_unit}].
Definition binaire.h:232
Lorene::Binaire::omega
double omega
Angular velocity with respect to an asymptotically inertial observer.
Definition binaire.h:129
Lorene::Binaire::p_virial_fus
double * p_virial_fus
Virial theorem error by J.L.Friedman, K.Uryu, and M.Shibata.
Definition binaire.h:157
Lorene::Binaire::operator=
void operator=(const Binaire &)
Assignment to another {\tt Binaire}.
Definition binaire.C:217
Lorene::Binaire::get_x_axe
double get_x_axe() const
Returns the absolute coordinate X of the rotation axis [{\tt r_unit}].
Definition binaire.h:247
Lorene::Binaire::star1
Etoile_bin star1
First star of the system.
Definition binaire.h:115
Lorene::Binaire::orbit
void orbit(double fact_omeg_min, double fact_omeg_max, double &xgg1, double &xgg2)
Computes the orbital angular velocity {\tt omega} and the position of the rotation axis {\tt x_axe}...
Definition binaire_orbite.C:122
Lorene::Binaire::total_ener
double total_ener() const
Total energy (excluding the rest mass energy).
Definition binaire_global.C:289
Lorene::Binaire::operator>>
ostream & operator>>(ostream &) const
Operator >> (function called by the operator <<).
Definition binaire.C:257
Lorene::Binaire::virial_fus
double virial_fus() const
Estimates the relative error on the virial theorem calculated by J.L.Friedman, K.Uryu,...
Definition binaire_global.C:481
Lorene::Binaire::set
Etoile_bin & set(int i)
Read/write of the star no. i.
Definition binaire.h:223
Lorene::Binaire::x_axe
double x_axe
Absolute X coordinate of the rotation axis.
Definition binaire.h:133
Lorene::Binaire::ham_constr
double ham_constr() const
Estimates the relative error on the Hamiltonian constraint equation by comparing $\underline\Delta\ln...
Definition binaire_constr.C:69
Lorene::Eos
Equation of state base class.
Definition eos.h:190
Lorene::Etoile_bin
Class for stars in binary system.
Definition etoile.h:814
Lorene::Tbl
Basic array class.
Definition tbl.h:161
Lorene
Lorene prototypes.
Definition app_hor.h:64
Lorene::sauve
virtual void sauve(FILE *) const
Save in a file.
Lorene::Map
Map(const Mg3d &)
Constructor from a multi-domain 3D grid.
Definition map.C:139