LORENE
star_bhns_global.C
1 /*
2  * Methods of class Star_bhns to compute global quantities
3  *
4  * (see file star_bhns.h for documentation).
5  *
6  */
7 
8 /*
9  * Copyright (c) 2005,2007 Keisuke Taniguchi
10  *
11  * This file is part of LORENE.
12  *
13  * LORENE is free software; you can redistribute it and/or modify
14  * it under the terms of the GNU General Public License version 2
15  * as published by the Free Software Foundation.
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  * $Id: star_bhns_global.C,v 1.4 2016/12/05 16:18:16 j_novak Exp $
32  * $Log: star_bhns_global.C,v $
33  * Revision 1.4 2016/12/05 16:18:16 j_novak
34  * Suppression of some global variables (file names, loch, ...) to prevent redefinitions
35  *
36  * Revision 1.3 2014/10/13 08:53:40 j_novak
37  * Lorene classes and functions now belong to the namespace Lorene.
38  *
39  * Revision 1.2 2008/05/15 19:15:20 k_taniguchi
40  * Change of a parameter.
41  *
42  * Revision 1.1 2007/06/22 01:31:24 k_taniguchi
43  * *** empty log message ***
44  *
45  *
46  * $Header: /cvsroot/Lorene/C++/Source/Star_bhns/star_bhns_global.C,v 1.4 2016/12/05 16:18:16 j_novak Exp $
47  *
48  */
49 
50 // C++ headers
51 //#include <>
52 
53 // C headers
54 //#include <>
55 
56 // Lorene headers
57 #include "star_bhns.h"
58 #include "unites.h"
59 #include "utilitaires.h"
60 
61  //-------------------------------//
62  // Baryon mass //
63  //-------------------------------//
64 
65 namespace Lorene {
66 double Star_bhns::mass_b() const {
67 
68  using namespace Unites ;
69 
70  if (p_mass_b == 0x0) { // a new computation is required
71 
72  Scalar dens = pow(confo_tot, 6.) * nbar * gam_euler ;
73  dens.std_spectral_base() ;
74 
75  p_mass_b = new double( dens.integrale() ) ;
76  }
77 
78  return *p_mass_b ;
79 
80  /*
81  cout << "Star_bhns::mass_b() is not available !!!" << endl
82  << " --> Use Star_bhns::mass_b_bhns(kerrschild, mass_bh, sepa)"
83  << endl ;
84  abort() ;
85  */
86 
87 }
88 
89 double Star_bhns::mass_b_bhns(bool kerrschild, const double& mass_bh,
90  const double& sepa) const {
91 
92  using namespace Unites ;
93 
94  if (p_mass_b_bhns == 0x0) { // a new computation is required
95 
96  Scalar tmp(mp) ;
97 
98  if (kerrschild) {
99 
100  Scalar xx(mp) ;
101  xx = mp.x ;
102  xx.std_spectral_base() ;
103  Scalar yy(mp) ;
104  yy = mp.y ;
105  yy.std_spectral_base() ;
106  Scalar zz(mp) ;
107  zz = mp.z ;
108  zz.std_spectral_base() ;
109 
110  double yns = mp.get_ori_y() ;
111 
112  Scalar rr(mp) ;
113  rr = sqrt( (xx+sepa)*(xx+sepa) + (yy+yns)*(yy+yns) + zz*zz ) ;
114  rr.std_spectral_base() ;
115 
116  tmp = sqrt(1. + 2.*ggrav*mass_bh/rr) ;
117 
118  }
119  else { // Isotropic coordinates with the maximal slicing
120 
121  tmp = 1. ;
122 
123  }
124  tmp.std_spectral_base() ;
125 
126  Scalar dens = pow(confo_tot, 6.) * nbar * gam_euler * tmp ;
127  dens.std_spectral_base() ;
128 
129  p_mass_b_bhns = new double( dens.integrale() ) ;
130  }
131 
132  return *p_mass_b_bhns ;
133 
134 }
135 
136 
137  //--------------------------------------//
138  // Gravitational mass //
139  //--------------------------------------//
140 
141 double Star_bhns::mass_g() const {
142 
143  cout << "Star_bhns::mass_g() is not available !!!" << endl
144  << " --> Use Star_bhns::mass_g_bhns()"
145  << endl ;
146  abort() ;
147 
148 }
149 
150 double Star_bhns::mass_g_bhns() const {
151 
152  // This mass is valid only for an isolated spherical star
153 
154  if (p_mass_g_bhns == 0x0) { // a new computation is required
155 
156  Scalar dens = lapconf_tot * pow(confo_tot, 5.)
157  * (ener_euler + s_euler) ;
158 
159  dens.std_spectral_base() ;
160 
161  p_mass_g_bhns = new double( dens.integrale() ) ;
162 
163  }
164 
165  return *p_mass_g_bhns ;
166 
167 }
168 }
double * p_mass_b
Baryon mass.
Definition: star.h:268
Scalar lapconf_tot
Total lapconf function.
Definition: star_bhns.h:119
double * p_mass_g_bhns
Gravitational mass.
Definition: star_bhns.h:226
Map & mp
Mapping associated with the star.
Definition: star.h:180
Cmp sqrt(const Cmp &)
Square root.
Definition: cmp_math.C:223
double get_ori_y() const
Returns the y coordinate of the origin.
Definition: map.h:782
Lorene prototypes.
Definition: app_hor.h:67
Standard units of space, time and mass.
Tensor field of valence 0 (or component of a tensorial field).
Definition: scalar.h:393
double integrale() const
Computes the integral over all space of *this .
Definition: scalar_integ.C:64
double * p_mass_b_bhns
Baryon mass.
Definition: star_bhns.h:225
virtual void std_spectral_base()
Sets the spectral bases of the Valeur va to the standard ones for a scalar field. ...
Definition: scalar.C:790
Scalar nbar
Baryon density in the fluid frame.
Definition: star.h:192
Scalar s_euler
Trace of the stress scalar in the Eulerian frame.
Definition: star.h:201
Scalar confo_tot
Total conformal factor.
Definition: star_bhns.h:163
Scalar gam_euler
Lorentz factor between the fluid and Eulerian observers.
Definition: star.h:204
Cmp pow(const Cmp &, int)
Power .
Definition: cmp_math.C:351
Coord y
y coordinate centered on the grid
Definition: map.h:739
Coord x
x coordinate centered on the grid
Definition: map.h:738
virtual double mass_g() const
Gravitational mass.
Coord z
z coordinate centered on the grid
Definition: map.h:740
Scalar ener_euler
Total energy density in the Eulerian frame.
Definition: star.h:198
virtual double mass_b() const
Baryon mass.