LORENE
Lorene::Hoteos_tabul Class Reference

Hot (temperature-dependent) tabulated equation of state, read from a file. More...

#include <hoteos.h>

Inheritance diagram for Lorene::Hoteos_tabul:
Lorene::Hot_eos

Public Member Functions

 Hoteos_tabul (const string &filename)
 Standard constructor from a filename.
 
 Hoteos_tabul (const Hoteos_tabul &)
 Copy constructor.
 
virtual ~Hoteos_tabul ()
 Destructor.
 
void operator= (const Hoteos_tabul &)
 Assignment to another Hoteos_tabul.
 
virtual bool operator== (const Hot_eos &) const
 Comparison operator (egality)
 
virtual bool operator!= (const Hot_eos &) const
 Comparison operator (difference)
 
virtual int identify () const
 Returns a number to identify the sub-classe of Hot_eos the object belongs to.
 
virtual const Eosnew_cold_Eos () const
 Returns the corresponding cold Eos.
 
virtual void sauve (FILE *) const
 Save in a file.
 
virtual double nbar_Hs_p (double ent, double sb) const
 Computes the baryon density from the log-enthalpy and entropy per baryon (virtual function implemented in the derived classes).
 
virtual double ener_Hs_p (double ent, double sb) const
 Computes the total energy density from the log-enthalpy and entropy per baryon (virtual function implemented in the derived classes).
 
virtual double press_Hs_p (double ent, double sb) const
 Computes the pressure from the log-enthalpy and entropy per baryon (virtual function implemented in the derived classes).
 
virtual double temp_Hs_p (double ent, double sb) const
 Computes the temperature from the log-enthalpy and entropy per baryon (virtual function implemented in the derived classes).
 
const stringget_name () const
 Returns the hot EOS name.
 
void set_name (const char *)
 Sets the hot EOS name.
 
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.
 
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.
 
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.
 

Static Public Member Functions

static Hot_eoshoteos_from_file (FILE *)
 Construction of an EOS from a binary file.
 
static Hot_eoshoteos_from_file (ifstream &)
 Construction of a hot EOS from a formatted file.
 

Protected Member Functions

 Hoteos_tabul (FILE *)
 Constructor from a binary file (created by the function sauve(FILE*) ).
 
 Hoteos_tabul (ifstream &)
 Constructor from a formatted file.
 
void read_table ()
 Reads the file containing the table and initializes in the arrays hhh , s_B, ppp, ...
 
void set_arrays_0x0 ()
 Sets all the arrays to the null pointer.
 
virtual ostreamoperator>> (ostream &) const
 Operator >>
 
virtual void del_deriv () const
 Deletes all the derived quantities.
 
void set_der_0x0 () const
 Sets to 0x0 all the pointers on derived quantities.
 
void calcule (const Scalar &thermo1, const Scalar &thermo2, int nzet, int l_min, double(Hot_eos::*fait)(double, double) const, Scalar &resu) const
 General computational method for Scalar 's.
 

Protected Attributes

string tablename
 Name of the file containing the tabulated data.
 
string authors
 Authors - reference for the table.
 
double hmin
 Lower boundary of the enthalpy interval.
 
double hmax
 Upper boundary of the enthalpy interval.
 
double sbmin
 Lower boundary of the entropy interval.
 
double sbmax
 Upper boundary of the entropy interval.
 
Tblhhh
 Table of $H = \log ( e + P ) / n_B$.
 
Tbls_B
 Table of $s_B$, entropy per baryon (in units of Boltzmann constant).
 
Tblppp
 Table of pressure $P$.
 
Tbldpdh
 Table of $\partial P/\partial H$.
 
Tbldpds
 Table of $\partial P/\partial s_B$.
 
Tbld2p
 Table of $\partial^2 P/\partial s_B \partial H$.
 
string name
 EOS name.
 
Eosp_cold_eos
 Corresponding cold Eos.
 

Friends

Hot_eosHot_eos::hoteos_from_file (FILE *)
 The construction functions from a file.
 
Hot_eosHot_eos::hoteos_from_file (ifstream &)
 

Detailed Description

Hot (temperature-dependent) tabulated equation of state, read from a file.

()

Definition at line 549 of file hoteos.h.

Constructor & Destructor Documentation

◆ Hoteos_tabul() [1/4]

Lorene::Hoteos_tabul::Hoteos_tabul ( const string filename)

