binary_xcts.h
/*
* Definition of Lorene class Binary_xcts
*
*/
/*
* Copyright (c) 2010 Michal Bejger
*
* 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_XCTS_H_
#define __BINARY_XCTS_H_
/*
* $Id: binary_xcts.h,v 1.4 2014/10/13 08:52:32 j_novak Exp $
* $Log: binary_xcts.h,v $
* Revision 1.4 2014/10/13 08:52:32 j_novak
* Lorene classes and functions now belong to the namespace Lorene.
*
* Revision 1.3 2010/12/20 09:58:31 m_bejger
* Pointer to the linear momentum added
*
* Revision 1.2 2010/12/09 10:35:56 m_bejger
* Declaration of the virial theorem volume version added
*
* Revision 1.1 2010/05/04 07:44:02 m_bejger
* Initial version
*
*
* $Header: /cvsroot/Lorene/C++/Include/binary_xcts.h,v 1.4 2014/10/13 08:52:32 j_novak Exp $
*
*/
// Lorene headers
#include "star.h"
namespace Lorene {
class Binary_xcts {
// Data :
// -----
protected:
Star_bin_xcts star1 ;
Star_bin_xcts star2 ;
Star_bin_xcts* 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 Tbl* p_lin_mom ;
mutable double* p_total_ener ;
mutable double* p_virial ;
mutable double* p_virial_vol ;
// Constructors - Destructor
// -------------------------
public:
Binary_xcts(Map& mp1, int nzet1, const Eos& eos1, int irrot1,
Map& mp2, int nzet2, const Eos& eos2, int irrot2) ;
Binary_xcts(const Binary_xcts& ) ;
Binary_xcts(Map& mp1, const Eos& eos1, Map& mp2, const Eos& eos2,
FILE* fich) ;
~Binary_xcts() ;
// Memory management
// -----------------
protected:
void del_deriv() const ;
void set_der_0x0() const ;
// Mutators / assignment
// ---------------------
public:
void operator=(const Binary_xcts&) ;
Star_bin_xcts& 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_xcts& 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_xcts& ) ;
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 ;
const Tbl& lin_mom() const ;
double total_ener() const ;
double virial() const ;
double virial_vol() 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() ;
} ;
ostream& operator<<(ostream& , const Binary_xcts& ) ;
}
#endif
Lorene::Binary_xcts
Binary systems in eXtended Conformal Thin Sandwich formulation.
Definition binary_xcts.h:59
Lorene::Binary_xcts::lin_mom
const Tbl & lin_mom() const
Total linear momentum.
Definition binary_global_xcts.C:268
Lorene::Binary_xcts::set_der_0x0
void set_der_0x0() const
Sets to 0x0 all the pointers on derived quantities.
Definition binary_xcts.C:162
Lorene::Binary_xcts::set_omega
double & set_omega()
Sets the orbital angular velocity [f_unit].
Definition binary_xcts.h:175
Lorene::Binary_xcts::total_ener
double total_ener() const
Total energy (excluding the rest mass energy).
Definition binary_global_xcts.C:307
Lorene::Binary_xcts::virial_vol
double virial_vol() const
Estimates the relative error on the virial theorem (volume version).
Definition binary_global_xcts.C:345
Lorene::Binary_xcts::p_mass_kom
double * p_mass_kom
Total Komar mass of the system.
Definition binary_xcts.h:94
Lorene::Binary_xcts::set_x_axe
double & set_x_axe()
Sets the absolute coordinate X of the rotation axis [r_unit].
Definition binary_xcts.h:178
Lorene::Binary_xcts::x_axe
double x_axe
Absolute X coordinate of the rotation axis.
Definition binary_xcts.h:84
Lorene::Binary_xcts::write_global
void write_global(ostream &) const
Write global quantities in a formatted file.
Definition binary_xcts.C:296
Lorene::Binary_xcts::star2
Star_bin_xcts star2
Second star of the system.
Definition binary_xcts.h:69
Lorene::Binary_xcts::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_orbit_xcts.C:97
Lorene::Binary_xcts::analytical_omega
void analytical_omega()
Sets the orbital angular velocity to some 2-PN analytical value (Keplerian value in the Newtonian cas...
Definition binary_omega_ana_xcts.C:50
Lorene::Binary_xcts::operator()
const Star_bin_xcts & operator()(int i) const
Returns a reference to the star no. i.
Definition binary_xcts.h:185
Lorene::Binary_xcts::mass_adm_vol
double mass_adm_vol() const
Total ADM mass (computed by a volume integral).
Definition binary_global_xcts.C:113
Lorene::Binary_xcts::p_virial_vol
double * p_virial_vol
Virial theorem error (volume version).
Definition binary_xcts.h:109
Lorene::Binary_xcts::get_x_axe
double get_x_axe() const
Returns the absolute coordinate X of the rotation axis [r_unit].
Definition binary_xcts.h:193
Lorene::Binary_xcts::p_lin_mom
Tbl * p_lin_mom
Total linear momentum of the system.
Definition binary_xcts.h:100
Lorene::Binary_xcts::operator=
void operator=(const Binary_xcts &)
Assignment to another Binary_xcts.
Definition binary_xcts.C:182
Lorene::Binary_xcts::mass_kom_vol
double mass_kom_vol() const
Total Komar mass (computed by a volume integral).
Definition binary_global_xcts.C:176
Lorene::Binary_xcts::star1
Star_bin_xcts star1
First star of the system.
Definition binary_xcts.h:66
Lorene::Binary_xcts::mom_constr
const Tbl & mom_constr() const
Estimates the relative error on the momentum constraint.
Lorene::Binary_xcts::sauve
void sauve(FILE *) const
Save in a file.
Definition binary_xcts.C:200
Lorene::Binary_xcts::mass_adm
double mass_adm() const
Total ADM mass.
Definition binary_global_xcts.C:82
Lorene::Binary_xcts::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_xcts.C:53
Lorene::Binary_xcts::separation
double separation() const
Returns the coordinate separation of the two stellar centers [r_unit].
Definition binary_xcts.C:434
Lorene::Binary_xcts::del_deriv
void del_deriv() const
Deletes all the derived quantities.
Definition binary_xcts.C:146
Lorene::Binary_xcts::Binary_xcts
Binary_xcts(Map &mp1, int nzet1, const Eos &eos1, int irrot1, Map &mp2, int nzet2, const Eos &eos2, int irrot2)
Standard constructor.
Definition binary_xcts.C:72
Lorene::Binary_xcts::p_mass_adm
double * p_mass_adm
Total ADM mass of the system.
Definition binary_xcts.h:91
Lorene::Binary_xcts::p_total_ener
double * p_total_ener
Total energy of the system.
Definition binary_xcts.h:103
Lorene::Binary_xcts::operator<<
friend ostream & operator<<(ostream &, const Binary_xcts &)
Display.
Definition binary_xcts.C:212
Lorene::Binary_xcts::display_poly
void display_poly(ostream &) const
Display in polytropic units.
Definition binary_xcts.C:246
Lorene::Binary_xcts::operator>>
ostream & operator>>(ostream &) const
Operator >> (function called by the operator <<).
Definition binary_xcts.C:219
Lorene::Binary_xcts::mass_kom
double mass_kom() const
Total Komar mass.
Definition binary_global_xcts.C:149
Lorene::Binary_xcts::~Binary_xcts
~Binary_xcts()
Destructor.
Definition binary_xcts.C:136
Lorene::Binary_xcts::virial
double virial() const
Estimates the relative error on the virial theorem.
Definition binary_global_xcts.C:326
Lorene::Binary_xcts::p_angu_mom
Tbl * p_angu_mom
Total angular momentum of the system.
Definition binary_xcts.h:97
Lorene::Binary_xcts::et
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
Lorene::Binary_xcts::p_virial
double * p_virial
Virial theorem error.
Definition binary_xcts.h:106
Lorene::Binary_xcts::angu_mom
const Tbl & angu_mom() const
Total angular momentum.
Definition binary_global_xcts.C:213
Lorene::Binary_xcts::ham_constr
double ham_constr() const
Estimates the relative error on the Hamiltonian constraint.
Lorene::Binary_xcts::set
Star_bin_xcts & set(int i)
Read/write of the star no. i.
Definition binary_xcts.h:167
Lorene::Binary_xcts::get_omega
double get_omega() const
Returns the orbital angular velocity [f_unit].
Definition binary_xcts.h:190
Lorene::Binary_xcts::omega
double omega
Angular velocity with respect to an asymptotically inertial observer.
Definition binary_xcts.h:80
Lorene::Eos
Equation of state base class.
Definition eos.h:190
Lorene::Star_bin_xcts
Class for stars in binary system in eXtended Conformal Thin Sandwich formulation.
Definition star.h:1091
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