Lorene::Hot_eos Class Referenceabstract
Equations of state

Base class for temperature-dependent equations of state (abstract class). More...

`#include <hoteos.h>`

Inheritance diagram for Lorene::Hot_eos:

## Public Member Functions

virtual | ~Hot_eos ()
| Destructor.
const string & | get_name () const
| Returns the hot EOS name.
void | set_name (const char *)
| Sets the hot EOS name.
virtual bool | operator== (const Hot_eos &) const =0
| Comparison operator (egality).
virtual bool | operator!= (const Hot_eos &) const =0
| Comparison operator (difference).
virtual int | identify () const =0
| Returns a number to identify the sub-classe of `Hot_eos` the object belongs to.
virtual void | sauve (FILE *) const
| Save in a file.
virtual const Eos & | new_cold_Eos () const =0
| Returns the corresponding cold `Eos`.
virtual double | nbar_Hs_p (double ent, double sb) const =0
| Computes the baryon density from the log-enthalpy and entropy per baryon (virtual function implemented in the derived classes).
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.
virtual double | ener_Hs_p (double ent, double sb) const =0
| Computes the total energy density from the log-enthalpy and entropy per baryon (virtual function implemented in the derived classes).
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.
virtual double | press_Hs_p (double ent, double sb) const =0
| Computes the pressure from the log-enthalpy and entropy per baryon (virtual function implemented in the derived classes).
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.
virtual double | temp_Hs_p (double ent, double sb) const =0
| Computes the temperature from the log-enthalpy and entropy per baryon (virtual function implemented in the derived classes).
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_eos * | hoteos_from_file (FILE *)
| Construction of an EOS from a binary file.
static Hot_eos * | hoteos_from_file (ifstream &)
| Construction of a hot EOS from a formatted file.

## Protected Member Functions

| Hot_eos ()
| Standard constructor.
| Hot_eos (const string &)
| Standard constructor from a name (string).
| Hot_eos (const char *)
| Standard constructor from a name (char*).
| Hot_eos (const Hot_eos &)
| Copy constructor.
| Hot_eos (FILE *)
| Constructor from a binary file (created by the function `sauve(FILE*)` ).
| Hot_eos (ifstream &)
| Constructor from a formatted file.
virtual void | del_deriv () const
| Deletes all the derived quantities.
void | set_der_0x0 () const
| Sets to `0x0` all the pointers on derived quantities.
virtual ostream & | operator>> (ostream &) const =0
| Operator >>.
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 | name
| EOS name.
Eos * | p_cold_eos
| Corresponding cold Eos.

## Friends

ostream & | operator<< (ostream &ost, const Hot_eos &eqetat)
| Display.

## Detailed Description

Base class for temperature-dependent equations of state (abstract class).

()

Definition at line 67 of file hoteos.h.

## Constructor & Destructor Documentation

## Hot_eos() [1/6]

Lorene::Hot_eos::Hot_eos | ( |  | ) |

protected

Standard constructor.

Definition at line 56 of file hoteos.C.

## Hot_eos() [2/6]

Lorene::Hot_eos::Hot_eos | ( | const string & | name_i | ) |

explicit protected

Standard constructor from a name (string).

Definition at line 60 of file hoteos.C.

References name, and set_der_0x0().

## Hot_eos() [3/6]

Lorene::Hot_eos::Hot_eos | ( | const char * | name_i | ) |

explicit protected

Standard constructor from a name (char*).

Definition at line 64 of file hoteos.C.

References name, and set_der_0x0().

## Hot_eos() [4/6]

Lorene::Hot_eos::Hot_eos | ( | const Hot_eos & | eos_i | ) |

protected

Copy constructor.

Definition at line 70 of file hoteos.C.

References Hot_eos(), name, and set_der_0x0().

## Hot_eos() [5/6]

