LORENE
hot_star.h
1 /*
2  * Definition of Lorene class Hot_star
3  *
4  */
5 
6 /*
7  * Copyright (c) 2026 Santiago Jaraba
8  *
9  * Copyright (c) 2010 Michal Bejger (for preceding class Star)
10  * Copyright (c) 2004 Francois Limousin (for preceding class Star)
11  *
12  * Copyright (c) 2000-2001 Eric Gourgoulhon (for preceding class Etoile)
13  * Copyright (c) 2000-2001 Keisuke Taniguchi (for preceding class Etoile)
14  *
15  * This file is part of LORENE.
16  *
17  * LORENE is free software; you can redistribute it and/or modify
18  * it under the terms of the GNU General Public License as published by
19  * the Free Software Foundation; either version 2 of the License, or
20  * (at your option) any later version.
21  *
22  * LORENE is distributed in the hope that it will be useful,
23  * but WITHOUT ANY WARRANTY; without even the implied warranty of
24  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25  * GNU General Public License for more details.
26  *
27  * You should have received a copy of the GNU General Public License
28  * along with LORENE; if not, write to the Free Software
29  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
30  *
31  */
32 
33 
34 #ifndef __HOT_STAR_H_
35 #define __HOT_STAR_H_
36 
37 // Headers Lorene
38 #include "tensor.h"
39 #include "metric.h"
40 
41 namespace Lorene {
42 class Hot_eos ;
43 
44  //---------------------------//
45  // base class Hot_star //
46  //---------------------------//
47 
76 class Hot_star {
77 
78  // Data :
79  // -----
80  protected:
81  Map& mp ;
82 
84  int nzet ;
85 
86  const Hot_eos& heos ;
87 
88  // Fluid quantities with respect to the fluid frame
89  // ------------------------------------------------
90 
92 
96 
97  // Temperature and entropy
100 
101  // Fluid quantities with respect to the Eulerian frame
102  // ---------------------------------------------------
104 
107 
110 
113 
118 
119  // Metric potentials
120  // -----------------
121 
128 
131 
134 
135  // Scalar field \f$\ln Q = \ln(\psi^2 N)\f$
136  //## to be removed from base class Star
137  Scalar lnq ;
138 
141 
142 
143  // Derived data :
144  // ------------
145  protected:
147  mutable double* p_ray_eq ;
148 
150  mutable double* p_ray_eq_pis2 ;
151 
153  mutable double* p_ray_eq_pi ;
154 
156  mutable double* p_ray_eq_3pis2 ;
157 
159  mutable double* p_ray_pole ;
160 
165  mutable Itbl* p_l_surf ;
166 
171  mutable Tbl* p_xi_surf ;
172 
173  mutable double* p_mass_b ;
174  mutable double* p_mass_g ;
175 
176 
177  // Constructors - Destructor
178  // -------------------------
179  public:
180 
188  Hot_star(Map& mp_i, int nzet_i, const Hot_eos& heos_i) ;
189 
190 
191  Hot_star(const Hot_star& ) ;
192 
200  Hot_star(Map& mp_i, const Hot_eos& heos_i, FILE* fich) ;
201 
202  virtual ~Hot_star() ;
203 
204 
205  // Memory management
206  // -----------------
207  protected:
209  virtual void del_deriv() const ;
210 
212  virtual void set_der_0x0() const ;
213 
217  virtual void del_hydro_euler() ;
218 
219 
220  // Mutators / assignment
221  // ---------------------
222  public:
224  void operator=(const Hot_star&) ;
225 
227  Map& set_mp() {return mp; } ;
228 
230  void set_enthalpy(const Scalar& ) ;
231 
235  void equation_of_state() ;
236 
241  virtual void hydro_euler() ;
242 
253  virtual void equilibrium_spher(double ent_c, double precis = 1.e-14,
254  const Tbl* pent_limit = 0x0 ) ;
255 
256  // Accessors
257  // ---------
258  public:
260  const Map& get_mp() const {return mp; } ;
261 
263  int get_nzet() const {return nzet; } ;
264 
266  const Hot_eos& get_eos() const {return heos; } ;
267 
269  const Scalar& get_ent() const {return ent;} ;
270 
272  const Scalar& get_entropy() const {return ent;} ;
273 
275  const Scalar& get_nbar() const {return nbar;} ;
276 
278  const Scalar& get_ener() const {return ener;} ;
279 
281  const Scalar& get_press() const {return press;} ;
282 
284  const Scalar& get_temp() const {return temp;} ;
285 
287  const Scalar& get_ener_euler() const {return ener_euler;} ;
288 
290  const Scalar& get_s_euler() const {return s_euler;} ;
291 
293  const Scalar& get_gam_euler() const {return gam_euler;} ;
294 
296  const Vector& get_u_euler() const {return u_euler;} ;
297 
301  const Tensor& get_stress_euler() const {return stress_euler;} ;
302 
307  const Scalar& get_logn() const {return logn;} ;
308 
310  const Scalar& get_nn() const {return nn;} ;
311 
313  const Vector& get_beta() const {return beta;} ;
314 
315  // Returns the scalar field \f$\ln Q\f$.
316  //## to be removed from base class Star
317  const Scalar& get_lnq() const {return lnq;} ;
318 
320  const Metric& get_gamma() const {return gamma;} ;
321 
322  // Outputs
323  // -------
324  public:
325  virtual void sauve(FILE* ) const ;
326 
328  friend ostream& operator<<(ostream& , const Hot_star& ) ;
329 
330  protected:
332  virtual ostream& operator>>(ostream& ) const ;
333 
334  // Global quantities
335  // -----------------
336  public:
338  double ray_eq() const ;
339 
341  double ray_eq_pis2() const ;
342 
344  double ray_eq_pi() const ;
345 
347  double ray_eq_3pis2() const ;
348 
350  double ray_pole() const ;
351 
359  virtual const Itbl& l_surf() const ;
360 
368  const Tbl& xi_surf() const ;
369 
371  virtual double mass_b() const = 0 ;
372 
374  virtual double mass_g() const = 0 ;
375 
376 };
377 ostream& operator<<(ostream& , const Hot_star& ) ;
378 
379 
380  //---------------------------//
381  // class Star_bin //
382  //---------------------------//
383 
394 class Star_bin : public Hot_star {
395 
396  // Data :
397  // -----
398  protected:
402  bool irrotational ;
403 
408 
413 
419 
424 
430 
433 
434 
439 
444 
447 
450 
455 
460 
461 
464 
469 
474 
477 
482 
487 
488 
493 
494 
500 
506 
512 
518 
524 
530 
535 
540 
546 
547  Vector ssjm1_wbeta ;
548 
553 
558 
563 
568 
573 
578 
588 
592  bool conf_flat ;
593 
594  // Derived data :
595  // ------------
596  protected:
598  mutable double* p_xa_barycenter ;
599 
600 };
601 
602 }
603 #endif
Sym_tensor hij_comp
Deviation of the inverse conformal metric from the inverse flat metric generated principally by the ...
Definition: hot_star.h:505
const Scalar & get_ener() const
Returns the proper total energy density.
Definition: hot_star.h:278
Vector dcov_phi
Covariant derivative of the logarithm of the conformal factor.
Definition: hot_star.h:466
const Scalar & get_nbar() const
Returns the proper baryon density.
Definition: hot_star.h:275
const Scalar & get_ent() const
Returns the enthalpy field.
Definition: hot_star.h:269
bool irrotational
true for an irrotational star, false for a corotating one
Definition: hot_star.h:402
Metric for tensor calculation.
Definition: metric.h:90
virtual double mass_b() const =0
Baryon mass.
Metric gamma
3-metric
Definition: hot_star.h:140
const Vector & get_u_euler() const
Returns the fluid 3-velocity with respect to the Eulerian observer.
Definition: hot_star.h:296
Scalar temp
Temperature field (in MeV)
Definition: hot_star.h:98
Scalar nbar
Baryon density in the fluid frame.
Definition: hot_star.h:93
Scalar psi0
Scalar potential of the non-translational part of fluid 4-velocity (in the irrotational case) ...
Definition: hot_star.h:407
Vector wit_w
Spatial projection of the fluid 3-velocity with respect to the co-orbiting observer.
Definition: hot_star.h:418
Scalar ssjm1_lnq
Effective source at the previous step for the resolution of the Poisson equation for lnq_auto...
Definition: hot_star.h:539
Sym_tensor hij_auto
Deviation of the inverse conformal metric from the inverse flat metric generated principally by the ...
Definition: hot_star.h:499
double * p_ray_pole
Coordinate radius at .
Definition: hot_star.h:159
double * p_mass_g
Gravitational mass.
Definition: hot_star.h:174
Vector d_psi
Gradient of (in the irrotational case) (Spherical components with respect to the mapping of the star...
Definition: hot_star.h:412
Scalar ssjm1_h31
Effective source at the previous step for the resolution of the Poisson equation for h20_auto...
Definition: hot_star.h:562
Lorene prototypes.
Definition: app_hor.h:67
Scalar ssjm1_h11
Effective source at the previous step for the resolution of the Poisson equation for h00_auto...
Definition: hot_star.h:552
int get_nzet() const
Returns the number of domains occupied by the star.
Definition: hot_star.h:263
Base class for hot stars.
Definition: hot_star.h:76
Flat metric for tensor calculation.
Definition: metric.h:261
Tensor field of valence 0 (or component of a tensorial field).
Definition: scalar.h:402
Scalar ener_euler
Total energy density in the Eulerian frame.
Definition: hot_star.h:103
Base class for coordinate mappings.
Definition: map.h:696
void equation_of_state()
Computes the proper baryon and energy density, as well as pressure from the enthalpy.
Definition: hot_star.C:489
Scalar ssjm1_h33
Effective source at the previous step for the resolution of the Poisson equation for h22_auto...
Definition: hot_star.h:577
Scalar logn_comp
Part of the lapse logarithm (gravitational potential at the Newtonian limit) generated principally by...
Definition: hot_star.h:443
Basic integer array class.
Definition: itbl.h:122
Scalar loggam
Logarithm of the Lorentz factor between the fluid and the co-orbiting observer.
Definition: hot_star.h:423
Scalar kcar_auto
Part of the scalar generated by beta_auto, i.e.
Definition: hot_star.h:523
double ray_eq_pi() const
Coordinate radius at , [r_unit].
Scalar entropy
Entropy per baryon field (in $k_B$)
Definition: hot_star.h:99
virtual const Itbl & l_surf() const
Description of the stellar surface: returns a 2-D Itbl containing the values of the domain index l on...
Scalar nn
Lapse function N .
Definition: hot_star.h:130
void set_enthalpy(const Scalar &)
Assignment of the enthalpy field.
Definition: hot_star.C:397
Tensor field of valence 1.
Definition: vector.h:188
const Scalar & get_gam_euler() const
Returns the Lorentz factor between the fluid and Eulerian observers.
Definition: hot_star.h:293
Scalar logn_auto
Part of the lapse logarithm (gravitational potential at the Newtonian limit) generated principally by...
Definition: hot_star.h:438
Scalar ssjm1_h21
Effective source at the previous step for the resolution of the Poisson equation for h10_auto...
Definition: hot_star.h:557
Scalar logn
Logarithm of the lapse N .
Definition: hot_star.h:127
const Scalar & get_temp() const
Returns the fluid temperature.
Definition: hot_star.h:284
double ray_eq_pis2() const
Coordinate radius at , [r_unit].
double ray_eq() const
Coordinate radius at , [r_unit].
int nzet
Number of domains of *mp occupied by the star.
Definition: hot_star.h:84
Scalar decouple
Function used to construct the part generated by the star from the total .
Definition: hot_star.h:587
virtual void sauve(FILE *) const
Save in a file.
Definition: hot_star.C:415
Sym_tensor hij
Total deviation of the inverse conformal metric from the inverse flat metric.
Definition: hot_star.h:492
const Scalar & get_nn() const
Returns the lapse function N.
Definition: hot_star.h:310
Itbl * p_l_surf
Description of the stellar surface: 2-D Itbl containing the values of the domain index l on the surfa...
Definition: hot_star.h:165
double * p_ray_eq_pis2
Coordinate radius at , .
Definition: hot_star.h:150
Scalar pot_centri
Centrifugal potential.
Definition: hot_star.h:432
Tbl * p_xi_surf
Description of the stellar surface: 2-D Tbl containing the values of the radial coordinate on the su...
Definition: hot_star.h:171
const Scalar & get_ener_euler() const
Returns the total energy density with respect to the Eulerian observer.
Definition: hot_star.h:287
double * p_xa_barycenter
Absolute coordinate X of the barycenter of the baryon density.
Definition: hot_star.h:598
Metric_flat flat
Flat metric defined on the mapping (Spherical components with respect to the mapping of the star) ...
Definition: hot_star.h:473
Scalar lnq_auto
Scalar field generated principally by the star.
Definition: hot_star.h:454
const Map & get_mp() const
Returns the mapping.
Definition: hot_star.h:260
Scalar lnq_comp
Scalar field generated principally by the companion star.
Definition: hot_star.h:459
const Hot_eos & get_eos() const
Returns the equation of state.
Definition: hot_star.h:266
double * p_mass_b
Baryon mass.
Definition: hot_star.h:173
Scalar gam_euler
Lorentz factor between the fluid and Eulerian observers.
Definition: hot_star.h:109
Scalar ener
Total energy density in the fluid frame.
Definition: hot_star.h:94
Scalar ent
Log-enthalpy.
Definition: hot_star.h:91
Map & mp
Mapping associated with the star.
Definition: hot_star.h:81
Sym_tensor tkij_comp
Part of the extrinsic curvature tensor generated by beta_comp.
Definition: hot_star.h:517
Tensor handling.
Definition: tensor.h:300
Vector dcov_logn
Covariant derivative of the total logarithm of the lapse.
Definition: hot_star.h:446
Class for stars in binary system.
Definition: hot_star.h:394
const Vector & get_beta() const
Returns the shift vector .
Definition: hot_star.h:313
const Metric & get_gamma() const
Returns the 3-metric .
Definition: hot_star.h:320
void operator=(const Hot_star &)
Assignment to another Hot_star.
Definition: hot_star.C:367
const Scalar & get_entropy() const
Returns the entropy field.
Definition: hot_star.h:272
Metric gtilde
Conformal metric .
Definition: hot_star.h:476
Map & set_mp()
Read/write of the mapping.
Definition: hot_star.h:227
Vector dcon_logn
Contravariant derivative of the total logarithm of the lapse.
Definition: hot_star.h:449
virtual void del_hydro_euler()
Sets to ETATNONDEF (undefined state) the hydrodynamical quantities relative to the Eulerian observer...
Definition: hot_star.C:346
double * p_ray_eq_pi
Coordinate radius at , .
Definition: hot_star.h:153
const Hot_eos & heos
Equation of state of the stellar matter.
Definition: hot_star.h:86
Base class for 2-parameters equations of state (abstract class).
Definition: hoteos.h:85
virtual void hydro_euler()
Computes the hydrodynamical quantities relative to the Eulerian observer from those in the fluid fram...
Definition: hot_star.C:570
Hot_star(Map &mp_i, int nzet_i, const Hot_eos &heos_i)
Standard constructor.
Definition: hot_star.C:130
Scalar ssjm1_h22
Effective source at the previous step for the resolution of the Poisson equation for h11_auto...
Definition: hot_star.h:567
Vector beta_comp
Part of the shift vector generated principally by the star (Spherical components with respect to the ...
Definition: hot_star.h:486
const Scalar & get_logn() const
Returns the logarithm of the lapse N.
Definition: hot_star.h:307
double * p_ray_eq_3pis2
Coordinate radius at , .
Definition: hot_star.h:156
const Tensor & get_stress_euler() const
Returns the spatial part of the stress-energy tensor with respect to the Eulerian observer...
Definition: hot_star.h:301
Sym_tensor tkij_auto
Part of the extrinsic curvature tensor generated by beta_auto.
Definition: hot_star.h:511
bool conf_flat
true if the 3-metric is conformally flat, false for a more general metric.
Definition: hot_star.h:592
Scalar ssjm1_h32
Effective source at the previous step for the resolution of the Poisson equation for h21_auto...
Definition: hot_star.h:572
friend ostream & operator<<(ostream &, const Hot_star &)
Display.
Definition: hot_star.C:431
Vector beta_auto
Part of the shift vector generated principally by the star (Spherical components with respect to the ...
Definition: hot_star.h:481
Sym_tensor stress_euler
Spatial part of the stress-energy tensor with respect to the Eulerian observer.
Definition: hot_star.h:117
Scalar kcar_comp
Part of the scalar generated by beta_auto and beta_comp, i.e.
Definition: hot_star.h:529
Scalar s_euler
Trace of the stress scalar in the Eulerian frame.
Definition: hot_star.h:106
const Scalar & get_s_euler() const
Returns the trace of the stress tensor in the Eulerian frame.
Definition: hot_star.h:290
virtual double mass_g() const =0
Gravitational mass.
double ray_eq_3pis2() const
Coordinate radius at , [r_unit].
virtual void set_der_0x0() const
Sets to 0x0 all the pointers on derived quantities.
Definition: hot_star.C:332
Basic array class.
Definition: tbl.h:164
Scalar ssjm1_khi
Effective source at the previous step for the resolution of the Poisson equation for khi...
Definition: hot_star.h:545
virtual ostream & operator>>(ostream &) const
Operator >> (virtual function called by the operator <<).
Definition: hot_star.C:436
virtual ~Hot_star()
Destructor.
Definition: hot_star.C:303
double ray_pole() const
Coordinate radius at [r_unit].
double * p_ray_eq
Coordinate radius at , .
Definition: hot_star.h:147
Scalar press
Fluid pressure.
Definition: hot_star.h:95
const Tbl & xi_surf() const
Description of the stellar surface: returns a 2-D Tbl containing the values of the radial coordinate ...
Vector bsn
3-vector shift, divided by N, of the rotating coordinates, .
Definition: hot_star.h:429
virtual void equilibrium_spher(double ent_c, double precis=1.e-14, const Tbl *pent_limit=0x0)
Computes a spherical static configuration.
Vector beta
Shift vector.
Definition: hot_star.h:133
Scalar psi4
Conformal factor .
Definition: hot_star.h:463
Class intended to describe valence-2 symmetric tensors.
Definition: sym_tensor.h:226
virtual void del_deriv() const
Deletes all the derived quantities.
Definition: hot_star.C:314
Vector dcon_phi
Contravariant derivative of the logarithm of the conformal factor.
Definition: hot_star.h:468
const Scalar & get_press() const
Returns the fluid pressure.
Definition: hot_star.h:281
Vector u_euler
Fluid 3-velocity with respect to the Eulerian observer.
Definition: hot_star.h:112
Scalar ssjm1_logn
Effective source at the previous step for the resolution of the Poisson equation for logn_auto...
Definition: hot_star.h:534