eos_fitting.h
/*
* Definition of Lorene class Eos_fitting
* Eos_fit_SLy4
* Eos_fit_FPS
* Eos_fit_AkmalPR
*
*/
/*
* Copyright (c) 2004 Keisuke Taniguchi
*
* 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 version 2
* as published by the Free Software Foundation.
*
* 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_FITTING_H_
#define __EOS_FITTING_H_
/*
* $Id: eos_fitting.h,v 1.4 2014/10/13 08:52:33 j_novak Exp $
* $Log: eos_fitting.h,v $
* Revision 1.4 2014/10/13 08:52:33 j_novak
* Lorene classes and functions now belong to the namespace Lorene.
*
* Revision 1.3 2014/10/06 15:09:39 j_novak
* Modified #include directives to use c++ syntax.
*
* Revision 1.2 2005/05/22 20:50:39 k_taniguchi
* Introduction of a new class Eos_fit_AkmalPR.
*
* Revision 1.1 2004/09/26 18:50:00 k_taniguchi
* Initial revision
*
*
*
* $Header: /cvsroot/Lorene/C++/Include/eos_fitting.h,v 1.4 2014/10/13 08:52:33 j_novak Exp $
*
*/
// Standard C++
#include "headcpp.h"
// Headers C
#include <cstdio>
#include <cassert>
// Lorene classes
#include "eos.h"
#include "param.h"
// External classes which appear in the declaration of class Eos_fitting:
namespace Lorene {
class Tbl ;
class Cmp ;
class Param ;
class Eos ;
//-----------------------------------------------------------------------//
// class Eos_fitting for the analytical fitting of realistic EOS //
//-----------------------------------------------------------------------//
class Eos_fitting : public Eos {
// Data :
// -----
protected:
char dataname[160] ;
double* pp ;
// Constructors - Destructor
// -------------------------
protected:
Eos_fitting(const char* name_i, const char* data, const char* path) ;
// Eos_fitting(const Eos_fitting& ) ; ///< Copy constructor
protected:
Eos_fitting(FILE* ) ;
Eos_fitting(ifstream& ist, const char* data) ;
friend Eos* Eos::eos_from_file(FILE* ) ;
friend Eos* Eos::eos_from_file(ifstream& ) ;
public:
virtual ~Eos_fitting() ;
// Outputs
// -------
public:
virtual void sauve(FILE *) const ;
// Miscellaneous
// -------------
protected:
void read_coef() ;
// 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 ;
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 ;
};
//--------------------------------------//
// class Eos_fit_SLy4 //
//--------------------------------------//
class Eos_fit_SLy4 : public Eos_fitting {
// Constructors - Destructor
// -------------------------
public:
Eos_fit_SLy4(const char* path) ;
protected:
Eos_fit_SLy4(FILE* ) ;
Eos_fit_SLy4(ifstream& ) ;
friend Eos* Eos::eos_from_file(FILE* ) ;
friend Eos* Eos::eos_from_file(ifstream& ) ;
public:
virtual ~Eos_fit_SLy4() ;
// Outputs
// -------
protected:
virtual ostream& operator>>(ostream &) const ;
// Miscellaneous
// -------------
public :
virtual bool operator==(const Eos& ) const ;
virtual bool operator!=(const Eos& ) const ;
virtual int identify() const ;
};
//-------------------------------------//
// class Eos_fit_FPS //
//-------------------------------------//
class Eos_fit_FPS : public Eos_fitting {
// Constructors - Destructor
// -------------------------
public:
Eos_fit_FPS(const char* path) ;
protected:
Eos_fit_FPS(FILE* ) ;
Eos_fit_FPS(ifstream& ) ;
friend Eos* Eos::eos_from_file(FILE* ) ;
friend Eos* Eos::eos_from_file(ifstream& ) ;
public:
virtual ~Eos_fit_FPS() ;
// Outputs
// -------
protected:
virtual ostream& operator>>(ostream &) const ;
// Miscellaneous
// -------------
public :
virtual bool operator==(const Eos& ) const ;
virtual bool operator!=(const Eos& ) const ;
virtual int identify() const ;
};
//-----------------------------------------//
// class Eos_fit_AkmalPR //
//-----------------------------------------//
class Eos_fit_AkmalPR : public Eos_fitting {
// Constructors - Destructor
// -------------------------
public:
Eos_fit_AkmalPR(const char* path) ;
protected:
Eos_fit_AkmalPR(FILE* ) ;
Eos_fit_AkmalPR(ifstream& ) ;
friend Eos* Eos::eos_from_file(FILE* ) ;
friend Eos* Eos::eos_from_file(ifstream& ) ;
public:
virtual ~Eos_fit_AkmalPR() ;
// Outputs
// -------
protected:
virtual ostream& operator>>(ostream &) const ;
// Miscellaneous
// -------------
public :
virtual bool operator==(const Eos& ) const ;
virtual bool operator!=(const Eos& ) const ;
virtual int identify() const ;
};
}
#endif
Lorene::Cmp
Component of a tensorial field *** DEPRECATED : use class Scalar instead ***.
Definition cmp.h:446
Lorene::Eos_fit_AkmalPR::operator!=
virtual bool operator!=(const Eos &) const
Comparison operator (difference).
Definition eos_fit_akmalpr.C:98
Lorene::Eos_fit_AkmalPR::~Eos_fit_AkmalPR
virtual ~Eos_fit_AkmalPR()
Destructor.
Definition eos_fit_akmalpr.C:75
Lorene::Eos_fit_AkmalPR::operator>>
virtual ostream & operator>>(ostream &) const
Operator >>.
Definition eos_fit_akmalpr.C:108
Lorene::Eos_fit_AkmalPR::Eos_fit_AkmalPR
Eos_fit_AkmalPR(const char *path)
Standard constructor.
Definition eos_fit_akmalpr.C:57
Lorene::Eos_fit_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:171
Lorene::Eos_fit_AkmalPR::operator==
virtual bool operator==(const Eos &) const
Comparison operator (egality).
Definition eos_fit_akmalpr.C:85
Lorene::Eos_fit_FPS::operator>>
virtual ostream & operator>>(ostream &) const
Operator >>.
Definition eos_fit_fps.C:110
Lorene::Eos_fit_FPS::~Eos_fit_FPS
virtual ~Eos_fit_FPS()
Destructor.
Definition eos_fit_fps.C:77
Lorene::Eos_fit_FPS::operator!=
virtual bool operator!=(const Eos &) const
Comparison operator (difference).
Definition eos_fit_fps.C:100
Lorene::Eos_fit_FPS::Eos_fit_FPS
Eos_fit_FPS(const char *path)
Standard constructor.
Definition eos_fit_fps.C:59
Lorene::Eos_fit_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:169
Lorene::Eos_fit_FPS::operator==
virtual bool operator==(const Eos &) const
Comparison operator (egality).
Definition eos_fit_fps.C:87
Lorene::Eos_fit_SLy4::Eos_fit_SLy4
Eos_fit_SLy4(const char *path)
Standard constructor.
Definition eos_fit_sly4.C:56
Lorene::Eos_fit_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:167
Lorene::Eos_fit_SLy4::~Eos_fit_SLy4
virtual ~Eos_fit_SLy4()
Destructor.
Definition eos_fit_sly4.C:74
Lorene::Eos_fit_SLy4::operator==
virtual bool operator==(const Eos &) const
Comparison operator (egality).
Definition eos_fit_sly4.C:84
Lorene::Eos_fit_SLy4::operator!=
virtual bool operator!=(const Eos &) const
Comparison operator (difference).
Definition eos_fit_sly4.C:97
Lorene::Eos_fit_SLy4::operator>>
virtual ostream & operator>>(ostream &) const
Operator >>.
Definition eos_fit_sly4.C:107
Lorene::Eos_fitting::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_fitting.C:393
Lorene::Eos_fitting::~Eos_fitting
virtual ~Eos_fitting()
Destructor.
Definition eos_fitting.C:116
Lorene::Eos_fitting::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_fitting.C:334
Lorene::Eos_fitting::read_coef
void read_coef()
Reading coefficients of the fitting equation for the energy density, the pressure,...
Definition eos_fitting.C:138
Lorene::Eos_fitting::dataname
char dataname[160]
Name of the file containing the fitting data.
Definition eos_fitting.h:86
Lorene::Eos_fitting::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_fitting.C:447
Lorene::Eos_fitting::pp
double * pp
Array of the coefficients of the fitting data.
Definition eos_fitting.h:89
Lorene::Eos_fitting::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_fitting.C:173
Lorene::Eos_fitting::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_fitting.C:240
Lorene::Eos_fitting::press_ent_p
virtual double press_ent_p(double ent, const Param *par=0x0) const
Computes the pressure from the log-enthalpy.
Definition eos_fitting.C:284
Lorene::Eos_fitting::sauve
virtual void sauve(FILE *) const
Save in a file.
Definition eos_fitting.C:127
Lorene::Eos_fitting::Eos_fitting
Eos_fitting(const char *name_i, const char *data, const char *path)
Standard constructor.
Definition eos_fitting.C:78
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