strot_dirac_diff_global.C
/*
* Methods for computing global quantities within the class Star_rot_Dirac_diff
*
* (see file star.h for documentation).
*
*/
/*
* Copyright (c) 2005 Motoyuki Saijo
*
* 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 strot_dirac_diff_global_C[] = "$Header: /cvsroot/Lorene/C++/Source/Star/strot_dirac_diff_global.C,v 1.3 2014/10/13 08:53:40 j_novak Exp $" ;
/*
* $Header: /cvsroot/Lorene/C++/Source/Star/strot_dirac_diff_global.C,v 1.3 2014/10/13 08:53:40 j_novak Exp $
*
*/
// C headers
#include <cmath>
// Lorene headers
#include "star_rot_dirac_diff.h"
//---------------------//
// T/W //
//---------------------//
namespace Lorene {
double Star_rot_Dirac_diff::tsw() const {
if (p_tsw == 0x0) { // a new computation is required
Vector phi_kill(mp, CON, mp.get_bvect_spher()) ;
phi_kill.set(1).set_etat_zero() ;
phi_kill.set(2).set_etat_zero() ;
phi_kill.set(3) = 1. ;
phi_kill.set(3).std_spectral_base() ;
phi_kill.set(3).mult_rsint() ;
Scalar j_source = contract(contract(gamma.cov(), 0, j_euler, 0),
0, phi_kill, 0) ;
Scalar dens = sqrt( gamma.determinant() ) * j_source * omega_field ;
dens.std_spectral_base() ;
double tcin = 0.5 * dens.integrale() ;
Scalar dens2 = sqrt( gamma.determinant() ) * gam_euler * ener ;
dens2.std_spectral_base() ;
double mass_p = dens2.integrale() ;
p_tsw = new double( tcin / ( mass_p + tcin - mass_g() ) ) ;
}
return *p_tsw ;
cout << "T/W : " << p_tsw << '\n' ;
}
}
Lorene::Scalar
Tensor field of valence 0 (or component of a tensorial field).
Definition scalar.h:387
Lorene::Scalar::integrale
double integrale() const
Computes the integral over all space of *this .
Definition scalar_integ.C:61
Lorene::Scalar::std_spectral_base
virtual void std_spectral_base()
Sets the spectral bases of the Valeur va to the standard ones for a scalar field.
Definition scalar.C:784
Lorene::Scalar::set_etat_zero
virtual void set_etat_zero()
Sets the logical state to ETATZERO (zero).
Definition scalar.C:324
Lorene::Scalar::mult_rsint
void mult_rsint()
Multiplication by everywhere; dzpuis is not changed.
Definition scalar_r_manip.C:281
Lorene::Star_rot_Dirac_diff::omega_field
Scalar omega_field
Field .
Definition star_rot_dirac_diff.h:84
Lorene::Star_rot_Dirac_diff::tsw
virtual double tsw() const
Ratio T/W.
Definition strot_dirac_diff_global.C:48
Lorene::Star_rot_Dirac::mass_g
virtual double mass_g() const
Gravitational mass.
Definition strot_dirac_global.C:117
Lorene::Star_rot_Dirac::p_tsw
double * p_tsw
Ratio T/W.
Definition star_rot_dirac.h:109
Lorene::Star_rot_Dirac::j_euler
Vector j_euler
Momentum density 3-vector with respect to the Eulerian observer.
Definition star_rot_dirac.h:77
Lorene::Star::ener
Scalar ener
Total energy density in the fluid frame.
Definition star.h:193
Lorene::Star::gam_euler
Scalar gam_euler
Lorentz factor between the fluid and Eulerian observers.
Definition star.h:204
Lorene::Star::gamma
Metric gamma
3-metric
Definition star.h:235
Lorene::Star::mp
Map & mp
Mapping associated with the star.
Definition star.h:180
Lorene::Vector
Tensor field of valence 1.
Definition vector.h:188
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::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