LORENE
eos_compose.h
1/*
2 * Definition of Lorene classes Eos_CompOSE
3 * Eos_consistent
4 */
5
6/*
7 * Copyright (c) 2014-2015 Jerome Novak
8 *
9 * This file is part of LORENE.
10 *
11 * LORENE is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
15 *
16 * LORENE is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
20 *
21 * You should have received a copy of the GNU General Public License
22 * along with LORENE; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24 *
25 */
26
27
28#ifndef __EOS_COMPOSE_H_
29#define __EOS_COMPOSE_H_
30
31/*
32 * $Id: eos_compose.h,v 1.1 2015/08/04 14:41:28 j_novak Exp $
33 * $Log: eos_compose.h,v $
34 * Revision 1.1 2015/08/04 14:41:28 j_novak
35 * Back to previous version for Eos_CompOSE. Enthalpy-consistent EoS can be accessed using Eos_consistent class (derived from Eos_CompOSE).
36 *
37 *
38 *
39 * $Header: /cvsroot/Lorene/C++/Include/eos_compose.h,v 1.1 2015/08/04 14:41:28 j_novak Exp $
40 *
41 */
42
43// Standard C++
44#include <string>
45#include "headcpp.h"
46
47// Headers C
48#include <cstdio>
49
50// Lorene classes
51namespace Lorene {
52class Tbl ;
53
54
55 //------------------------------------//
56 // class Eos_CompOSE //
57 //------------------------------------//
58
59
77class Eos_CompOSE : public Eos_tabul {
78
79 // Constructors - Destructor
80 // -------------------------
81 public:
82
92 Eos_CompOSE(const string& files_path) ;
93
112 Eos_CompOSE(const char* file_name) ;
113
114
115 protected:
122 Eos_CompOSE(FILE* ) ;
123
129 Eos_CompOSE(ifstream&) ;
130
131 private:
136
137
139 friend Eos* Eos::eos_from_file(FILE* ) ;
140 friend Eos* Eos::eos_from_file(ifstream& ) ;
141
142 public:
143 virtual ~Eos_CompOSE() ;
144
145 // Miscellaneous
146 // -------------
147
148 public :
150 virtual bool operator==(const Eos& ) const ;
151
153 virtual bool operator!=(const Eos& ) const ;
154
158 virtual int identify() const ;
159
160 // Outputs
161 // -------
162
163 protected:
164 virtual ostream& operator>>(ostream &) const ;
165
166
167};
168
169 //------------------------------------//
170 // class Eos_consistent //
171 //------------------------------------//
172
173
194
195 // Constructors - Destructor
196 // -------------------------
197 public:
198
208 Eos_consistent(const string& files_path) ;
209
228 Eos_consistent(const char* file_name) ;
229
230
231 protected:
238 Eos_consistent(FILE* ) ;
239
245 Eos_consistent(ifstream&) ;
246
247 private:
252
253
255 friend Eos* Eos::eos_from_file(FILE* ) ;
256 friend Eos* Eos::eos_from_file(ifstream& ) ;
257
258 public:
259 virtual ~Eos_consistent() ;
260
261 // Miscellaneous
262 // -------------
263
264 public :
266 virtual bool operator==(const Eos& ) const ;
267
269 virtual bool operator!=(const Eos& ) const ;
270
274 virtual int identify() const ;
275
276 // Outputs
277 // -------
278
279 protected:
280 virtual ostream& operator>>(ostream &) const ;
281
282 // Computational functions
283 // -----------------------
284
285 public:
293 virtual double nbar_ent_p(double ent, const Param* par=0x0) const ;
294
302 virtual double ener_ent_p(double ent, const Param* par=0x0) const ;
303
311 virtual double press_ent_p(double ent, const Param* par=0x0) const ;
312
313};
314
315
316
317}
318#endif
319
Equation of state for the CompOSE database.
Definition eos_compose.h:77
Eos_CompOSE(const Eos_CompOSE &)
Copy constructor (private to make Eos_CompOSE a non-copiable class)
virtual ~Eos_CompOSE()
Destructor.
virtual bool operator==(const Eos &) const
Comparison operator (egality)
virtual bool operator!=(const Eos &) const
Comparison operator (difference)
virtual ostream & operator>>(ostream &) const
Operator >>
virtual int identify() const
Returns a number to identify the sub-classe of Eos the object belongs to.
Equation of state for the CompOSE database with a consistent computation of the log-enthalpy (derived...
Eos_consistent(const Eos_consistent &)
Copy constructor (private to make Eos_consistent a non-copiable class)
virtual bool operator==(const Eos &) const
Comparison operator (egality)
virtual double press_ent_p(double ent, const Param *par=0x0) const
Computes the pressure from the log-enthalpy.
virtual bool operator!=(const Eos &) const
Comparison operator (difference)
virtual ostream & operator>>(ostream &) const
Operator >>
virtual double nbar_ent_p(double ent, const Param *par=0x0) const
Computes the baryon density from the log-enthalpy.
virtual int identify() const
Returns a number to identify the sub-classe of Eos the object belongs to.
virtual ~Eos_consistent()
Destructor.
virtual double ener_ent_p(double ent, const Param *par=0x0) const
Computes the total energy density from the log-enthalpy.
Base class for tabulated equations of state.
Definition eos_tabul.h:149
Equation of state base class.
Definition eos.h:190
static Eos * eos_from_file(FILE *)
Construction of an EOS from a binary file.
Parameter storage.
Definition param.h:125
Lorene prototypes.
Definition app_hor.h:64