Standard constructor from a filename.

Definition at line 70 of file hoteos_tabul.C.

References read_table(), and set_arrays_0x0().

◆ Hoteos_tabul() [2/4]

Lorene::Hoteos_tabul::Hoteos_tabul ( const Hoteos_tabul )

Copy constructor.

◆ Hoteos_tabul() [3/4]

Lorene::Hoteos_tabul::Hoteos_tabul ( FILE fich)
protected

Constructor from a binary file (created by the function sauve(FILE*) ).

This constructor is protected because any hot EOS construction from a binary file must be done via the function Hot_eos::eos_from_file(FILE*) .

Definition at line 81 of file hoteos_tabul.C.

References read_table(), set_arrays_0x0(), and tablename.

◆ Hoteos_tabul() [4/4]

Lorene::Hoteos_tabul::Hoteos_tabul ( ifstream fich)
protected

Constructor from a formatted file.

This constructor is protected because any EOS construction from a formatted file must be done via the function Hot_eos::hoteos_from_file(ifstream&) .

Definition at line 92 of file hoteos_tabul.C.

References read_table(), set_arrays_0x0(), and tablename.

◆ ~Hoteos_tabul()

Lorene::Hoteos_tabul::~Hoteos_tabul ( )
virtual

Destructor.

Definition at line 114 of file hoteos_tabul.C.

References d2p, dpdh, dpds, hhh, ppp, and s_B.

Member Function Documentation

◆ calcule()

void Lorene::Hot_eos::calcule ( const Scalar thermo1,
const Scalar thermo2,
int  nzet,
int  l_min,
double(Hot_eos::*)(double, double) const  fait,
Scalar resu 
) const
protectedinherited

General computational method for Scalar 's.

Parameters
thermo1[input] first thermodynamical quantity (for instance the enthalpy field) from which the thermodynamical quantity resu
is to be computed.
thermo2[input] second thermodynamical quantity (for instance the entropy field) from which the thermodynamical quantity resu
is to be computed.
nzet[input] number of domains where resu is to be computed.
l_min[input] index of the innermost domain is which resu is to be computed [default value: 0]; resu is computed only in domains whose indices are in [l_min,l_min+nzet-1] . In the other domains, it is set to zero.
fait[input] pointer on the member function of class Hot_eos which performs the pointwise calculation.
resu[output] result of the computation.

Definition at line 153 of file hoteos.C.

◆ del_deriv()

void Lorene::Hot_eos::del_deriv ( ) const
protectedvirtualinherited

Deletes all the derived quantities.

Definition at line 109 of file hoteos.C.

References Lorene::Hot_eos::p_cold_eos, and Lorene::Hot_eos::set_der_0x0().

◆ ener_Hs()

Scalar Lorene::Hot_eos::ener_Hs ( const Scalar ent,
const Scalar sb,
int  nzet,
int  l_min = 0 
) const
inherited

Computes the total energy density from the log-enthalpy and entropy per baryon.

Parameters
ent[input, unit: $c^2$] log-enthalpy H defined by $H = c^2 \ln\left( {e+p \over m_B c^2 n} \right) $, where e is the (total) energy density, p the pressure, n the baryon density, and $m_B$ the baryon mass
sb[input, unit: $k_B$] entropy per baryon $s_b$
nzetnumber of domains where the energy density is to be computed.
l_minindex of the innermost domain is which the energy density is to be computed [default value: 0]; the energy density is computed only in domains whose indices are in [l_min,l_min+nzet-1] . In the other domains, it is set to zero.
Returns
energy density [unit: $\rho_{\rm nuc} c^2$], where $\rho_{\rm nuc} := 1.66\ 10^{17} \ {\rm kg/m}^3$

Definition at line 252 of file hoteos.C.

References Lorene::Tensor::get_mp().

◆ ener_Hs_p()

double Lorene::Hoteos_tabul::ener_Hs_p ( double  ent,
double  sb 
) const
virtual

Computes the total energy density from the log-enthalpy and entropy per baryon (virtual function implemented in the derived classes).

Parameters
ent[input, unit: $c^2$] log-enthalpy H defined by $H = c^2 \ln\left( {e+p \over m_B c^2 n} \right) $, where e is the (total) energy density, p the pressure, n the baryon density, and $m_B$ the baryon mass
sb[input, unit: $k_B$] entropy per baryon $s_b$
Returns
energy density e [unit: $\rho_{\rm nuc} c^2$], where $\rho_{\rm nuc} := 1.66\ 10^{17} \ {\rm kg/m}^3$

