Debian Codegraph @

C++/Source/Star_bhns/star_bhns_global.C

raw
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 }