eos_mag.h
/*
* Definition of Lorene classes Eos_mag
*/
/*
* Copyright (c) 2011 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_MAG_H_
#define __EOS_MAG_H_
/*
* $Id: eos_mag.h,v 1.4 2014/10/13 08:52:33 j_novak Exp $
* $Log: eos_mag.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 2013/12/13 16:36:51 j_novak
* Addition and computation of magnetisation terms in the Einstein equations.
*
* Revision 1.2 2011/10/04 16:05:18 j_novak
* Update of Eos_mag class. Suppression of loge, re-definition of the derivatives
* and use of interpol_herm_2d.
*
* Revision 1.1 2011/06/16 10:49:18 j_novak
* New class Eos_mag for EOSs depending on density and magnetic field.
*
*
* $Header: /cvsroot/Lorene/C++/Include/eos_mag.h,v 1.4 2014/10/13 08:52:33 j_novak Exp $
*
*/
// Standard C++
#include "headcpp.h"
#include <string>
// Headers C
#include <cstdio>
// Lorene classes
namespace Lorene {
class Tbl ;
class Cmp ;
//------------------------------------//
// class Eos_mag //
//------------------------------------//
class Eos_mag : public Eos {
// Data :
// -----
protected:
string tablename ;
double hmin ;
double hmax ;
double Bmax ;
Tbl* logp ;
Tbl* logh ;
Tbl* Bfield ;
Tbl* dlpsdlh ;
Tbl* dlpsdB ;
Tbl* d2lp ;
// Constructors - Destructor
// -------------------------
protected:
Eos_mag(const char* name_i, const char* table, const char* path) ;
Eos_mag(const char* name_i, const char* file_name) ;
Eos_mag(const Eos_mag& ) ;
protected:
Eos_mag(FILE* ) ;
Eos_mag(ifstream& ist, const char* table) ;
Eos_mag(ifstream& ist) ;
friend Eos* Eos::eos_from_file(FILE* ) ;
friend Eos* Eos::eos_from_file(ifstream& ) ;
public:
virtual ~Eos_mag() ;
// Miscellaneous
// -------------
protected:
void read_table() ;
public :
virtual bool operator==(const Eos& ) const ;
virtual bool operator!=(const Eos& ) const ;
virtual int identify() const ;
// Outputs
// -------
public:
virtual void sauve(FILE* ) const ;
protected:
virtual ostream& operator>>(ostream &) const ;
// Computational functions
// -----------------------
public:
double mag_ent_p(double ent, const Param* par=0x0) const ;
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_mag::dlpsdB
Tbl * dlpsdB
Table of .
Definition eos_mag.h:109
Lorene::Eos_mag::mag_ent_p
double mag_ent_p(double ent, const Param *par=0x0) const
Computes the magnetisation.
Definition eos_mag.C:460
Lorene::Eos_mag::d2lp
Tbl * d2lp
Table of .
Definition eos_mag.h:112
Lorene::Eos_mag::operator!=
virtual bool operator!=(const Eos &) const
Comparison operator (difference).
Definition eos_mag.C:196
Lorene::Eos_mag::identify
virtual int identify() const
Returns a number to identify the sub-classe of Eos the object belongs to.
Definition eos_from_file.C:157
Lorene::Eos_mag::logp
Tbl * logp
Table of .
Definition eos_mag.h:97
Lorene::Eos_mag::logh
Tbl * logh
Table of .
Definition eos_mag.h:100
Lorene::Eos_mag::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_mag.C:533
Lorene::Eos_mag::press_ent_p
virtual double press_ent_p(double ent, const Param *par=0x0) const
Computes the pressure from the log-enthalpy.
Definition eos_mag.C:419
Lorene::Eos_mag::sauve
virtual void sauve(FILE *) const
Save in a file.
Definition eos_mag.C:171
Lorene::Eos_mag::Bmax
double Bmax
Upper boundary of the magnetic field interval.
Definition eos_mag.h:94
Lorene::Eos_mag::~Eos_mag
virtual ~Eos_mag()
Destructor.
Definition eos_mag.C:158
Lorene::Eos_mag::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_mag.C:330
Lorene::Eos_mag::Bfield
Tbl * Bfield
Table of .
Definition eos_mag.h:103
Lorene::Eos_mag::Eos_mag
Eos_mag(const Eos_mag &)
Copy constructor.
Lorene::Eos_mag::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_mag.C:508
Lorene::Eos_mag::operator==
virtual bool operator==(const Eos &) const
Comparison operator (egality).
Definition eos_mag.C:183
Lorene::Eos_mag::hmin
double hmin
Lower boundary of the log-enthalpy interval.
Definition eos_mag.h:88
Lorene::Eos_mag::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_mag.C:520
Lorene::Eos_mag::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_mag.C:373
Lorene::Eos_mag::tablename
string tablename
Name of the file containing the tabulated data.
Definition eos_mag.h:85
Lorene::Eos_mag::read_table
void read_table()
Reads the file containing the table and initializes in the arrays logh , logp and dlpsdlh .
Definition eos_mag.C:224
Lorene::Eos_mag::dlpsdlh
Tbl * dlpsdlh
Table of .
Definition eos_mag.h:106
Lorene::Eos_mag::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_mag.C:545
Lorene::Eos_mag::Eos_mag
Eos_mag(const char *name_i, const char *table, const char *path)
Standard constructor.
Definition eos_mag.C:98
Lorene::Eos_mag::hmax
double hmax
Upper boundary of the log-enthalpy interval.
Definition eos_mag.h:91
Lorene::Eos_mag::operator>>
virtual ostream & operator>>(ostream &) const
Operator >>.
Definition eos_mag.C:207
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