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 
29 
30 
31 /*
32  * $Id: et_rot_diff_global.C,v 1.5 2016/12/05 16:17:53 j_novak Exp $
33  * $Log: et_rot_diff_global.C,v $
34  * Revision 1.5 2016/12/05 16:17:53 j_novak
35  * Suppression of some global variables (file names, loch, ...) to prevent redefinitions
36  *
37  * Revision 1.4 2014/10/13 08:52:57 j_novak
38  * Lorene classes and functions now belong to the namespace Lorene.
39  *
40  * Revision 1.3 2014/10/06 15:13:08 j_novak
41  * Modified #include directives to use c++ syntax.
42  *
43  * Revision 1.2 2003/12/19 16:21:42 j_novak
44  * Shadow hunt
45  *
46  * Revision 1.1.1.1 2001/11/20 15:19:28 e_gourgoulhon
47  * LORENE
48  *
49  * Revision 1.2 2001/10/24 16:06:53 eric
50  * fonction tsw(): correction erreur ener. cin. (facteur 0.5).
51  *
52  * Revision 1.1 2001/10/19 08:18:30 eric
53  * Initial revision
54  *
55  *
56  * $Header: /cvsroot/Lorene/C++/Source/Etoile/et_rot_diff_global.C,v 1.5 2016/12/05 16:17:53 j_novak Exp $
57  *
58  */
59 
60 // Headers C
61 #include <cmath>
62 
63 // Headers Lorene
64 #include "et_rot_diff.h"
65  //----------------------------//
66  // T/W //
67  //----------------------------//
68 
69 namespace Lorene {
70 double Et_rot_diff::tsw() const {
71 
72  if (p_tsw == 0x0) { // a new computation is required
73 
74  Cmp dens = uuu() ;
75 
76  dens.mult_r() ; // Multiplication by
77  dens.va = (dens.va).mult_st() ; // r sin(theta)
78 
79  if (relativistic) {
80  dens = omega_field() * a_car() * b_car() * (ener_euler() + press())
81  * dens ;
82  }
83  else { // Newtonian case
84  dens = omega_field() * nbar() * dens ;
85  }
86 
87  dens.std_base_scal() ;
88 
89  double tcin = 0.5 * dens.integrale() ;
90 
91  if (relativistic) {
92 
93  Cmp dens2 = a_car() * bbb() * gam_euler() * ener() ;
94  dens2.std_base_scal() ;
95  double mass_p = dens2.integrale() ;
96 
97  p_tsw = new double( tcin / ( mass_p + tcin - mass_g() ) ) ;
98 
99  }
100  else { // Newtonian case
101  Cmp dens2 = 0.5 * nbar() * logn() ;
102  dens2.std_base_scal() ;
103  double wgrav = dens2.integrale() ;
104  p_tsw = new double( tcin / fabs(wgrav) ) ;
105  }
106 
107 
108  }
109 
110  return *p_tsw ;
111 
112 }
113 
114 }
Component of a tensorial field *** DEPRECATED : use class Scalar instead ***.
Definition: cmp.h:446
Lorene prototypes.
Definition: app_hor.h:67
Tenseur b_car
Square of the metric factor B.
Definition: etoile.h:1510
Tenseur press
Fluid pressure.
Definition: etoile.h:464
void mult_r()
Multiplication by r everywhere.
Definition: cmp_r_manip.C:94
Tenseur nbar
Baryon density in the fluid frame.
Definition: etoile.h:462
Tenseur gam_euler
Lorentz factor between the fluid and Eulerian observers.
Definition: etoile.h:474
double * p_tsw
Ratio T/W.
Definition: etoile.h:1635
double integrale() const
Computes the integral over all space of *this .
Definition: cmp_integ.C:58
Tenseur bbb
Metric factor B.
Definition: etoile.h:1507
Tenseur uuu
Norm of u_euler.
Definition: etoile.h:1521
void std_base_scal()
Sets the spectral bases of the Valeur va to the standard ones for a scalar.
Definition: cmp.C:647
Tenseur a_car
Total conformal factor .
Definition: etoile.h:518
bool relativistic
Indicator of relativity: true for a relativistic star, false for a Newtonian one. ...
Definition: etoile.h:440
Tenseur ener
Total energy density in the fluid frame.
Definition: etoile.h:463
Tenseur & logn
Metric potential = logn_auto.
Definition: etoile.h:1524
virtual double mass_g() const
Gravitational mass.
Tenseur ener_euler
Total energy density in the Eulerian frame.
Definition: etoile.h:468
Valeur va
The numerical value of the Cmp.
Definition: cmp.h:464
Tenseur omega_field
Field .
Definition: et_rot_diff.h:108
virtual double tsw() const
Ratio T/W.