LORENE
et_rot_diff_global.C
1/*
2 * Methods for computing global quantities within the class Et_rot_diff
3 *
4 * (see file et_rot_diff.h for documentation)
5 */
6
7/*
8 * Copyright (c) 2001 Eric Gourgoulhon
9 *
10 * This file is part of LORENE.
11 *
12 * LORENE is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; either version 2 of the License, or
15 * (at your option) any later version.
16 *
17 * LORENE is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
21 *
22 * You should have received a copy of the GNU General Public License
23 * along with LORENE; if not, write to the Free Software
24 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 *
26 */
27
28
29char et_rot_diff_global_C[] = "$Header: /cvsroot/Lorene/C++/Source/Etoile/et_rot_diff_global.C,v 1.4 2014/10/13 08:52:57 j_novak Exp $" ;
30
31/*
32 * $Id: et_rot_diff_global.C,v 1.4 2014/10/13 08:52:57 j_novak Exp $
33 * $Log: et_rot_diff_global.C,v $
34 * Revision 1.4 2014/10/13 08:52:57 j_novak
35 * Lorene classes and functions now belong to the namespace Lorene.
36 *
37 * Revision 1.3 2014/10/06 15:13:08 j_novak
38 * Modified #include directives to use c++ syntax.
39 *
40 * Revision 1.2 2003/12/19 16:21:42 j_novak
41 * Shadow hunt
42 *
43 * Revision 1.1.1.1 2001/11/20 15:19:28 e_gourgoulhon
44 * LORENE
45 *
46 * Revision 1.2 2001/10/24 16:06:53 eric
47 * fonction tsw(): correction erreur ener. cin. (facteur 0.5).
48 *
49 * Revision 1.1 2001/10/19 08:18:30 eric
50 * Initial revision
51 *
52 *
53 * $Header: /cvsroot/Lorene/C++/Source/Etoile/et_rot_diff_global.C,v 1.4 2014/10/13 08:52:57 j_novak Exp $
54 *
55 */
56
57// Headers C
58#include <cmath>
59
60// Headers Lorene
61#include "et_rot_diff.h"
62 //----------------------------//
63 // T/W //
64 //----------------------------//
65
66namespace Lorene {
67double Et_rot_diff::tsw() const {
68
69 if (p_tsw == 0x0) { // a new computation is required
70
71 Cmp dens = uuu() ;
72
73 dens.mult_r() ; // Multiplication by
74 dens.va = (dens.va).mult_st() ; // r sin(theta)
75
76 if (relativistic) {
77 dens = omega_field() * a_car() * b_car() * (ener_euler() + press())
78 * dens ;
79 }
80 else { // Newtonian case
81 dens = omega_field() * nbar() * dens ;
82 }
83
84 dens.std_base_scal() ;
85
86 double tcin = 0.5 * dens.integrale() ;
87
88 if (relativistic) {
89
90 Cmp dens2 = a_car() * bbb() * gam_euler() * ener() ;
91 dens2.std_base_scal() ;
92 double mass_p = dens2.integrale() ;
93
94 p_tsw = new double( tcin / ( mass_p + tcin - mass_g() ) ) ;
95
96 }
97 else { // Newtonian case
98 Cmp dens2 = 0.5 * nbar() * logn() ;
99 dens2.std_base_scal() ;
100 double wgrav = dens2.integrale() ;
101 p_tsw = new double( tcin / fabs(wgrav) ) ;
102 }
103
104
105 }
106
107 return *p_tsw ;
108
109}
110
111}
Component of a tensorial field *** DEPRECATED : use class Scalar instead ***.
Definition cmp.h:446
Valeur va
The numerical value of the Cmp
Definition cmp.h:464
void std_base_scal()
Sets the spectral bases of the Valeur va to the standard ones for a scalar.
Definition cmp.C:644
void mult_r()
Multiplication by r everywhere.
Definition cmp_r_manip.C:91
double integrale() const
Computes the integral over all space of *this .
Definition cmp_integ.C:55
virtual double tsw() const
Ratio T/W.
Tenseur omega_field
Field .
Tenseur uuu
Norm of u_euler.
Definition etoile.h:1518
Tenseur & logn
Metric potential = logn_auto.
Definition etoile.h:1521
virtual double mass_g() const
Gravitational mass.
Tenseur bbb
Metric factor B.
Definition etoile.h:1504
double * p_tsw
Ratio T/W.
Definition etoile.h:1632
Tenseur b_car
Square of the metric factor B.
Definition etoile.h:1507
Tenseur nbar
Baryon density in the fluid frame.
Definition etoile.h:459
Tenseur gam_euler
Lorentz factor between the fluid and Eulerian observers.
Definition etoile.h:471
Tenseur ener
Total energy density in the fluid frame.
Definition etoile.h:460
Tenseur press
Fluid pressure.
Definition etoile.h:461
bool relativistic
Indicator of relativity: true for a relativistic star, false for a Newtonian one.
Definition etoile.h:437
Tenseur ener_euler
Total energy density in the Eulerian frame.
Definition etoile.h:465
Tenseur a_car
Total conformal factor .
Definition etoile.h:515
Lorene prototypes.
Definition app_hor.h:64