eos_multi_poly.h
/*
* Definition of Lorene class Eos_multi_poly
*
*/
/*
* Copyright (c) 2009 Keisuke Taniguchi
* 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_MULTI_POLY_H_
#define __EOS_MULTI_POLY_H_
/*
* $Id: eos_multi_poly.h,v 1.6 2014/10/13 08:52:33 j_novak Exp $
* $Log: eos_multi_poly.h,v $
* Revision 1.6 2014/10/13 08:52:33 j_novak
* Lorene classes and functions now belong to the namespace Lorene.
*
* Revision 1.5 2014/10/06 15:09:39 j_novak
* Modified #include directives to use c++ syntax.
*
* Revision 1.4 2009/06/23 14:33:31 k_taniguchi
* Completely revised.
*
* Revision 1.3 2004/05/14 11:35:17 k_taniguchi
* Minor changes in some comments.
*
* Revision 1.2 2004/05/07 13:04:01 j_novak
* Forgotten #include<assert.h>
*
* Revision 1.1 2004/05/07 08:09:56 k_taniguchi
* Initial revision
*
*
*
* $Header: /cvsroot/Lorene/C++/Include/eos_multi_poly.h,v 1.6 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"
namespace Lorene {
class Tbl ;
class Cmp ;
class Param ;
class Eos ;
//-------------------------------------------//
// base class Eos for multiple polytrope //
//-------------------------------------------//
class Eos_multi_poly : public Eos {
// Data :
// -----
protected:
int npeos ;
double* gamma ;
double kappa0 ;
double logP1 ;
double* logRho ;
double* kappa ;
double* nbCrit ;
double* entCrit ;
double* decInc ;
double m0 ;
double* mu0 ;
// Constructors - Destructor
// -------------------------
public:
Eos_multi_poly(int npoly, double* gamma_i, double kappa0_i,
double logP1_i, double* logRho_i, double* decInc_i) ;
Eos_multi_poly(const Eos_multi_poly& ) ;
protected:
Eos_multi_poly(FILE* ) ;
Eos_multi_poly(ifstream& ) ;
friend Eos* Eos::eos_from_file(FILE* ) ;
friend Eos* Eos::eos_from_file(ifstream& ) ;
public:
virtual ~Eos_multi_poly() ;
// Assignment
// ----------
public:
void operator=(const Eos_multi_poly&) ;
// double& set_kappa(int n) ;
// Miscellaneous
// -------------
public:
virtual bool operator==(const Eos& ) const ;
virtual bool operator!=(const Eos& ) const ;
virtual int identify() const ;
const int& get_npeos() const { return npeos ; } ;
const double& get_gamma(int n) const {
assert(n>=0 && n<npeos) ;
return gamma[n] ;
} ;
const double& get_kappa0() const { return kappa0 ; } ;
const double& get_logP1() const { return logP1 ; } ;
const double& get_logRho(int n) const {
assert(n>=0 && n<npeos-1) ;
return logRho[n] ;
} ;
const double& get_kappa(int n) const {
assert(n>=0 && n<npeos) ;
return kappa[n] ;
} ;
const double& get_nbCrit(int n) const {
assert(n>=0 && n<npeos-1) ;
return nbCrit[n] ;
} ;
const double& get_entCrit(int n) const {
assert(n>=0 && n<npeos-1) ;
return entCrit[n] ;
} ;
protected:
void set_auxiliary() ;
// Outputs
// -------
public:
virtual void sauve(FILE *) const ;
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 ;
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 ;
};
}
#endif
Lorene::Cmp
Component of a tensorial field *** DEPRECATED : use class Scalar instead ***.
Definition cmp.h:446
Lorene::Eos_multi_poly::sauve
virtual void sauve(FILE *) const
Save in a file.
Definition eos_multi_poly.C:395
Lorene::Eos_multi_poly::get_gamma
const double & get_gamma(int n) const
Returns the adiabatic index .
Definition eos_multi_poly.h:217
Lorene::Eos_multi_poly::npeos
int npeos
Number of polytropic equations of state.
Definition eos_multi_poly.h:91
Lorene::Eos_multi_poly::decInc
double * decInc
Array (size npeos - 1) of the percentage which detemines the terminating enthalpy for lower density a...
Definition eos_multi_poly.h:129
Lorene::Eos_multi_poly::m0
double m0
Individual particule mass [unit: ].
Definition eos_multi_poly.h:134
Lorene::Eos_multi_poly::operator=
void operator=(const Eos_multi_poly &)
Assignment to another Eos_multi_poly.
Definition eos_multi_poly.C:258
Lorene::Eos_multi_poly::get_logRho
const double & get_logRho(int n) const
Returns the exponent of fiducial densities.
Definition eos_multi_poly.h:229
Lorene::Eos_multi_poly::nbCrit
double * nbCrit
Array (size npeos - 1) of the number density at which the polytropic EOS changes its index and consta...
Definition eos_multi_poly.h:118
Lorene::Eos_multi_poly::get_kappa
const double & get_kappa(int n) const
Returns the pressure coefficient [unit: ], where and .
Definition eos_multi_poly.h:240
Lorene::Eos_multi_poly::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_multi_poly.C:990
Lorene::Eos_multi_poly::press_ent_p
virtual double press_ent_p(double ent, const Param *par=0x0) const
Computes the pressure from the log-enthalpy.
Definition eos_multi_poly.C:700
Lorene::Eos_multi_poly::get_entCrit
const double & get_entCrit(int n) const
Returns the critical enthalpy.
Definition eos_multi_poly.h:252
Lorene::Eos_multi_poly::mu0
double * mu0
Array (size: npeos) of the relativistic chemical potential at zero pressure [unit: ,...
Definition eos_multi_poly.h:142
Lorene::Eos_multi_poly::get_nbCrit
const double & get_nbCrit(int n) const
Returns the critical number density.
Definition eos_multi_poly.h:246
Lorene::Eos_multi_poly::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_multi_poly.C:493
Lorene::Eos_multi_poly::gamma
double * gamma
Array (size: npeos) of adiabatic index .
Definition eos_multi_poly.h:94
Lorene::Eos_multi_poly::get_npeos
const int & get_npeos() const
Returns the number of polytropes npeos.
Definition eos_multi_poly.h:214
Lorene::Eos_multi_poly::logRho
double * logRho
Array (size: npeos - 1) of the exponent of fiducial densities.
Definition eos_multi_poly.h:105
Lorene::Eos_multi_poly::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_multi_poly.C:857
Lorene::Eos_multi_poly::get_kappa0
const double & get_kappa0() const
Returns the pressure coefficient for the crust.
Definition eos_multi_poly.h:223
Lorene::Eos_multi_poly::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_multi_poly.C:591
Lorene::Eos_multi_poly::logP1
double logP1
Exponent of the pressure at the fiducial density .
Definition eos_multi_poly.h:102
Lorene::Eos_multi_poly::operator!=
virtual bool operator!=(const Eos &) const
Comparison operator (difference).
Definition eos_multi_poly.C:385
Lorene::Eos_multi_poly::set_auxiliary
void set_auxiliary()
Computes the auxiliary quantities.
Definition eos_multi_poly.C:270
Lorene::Eos_multi_poly::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_multi_poly.C:1088
Lorene::Eos_multi_poly::identify
virtual int identify() const
Returns a number to identify the sub-classe of Eos the object belongs to.
Definition eos_from_file.C:165
Lorene::Eos_multi_poly::operator>>
virtual ostream & operator>>(ostream &) const
Operator >>.
Definition eos_multi_poly.C:419
Lorene::Eos_multi_poly::kappa
double * kappa
Array (size: npeos) of pressure coefficient [unit: ], where and .
Definition eos_multi_poly.h:113
Lorene::Eos_multi_poly::kappa0
double kappa0
Pressure coefficient for the crust [unit: ].
Definition eos_multi_poly.h:99
Lorene::Eos_multi_poly::~Eos_multi_poly
virtual ~Eos_multi_poly()
Destructor.
Definition eos_multi_poly.C:242
Lorene::Eos_multi_poly::entCrit
double * entCrit
Array (size npeos - 1) of the critical enthalpy at which the polytropic EOS changes its index and con...
Definition eos_multi_poly.h:123
Lorene::Eos_multi_poly::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_multi_poly.C:798
Lorene::Eos_multi_poly::operator==
virtual bool operator==(const Eos &) const
Read/write kappa.
Definition eos_multi_poly.C:341
Lorene::Eos_multi_poly::get_logP1
const double & get_logP1() const
Returns the exponent of the pressure at the fiducial density.
Definition eos_multi_poly.h:226
Lorene::Eos_multi_poly::Eos_multi_poly
Eos_multi_poly(int npoly, double *gamma_i, double kappa0_i, double logP1_i, double *logRho_i, double *decInc_i)
Standard constructor (sets m0 to 1).
Definition eos_multi_poly.C:94
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