eos_tabul.h
/*
* Definition of Lorene classes Eos_tabul
* Eos_SLy4
* Eos_FPS
* Eos_BPAL12
* Eos_AkmalPR
* Eos_BBB2
* Eos_BalbN1H1
* Eos_GlendNH3
*/
/*
* Copyright (c) 2000-2001 Eric Gourgoulhon
* (c) 2014 Jerome Novak
*
* This file is part of LORENE.
*
* LORENE is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* LORENE is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with LORENE; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#ifndef __EOS_TABUL_H_
#define __EOS_TABUL_H_
/*
* $Id: eos_tabul.h,v 1.16 2015/08/04 14:41:28 j_novak Exp $
* $Log: eos_tabul.h,v $
* Revision 1.16 2015/08/04 14:41:28 j_novak
* Back to previous version for Eos_CompOSE. Enthalpy-consistent EoS can be accessed using Eos_consistent class (derived from Eos_CompOSE).
*
* Revision 1.15 2015/01/27 14:22:38 j_novak
* New methods in Eos_tabul to correct for EoS themro consistency (optional).
*
* Revision 1.14 2014/10/13 08:52:34 j_novak
* Lorene classes and functions now belong to the namespace Lorene.
*
* Revision 1.13 2014/07/01 09:26:20 j_novak
* Improvement of comments
*
* Revision 1.12 2014/06/30 16:13:18 j_novak
* New methods for reading directly from CompOSE files.
*
* Revision 1.11 2014/03/06 15:53:34 j_novak
* Eos_compstar is now Eos_compOSE. Eos_tabul uses strings and contains informations about authors.
*
* Revision 1.10 2010/02/02 14:26:10 j_novak
* *** empty log message ***
*
* Revision 1.9 2010/02/02 13:21:52 j_novak
* New class Eos_Compstar.
*
* Revision 1.8 2004/03/22 13:12:41 j_novak
* Modification of comments to use doxygen instead of doc++
*
* Revision 1.7 2003/12/08 15:48:43 m_bejger
* GlendNH3 EOS (Glendenning 1985, case 3) added
*
* Revision 1.6 2003/11/25 13:44:15 m_bejger
* Declared some vectors for Eos_tabul::read_table()
*
* Revision 1.5 2003/11/21 16:19:09 m_bejger
* Added new tables: lognb, dlpsdlnb
*
* Revision 1.4 2002/10/16 14:36:29 j_novak
* Reorganization of #include instructions of standard C++, in order to
* use experimental version 3 of gcc.
*
* Revision 1.3 2002/09/13 09:17:31 j_novak
* Modif. commentaires
*
* Revision 1.2 2002/04/09 14:32:15 e_gourgoulhon
* 1/ Added extra parameters in EOS computational functions (argument par)
* 2/ New class MEos for multi-domain EOS
*
* Revision 1.1.1.1 2001/11/20 15:19:27 e_gourgoulhon
* LORENE
*
* Revision 2.5 2001/09/11 16:15:46 eric
* Ajout des classes Eos_BBB2 et Eos_BalbN1H1
*
* Revision 2.4 2001/09/11 15:05:48 eric
* Ajout de la classe Eos_AkmalPR
*
* Revision 2.3 2001/03/23 13:40:23 eric
* Modifs commentaires.
*
* Revision 2.2 2001/02/07 09:45:28 eric
* Suppression de la fonction derent_ent_p.
* Ajout des fonctions donnant les derivees de l'EOS:
* der_nbar_ent_p
* der_ener_ent_p
* der_press_ent_p
*
* Revision 2.1 2000/11/23 22:33:48 eric
* Ajout de Eos_BPAL12.
*
* Revision 2.0 2000/11/22 19:29:18 eric
* *** empty log message ***
*
*
* $Header: /cvsroot/Lorene/C++/Include/eos_tabul.h,v 1.16 2015/08/04 14:41:28 j_novak Exp $
*
*/
// Standard C++
#include <string>
#include "headcpp.h"
// Headers C
#include <cstdio>
// Lorene classes
namespace Lorene {
class Tbl ;
//------------------------------------//
// class Eos_tabul //
//------------------------------------//
class Eos_tabul : public Eos {
// Data :
// -----
protected:
string tablename ;
string authors ;
double hmin ;
double hmax ;
Tbl* logh ;
Tbl* logp ;
Tbl* dlpsdlh ;
Tbl* lognb ;
Tbl* dlpsdlnb ;
double* press ;
double* nb ;
double* ro ;
// Constructors - Destructor
// -------------------------
protected:
Eos_tabul(const char* name_i, const char* table, const char* path) ;
Eos_tabul(const char* name_i, const char* file_name) ;
Eos_tabul(const Eos_tabul& ) ;
Eos_tabul(const char* name_i) ;
protected:
Eos_tabul(FILE* ) ;
Eos_tabul(ifstream& ist, const char* table) ;
Eos_tabul(ifstream& ist) ;
friend Eos* Eos::eos_from_file(FILE* ) ;
friend Eos* Eos::eos_from_file(ifstream& ) ;
public:
virtual ~Eos_tabul() ;
// Miscellaneous
// -------------
protected:
void read_table() ;
// Outputs
// -------
public:
virtual void sauve(FILE* ) const ;
// Computational functions
// -----------------------
public:
virtual double nbar_ent_p(double ent, const Param* par=0x0) const ;
/* mb test version for linear interpolation
virtual double nbar_ent_p_mbtest(double ent, const Param* par=0x0) const ;
*/
virtual double ener_ent_p(double ent, const Param* par=0x0) const ;
virtual double press_ent_p(double ent, const Param* par=0x0) const ;
/* mb test version for linear interpolation
virtual double press_ent_p_mbtest(double ent, const Param* par=0x0) const ;
*/
virtual double der_nbar_ent_p(double ent, const Param* par=0x0) const ;
virtual double der_ener_ent_p(double ent, const Param* par=0x0) const ;
virtual double der_press_ent_p(double ent, const Param* par=0x0) const ;
virtual double der_press_nbar_p(double ent, const Param* par=0x0) const ;
};
//------------------------------------//
// class Eos_SLy4 //
//------------------------------------//
class Eos_SLy4 : public Eos_tabul {
// Constructors - Destructor
// -------------------------
public:
Eos_SLy4(const char* path) ;
protected:
Eos_SLy4(FILE* ) ;
Eos_SLy4(ifstream& ) ;
private:
Eos_SLy4(const Eos_SLy4& ) ;
friend Eos* Eos::eos_from_file(FILE* ) ;
friend Eos* Eos::eos_from_file(ifstream& ) ;
public:
virtual ~Eos_SLy4() ;
// Miscellaneous
// -------------
public :
virtual bool operator==(const Eos& ) const ;
virtual bool operator!=(const Eos& ) const ;
virtual int identify() const ;
// Outputs
// -------
protected:
virtual ostream& operator>>(ostream &) const ;
};
//------------------------------------//
// class Eos_FPS //
//------------------------------------//
class Eos_FPS : public Eos_tabul {
// Constructors - Destructor
// -------------------------
public:
Eos_FPS(const char* path) ;
protected:
Eos_FPS(FILE* ) ;
Eos_FPS(ifstream& ) ;
private:
Eos_FPS(const Eos_FPS& ) ;
friend Eos* Eos::eos_from_file(FILE* ) ;
friend Eos* Eos::eos_from_file(ifstream& ) ;
public:
virtual ~Eos_FPS() ;
// Miscellaneous
// -------------
public :
virtual bool operator==(const Eos& ) const ;
virtual bool operator!=(const Eos& ) const ;
virtual int identify() const ;
// Outputs
// -------
protected:
virtual ostream& operator>>(ostream &) const ;
};
//------------------------------------//
// class Eos_BPAL12 //
//------------------------------------//
class Eos_BPAL12 : public Eos_tabul {
// Constructors - Destructor
// -------------------------
public:
Eos_BPAL12(const char* path) ;
protected:
Eos_BPAL12(FILE* ) ;
Eos_BPAL12(ifstream& ) ;
private:
Eos_BPAL12(const Eos_BPAL12& ) ;
friend Eos* Eos::eos_from_file(FILE* ) ;
friend Eos* Eos::eos_from_file(ifstream& ) ;
public:
virtual ~Eos_BPAL12() ;
// Miscellaneous
// -------------
public :
virtual bool operator==(const Eos& ) const ;
virtual bool operator!=(const Eos& ) const ;
virtual int identify() const ;
// Outputs
// -------
protected:
virtual ostream& operator>>(ostream &) const ;
};
//------------------------------------//
// class Eos_AkmalPR //
//------------------------------------//
class Eos_AkmalPR : public Eos_tabul {
// Constructors - Destructor
// -------------------------
public:
Eos_AkmalPR(const char* path) ;
protected:
Eos_AkmalPR(FILE* ) ;
Eos_AkmalPR(ifstream& ) ;
private:
Eos_AkmalPR(const Eos_AkmalPR& ) ;
friend Eos* Eos::eos_from_file(FILE* ) ;
friend Eos* Eos::eos_from_file(ifstream& ) ;
public:
virtual ~Eos_AkmalPR() ;
// Miscellaneous
// -------------
public :
virtual bool operator==(const Eos& ) const ;
virtual bool operator!=(const Eos& ) const ;
virtual int identify() const ;
// Outputs
// -------
protected:
virtual ostream& operator>>(ostream &) const ;
};
//------------------------------------//
// class Eos_BBB2 //
//------------------------------------//
class Eos_BBB2 : public Eos_tabul {
// Constructors - Destructor
// -------------------------
public:
Eos_BBB2(const char* path) ;
protected:
Eos_BBB2(FILE* ) ;
Eos_BBB2(ifstream& ) ;
private:
Eos_BBB2(const Eos_BBB2& ) ;
friend Eos* Eos::eos_from_file(FILE* ) ;
friend Eos* Eos::eos_from_file(ifstream& ) ;
public:
virtual ~Eos_BBB2() ;
// Miscellaneous
// -------------
public :
virtual bool operator==(const Eos& ) const ;
virtual bool operator!=(const Eos& ) const ;
virtual int identify() const ;
// Outputs
// -------
protected:
virtual ostream& operator>>(ostream &) const ;
};
//------------------------------------//
// class Eos_BalbN1H1 //
//------------------------------------//
class Eos_BalbN1H1 : public Eos_tabul {
// Constructors - Destructor
// -------------------------
public:
Eos_BalbN1H1(const char* path) ;
protected:
Eos_BalbN1H1(FILE* ) ;
Eos_BalbN1H1(ifstream& ) ;
private:
Eos_BalbN1H1(const Eos_BalbN1H1& ) ;
friend Eos* Eos::eos_from_file(FILE* ) ;
friend Eos* Eos::eos_from_file(ifstream& ) ;
public:
virtual ~Eos_BalbN1H1() ;
// Miscellaneous
// -------------
public :
virtual bool operator==(const Eos& ) const ;
virtual bool operator!=(const Eos& ) const ;
virtual int identify() const ;
// Outputs
// -------
protected:
virtual ostream& operator>>(ostream &) const ;
};
//------------------------------------//
// class Eos_GlendNH3 //
//------------------------------------//
class Eos_GlendNH3 : public Eos_tabul {
// Constructors - Destructor
// -------------------------
public:
Eos_GlendNH3(const char* path) ;
protected:
Eos_GlendNH3(FILE* ) ;
Eos_GlendNH3(ifstream& ) ;
private:
Eos_GlendNH3(const Eos_GlendNH3& ) ;
friend Eos* Eos::eos_from_file(FILE* ) ;
friend Eos* Eos::eos_from_file(ifstream& ) ;
public:
virtual ~Eos_GlendNH3() ;
// Miscellaneous
// -------------
public :
virtual bool operator==(const Eos& ) const ;
virtual bool operator!=(const Eos& ) const ;
virtual int identify() const ;
// Outputs
// -------
protected:
virtual ostream& operator>>(ostream &) const ;
};
}
#endif
Lorene::Eos_AkmalPR::operator!=
virtual bool operator!=(const Eos &) const
Comparison operator (difference).
Definition eos_akmalpr.C:114
Lorene::Eos_AkmalPR::operator==
virtual bool operator==(const Eos &) const
Comparison operator (egality).
Definition eos_akmalpr.C:101
Lorene::Eos_AkmalPR::identify
virtual int identify() const
Returns a number to identify the sub-classe of Eos the object belongs to.
Definition eos_from_file.C:147
Lorene::Eos_AkmalPR::Eos_AkmalPR
Eos_AkmalPR(const Eos_AkmalPR &)
Copy constructor (private to make Eos_AkmalPR a non-copiable class).
Lorene::Eos_AkmalPR::Eos_AkmalPR
Eos_AkmalPR(const char *path)
Standard constructor.
Definition eos_akmalpr.C:66
Lorene::Eos_AkmalPR::~Eos_AkmalPR
virtual ~Eos_AkmalPR()
Destructor.
Definition eos_akmalpr.C:89
Lorene::Eos_AkmalPR::operator>>
virtual ostream & operator>>(ostream &) const
Operator >>.
Definition eos_akmalpr.C:125
Lorene::Eos_BBB2::Eos_BBB2
Eos_BBB2(const char *path)
Standard constructor.
Definition eos_bbb2.C:65
Lorene::Eos_BBB2::operator>>
virtual ostream & operator>>(ostream &) const
Operator >>.
Definition eos_bbb2.C:124
Lorene::Eos_BBB2::~Eos_BBB2
virtual ~Eos_BBB2()
Destructor.
Definition eos_bbb2.C:88
Lorene::Eos_BBB2::Eos_BBB2
Eos_BBB2(const Eos_BBB2 &)
Copy constructor (private to make Eos_BBB2 a non-copiable class).
Lorene::Eos_BBB2::identify
virtual int identify() const
Returns a number to identify the sub-classe of Eos the object belongs to.
Definition eos_from_file.C:149
Lorene::Eos_BBB2::operator!=
virtual bool operator!=(const Eos &) const
Comparison operator (difference).
Definition eos_bbb2.C:113
Lorene::Eos_BBB2::operator==
virtual bool operator==(const Eos &) const
Comparison operator (egality).
Definition eos_bbb2.C:100
Lorene::Eos_BPAL12::operator!=
virtual bool operator!=(const Eos &) const
Comparison operator (difference).
Definition eos_bpal12.C:112
Lorene::Eos_BPAL12::~Eos_BPAL12
virtual ~Eos_BPAL12()
Destructor.
Definition eos_bpal12.C:87
Lorene::Eos_BPAL12::identify
virtual int identify() const
Returns a number to identify the sub-classe of Eos the object belongs to.
Definition eos_from_file.C:145
Lorene::Eos_BPAL12::operator>>
virtual ostream & operator>>(ostream &) const
Operator >>.
Definition eos_bpal12.C:123
Lorene::Eos_BPAL12::Eos_BPAL12
Eos_BPAL12(const Eos_BPAL12 &)
Copy constructor (private to make Eos_BPAL12 a non-copiable class).
Lorene::Eos_BPAL12::Eos_BPAL12
Eos_BPAL12(const char *path)
Standard constructor.
Definition eos_bpal12.C:64
Lorene::Eos_BPAL12::operator==
virtual bool operator==(const Eos &) const
Comparison operator (egality).
Definition eos_bpal12.C:99
Lorene::Eos_BalbN1H1::~Eos_BalbN1H1
virtual ~Eos_BalbN1H1()
Destructor.
Definition eos_balbn1h1.C:89
Lorene::Eos_BalbN1H1::identify
virtual int identify() const
Returns a number to identify the sub-classe of Eos the object belongs to.
Definition eos_from_file.C:151
Lorene::Eos_BalbN1H1::operator!=
virtual bool operator!=(const Eos &) const
Comparison operator (difference).
Definition eos_balbn1h1.C:114
Lorene::Eos_BalbN1H1::Eos_BalbN1H1
Eos_BalbN1H1(const Eos_BalbN1H1 &)
Copy constructor (private to make Eos_BalbN1H1 a non-copiable class).
Lorene::Eos_BalbN1H1::Eos_BalbN1H1
Eos_BalbN1H1(const char *path)
Standard constructor.
Definition eos_balbn1h1.C:66
Lorene::Eos_BalbN1H1::operator==
virtual bool operator==(const Eos &) const
Comparison operator (egality).
Definition eos_balbn1h1.C:101
Lorene::Eos_BalbN1H1::operator>>
virtual ostream & operator>>(ostream &) const
Operator >>.
Definition eos_balbn1h1.C:125
Lorene::Eos_FPS::Eos_FPS
Eos_FPS(const char *path)
Standard constructor.
Definition eos_fps.C:64
Lorene::Eos_FPS::~Eos_FPS
virtual ~Eos_FPS()
Destructor.
Definition eos_fps.C:86
Lorene::Eos_FPS::identify
virtual int identify() const
Returns a number to identify the sub-classe of Eos the object belongs to.
Definition eos_from_file.C:143
Lorene::Eos_FPS::Eos_FPS
Eos_FPS(const Eos_FPS &)
Copy constructor (private to make Eos_FPS a non-copiable class).
Lorene::Eos_FPS::operator>>
virtual ostream & operator>>(ostream &) const
Operator >>.
Definition eos_fps.C:122
Lorene::Eos_FPS::operator!=
virtual bool operator!=(const Eos &) const
Comparison operator (difference).
Definition eos_fps.C:111
Lorene::Eos_FPS::operator==
virtual bool operator==(const Eos &) const
Comparison operator (egality).
Definition eos_fps.C:98
Lorene::Eos_GlendNH3::operator>>
virtual ostream & operator>>(ostream &) const
Operator >>.
Definition eos_glendnh3.C:78
Lorene::Eos_GlendNH3::Eos_GlendNH3
Eos_GlendNH3(const Eos_GlendNH3 &)
Copy constructor (private to make Eos_GlendNH3 a non-copiable class).
Lorene::Eos_GlendNH3::Eos_GlendNH3
Eos_GlendNH3(const char *path)
Standard constructor.
Definition eos_glendnh3.C:19
Lorene::Eos_GlendNH3::~Eos_GlendNH3
virtual ~Eos_GlendNH3()
Destructor.
Definition eos_glendnh3.C:42
Lorene::Eos_GlendNH3::operator!=
virtual bool operator!=(const Eos &) const
Comparison operator (difference).
Definition eos_glendnh3.C:67
Lorene::Eos_GlendNH3::operator==
virtual bool operator==(const Eos &) const
Comparison operator (egality).
Definition eos_glendnh3.C:54
Lorene::Eos_GlendNH3::identify
virtual int identify() const
Returns a number to identify the sub-classe of Eos the object belongs to.
Definition eos_from_file.C:153
Lorene::Eos_SLy4::~Eos_SLy4
virtual ~Eos_SLy4()
Destructor.
Definition eos_sly4.C:86
Lorene::Eos_SLy4::operator!=
virtual bool operator!=(const Eos &) const
Comparison operator (difference).
Definition eos_sly4.C:111
Lorene::Eos_SLy4::operator>>
virtual ostream & operator>>(ostream &) const
Operator >>.
Definition eos_sly4.C:122
Lorene::Eos_SLy4::operator==
virtual bool operator==(const Eos &) const
Comparison operator (egality).
Definition eos_sly4.C:98
Lorene::Eos_SLy4::Eos_SLy4
Eos_SLy4(const Eos_SLy4 &)
Copy constructor (private to make Eos_SLy4 a non-copiable class).
Lorene::Eos_SLy4::Eos_SLy4
Eos_SLy4(const char *path)
Standard constructor.
Definition eos_sly4.C:64
Lorene::Eos_SLy4::identify
virtual int identify() const
Returns a number to identify the sub-classe of Eos the object belongs to.
Definition eos_from_file.C:141
Lorene::Eos_tabul::press_ent_p
virtual double press_ent_p(double ent, const Param *par=0x0) const
Computes the pressure from the log-enthalpy.
Definition eos_tabul.C:462
Lorene::Eos_tabul::ener_ent_p
virtual double ener_ent_p(double ent, const Param *par=0x0) const
Computes the total energy density from the log-enthalpy.
Definition eos_tabul.C:434
Lorene::Eos_tabul::der_press_ent_p
virtual double der_press_ent_p(double ent, const Param *par=0x0) const
Computes the logarithmic derivative from the log-enthalpy.
Definition eos_tabul.C:530
Lorene::Eos_tabul::read_table
void read_table()
Reads the file containing the table and initializes in the arrays logh , logp and dlpsdlh .
Definition eos_tabul.C:226
Lorene::Eos_tabul::~Eos_tabul
virtual ~Eos_tabul()
Destructor.
Definition eos_tabul.C:201
Lorene::Eos_tabul::lognb
Tbl * lognb
Table of .
Definition eos_tabul.h:176
Lorene::Eos_tabul::Eos_tabul
Eos_tabul(const char *name_i, const char *table, const char *path)
Standard constructor.
Definition eos_tabul.C:133
Lorene::Eos_tabul::dlpsdlh
Tbl * dlpsdlh
Table of .
Definition eos_tabul.h:173
Lorene::Eos_tabul::dlpsdlnb
Tbl * dlpsdlnb
Table of .
Definition eos_tabul.h:179
Lorene::Eos_tabul::nbar_ent_p
virtual double nbar_ent_p(double ent, const Param *par=0x0) const
Computes the baryon density from the log-enthalpy.
Definition eos_tabul.C:406
Lorene::Eos_tabul::der_nbar_ent_p
virtual double der_nbar_ent_p(double ent, const Param *par=0x0) const
Computes the logarithmic derivative from the log-enthalpy.
Definition eos_tabul.C:487
Lorene::Eos_tabul::der_ener_ent_p
virtual double der_ener_ent_p(double ent, const Param *par=0x0) const
Computes the logarithmic derivative from the log-enthalpy.
Definition eos_tabul.C:510
Lorene::Eos_tabul::sauve
virtual void sauve(FILE *) const
Save in a file.
Definition eos_tabul.C:213
Lorene::Eos_tabul::logh
Tbl * logh
Table of .
Definition eos_tabul.h:167
Lorene::Eos_tabul::tablename
string tablename
Name of the file containing the tabulated data.
Definition eos_tabul.h:156
Lorene::Eos_tabul::Eos_tabul
Eos_tabul(const Eos_tabul &)
Copy constructor.
Lorene::Eos_tabul::hmin
double hmin
Lower boundary of the enthalpy interval.
Definition eos_tabul.h:161
Lorene::Eos_tabul::logp
Tbl * logp
Table of .
Definition eos_tabul.h:170
Lorene::Eos_tabul::der_press_nbar_p
virtual double der_press_nbar_p(double ent, const Param *par=0x0) const
Computes the logarithmic derivative from the log-enthalpy.
Definition eos_tabul.C:560
Lorene::Eos_tabul::authors
string authors
Authors - reference for the table.
Definition eos_tabul.h:158
Lorene::Eos_tabul::hmax
double hmax
Upper boundary of the enthalpy interval.
Definition eos_tabul.h:164
Lorene::Eos
Equation of state base class.
Definition eos.h:190
Lorene::Eos::eos_from_file
static Eos * eos_from_file(FILE *)
Construction of an EOS from a binary file.
Definition eos_from_file.C:177
Lorene::Eos::Eos
Eos()
Standard constructor.
Definition eos.C:108
Lorene::Param
Parameter storage.
Definition param.h:125
Lorene::Tbl
Basic array class.
Definition tbl.h:161
Lorene
Lorene prototypes.
Definition app_hor.h:64