Implements Lorene::Hot_eos.

Definition at line 330 of file hoteos_tabul.C.

References d2p, dpdh, dpds, Lorene::exp(), hhh, hmax, hmin, ppp, s_B, sbmax, and sbmin.

◆ get_name()

const string & Lorene::Hot_eos::get_name ( ) const
inlineinherited

Returns the hot EOS name.

Definition at line 120 of file hoteos.h.

References Lorene::Hot_eos::name.

◆ hoteos_from_file() [1/2]

Hot_eos * Lorene::Hot_eos::hoteos_from_file ( FILE fich)
staticinherited

Construction of an EOS from a binary file.

The file must have been created by the function sauve(FILE*) .

Definition at line 67 of file hoteos_from_file.C.

References Lorene::fread_be().

◆ hoteos_from_file() [2/2]

Hot_eos * Lorene::Hot_eos::hoteos_from_file ( ifstream fich)
staticinherited

Construction of a hot EOS from a formatted file.

The fist line of the file must start by the EOS number, according to the following conventions:

  • 1 = relativistic ideal gas (class Ideal_gas ).
  • 2 = non-relativistic ideal gas (class Ideal_gas_norel ).

The second line in the file should contain a name given by the user to the EOS. The following lines should contain the EOS parameters (one parameter per line), in the same order than in the class declaration.

Definition at line 104 of file hoteos_from_file.C.

◆ identify()

int Lorene::Hoteos_tabul::identify ( ) const
virtual

Returns a number to identify the sub-classe of Hot_eos the object belongs to.

Implements Lorene::Hot_eos.

Definition at line 60 of file hoteos_from_file.C.

◆ nbar_Hs()

Scalar Lorene::Hot_eos::nbar_Hs ( const Scalar ent,
const Scalar sb,
int  nzet,
int  l_min = 0 
) const
inherited

Computes the baryon density field from the log-enthalpy field and entropy per baryon.

Parameters
ent[input, unit: $c^2$] log-enthalpy H defined by $H = c^2 \ln\left( {e+p \over m_B c^2 n} \right) $, where e is the (total) energy density, p the pressure, n the baryon density, and $m_B$ the baryon mass
sb[input, unit: $k_B$] entropy per baryon $s_b$
nzetnumber of domains where the baryon density is to be computed.
l_minindex of the innermost domain is which the baryon density is to be computed [default value: 0]; the baryon density is computed only in domains whose indices are in [l_min,l_min+nzet-1] . In the other domains, it is set to zero.
Returns
baryon density [unit: $n_{\rm nuc} := 0.1 \ {\rm fm}^{-3}$]

Definition at line 236 of file hoteos.C.

References Lorene::Tensor::get_mp().

◆ nbar_Hs_p()

double Lorene::Hoteos_tabul::nbar_Hs_p ( double  ent,
double  sb 
) const
virtual

Computes the baryon density from the log-enthalpy and entropy per baryon (virtual function implemented in the derived classes).

Parameters
ent[input, unit: $c^2$] log-enthalpy H defined by $H = c^2 \ln\left( {e+p \over m_B c^2 n} (to be modified) \right) $, where e is the (total) energy density, p the pressure, n the baryon density, and $m_B$ the baryon mass
sb[input, unit: $k_B$] entropy per baryon $s_b$
Returns
baryon density [unit: $n_{\rm nuc} := 0.1 \ {\rm fm}^{-3}$]

Implements Lorene::Hot_eos.

Definition at line 294 of file hoteos_tabul.C.

References d2p, dpdh, dpds, Lorene::exp(), hhh, hmax, hmin, ppp, s_B, sbmax, and sbmin.

◆ new_cold_Eos()

const Eos & Lorene::Hoteos_tabul::new_cold_Eos ( ) const
virtual

Returns the corresponding cold Eos.

Implements Lorene::Hot_eos.

Definition at line 252 of file hoteos_tabul.C.

References Lorene::Hot_eos::p_cold_eos, and tablename.

◆ operator!=()

bool Lorene::Hoteos_tabul::operator!= ( const Hot_eos eos_i) const
virtual

Comparison operator (difference)

Implements Lorene::Hot_eos.

Definition at line 282 of file hoteos_tabul.C.

