LORENE
star_bin_global_xcts.C
1/*
2 * Methods for computing global quantities within the class Star_bin_xcts
3 * (see file star.h for documentation)
4 */
5
6/*
7 * Copyright (c) 2010 Michal Bejger
8 *
9 * This file is part of LORENE.
10 *
11 * LORENE is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License version 2
13 * as published by the Free Software Foundation.
14 *
15 * LORENE is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with LORENE; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 *
24 */
25
26char star_bin_global_xcts_C[] = "$Header: /cvsroot/Lorene/C++/Source/Star/star_bin_global_xcts.C,v 1.2 2014/10/13 08:53:38 j_novak Exp $" ;
27
28/*
29 * $Id: star_bin_global_xcts.C,v 1.2 2014/10/13 08:53:38 j_novak Exp $
30 * $Log: star_bin_global_xcts.C,v $
31 * Revision 1.2 2014/10/13 08:53:38 j_novak
32 * Lorene classes and functions now belong to the namespace Lorene.
33 *
34 * Revision 1.1 2010/05/04 07:51:05 m_bejger
35 * Initial version
36 *
37 * $Header: /cvsroot/Lorene/C++/Source/Star/star_bin_global_xcts.C,v 1.2 2014/10/13 08:53:38 j_novak Exp $
38 *
39 */
40
41// Headers Lorene
42#include "star.h"
43#include "utilitaires.h"
44
45 //--------------------------//
46 // Baryon mass //
47 //--------------------------//
48
49namespace Lorene {
50double Star_bin_xcts::mass_b() const {
51
52 if (p_mass_b == 0x0) { // a new computation is required
53
55
57
58 dens.std_spectral_base() ;
59
60 p_mass_b = new double( dens.integrale() ) ;
61
62 }
63
64 return *p_mass_b ;
65
66}
67
68
69
70 //----------------------------//
71 // Gravitational mass //
72 //----------------------------//
73
74double Star_bin_xcts::mass_g() const {
75
76 if (p_mass_g == 0x0) { // a new computation is required
77
79
81 * ( ener_euler + s_euler ) ;
82
83 dens.std_spectral_base() ;
84
85 p_mass_g = new double( dens.integrale() ) ;
86
87 }
88
89 return *p_mass_g ;
90
91}
92
93
94 //----------------------------------//
95 // X coordinate of the barycenter //
96 //----------------------------------//
97
98
100
101 if (p_xa_barycenter == 0x0) { // a new computation is required
102
103 Scalar xxa(mp) ;
104 xxa = mp.xa ; // Absolute X coordinate
105 xxa.std_spectral_base() ;
106
108
110
111 int nzone = mp.get_mg()->get_nzone() ;
112 dens.annule_domain(nzone - 1) ;
113
114 dens.std_spectral_base() ;
115
116 p_xa_barycenter = new double( dens.integrale() / mass_b() ) ;
117
118 }
119
120 return *p_xa_barycenter ;
121
122}
123}
Time evolution with partial storage (*** under development ***).
Definition evolution.h:371
Coord xa
Absolute x coordinate.
Definition map.h:730
const Mg3d * get_mg() const
Gives the Mg3d on which the mapping is defined.
Definition map.h:765
virtual const Scalar & determinant() const
Returns the determinant.
Definition metric.C:392
Tensor field of valence 0 (or component of a tensorial field).
Definition scalar.h:387
virtual double xa_barycenter() const
Absolute coordinate X of the barycenter of the baryon density,.
virtual double mass_g() const
Gravitational mass.
virtual double mass_b() const
Baryon mass.
double * p_xa_barycenter
Absolute coordinate X of the barycenter of the baryon density.
Definition star.h:1240
Scalar nn
Lapse function N .
Definition star.h:225
double * p_mass_b
Baryon mass.
Definition star.h:268
Scalar nbar
Baryon density in the fluid frame.
Definition star.h:192
Scalar ener_euler
Total energy density in the Eulerian frame.
Definition star.h:198
Scalar gam_euler
Lorentz factor between the fluid and Eulerian observers.
Definition star.h:204
Scalar s_euler
Trace of the stress scalar in the Eulerian frame.
Definition star.h:201
double * p_mass_g
Gravitational mass.
Definition star.h:269
Metric gamma
3-metric
Definition star.h:235
Map & mp
Mapping associated with the star.
Definition star.h:180
Cmp sqrt(const Cmp &)
Square root.
Definition cmp_math.C:220
Lorene prototypes.
Definition app_hor.h:64