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 char star_bhns_global_C[] = "$Header: /cvsroot/Lorene/C++/Source/Star_bhns/star_bhns_global.C,v 1.3 2014/10/13 08:53:40 j_novak Exp $" ;
29 
30 /*
31  * $Id: star_bhns_global.C,v 1.3 2014/10/13 08:53:40 j_novak Exp $
32  * $Log: star_bhns_global.C,v $
33  * Revision 1.3 2014/10/13 08:53:40 j_novak
34  * Lorene classes and functions now belong to the namespace Lorene.
35  *
36  * Revision 1.2 2008/05/15 19:15:20 k_taniguchi
37  * Change of a parameter.
38  *
39  * Revision 1.1 2007/06/22 01:31:24 k_taniguchi
40  * *** empty log message ***
41  *
42  *
43  * $Header: /cvsroot/Lorene/C++/Source/Star_bhns/star_bhns_global.C,v 1.3 2014/10/13 08:53:40 j_novak Exp $
44  *
45  */
46 
47 // C++ headers
48 //#include <>
49 
50 // C headers
51 //#include <>
52 
53 // Lorene headers
54 #include "star_bhns.h"
55 #include "unites.h"
56 #include "utilitaires.h"
57 
58  //-------------------------------//
59  // Baryon mass //
60  //-------------------------------//
61 
62 namespace Lorene {
63 double Star_bhns::mass_b() const {
64 
65  using namespace Unites ;
66 
67  if (p_mass_b == 0x0) { // a new computation is required
68 
69  Scalar dens = pow(confo_tot, 6.) * nbar * gam_euler ;
70  dens.std_spectral_base() ;
71 
72  p_mass_b = new double( dens.integrale() ) ;
73  }
74 
75  return *p_mass_b ;
76 
77  /*
78  cout << "Star_bhns::mass_b() is not available !!!" << endl
79  << " --> Use Star_bhns::mass_b_bhns(kerrschild, mass_bh, sepa)"
80  << endl ;
81  abort() ;
82  */
83 
84 }
85 
86 double Star_bhns::mass_b_bhns(bool kerrschild, const double& mass_bh,
87  const double& sepa) const {
88 
89  using namespace Unites ;
90 
91  if (p_mass_b_bhns == 0x0) { // a new computation is required
92 
93  Scalar tmp(mp) ;
94 
95  if (kerrschild) {
96 
97  Scalar xx(mp) ;
98  xx = mp.x ;
99  xx.std_spectral_base() ;
100  Scalar yy(mp) ;
101  yy = mp.y ;
102  yy.std_spectral_base() ;
103  Scalar zz(mp) ;
104  zz = mp.z ;
105  zz.std_spectral_base() ;
106 
107  double yns = mp.get_ori_y() ;
108 
109  Scalar rr(mp) ;
110  rr = sqrt( (xx+sepa)*(xx+sepa) + (yy+yns)*(yy+yns) + zz*zz ) ;
111  rr.std_spectral_base() ;
112 
113  tmp = sqrt(1. + 2.*ggrav*mass_bh/rr) ;
114 
115  }
116  else { // Isotropic coordinates with the maximal slicing
117 
118  tmp = 1. ;
119 
120  }
121  tmp.std_spectral_base() ;
122 
123  Scalar dens = pow(confo_tot, 6.) * nbar * gam_euler * tmp ;
124  dens.std_spectral_base() ;
125 
126  p_mass_b_bhns = new double( dens.integrale() ) ;
127  }
128 
129  return *p_mass_b_bhns ;
130 
131 }
132 
133 
134  //--------------------------------------//
135  // Gravitational mass //
136  //--------------------------------------//
137 
138 double Star_bhns::mass_g() const {
139 
140  cout << "Star_bhns::mass_g() is not available !!!" << endl
141  << " --> Use Star_bhns::mass_g_bhns()"
142  << endl ;
143  abort() ;
144 
145 }
146 
147 double Star_bhns::mass_g_bhns() const {
148 
149  // This mass is valid only for an isolated spherical star
150 
151  if (p_mass_g_bhns == 0x0) { // a new computation is required
152 
153  Scalar dens = lapconf_tot * pow(confo_tot, 5.)
154  * (ener_euler + s_euler) ;
155 
156  dens.std_spectral_base() ;
157 
158  p_mass_g_bhns = new double( dens.integrale() ) ;
159 
160  }
161 
162  return *p_mass_g_bhns ;
163 
164 }
165 }
Lorene::Map::z
Coord z
z coordinate centered on the grid
Definition: map.h:728
Lorene::Star::nbar
Scalar nbar
Baryon density in the fluid frame.
Definition: star.h:192
Lorene::Star::gam_euler
Scalar gam_euler
Lorentz factor between the fluid and Eulerian observers.
Definition: star.h:204
Lorene
Lorene prototypes.
Definition: app_hor.h:64
Lorene::Map::get_ori_y
double get_ori_y() const
Returns the y coordinate of the origin.
Definition: map.h:770
Lorene::Star_bhns::lapconf_tot
Scalar lapconf_tot
Total lapconf function.
Definition: star_bhns.h:119
Lorene::Star_bhns::confo_tot
Scalar confo_tot
Total conformal factor.
Definition: star_bhns.h:163
Lorene::Scalar
Tensor field of valence 0 (or component of a tensorial field).
Definition: scalar.h:387
Lorene::pow
Cmp pow(const Cmp &, int)
Power .
Definition: cmp_math.C:348
Lorene::Star::p_mass_b
double * p_mass_b
Baryon mass.
Definition: star.h:268
Unites
Standard units of space, time and mass.
Lorene::Star::mp
Map & mp
Mapping associated with the star.
Definition: star.h:180
Lorene::Star::ener_euler
Scalar ener_euler
Total energy density in the Eulerian frame.
Definition: star.h:198
Lorene::Star_bhns::p_mass_b_bhns
double * p_mass_b_bhns
Baryon mass.
Definition: star_bhns.h:225
Lorene::Star_bhns::mass_g
virtual double mass_g() const
Gravitational mass.
Definition: star_bhns_global.C:138
Lorene::sqrt
Cmp sqrt(const Cmp &)
Square root.
Definition: cmp_math.C:220
Lorene::Map::x
Coord x
x coordinate centered on the grid
Definition: map.h:726
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::Star_bhns::p_mass_g_bhns
double * p_mass_g_bhns
Gravitational mass.
Definition: star_bhns.h:226
Lorene::Map::y
Coord y
y coordinate centered on the grid
Definition: map.h:727
Lorene::Star::s_euler
Scalar s_euler
Trace of the stress scalar in the Eulerian frame.
Definition: star.h:201
Lorene::Star_bhns::mass_b
virtual double mass_b() const
Baryon mass.
Definition: star_bhns_global.C:63