References operator==().

◆ operator=()

void Lorene::Hoteos_tabul::operator= ( const Hoteos_tabul )

Assignment to another Hoteos_tabul.

◆ operator==()

bool Lorene::Hoteos_tabul::operator== ( const Hot_eos eos_i) const
virtual

Comparison operator (egality)

Implements Lorene::Hot_eos.

Definition at line 269 of file hoteos_tabul.C.

References identify(), and Lorene::Hot_eos::identify().

◆ operator>>()

ostream & Lorene::Hoteos_tabul::operator>> ( ostream ost) const
protectedvirtual

Operator >>

Implements Lorene::Hot_eos.

Definition at line 136 of file hoteos_tabul.C.

References authors, Lorene::Tbl::get_dim(), hhh, and tablename.

◆ press_Hs()

Scalar Lorene::Hot_eos::press_Hs ( const Scalar ent,
const Scalar sb,
int  nzet,
int  l_min = 0 
) const
inherited

Computes the pressure from the log-enthalpy and entropy per baryon.

Parameters
ent[input, unit: $c^2$] log-enthalpy H defined by $H = c^2 \ln\left( {e+p \over m_B c^2 n} \right) $, where e is the (total) energy density, p the pressure, n the baryon density, and $m_B$ the baryon mass
sb[input, unit: $k_B$] entropy per baryon $s_b$
nzetnumber of domains where the pressure is to be computed.
l_minindex of the innermost domain is which the pressure is to be computed [default value: 0]; the pressure is computed only in domains whose indices are in [l_min,l_min+nzet-1] . In the other domains, it is set to zero.
Returns
pressure [unit: $\rho_{\rm nuc} c^2$], where $\rho_{\rm nuc} := 1.66\ 10^{17} \ {\rm kg/m}^3$

Definition at line 266 of file hoteos.C.

References Lorene::Tensor::get_mp().

◆ press_Hs_p()

double Lorene::Hoteos_tabul::press_Hs_p ( double  ent,
double  sb 
) const
virtual

Computes the pressure from the log-enthalpy and entropy per baryon (virtual function implemented in the derived classes).

Parameters
ent[input, unit: $c^2$] log-enthalpy H defined by $H = c^2 \ln\left( {e+p \over m_B c^2 n} \right) $, where e is the (total) energy density, p the pressure, n the baryon density, and $m_B$ the baryon mass
sb[input, unit: $k_B$] entropy per baryon $s_b$
Returns
pressure p [unit: $\rho_{\rm nuc} c^2$], where $\rho_{\rm nuc} := 1.66\ 10^{17} \ {\rm kg/m}^3$

Implements Lorene::Hot_eos.

Definition at line 369 of file hoteos_tabul.C.

References d2p, dpdh, dpds, hhh, hmax, hmin, ppp, s_B, sbmax, and sbmin.

◆ read_table()

void Lorene::Hoteos_tabul::read_table ( )
protected

Reads the file containing the table and initializes in the arrays hhh , s_B, ppp, ...

Definition at line 153 of file hoteos_tabul.C.

References authors, d2p, dpdh, dpds, hhh, hmax, hmin, Lorene::log(), ppp, s_B, sbmax, sbmin, Lorene::Tbl::set(), Lorene::Tbl::set_etat_qcq(), and tablename.

◆ sauve()

void Lorene::Hoteos_tabul::sauve ( FILE fich) const
virtual

Save in a file.

Reimplemented from Lorene::Hot_eos.

Definition at line 127 of file hoteos_tabul.C.

References Lorene::Hot_eos::sauve(), and tablename.

◆ set_arrays_0x0()

void Lorene::Hoteos_tabul::set_arrays_0x0 ( )
protected

Sets all the arrays to the null pointer.

Definition at line 101 of file hoteos_tabul.C.

References d2p, dpdh, dpds, hhh, ppp, and s_B.

◆ set_der_0x0()

void Lorene::Hot_eos::set_der_0x0 ( ) const
protectedinherited

Sets to 0x0 all the pointers on derived quantities.

Definition at line 114 of file hoteos.C.

References Lorene::Hot_eos::p_cold_eos.

◆ set_name()

void Lorene::Hot_eos::set_name ( const char name_i)
inherited

Sets the hot EOS name.

Definition at line 118 of file hoteos.C.

References Lorene::Hot_eos::name.

