116 #include "hot_star.h" 118 #include "utilitaires.h" 143 u_euler(mpi, CON, mp.get_bvect_spher()),
144 stress_euler(mpi, CON, mp.get_bvect_spher()),
147 beta(mpi, CON, mp.get_bvect_spher()),
149 gamma(mp.flat_met_spher()){
218 ener_euler(et.ener_euler),
220 gam_euler(et.gam_euler),
222 stress_euler(et.stress_euler),
247 u_euler(mpi, CON, mp.get_bvect_spher()),
248 stress_euler(mpi, CON, mp.get_bvect_spher()),
249 logn(mpi, *(mpi.get_mg()), fich),
251 beta(mpi, CON, mp.get_bvect_spher()),
252 lnq(mpi, *(mpi.get_mg()), fich),
253 gamma(mpi.flat_met_spher()){
260 fread_be(&xx,
sizeof(
int), 1, fich) ;
270 if (
heos != *p_heos_file) {
272 "Hot_star::Hot_star(const Map&, const Hot_eos&, FILE*) : the hot EOS given in " 274 " argument and that read in the file are different !" << endl ;
369 assert( &(et.
mp) == &
mp ) ;
431 ostream& operator<<(ostream& ost,
const Hot_star& et) {
442 ost <<
"Number of domains occupied by the star : " <<
nzet << endl ;
444 ost <<
"Equation of state : " << endl ;
445 ost <<
heos << endl ;
447 ost << endl <<
"Central enthalpy : " <<
ent.
val_grid_point(0,0,0,0) <<
" c^2" << endl ;
449 <<
" x 0.1 fm^-3" << endl ;
451 <<
" rho_nuc c^2" << endl ;
453 <<
" rho_nuc c^2" << endl ;
459 <<
" M_sol" << endl ;
468 <<
"Coordinate equatorial radius (phi=0) a1 = " 469 <<
ray_eq()/km <<
" km" << endl ;
470 ost <<
"Coordinate equatorial radius (phi=pi/2) a2 = " 472 ost <<
"Coordinate equatorial radius (phi=pi): " 474 ost <<
"Coordinate polar radius a3 = " 478 ost << endl <<
"Baryon mass : " <<
mass_b() / msol <<
" M_sol" << endl ;
479 ost <<
"Gravitational mass : " <<
mass_g() / msol <<
" M_sol" << endl ;
498 double epsilon = 1.e-12 ;
504 for (
int l=0; l<nz; l++) {
506 for (
int k=0; k<mg->
get_np(l); k++) {
507 for (
int j=0; j<mg->
get_nt(l); j++) {
508 for (
int i=0; i<mg->
get_nr(l); i++) {
520 fact_ent.
set_domain(0) = 1 + epsilon * xi(0) * xi(0) ;
521 fact_ent.
set_domain(1) = 1 - 0.25 * epsilon * (xi(1) - 1) * (xi(1) - 1) ;
523 for (
int l=
nzet; l<nz; l++) {
530 fact_ent.
set_domain(1) = 1 - 0.5 * epsilon * (xi(1) - 0.5) * (xi(1) - 0.5) ;
531 fact_ent.
set_domain(2) = 1 - 0.25 * epsilon * (xi(2) - 1) * (xi(2) - 1) ;
536 cout <<
"Hot_star::equation_of_state: not ready yet for nzet > 3 !" 540 ent_eos = fact_ent * ent_eos ;
573 "Hot_star::hydro_euler : hydro_euler must be called via a derived class" 574 << endl <<
" of Hot_star !" << endl ;
Metric for tensor calculation.
virtual double mass_b() const =0
Baryon mass.
const Grille3d * get_grille3d(int l) const
Returns a pointer on the 3D mono-grid for domain no. l.
Scalar temp
Temperature field (in MeV)
Scalar nbar
Baryon density in the fluid frame.
int get_np(int l) const
Returns the number of points in the azimuthal direction ( ) in domain no. l.
double * p_ray_pole
Coordinate radius at .
double * p_mass_g
Gravitational mass.
Standard units of space, time and mass.
const Mg3d * get_mg() const
Gives the Mg3d on which the mapping is defined.
Base class for hot stars.
Tensor field of valence 0 (or component of a tensorial field).
virtual void set_etat_nondef()
Sets the logical state of all components to ETATNONDEF (undefined state).
Scalar ener_euler
Total energy density in the Eulerian frame.
Base class for coordinate mappings.
void equation_of_state()
Computes the proper baryon and energy density, as well as pressure from the enthalpy.
virtual void std_spectral_base()
Sets the spectral bases of the Valeur va to the standard ones for a scalar field. ...
double ray_eq_pi() const
Coordinate radius at , [r_unit].
Scalar entropy
Entropy per baryon field (in $k_B$)
virtual void allocate_all()
Sets the logical state to ETATQCQ (ordinary state) and performs the memory allocation of all the elem...
virtual void set_etat_nondef()
Sets the logical state to ETATNONDEF (undefined).
double * x
Array of values of at the nr collocation points.
virtual void set_etat_qcq()
Sets the logical state to ETATQCQ (ordinary state).
Scalar nn
Lapse function N .
void set_enthalpy(const Scalar &)
Assignment of the enthalpy field.
Tbl & set_domain(int l)
Read/write of the value in a given domain.
Scalar press_Hs(const Scalar &ent, const Scalar &sb, int nzet, int l_min=0) const
Computes the pressure from the log-enthalpy and entropy per baryon.
Scalar temp_Hs(const Scalar &ent, const Scalar &sb, int nzet, int l_min=0) const
Computes the temperature field from the log-enthalpy field and entropy per baryon.
Scalar ener_Hs(const Scalar &ent, const Scalar &sb, int nzet, int l_min=0) const
Computes the total energy density from the log-enthalpy and entropy per baryon.
double val_grid_point(int l, int k, int j, int i) const
Returns the value of the field at a specified grid point.
Scalar logn
Logarithm of the lapse N .
void set_etat_qcq()
Sets the logical state to ETATQCQ (ordinary state).
double ray_eq_pis2() const
Coordinate radius at , [r_unit].
double ray_eq() const
Coordinate radius at , [r_unit].
virtual void sauve(FILE *) const
Save in a file.
int nzet
Number of domains of *mp occupied by the star.
virtual void sauve(FILE *) const
Save in a file.
Itbl * p_l_surf
Description of the stellar surface: 2-D Itbl containing the values of the domain index l on the surfa...
double * p_ray_eq_pis2
Coordinate radius at , .
Tbl * p_xi_surf
Description of the stellar surface: 2-D Tbl containing the values of the radial coordinate on the su...
int get_nzone() const
Returns the number of domains.
double * p_mass_b
Baryon mass.
Scalar gam_euler
Lorentz factor between the fluid and Eulerian observers.
Scalar ener
Total energy density in the fluid frame.
Map & mp
Mapping associated with the star.
Scalar nbar_Hs(const Scalar &ent, const Scalar &sb, int nzet, int l_min=0) const
Computes the baryon density field from the log-enthalpy field and entropy per baryon.
int fwrite_be(const int *aa, int size, int nb, FILE *fich)
Writes integer(s) into a binary file according to the big endian convention.
void set_etat_qcq()
Sets the logical state to ETATQCQ (ordinary state).
Tbl & set(int l)
Read/write of the Tbl in a given domain.
void operator=(const Hot_star &)
Assignment to another Hot_star.
virtual void del_hydro_euler()
Sets to ETATNONDEF (undefined state) the hydrodynamical quantities relative to the Eulerian observer...
int fread_be(int *aa, int size, int nb, FILE *fich)
Reads integer(s) from a binary file according to the big endian convention.
double * p_ray_eq_pi
Coordinate radius at , .
int get_nr(int l) const
Returns the number of points in the radial direction ( ) in domain no. l.
virtual const Sym_tensor & cov() const
Read-only access to the covariant representation.
const Hot_eos & heos
Equation of state of the stellar matter.
Base class for 2-parameters equations of state (abstract class).
virtual void hydro_euler()
Computes the hydrodynamical quantities relative to the Eulerian observer from those in the fluid fram...
Hot_star(Map &mp_i, int nzet_i, const Hot_eos &heos_i)
Standard constructor.
double * p_ray_eq_3pis2
Coordinate radius at , .
virtual void sauve(FILE *) const
Save in a file.
static Hot_eos * hoteos_from_file(FILE *)
Construction of an EOS from a binary file.
Sym_tensor stress_euler
Spatial part of the stress-energy tensor with respect to the Eulerian observer.
Scalar s_euler
Trace of the stress scalar in the Eulerian frame.
virtual double mass_g() const =0
Gravitational mass.
virtual void set_etat_zero()
Sets the logical state of all components to ETATZERO (zero state).
virtual void set_der_0x0() const
Sets to 0x0 all the pointers on derived quantities.
int get_nt(int l) const
Returns the number of points in the co-latitude direction ( ) in domain no. l.
virtual ostream & operator>>(ostream &) const
Operator >> (virtual function called by the operator <<).
virtual ~Hot_star()
Destructor.
double ray_pole() const
Coordinate radius at [r_unit].
Tbl ** t
Array (size nzone ) of pointers on the Tbl 's.
double * p_ray_eq
Coordinate radius at , .
Scalar press
Fluid pressure.
const Metric_flat & flat_met_spher() const
Returns the flat metric associated with the spherical coordinates and with components expressed in th...
virtual void del_deriv() const
Deletes all the derived quantities.
Vector u_euler
Fluid 3-velocity with respect to the Eulerian observer.