star_rot.C
/*
* Methods of class Star_rot
*
* (see file star_rot.h for documentation).
*
*/
/*
* Copyright (c) 2010 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 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
*
*/
char star_rot_C[] = "$Header: /cvsroot/Lorene/C++/Source/Star/star_rot.C,v 1.9 2015/05/19 09:30:56 j_novak Exp $" ;
/*
* $Id: star_rot.C,v 1.9 2015/05/19 09:30:56 j_novak Exp $
* $Log: star_rot.C,v $
* Revision 1.9 2015/05/19 09:30:56 j_novak
* New methods for computing the area of the star and its mean radius.
*
* Revision 1.8 2014/10/13 08:53:39 j_novak
* Lorene classes and functions now belong to the namespace Lorene.
*
* Revision 1.7 2014/10/06 15:13:17 j_novak
* Modified #include directives to use c++ syntax.
*
* Revision 1.6 2010/02/08 11:45:58 j_novak
* Better computation of fait_shift()
*
* Revision 1.5 2010/02/08 10:56:30 j_novak
* Added a few things missing for the reading from resulting file.
*
* Revision 1.4 2010/02/02 12:45:16 e_gourgoulhon
* Improved the display (operator>>)
*
* Revision 1.3 2010/01/25 22:33:35 e_gourgoulhon
* Debugging...
*
* Revision 1.2 2010/01/25 18:15:32 e_gourgoulhon
* Added member unsurc2
*
* Revision 1.1 2010/01/24 16:09:39 e_gourgoulhon
* New class Star_rot.
*
*
* $Header: /cvsroot/Lorene/C++/Source/Star/star_rot.C,v 1.9 2015/05/19 09:30:56 j_novak Exp $
*
*/
// C headers
#include <cmath>
#include <cassert>
// Lorene headers
#include "star_rot.h"
#include "eos.h"
#include "unites.h"
#include "utilitaires.h"
#include "nbr_spx.h"
//--------------//
// Constructors //
//--------------//
// Standard constructor
// --------------------
namespace Lorene {
Star_rot::Star_rot(Map& mpi, int nzet_i, bool relat, const Eos& eos_i)
: Star(mpi, nzet_i, eos_i),
relativistic(relat),
a_car(mpi),
bbb(mpi),
b_car(mpi),
nphi(mpi),
tnphi(mpi),
uuu(mpi),
nuf(mpi),
nuq(mpi),
dzeta(mpi),
tggg(mpi),
w_shift(mpi, CON, mp.get_bvect_cart()),
khi_shift(mpi),
tkij(mpi, COV, mp.get_bvect_cart()),
ak_car(mpi),
ssjm1_nuf(mpi),
ssjm1_nuq(mpi),
ssjm1_dzeta(mpi),
ssjm1_tggg(mpi),
ssjm1_khi(mpi),
ssjm1_wshift(mpi, CON, mp.get_bvect_cart())
{
// Parameter 1/c^2 is deduced from relativistic:
unsurc2 = relativistic ? double(1) : double(0) ;
// Initialization to a static state :
omega = 0 ;
uuu = 0 ;
// Initialization to a flat metric :
a_car = 1 ;
bbb = 1 ;
bbb.std_spectral_base() ;
b_car = 1 ;
nphi = 0 ;
tnphi = 0 ;
nuf = 0 ;
nuq = 0 ;
dzeta = 0 ;
tggg = 0 ;
w_shift.set_etat_zero() ;
khi_shift = 0 ;
beta.set_etat_zero() ;
beta.set_triad( mp.get_bvect_cart() ) ;
tkij.set_etat_zero() ;
ak_car = 0 ;
ssjm1_nuf = 0 ;
ssjm1_nuq = 0 ;
ssjm1_dzeta = 0 ;
ssjm1_tggg = 0 ;
ssjm1_khi = 0 ;
ssjm1_wshift.set_etat_zero() ;
// Pointers of derived quantities initialized to zero :
set_der_0x0() ;
}
// Copy constructor
// ----------------
Star_rot::Star_rot(const Star_rot& et)
: Star(et),
relativistic(et.relativistic),
unsurc2(et.unsurc2),
omega(et.omega),
a_car(et.a_car),
bbb(et.bbb),
b_car(et.b_car),
nphi(et.nphi),
tnphi(et.tnphi),
uuu(et.uuu),
nuf(et.nuf),
nuq(et.nuq),
dzeta(et.dzeta),
tggg(et.tggg),
w_shift(et.w_shift),
khi_shift(et.khi_shift),
tkij(et.tkij),
ak_car(et.ak_car),
ssjm1_nuf(et.ssjm1_nuf),
ssjm1_nuq(et.ssjm1_nuq),
ssjm1_dzeta(et.ssjm1_dzeta),
ssjm1_tggg(et.ssjm1_tggg),
ssjm1_khi(et.ssjm1_khi),
ssjm1_wshift(et.ssjm1_wshift)
{
// Pointers of derived quantities initialized to zero :
set_der_0x0() ;
}
// Constructor from a file
// -----------------------
Star_rot::Star_rot(Map& mpi, const Eos& eos_i, FILE* fich)
: Star(mpi, eos_i, fich),
a_car(mpi),
bbb(mpi),
b_car(mpi),
nphi(mpi),
tnphi(mpi),
uuu(mpi),
nuf(mpi),
nuq(mpi),
dzeta(mpi),
tggg(mpi),
w_shift(mpi, CON, mp.get_bvect_cart()),
khi_shift(mpi),
tkij(mpi, COV, mp.get_bvect_cart()),
ak_car(mpi),
ssjm1_nuf(mpi),
ssjm1_nuq(mpi),
ssjm1_dzeta(mpi),
ssjm1_tggg(mpi),
ssjm1_khi(mpi),
ssjm1_wshift(mpi, CON, mp.get_bvect_cart())
{
// Star parameters
// -----------------
// relativistic is read in the file:
fread(&relativistic, sizeof(bool), 1, fich) ; //## to be checked !
// Parameter 1/c^2 is deduced from relativistic:
unsurc2 = relativistic ? double(1) : double(0) ;
// omega is read in the file:
fread_be(&omega, sizeof(double), 1, fich) ;
// Read of the saved fields:
// ------------------------
Scalar nuf_file(mp, *(mp.get_mg()), fich) ;
nuf = nuf_file ;
Scalar nuq_file(mp, *(mp.get_mg()), fich) ;
nuq = nuq_file ;
Scalar dzeta_file(mp, *(mp.get_mg()), fich) ;
dzeta = dzeta_file ;
Scalar tggg_file(mp, *(mp.get_mg()), fich) ;
tggg = tggg_file ;
Vector w_shift_file(mp, mp.get_bvect_cart(), fich) ;
w_shift = w_shift_file ;
Scalar khi_shift_file(mp, *(mp.get_mg()), fich) ;
khi_shift = khi_shift_file ;
fait_shift() ; // constructs shift from w_shift and khi_shift
fait_nphi() ; // constructs N^phi from (N^x,N^y,N^z)
Scalar ssjm1_nuf_file(mp, *(mp.get_mg()), fich) ;
ssjm1_nuf = ssjm1_nuf_file ;
Scalar ssjm1_nuq_file(mp, *(mp.get_mg()), fich) ;
ssjm1_nuq = ssjm1_nuq_file ;
Scalar ssjm1_dzeta_file(mp, *(mp.get_mg()), fich) ;
ssjm1_dzeta = ssjm1_dzeta_file ;
Scalar ssjm1_tggg_file(mp, *(mp.get_mg()), fich) ;
ssjm1_tggg = ssjm1_tggg_file ;
Scalar ssjm1_khi_file(mp, *(mp.get_mg()), fich) ;
ssjm1_khi = ssjm1_khi_file ;
Vector ssjm1_wshift_file(mp, mp.get_bvect_cart(), fich) ;
ssjm1_wshift = ssjm1_wshift_file ;
// All other fields are initialized to zero :
// ----------------------------------------
a_car = 0 ;
bbb = 0 ;
b_car = 0 ;
uuu = 0 ;
tkij.set_etat_zero() ;
ak_car = 0 ;
// Pointers of derived quantities initialized to zero
// --------------------------------------------------
set_der_0x0() ;
}
//------------//
// Destructor //
//------------//
Star_rot::~Star_rot(){
del_deriv() ;
}
//----------------------------------//
// Management of derived quantities //
//----------------------------------//
void Star_rot::del_deriv() const {
Star::del_deriv() ;
if (p_angu_mom != 0x0) delete p_angu_mom ;
if (p_tsw != 0x0) delete p_tsw ;
if (p_grv2 != 0x0) delete p_grv2 ;
if (p_grv3 != 0x0) delete p_grv3 ;
if (p_r_circ != 0x0) delete p_r_circ ;
if (p_area != 0x0) delete p_area ;
if (p_aplat != 0x0) delete p_aplat ;
if (p_z_eqf != 0x0) delete p_z_eqf ;
if (p_z_eqb != 0x0) delete p_z_eqb ;
if (p_z_pole != 0x0) delete p_z_pole ;
if (p_mom_quad != 0x0) delete p_mom_quad ;
if (p_r_isco != 0x0) delete p_r_isco ;
if (p_f_isco != 0x0) delete p_f_isco ;
if (p_lspec_isco != 0x0) delete p_lspec_isco ;
if (p_espec_isco != 0x0) delete p_espec_isco ;
if (p_f_eq != 0x0) delete p_f_eq ;
Star_rot::set_der_0x0() ;
}
void Star_rot::set_der_0x0() const {
Star::set_der_0x0() ;
p_angu_mom = 0x0 ;
p_tsw = 0x0 ;
p_grv2 = 0x0 ;
p_grv3 = 0x0 ;
p_r_circ = 0x0 ;
p_area = 0x0 ;
p_aplat = 0x0 ;
p_z_eqf = 0x0 ;
p_z_eqb = 0x0 ;
p_z_pole = 0x0 ;
p_mom_quad = 0x0 ;
p_r_isco = 0x0 ;
p_f_isco = 0x0 ;
p_lspec_isco = 0x0 ;
p_espec_isco = 0x0 ;
p_f_eq = 0x0 ;
}
void Star_rot::del_hydro_euler() {
Star::del_hydro_euler() ;
del_deriv() ;
}
//--------------//
// Assignment //
//--------------//
// Assignment to another Star_rot
// --------------------------------
void Star_rot::operator=(const Star_rot& et) {
// Assignment of quantities common to all the derived classes of Star
Star::operator=(et) ;
// Assignement of proper quantities of class Star_rot
relativistic = et.relativistic ;
unsurc2 = et.unsurc2 ;
omega = et.omega ;
a_car = et.a_car ;
bbb = et.bbb ;
b_car = et.b_car ;
nphi = et.nphi ;
tnphi = et.tnphi ;
uuu = et.uuu ;
nuf = et.nuf ;
nuq = et.nuq ;
dzeta = et.dzeta ;
tggg = et.tggg ;
w_shift = et.w_shift ;
khi_shift = et.khi_shift ;
tkij = et.tkij ;
ak_car = et.ak_car ;
ssjm1_nuf = et.ssjm1_nuf ;
ssjm1_nuq = et.ssjm1_nuq ;
ssjm1_dzeta = et.ssjm1_dzeta ;
ssjm1_tggg = et.ssjm1_tggg ;
ssjm1_khi = et.ssjm1_khi ;
ssjm1_wshift = et.ssjm1_wshift ;
del_deriv() ; // Deletes all derived quantities
}
//--------------//
// Outputs //
//--------------//
// Save in a file
// --------------
void Star_rot::sauve(FILE* fich) const {
Star::sauve(fich) ;
fwrite(&relativistic, sizeof(bool), 1, fich) ;
fwrite_be(&omega, sizeof(double), 1, fich) ;
nuf.sauve(fich) ;
nuq.sauve(fich) ;
dzeta.sauve(fich) ;
tggg.sauve(fich) ;
w_shift.sauve(fich) ;
khi_shift.sauve(fich) ;
ssjm1_nuf.sauve(fich) ;
ssjm1_nuq.sauve(fich) ;
ssjm1_dzeta.sauve(fich) ;
ssjm1_tggg.sauve(fich) ;
ssjm1_khi.sauve(fich) ;
ssjm1_wshift.sauve(fich) ;
}
// Printing
// --------
ostream& Star_rot::operator>>(ostream& ost) const {
using namespace Unites ;
Star::operator>>(ost) ;
double omega_c = get_omega_c() ;
ost << endl ;
if (omega != __infinity) {
ost << "Uniformly rotating star" << endl ;
ost << "-----------------------" << endl ;
double freq = omega / (2.*M_PI) ;
ost << "Omega : " << omega * f_unit
<< " rad/s f : " << freq * f_unit << " Hz" << endl ;
ost << "Rotation period : " << 1000. / (freq * f_unit) << " ms"
<< endl ;
}
else {
ost << "Differentially rotating star" << endl ;
ost << "----------------------------" << endl ;
double freq = omega_c / (2.*M_PI) ;
ost << "Central value of Omega : " << omega_c * f_unit
<< " rad/s f : " << freq * f_unit << " Hz" << endl ;
ost << "Central rotation period : " << 1000. / (freq * f_unit) << " ms"
<< endl ;
}
if (relativistic) {
ost << "Relativistic star" << endl ;
}
else {
ost << "Newtonian star" << endl ;
}
double compact = qpig/(4.*M_PI) * mass_g() / r_circ() ;
ost << "Compactness G M_g /(c^2 R_circ) : " << compact << endl ;
double nphi_c = nphi.val_grid_point(0, 0, 0, 0) ;
if ( (omega_c==0) && (nphi_c==0) ) {
ost << "Central N^phi : " << nphi_c << endl ;
}
else{
ost << "Central N^phi/Omega : " << nphi_c / omega_c << endl ;
}
ost << "Error on the virial identity GRV2 : " << grv2() << endl ;
double xgrv3 = grv3(&ost) ;
ost << "Error on the virial identity GRV3 : " << xgrv3 << endl ;
double mom_quad_38si = mom_quad() * rho_unit * (pow(r_unit, double(5.))
/ double(1.e38) ) ;
ost << "Quadrupole moment Q : " << mom_quad_38si << " 10^38 kg m^2"
<< endl ;
ost << "Q / (M R_circ^2) : "
<< mom_quad() / ( mass_g() * pow( r_circ(), 2. ) ) << endl ;
ost << "c^4 Q / (G^2 M^3) : "
<< mom_quad() / ( pow(qpig/(4*M_PI), 2.) * pow(mass_g(), 3.) )
<< endl ;
ost << "Angular momentum J : "
<< angu_mom()/( qpig / (4* M_PI) * msol*msol) << " G M_sol^2 / c"
<< endl ;
ost << "c J / (G M^2) : "
<< angu_mom()/( qpig / (4* M_PI) * pow(mass_g(), 2.) ) << endl ;
if (omega != __infinity) {
double mom_iner = angu_mom() / omega ;
double mom_iner_38si = mom_iner * rho_unit * (pow(r_unit, double(5.))
/ double(1.e38) ) ;
ost << "Moment of inertia: " << mom_iner_38si << " 10^38 kg m^2"
<< endl ;
}
ost << "Ratio T/W : " << tsw() << endl ;
ost << "Circumferential equatorial radius R_circ : "
<< r_circ()/km << " km" << endl ;
if (mp.get_mg()->get_np(0) == 1) {
ost << "Surface area : " << area()/(km*km) << " km^2" << endl ;
ost << "Mean radius : " << mean_radius()/km << " km" << endl ;
}
ost << "Coordinate equatorial radius r_eq : " << ray_eq()/km << " km"
<< endl ;
ost << "Flattening r_pole/r_eq : " << aplat() << endl ;
int lsurf = nzet - 1;
int nt = mp.get_mg()->get_nt(lsurf) ;
int nr = mp.get_mg()->get_nr(lsurf) ;
ost << "Equatorial value of the velocity U: "
<< uuu.val_grid_point(nzet-1, 0, nt-1, nr-1) << " c" << endl ;
ost << "Redshift at the equator (forward) : " << z_eqf() << endl ;
ost << "Redshift at the equator (backward): " << z_eqb() << endl ;
ost << "Redshift at the pole : " << z_pole() << endl ;
ost << "Central value of log(N) : "
<< logn.val_grid_point(0, 0, 0, 0) << endl ;
ost << "Central value of dzeta=log(AN) : "
<< dzeta.val_grid_point(0, 0, 0, 0) << endl ;
if ( (omega_c==0) && (nphi_c==0) ) {
ost << "Central N^phi : " << nphi_c << endl ;
}
else{
ost << "Central N^phi/Omega : " << nphi_c / omega_c << endl ;
}
ost << " ... w_shift (NB: components in the star Cartesian frame) [c] : "
<< endl
<< w_shift(1).val_grid_point(0, 0, 0, 0) << " "
<< w_shift(2).val_grid_point(0, 0, 0, 0) << " "
<< w_shift(3).val_grid_point(0, 0, 0, 0) << endl ;
ost << "Central value of khi_shift [km c] : "
<< khi_shift.val_grid_point(0, 0, 0, 0) / km << endl ;
ost << "Central value of B^2 : " << b_car.val_grid_point(0,0,0,0) << endl ;
Tbl diff_a_b = diffrel( a_car, b_car ) ;
ost <<
"Relative discrepancy in each domain between the metric coef. A^2 and B^2 : "
<< endl ;
for (int l=0; l<diff_a_b.get_taille(); l++) {
ost << diff_a_b(l) << " " ;
}
ost << endl ;
// Approximate formula for R_isco = 6 R_g (1-(2/3)^1.5 j )
// up to the first order in j
double jdimless = angu_mom() / ( ggrav * pow(mass_g(), 2.) ) ;
double r_grav = ggrav * mass_g() ;
double r_isco_appr = 6. * r_grav * ( 1. - pow(2./3.,1.5) * jdimless ) ;
// Approximate formula for the ISCO frequency
// freq_ms = 6^{-1.5}/2pi/R_g (1+11*6^(-1.5) j )
// up to the first order in j
double f_isco_appr = ( 1. + 11. /6. /sqrt(6.) * jdimless ) / r_grav /
(12. * M_PI ) / sqrt(6.) ;
ost << endl << "Innermost stable circular orbit (ISCO) : " << endl ;
double xr_isco = r_isco(&ost) ;
ost <<" circumferential radius r_isco = "
<< xr_isco / km << " km" << endl ;
ost <<" (approx. 6M + 1st order in j : "
<< r_isco_appr / km << " km)" << endl ;
ost <<" (approx. 6M : "
<< 6. * r_grav / km << " km)" << endl ;
ost <<" orbital frequency f_isco = "
<< f_isco() * f_unit << " Hz" << endl ;
ost <<" (approx. 1st order in j : "
<< f_isco_appr * f_unit << " Hz)" << endl ;
return ost ;
}
void Star_rot::partial_display(ostream& ost) const {
using namespace Unites ;
double omega_c = get_omega_c() ;
double freq = omega_c / (2.*M_PI) ;
ost << "Central Omega : " << omega_c * f_unit
<< " rad/s f : " << freq * f_unit << " Hz" << endl ;
ost << "Rotation period : " << 1000. / (freq * f_unit) << " ms"
<< endl ;
ost << endl << "Central enthalpy : " << ent.val_grid_point(0,0,0,0) << " c^2" << endl ;
ost << "Central proper baryon density : " << nbar.val_grid_point(0,0,0,0)
<< " x 0.1 fm^-3" << endl ;
ost << "Central proper energy density : " << ener.val_grid_point(0,0,0,0)
<< " rho_nuc c^2" << endl ;
ost << "Central pressure : " << press.val_grid_point(0,0,0,0)
<< " rho_nuc c^2" << endl ;
ost << "Central value of log(N) : "
<< logn.val_grid_point(0, 0, 0, 0) << endl ;
ost << "Central lapse N : " << nn.val_grid_point(0,0,0,0) << endl ;
ost << "Central value of dzeta=log(AN) : "
<< dzeta.val_grid_point(0, 0, 0, 0) << endl ;
ost << "Central value of A^2 : " << a_car.val_grid_point(0,0,0,0) << endl ;
ost << "Central value of B^2 : " << b_car.val_grid_point(0,0,0,0) << endl ;
double nphi_c = nphi.val_grid_point(0, 0, 0, 0) ;
if ( (omega_c==0) && (nphi_c==0) ) {
ost << "Central N^phi : " << nphi_c << endl ;
}
else{
ost << "Central N^phi/Omega : " << nphi_c / omega_c
<< endl ;
}
int lsurf = nzet - 1;
int nt = mp.get_mg()->get_nt(lsurf) ;
int nr = mp.get_mg()->get_nr(lsurf) ;
ost << "Equatorial value of the velocity U: "
<< uuu.val_grid_point(nzet-1, 0, nt-1, nr-1) << " c" << endl ;
ost << endl
<< "Coordinate equatorial radius r_eq = "
<< ray_eq()/km << " km" << endl ;
ost << "Flattening r_pole/r_eq : " << aplat() << endl ;
}
double Star_rot::get_omega_c() const {
return omega ;
}
// display_poly
// ------------
void Star_rot::display_poly(ostream& ost) const {
using namespace Unites ;
const Eos_poly* p_eos_poly = dynamic_cast<const Eos_poly*>( &eos ) ;
if (p_eos_poly != 0x0) {
double kappa = p_eos_poly->get_kap() ;
// kappa^{n/2}
double kap_ns2 = pow( kappa, 0.5 /(p_eos_poly->get_gam()-1) ) ;
// Polytropic unit of length in terms of r_unit :
double r_poly = kap_ns2 / sqrt(ggrav) ;
// Polytropic unit of time in terms of t_unit :
double t_poly = r_poly ;
// Polytropic unit of mass in terms of m_unit :
double m_poly = r_poly / ggrav ;
// Polytropic unit of angular momentum in terms of j_unit :
double j_poly = r_poly * r_poly / ggrav ;
// Polytropic unit of density in terms of rho_unit :
double rho_poly = 1. / (ggrav * r_poly * r_poly) ;
ost.precision(10) ;
ost << endl << "Quantities in polytropic units : " << endl ;
ost << "==============================" << endl ;
ost << " ( r_poly = " << r_poly / km << " km )" << endl ;
ost << " n_c : " << nbar.val_grid_point(0, 0, 0, 0) / rho_poly << endl ;
ost << " e_c : " << ener.val_grid_point(0, 0, 0, 0) / rho_poly << endl ;
ost << " Omega_c : " << get_omega_c() * t_poly << endl ;
ost << " P_c : " << 2.*M_PI / get_omega_c() / t_poly << endl ;
ost << " M_bar : " << mass_b() / m_poly << endl ;
ost << " M : " << mass_g() / m_poly << endl ;
ost << " J : " << angu_mom() / j_poly << endl ;
ost << " r_eq : " << ray_eq() / r_poly << endl ;
ost << " R_circ : " << r_circ() / r_poly << endl ;
ost << " R_mean : " << mean_radius() / r_poly << endl ;
}
}
//-------------------------//
// Computational methods //
//-------------------------//
void Star_rot::fait_shift() {
Vector d_khi = khi_shift.derive_con( mp.flat_met_cart() ) ;
d_khi.dec_dzpuis(2) ; // divide by r^2 in the external compactified domain
// x_k dW^k/dx_i
Scalar xx(mp) ;
Scalar yy(mp) ;
Scalar zz(mp) ;
Scalar sintcosp(mp) ;
Scalar sintsinp(mp) ;
Scalar cost(mp) ;
xx = mp.x ;
yy = mp.y ;
zz = mp.z ;
sintcosp = mp.sint * mp.cosp ;
sintsinp = mp.sint * mp.sinp ;
cost = mp.cost ;
int nz = mp.get_mg()->get_nzone() ;
Vector xk(mp, COV, mp.get_bvect_cart()) ;
xk.set(1) = xx ;
xk.set(1).set_domain(nz-1) = sintcosp.domain(nz-1) ;
xk.set(1).set_dzpuis(-1) ;
xk.set(2) = yy ;
xk.set(2).set_domain(nz-1) = sintsinp.domain(nz-1) ;
xk.set(2).set_dzpuis(-1) ;
xk.set(3) = zz ;
xk.set(3).set_domain(nz-1) = cost.domain(nz-1) ;
xk.set(3).set_dzpuis(-1) ;
xk.std_spectral_base() ;
Tensor d_w = w_shift.derive_con( mp.flat_met_cart() ) ;
Vector x_d_w = contract(xk, 0, d_w, 0) ;
x_d_w.dec_dzpuis() ;
double lambda = double(1) / double(3) ;
beta = - (lambda+2)/2./(lambda+1) * w_shift
+ (lambda/2./(lambda+1)) * (d_khi + x_d_w) ;
}
void Star_rot::fait_nphi() {
if ( (beta(1).get_etat() == ETATZERO) && (beta(2).get_etat() == ETATZERO) ) {
tnphi = 0 ;
nphi = 0 ;
return ;
}
// Computation of tnphi
// --------------------
mp.comp_p_from_cartesian( -beta(1), -beta(2), tnphi ) ;
// Computation of nphi
// -------------------
nphi = tnphi ;
nphi.div_rsint() ;
}
}
Lorene::Eos_poly
Polytropic equation of state (relativistic case).
Definition eos.h:757
Lorene::Eos_poly::get_gam
double get_gam() const
Returns the adiabatic index (cf. Eq. (3)).
Definition eos_poly.C:256
Lorene::Eos_poly::get_kap
double get_kap() const
Returns the pressure coefficient (cf.
Definition eos_poly.C:260
Lorene::Eos
Equation of state base class.
Definition eos.h:190
Lorene::Scalar
Tensor field of valence 0 (or component of a tensorial field).
Definition scalar.h:387
Lorene::Scalar::set_domain
Tbl & set_domain(int l)
Read/write of the value in a given domain.
Definition scalar.h:615
Lorene::Scalar::set_dzpuis
void set_dzpuis(int)
Modifies the dzpuis flag.
Definition scalar.C:808
Lorene::Scalar::domain
const Tbl & domain(int l) const
Read-only of the value in a given domain.
Definition scalar.h:625
Lorene::Star_rot::p_angu_mom
double * p_angu_mom
Angular momentum.
Definition star_rot.h:232
Lorene::Star_rot::display_poly
virtual void display_poly(ostream &) const
Display in polytropic units.
Definition star_rot.C:649
Lorene::Star_rot::mean_radius
virtual double mean_radius() const
Mean star radius from the area .
Definition star_rot_global.C:416
Lorene::Star_rot::p_r_isco
double * p_r_isco
Circumferential radius of the ISCO.
Definition star_rot.h:243
Lorene::Star_rot::p_aplat
double * p_aplat
Flatening r_pole/r_eq.
Definition star_rot.h:237
Lorene::Star_rot::Star_rot
Star_rot(Map &mp_i, int nzet_i, bool relat, const Eos &eos_i)
Standard constructor.
Definition star_rot.C:86
Lorene::Star_rot::p_mom_quad
double * p_mom_quad
Quadrupole moment.
Definition star_rot.h:242
Lorene::Star_rot::ssjm1_tggg
Scalar ssjm1_tggg
Effective source at the previous step for the resolution of the Poisson equation for tggg .
Definition star_rot.h:208
Lorene::Star_rot::tkij
Sym_tensor tkij
Tensor related to the extrinsic curvature tensor by .
Definition star_rot.h:167
Lorene::Star_rot::mom_quad
virtual double mom_quad() const
Quadrupole moment.
Definition star_rot_global.C:521
Lorene::Star_rot::p_z_eqf
double * p_z_eqf
Forward redshift factor at equator.
Definition star_rot.h:239
Lorene::Star_rot::tggg
Scalar tggg
Metric potential .
Definition star_rot.h:137
Lorene::Star_rot::tnphi
Scalar tnphi
Component of the shift vector.
Definition star_rot.h:118
Lorene::Star_rot::fait_shift
void fait_shift()
Computes shift from w_shift and khi_shift according to Shibata's prescription [Prog.
Definition star_rot.C:703
Lorene::Star_rot::~Star_rot
virtual ~Star_rot()
Destructor.
Definition star_rot.C:287
Lorene::Star_rot::z_pole
virtual double z_pole() const
Redshift factor at North pole.
Definition star_rot_global.C:502
Lorene::Star_rot::r_isco
virtual double r_isco(ostream *ost=0x0) const
Circumferential radius of the innermost stable circular orbit (ISCO).
Definition star_rot_isco.C:71
Lorene::Star_rot::z_eqb
virtual double z_eqb() const
Backward redshift factor at equator.
Definition star_rot_global.C:471
Lorene::Star_rot::unsurc2
double unsurc2
: unsurc2=1 for a relativistic star, 0 for a Newtonian one.
Definition star_rot.h:99
Lorene::Star_rot::w_shift
Vector w_shift
Vector used in the decomposition of shift , following Shibata's prescription [Prog.
Definition star_rot.h:150
Lorene::Star_rot::b_car
Scalar b_car
Square of the metric factor B.
Definition star_rot.h:110
Lorene::Star_rot::operator=
void operator=(const Star_rot &)
Assignment to another Star_rot.
Definition star_rot.C:359
Lorene::Star_rot::p_lspec_isco
double * p_lspec_isco
Specific angular momentum of a particle on the ISCO.
Definition star_rot.h:248
Lorene::Star_rot::bbb
Scalar bbb
Metric factor B.
Definition star_rot.h:107
Lorene::Star_rot::mass_b
virtual double mass_b() const
Baryon mass.
Definition star_rot_global.C:98
Lorene::Star_rot::get_omega_c
virtual double get_omega_c() const
Returns the central value of the rotation angular velocity ([f_unit] ).
Definition star_rot.C:640
Lorene::Star_rot::omega
double omega
Rotation angular velocity ([f_unit] ).
Definition star_rot.h:101
Lorene::Star_rot::ak_car
Scalar ak_car
Scalar .
Definition star_rot.h:186
Lorene::Star_rot::r_circ
virtual double r_circ() const
Circumferential radius.
Definition star_rot_global.C:342
Lorene::Star_rot::uuu
Scalar uuu
Norm of u_euler.
Definition star_rot.h:121
Lorene::Star_rot::z_eqf
virtual double z_eqf() const
Forward redshift factor at equator.
Definition star_rot_global.C:443
Lorene::Star_rot::nphi
Scalar nphi
Metric coefficient .
Definition star_rot.h:113
Lorene::Star_rot::set_der_0x0
virtual void set_der_0x0() const
Sets to 0x0 all the pointers on derived quantities.
Definition star_rot.C:322
Lorene::Star_rot::p_f_isco
double * p_f_isco
Orbital frequency of the ISCO.
Definition star_rot.h:244
Lorene::Star_rot::f_isco
virtual double f_isco() const
Orbital frequency at the innermost stable circular orbit (ISCO).
Definition star_rot_isco.C:255
Lorene::Star_rot::mass_g
virtual double mass_g() const
Gravitational mass.
Definition star_rot_global.C:124
Lorene::Star_rot::operator>>
virtual ostream & operator>>(ostream &) const
Operator >> (virtual function called by the operator <<).
Definition star_rot.C:428
Lorene::Star_rot::sauve
virtual void sauve(FILE *) const
Save in a file.
Definition star_rot.C:401
Lorene::Star_rot::p_area
double * p_area
Integrated surface area.
Definition star_rot.h:238
Lorene::Star_rot::aplat
virtual double aplat() const
Flatening r_pole/r_eq.
Definition star_rot_global.C:426
Lorene::Star_rot::p_grv3
double * p_grv3
Error on the virial identity GRV3.
Definition star_rot.h:235
Lorene::Star_rot::ssjm1_nuq
Scalar ssjm1_nuq
Effective source at the previous step for the resolution of the Poisson equation for nuq by means of ...
Definition star_rot.h:198
Lorene::Star_rot::p_espec_isco
double * p_espec_isco
Specific energy of a particle on the ISCO.
Definition star_rot.h:246
Lorene::Star_rot::p_tsw
double * p_tsw
Ratio T/W.
Definition star_rot.h:233
Lorene::Star_rot::nuf
Scalar nuf
Part of the Metric potential = logn generated by the matter terms.
Definition star_rot.h:126
Lorene::Star_rot::relativistic
bool relativistic
Indicator of relativity: true for a relativistic star, false for a Newtonian one.
Definition star_rot.h:94
Lorene::Star_rot::p_f_eq
double * p_f_eq
Orbital frequency at the equator.
Definition star_rot.h:249
Lorene::Star_rot::ssjm1_dzeta
Scalar ssjm1_dzeta
Effective source at the previous step for the resolution of the Poisson equation for dzeta .
Definition star_rot.h:203
Lorene::Star_rot::tsw
virtual double tsw() const
Ratio T/W.
Definition star_rot_global.C:176
Lorene::Star_rot::del_hydro_euler
virtual void del_hydro_euler()
Sets to ETATNONDEF (undefined state) the hydrodynamical quantities relative to the Eulerian observer.
Definition star_rot.C:345
Lorene::Star_rot::grv3
virtual double grv3(ostream *ost=0x0) const
Error on the virial identity GRV3.
Definition star_rot_global.C:235
Lorene::Star_rot::ssjm1_khi
Scalar ssjm1_khi
Effective source at the previous step for the resolution of the Poisson equation for the scalar by m...
Definition star_rot.h:216
Lorene::Star_rot::dzeta
Scalar dzeta
Metric potential .
Definition star_rot.h:134
Lorene::Star_rot::area
virtual double area() const
Integrated surface area in .
Definition star_rot_global.C:366
Lorene::Star_rot::a_car
Scalar a_car
Square of the metric factor A.
Definition star_rot.h:104
Lorene::Star_rot::ssjm1_nuf
Scalar ssjm1_nuf
Effective source at the previous step for the resolution of the Poisson equation for nuf by means of ...
Definition star_rot.h:192
Lorene::Star_rot::nuq
Scalar nuq
Part of the Metric potential = logn generated by the quadratic terms.
Definition star_rot.h:131
Lorene::Star_rot::p_grv2
double * p_grv2
Error on the virial identity GRV2.
Definition star_rot.h:234
Lorene::Star_rot::del_deriv
virtual void del_deriv() const
Deletes all the derived quantities.
Definition star_rot.C:297
Lorene::Star_rot::ssjm1_wshift
Vector ssjm1_wshift
Effective source at the previous step for the resolution of the vector Poisson equation for .
Definition star_rot.h:225
Lorene::Star_rot::p_r_circ
double * p_r_circ
Circumferential radius.
Definition star_rot.h:236
Lorene::Star_rot::grv2
virtual double grv2() const
Error on the virial identity GRV2.
Definition star_rot_global.C:204
Lorene::Star_rot::angu_mom
virtual double angu_mom() const
Angular momentum.
Definition star_rot_global.C:150
Lorene::Star_rot::p_z_eqb
double * p_z_eqb
Backward redshift factor at equator.
Definition star_rot.h:240
Lorene::Star_rot::partial_display
virtual void partial_display(ostream &) const
Printing of some informations, excluding all global quantities.
Definition star_rot.C:590
Lorene::Star_rot::p_z_pole
double * p_z_pole
Redshift factor at North pole.
Definition star_rot.h:241
Lorene::Star_rot::khi_shift
Scalar khi_shift
Scalar used in the decomposition of shift , following Shibata's prescription [Prog.
Definition star_rot.h:160
Lorene::Star_rot::fait_nphi
void fait_nphi()
Computes tnphi and nphi from the Cartesian components of the shift, stored in shift .
Definition star_rot.C:748
Lorene::Star::Star
Star(Map &mp_i, int nzet_i, const Eos &eos_i)
Standard constructor.
Definition star.C:124
Lorene::Star::ener
Scalar ener
Total energy density in the fluid frame.
Definition star.h:193
Lorene::Star::logn
Scalar logn
Logarithm of the lapse N .
Definition star.h:222
Lorene::Star::nn
Scalar nn
Lapse function N .
Definition star.h:225
Lorene::Star::del_hydro_euler
virtual void del_hydro_euler()
Sets to ETATNONDEF (undefined state) the hydrodynamical quantities relative to the Eulerian observer.
Definition star.C:330
Lorene::Star::eos
const Eos & eos
Equation of state of the stellar matter.
Definition star.h:185
Lorene::Star::nbar
Scalar nbar
Baryon density in the fluid frame.
Definition star.h:192
Lorene::Star::del_deriv
virtual void del_deriv() const
Deletes all the derived quantities.
Definition star.C:298
Lorene::Star::operator>>
virtual ostream & operator>>(ostream &) const
Operator >> (virtual function called by the operator <<).
Definition star.C:417
Lorene::Star::set_der_0x0
virtual void set_der_0x0() const
Sets to 0x0 all the pointers on derived quantities.
Definition star.C:316
Lorene::Star::ray_eq
double ray_eq() const
Coordinate radius at , [r_unit].
Definition star_global.C:108
Lorene::Star::sauve
virtual void sauve(FILE *) const
Save in a file.
Definition star.C:397
Lorene::Star::press
Scalar press
Fluid pressure.
Definition star.h:194
Lorene::Star::ent
Scalar ent
Log-enthalpy.
Definition star.h:190
Lorene::Star::mp
Map & mp
Mapping associated with the star.
Definition star.h:180
Lorene::Star::operator=
void operator=(const Star &)
Assignment to another Star.
Definition star.C:351
Lorene::Star::nzet
int nzet
Number of domains of *mp occupied by the star.
Definition star.h:183
Lorene::Star::beta
Vector beta
Shift vector.
Definition star.h:228
Lorene::Tbl
Basic array class.
Definition tbl.h:161
Lorene::Tbl::get_taille
int get_taille() const
Gives the total size (ie dim.taille).
Definition tbl.h:397
Lorene::Tensor
Tensor handling.
Definition tensor.h:288
Lorene::Vector
Tensor field of valence 1.
Definition vector.h:188
Lorene::Vector::std_spectral_base
virtual void std_spectral_base()
Sets the standard spectal bases of decomposition for each component.
Definition vector.C:316
Lorene::Vector::set
Scalar & set(int)
Read/write access to a component.
Definition vector.C:296
Lorene::sqrt
Cmp sqrt(const Cmp &)
Square root.
Definition cmp_math.C:220
Lorene::diffrel
Tbl diffrel(const Cmp &a, const Cmp &b)
Relative difference between two Cmp (norme version).
Definition cmp_math.C:504
Lorene::pow
Cmp pow(const Cmp &, int)
Power .
Definition cmp_math.C:348
Lorene::fread_be
int fread_be(int *aa, int size, int nb, FILE *fich)
Reads integer(s) from a binary file according to the big endian convention.
Definition fread_be.C:69
Lorene::fwrite_be
int fwrite_be(const int *aa, int size, int nb, FILE *fich)
Writes integer(s) into a binary file according to the big endian convention.
Definition fwrite_be.C:70
Lorene::Tensor::dec_dzpuis
virtual void dec_dzpuis(int dec=1)
Decreases by dec units the value of dzpuis and changes accordingly the values in the compactified ext...
Definition tensor.C:808
Lorene::contract
Tenseur contract(const Tenseur &, int id1, int id2)
Self contraction of two indices of a Tenseur .
Definition tenseur_operateur.C:279
Lorene
Lorene prototypes.
Definition app_hor.h:64
Lorene::get_bvect_cart
const Base_vect_cart & get_bvect_cart() const
Returns the Cartesian basis associated with the coordinates (x,y,z) of the mapping,...
Definition map.h:791
Lorene::cost
Coord cost
Definition map.h:722
Lorene::Map
Map(const Mg3d &)
Constructor from a multi-domain 3D grid.
Definition map.C:139
Unites
Standard units of space, time and mass.