eos_compose.h
/*
* Definition of Lorene classes Eos_CompOSE
* Eos_consistent
*/
/*
* Copyright (c) 2014-2015 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_COMPOSE_H_
#define __EOS_COMPOSE_H_
/*
* $Id: eos_compose.h,v 1.1 2015/08/04 14:41:28 j_novak Exp $
* $Log: eos_compose.h,v $
* Revision 1.1 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).
*
*
*
* $Header: /cvsroot/Lorene/C++/Include/eos_compose.h,v 1.1 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_CompOSE //
//------------------------------------//
class Eos_CompOSE : public Eos_tabul {
// Constructors - Destructor
// -------------------------
public:
Eos_CompOSE(const string& files_path) ;
Eos_CompOSE(const char* file_name) ;
protected:
Eos_CompOSE(FILE* ) ;
Eos_CompOSE(ifstream&) ;
private:
Eos_CompOSE(const Eos_CompOSE& ) ;
friend Eos* Eos::eos_from_file(FILE* ) ;
friend Eos* Eos::eos_from_file(ifstream& ) ;
public:
virtual ~Eos_CompOSE() ;
// 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_consistent //
//------------------------------------//
class Eos_consistent : public Eos_CompOSE {
// Constructors - Destructor
// -------------------------
public:
Eos_consistent(const string& files_path) ;
Eos_consistent(const char* file_name) ;
protected:
Eos_consistent(FILE* ) ;
Eos_consistent(ifstream&) ;
private:
Eos_consistent(const Eos_consistent& ) ;
friend Eos* Eos::eos_from_file(FILE* ) ;
friend Eos* Eos::eos_from_file(ifstream& ) ;
public:
virtual ~Eos_consistent() ;
// 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 ;
// Computational functions
// -----------------------
public:
virtual double nbar_ent_p(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 ;
};
}
#endif
Lorene::Eos_CompOSE::Eos_CompOSE
Eos_CompOSE(const Eos_CompOSE &)
Copy constructor (private to make Eos_CompOSE a non-copiable class).
Lorene::Eos_CompOSE::~Eos_CompOSE
virtual ~Eos_CompOSE()
Destructor.
Definition eos_compose.C:274
Lorene::Eos_CompOSE::operator==
virtual bool operator==(const Eos &) const
Comparison operator (egality).
Definition eos_compose.C:286
Lorene::Eos_CompOSE::operator!=
virtual bool operator!=(const Eos &) const
Comparison operator (difference).
Definition eos_compose.C:299
Lorene::Eos_CompOSE::Eos_CompOSE
Eos_CompOSE(const string &files_path)
Constructor from CompOSE data.
Definition eos_compose.C:99
Lorene::Eos_CompOSE::operator>>
virtual ostream & operator>>(ostream &) const
Operator >>.
Definition eos_compose.C:310
Lorene::Eos_CompOSE::identify
virtual int identify() const
Returns a number to identify the sub-classe of Eos the object belongs to.
Definition eos_from_file.C:155
Lorene::Eos_consistent::Eos_consistent
Eos_consistent(const Eos_consistent &)
Copy constructor (private to make Eos_consistent a non-copiable class).
Lorene::Eos_consistent::operator==
virtual bool operator==(const Eos &) const
Comparison operator (egality).
Definition eos_consistent.C:182
Lorene::Eos_consistent::press_ent_p
virtual double press_ent_p(double ent, const Param *par=0x0) const
Computes the pressure from the log-enthalpy.
Definition eos_consistent.C:276
Lorene::Eos_consistent::operator!=
virtual bool operator!=(const Eos &) const
Comparison operator (difference).
Definition eos_consistent.C:195
Lorene::Eos_consistent::operator>>
virtual ostream & operator>>(ostream &) const
Operator >>.
Definition eos_consistent.C:311
Lorene::Eos_consistent::Eos_consistent
Eos_consistent(const string &files_path)
Constructor from CompOSE data.
Definition eos_consistent.C:82
Lorene::Eos_consistent::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_consistent.C:208
Lorene::Eos_consistent::identify
virtual int identify() const
Returns a number to identify the sub-classe of Eos the object belongs to.
Definition eos_from_file.C:161
Lorene::Eos_consistent::~Eos_consistent
virtual ~Eos_consistent()
Destructor.
Definition eos_consistent.C:170
Lorene::Eos_consistent::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_consistent.C:242
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
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::Param
Parameter storage.
Definition param.h:125
Lorene::Tbl
Basic array class.
Definition tbl.h:161
Lorene
Lorene prototypes.
Definition app_hor.h:64