Lorene::Hot_eos::Hot_eos | ( | 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::hoteos_from_file(FILE*)` .

Definition at line 76 of file hoteos.C.

References set_der_0x0(), and set_name().

## Hot_eos() [6/6]

Lorene::Hot_eos::Hot_eos | ( | ifstream & | fich | ) |

protected

Constructor from a formatted file.

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

Definition at line 90 of file hoteos.C.

References set_der_0x0(), and set_name().

## ~Hot_eos()

Lorene::Hot_eos::~Hot_eos | ( |  | ) |

virtual

Destructor.

Definition at line 101 of file hoteos.C.

References del_deriv().

## Member Function Documentation

## calcule()

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

protected

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.

References Lorene::Scalar::annule(), Lorene::Tbl::annule_hard(), Lorene::Valeur::annule_hard(), Lorene::Valeur::c, Lorene::Valeur::coef_i(), Lorene::Tbl::dim, Lorene::Scalar::get_etat(), Lorene::Tbl::get_etat(), Lorene::Valeur::get_mg(), Lorene::Tensor::get_mp(), Lorene::Mg3d::get_nzone(), Lorene::Scalar::get_spectral_va(), Lorene::Tbl::get_taille(), Hot_eos(), Lorene::Map(), Lorene::Valeur::set_etat_c_qcq(), Lorene::Mtbl::set_etat_qcq(), Lorene::Scalar::set_etat_qcq(), Lorene::Tbl::set_etat_qcq(), Lorene::Scalar::set_etat_zero(), Lorene::Tbl::set_etat_zero(), Lorene::Scalar::set_spectral_va(), Lorene::Mtbl::t, and Lorene::Tbl::t.

## del_deriv()

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

protected virtual

Deletes all the derived quantities.

Definition at line 109 of file hoteos.C.

References p_cold_eos, and set_der_0x0().

## ener_Hs()

Scalar Lorene::Hot_eos::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.

Parameters

  ent | [input, unit: ] log-enthalpy H defined by , where e is the (total) energy density, p the pressure, n the baryon density, and the baryon mass
  sb | [input, unit: ] entropy per baryon
  nzet | number of domains where the energy density is to be computed.
  l_min | index 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: ], where

Definition at line 252 of file hoteos.C.

References calcule(), ener_Hs_p(), and Lorene::Tensor::get_mp().

## ener_Hs_p()

virtual double Lorene::Hot_eos::ener_Hs_p | ( | double | ent,
|  | double | sb ) const

pure 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: ] log-enthalpy H defined by , where e is the (total) energy density, p the pressure, n the baryon density, and the baryon mass
  sb | [input, unit: ] entropy per baryon

Returns
  energy density e [unit: ], where

Implemented in Lorene::Hoteos_tabul, and Lorene::Ideal_gas.

## get_name()

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

inline

Returns the hot EOS name.

Definition at line 120 of file hoteos.h.

References name.

## hoteos_from_file() [1/2]

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

static

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(), and Hot_eos().

## hoteos_from_file() [2/2]

Hot_eos * Lorene::Hot_eos::hoteos_from_file | ( | ifstream & | fich | ) |

static

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.

References Hot_eos().

## identify()

virtual int Lorene::Hot_eos::identify | ( |  | ) | const

pure virtual

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

Implemented in Lorene::Hoteos_tabul, and Lorene::Ideal_gas.

References Hot_eos().

## nbar_Hs()

Scalar Lorene::Hot_eos::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.

Parameters

  ent | [input, unit: ] log-enthalpy H defined by , where e is the (total) energy density, p the pressure, n the baryon density, and the baryon mass
  sb | [input, unit: ] entropy per baryon
  nzet | number of domains where the baryon density is to be computed.
  l_min | index 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: ]

Definition at line 236 of file hoteos.C.

References calcule(), Lorene::Tensor::get_mp(), and nbar_Hs_p().

## nbar_Hs_p()

virtual double Lorene::Hot_eos::nbar_Hs_p | ( | double | ent,
|  | double | sb ) const

pure virtual

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

Parameters

  ent | [input, unit: ] log-enthalpy H defined by , where e is the (total) energy density, p the pressure, n the baryon density, and the baryon mass
  sb | [input, unit: ] entropy per baryon

Returns
  baryon density [unit: ]

Implemented in Lorene::Hoteos_tabul, and Lorene::Ideal_gas.

## new_cold_Eos()

virtual const Eos & Lorene::Hot_eos::new_cold_Eos | ( |  | ) | const

pure virtual

Returns the corresponding cold `Eos`.

Implemented in Lorene::Hoteos_tabul, and Lorene::Ideal_gas.

References Hot_eos().

## operator!=()

virtual bool Lorene::Hot_eos::operator!= | ( | const Hot_eos & |  | ) | const

pure virtual

Comparison operator (difference).

Implemented in Lorene::Hoteos_tabul, and Lorene::Ideal_gas.

References Hot_eos().

## operator==()

virtual bool Lorene::Hot_eos::operator== | ( | const Hot_eos & |  | ) | const

pure virtual

Comparison operator (egality).

Implemented in Lorene::Hoteos_tabul, and Lorene::Ideal_gas.

References Hot_eos().

## operator>>()

virtual ostream & Lorene::Hot_eos::operator>> | ( | ostream & |  | ) | const

protected pure virtual

Operator >>.

Implemented in Lorene::Hoteos_tabul, and Lorene::Ideal_gas.

## press_Hs()

Scalar Lorene::Hot_eos::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.

Parameters

  ent | [input, unit: ] log-enthalpy H defined by , where e is the (total) energy density, p the pressure, n the baryon density, and the baryon mass
  sb | [input, unit: ] entropy per baryon
  nzet | number of domains where the pressure is to be computed.
  l_min | index 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: ], where

Definition at line 266 of file hoteos.C.

References calcule(), Lorene::Tensor::get_mp(), and press_Hs_p().

## press_Hs_p()

virtual double Lorene::Hot_eos::press_Hs_p | ( | double | ent,
|  | double | sb ) const

pure virtual

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

Parameters

  ent | [input, unit: ] log-enthalpy H defined by , where e is the (total) energy density, p the pressure, n the baryon density, and the baryon mass
  sb | [input, unit: ] entropy per baryon

Returns
  pressure p [unit: ], where

Implemented in Lorene::Hoteos_tabul, and Lorene::Ideal_gas.

## sauve()

void Lorene::Hot_eos::sauve | ( | FILE * | fich | ) | const

virtual

Save in a file.

Reimplemented in Lorene::Hoteos_tabul, and Lorene::Ideal_gas.

Definition at line 129 of file hoteos.C.

References Lorene::fwrite_be(), identify(), and name.

## set_der_0x0()

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

protected

Sets to `0x0` all the pointers on derived quantities.

Definition at line 114 of file hoteos.C.

References p_cold_eos.

## set_name()

void Lorene::Hot_eos::set_name | ( | const char * | name_i | ) |

Sets the hot EOS name.

Definition at line 118 of file hoteos.C.

References name.

## temp_Hs()

Scalar Lorene::Hot_eos::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.

Parameters

  ent | [input, unit: ] log-enthalpy H defined by , where e is the (total) energy density, p the pressure, n the baryon density, and the baryon mass
  sb | [input, unit: ] entropy per baryon
  nzet | number of domains where the baryon density is to be computed.
  l_min | index 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 calcule(), Lorene::Tensor::get_mp(), and temp_Hs_p().

## temp_Hs_p()

virtual double Lorene::Hot_eos::temp_Hs_p | ( | double | ent,
|  | double | sb ) const

pure virtual

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

Parameters

  ent | [input, unit: ] log-enthalpy H defined by , where e is the (total) energy density, p the pressure, n the baryon density, and the baryon mass
  sb | [input, unit: ] entropy per baryon

Returns
  temperature [unit: MeV]

Implemented in Lorene::Hoteos_tabul, and Lorene::Ideal_gas.

## Friends And Related Symbol Documentation

## operator<<

ostream & operator<< | ( | ostream & | ost,
|  | const Hot_eos & | eqetat )

friend

Display.

Definition at line 143 of file hoteos.C.

References get_name(), Hot_eos(), and operator<<.

## Member Data Documentation

## name

string Lorene::Hot_eos::name

protected

EOS name.

Definition at line 72 of file hoteos.h.

## p_cold_eos

Eos* Lorene::Hot_eos::p_cold_eos

mutable protected

Corresponding cold Eos.

Definition at line 108 of file hoteos.h.

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

- hoteos.h
- hoteos.C
- hoteos_from_file.C