◆ temp_Hs()

Scalar Lorene::Hot_eos::temp_Hs ( const Scalar ent,
const Scalar sb,
int  nzet,
int  l_min = 0 
) const
inherited

Computes the temperature field from the log-enthalpy field and entropy per baryon.

Parameters
ent[input, unit: $c^2$] log-enthalpy H defined by $H = c^2 \ln\left( {e+p \over m_B c^2 n} \right) $, where e is the (total) energy density, p the pressure, n the baryon density, and $m_B$ the baryon mass
sb[input, unit: $k_B$] entropy per baryon $s_b$
nzetnumber of domains where the baryon density is to be computed.
l_minindex of the innermost domain is which the baryon density is to be computed [default value: 0]; the baryon density is computed only in domains whose indices are in [l_min,l_min+nzet-1] . In the other domains, it is set to zero.
Returns
temperature [unit: MeV]

Definition at line 280 of file hoteos.C.

References Lorene::Tensor::get_mp().

◆ temp_Hs_p()

double Lorene::Hoteos_tabul::temp_Hs_p ( double  ent,
double  sb 
) const
virtual

Computes the temperature from the log-enthalpy and entropy per baryon (virtual function implemented in the derived classes).

Parameters
ent[input, unit: $c^2$] log-enthalpy H defined by $H = c^2 \ln\left( {e+p \over m_B c^2 n} (to be modified) \right) $, where e is the (total) energy density, p the pressure, n the baryon density, and $m_B$ the baryon mass
sb[input, unit: $k_B$] entropy per baryon $s_b$
Returns
temperature [unit: MeV]

Implements Lorene::Hot_eos.

Definition at line 403 of file hoteos_tabul.C.

References d2p, dpdh, dpds, Lorene::exp(), hhh, hmax, hmin, ppp, s_B, sbmax, and sbmin.

Friends And Related Symbol Documentation

◆ Hot_eos::hoteos_from_file

The construction functions from a file.

Member Data Documentation

◆ authors

string Lorene::Hoteos_tabul::authors
protected

Authors - reference for the table.

Definition at line 558 of file hoteos.h.

◆ d2p

Tbl* Lorene::Hoteos_tabul::d2p
protected

Table of $\partial^2 P/\partial s_B \partial H$.

Definition at line 588 of file hoteos.h.

◆ dpdh

Tbl* Lorene::Hoteos_tabul::dpdh
protected

Table of $\partial P/\partial H$.

Definition at line 582 of file hoteos.h.

◆ dpds

Tbl* Lorene::Hoteos_tabul::dpds
protected

Table of $\partial P/\partial s_B$.

Definition at line 585 of file hoteos.h.

◆ hhh

Tbl* Lorene::Hoteos_tabul::hhh
protected

Table of $H = \log ( e + P ) / n_B$.

Definition at line 573 of file hoteos.h.

◆ hmax

double Lorene::Hoteos_tabul::hmax
protected

Upper boundary of the enthalpy interval.

Definition at line 564 of file hoteos.h.

◆ hmin

double Lorene::Hoteos_tabul::hmin
protected

Lower boundary of the enthalpy interval.

Definition at line 561 of file hoteos.h.

◆ name

string Lorene::Hot_eos::name
protectedinherited

EOS name.

Definition at line 72 of file hoteos.h.

◆ p_cold_eos

Eos* Lorene::Hot_eos::p_cold_eos
mutableprotectedinherited

Corresponding cold Eos.

Definition at line 108 of file hoteos.h.

◆ ppp

Tbl* Lorene::Hoteos_tabul::ppp
protected

Table of pressure $P$.

Definition at line 579 of file hoteos.h.

◆ s_B

Tbl* Lorene::Hoteos_tabul::s_B
protected

Table of $s_B$, entropy per baryon (in units of Boltzmann constant).

Definition at line 576 of file hoteos.h.

◆ sbmax

double Lorene::Hoteos_tabul::sbmax
protected

Upper boundary of the entropy interval.

Definition at line 570 of file hoteos.h.

◆ sbmin

double Lorene::Hoteos_tabul::sbmin
protected

Lower boundary of the entropy interval.

Definition at line 567 of file hoteos.h.

◆ tablename

string Lorene::Hoteos_tabul::tablename
protected

Name of the file containing the tabulated data.

Definition at line 556 of file hoteos.h.


The documentation for this class was generated from the following files: