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
51 namespace Lorene {
52 class Tbl ;
53 
54 
55  //------------------------------------//
56  // class Eos_CompOSE //
57  //------------------------------------//
58 
59 
77 class 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:
135  Eos_CompOSE(const Eos_CompOSE& ) ;
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 
193 class Eos_consistent : public Eos_CompOSE {
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:
251  Eos_consistent(const Eos_consistent& ) ;
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 
Lorene::Eos_CompOSE::Eos_CompOSE
Eos_CompOSE(const string &files_path)
Constructor from CompOSE data.
Definition: eos_compose.C:99
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
Lorene prototypes.
Definition: app_hor.h:64
Lorene::Eos_consistent
Equation of state for the CompOSE database with a consistent computation of the log-enthalpy (derived...
Definition: eos_compose.h:193
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
Equation of state base class.
Definition: eos.h:190
Lorene::Eos_consistent::operator!=
virtual bool operator!=(const Eos &) const
Comparison operator (difference)
Definition: eos_consistent.C:195
Lorene::Eos_consistent::Eos_consistent
Eos_consistent(const string &files_path)
Constructor from CompOSE data.
Definition: eos_consistent.C:82
Lorene::Eos_consistent::~Eos_consistent
virtual ~Eos_consistent()
Destructor.
Definition: eos_consistent.C:170
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::operator==
virtual bool operator==(const Eos &) const
Comparison operator (egality)
Definition: eos_consistent.C:182
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::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::Param
Parameter storage.
Definition: param.h:125
Lorene::Eos_tabul
Base class for tabulated equations of state.
Definition: eos_tabul.h:149
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::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 ostream & operator>>(ostream &) const
Operator >>
Definition: eos_consistent.C:311
Lorene::Eos_CompOSE::operator!=
virtual bool operator!=(const Eos &) const
Comparison operator (difference)
Definition: eos_compose.C:299
Lorene::Eos_CompOSE
Equation of state for the CompOSE database.
Definition: eos_compose.h:77
Lorene::Eos_CompOSE::operator>>
virtual ostream & operator>>(ostream &) const
Operator >>
Definition: eos_compose.C:310