LORENE
eos_fitting.h
1/*
2 * Definition of Lorene class Eos_fitting
3 * Eos_fit_SLy4
4 * Eos_fit_FPS
5 * Eos_fit_AkmalPR
6 *
7 */
8
9/*
10 * Copyright (c) 2004 Keisuke Taniguchi
11 *
12 * This file is part of LORENE.
13 *
14 * LORENE is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License version 2
16 * as published by the Free Software Foundation.
17 *
18 * LORENE is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
22 *
23 * You should have received a copy of the GNU General Public License
24 * along with LORENE; if not, write to the Free Software
25 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
26 *
27 */
28
29#ifndef __EOS_FITTING_H_
30#define __EOS_FITTING_H_
31
32/*
33 * $Id: eos_fitting.h,v 1.4 2014/10/13 08:52:33 j_novak Exp $
34 * $Log: eos_fitting.h,v $
35 * Revision 1.4 2014/10/13 08:52:33 j_novak
36 * Lorene classes and functions now belong to the namespace Lorene.
37 *
38 * Revision 1.3 2014/10/06 15:09:39 j_novak
39 * Modified #include directives to use c++ syntax.
40 *
41 * Revision 1.2 2005/05/22 20:50:39 k_taniguchi
42 * Introduction of a new class Eos_fit_AkmalPR.
43 *
44 * Revision 1.1 2004/09/26 18:50:00 k_taniguchi
45 * Initial revision
46 *
47 *
48 *
49 * $Header: /cvsroot/Lorene/C++/Include/eos_fitting.h,v 1.4 2014/10/13 08:52:33 j_novak Exp $
50 *
51 */
52
53// Standard C++
54#include "headcpp.h"
55
56// Headers C
57#include <cstdio>
58#include <cassert>
59
60// Lorene classes
61#include "eos.h"
62#include "param.h"
63
64// External classes which appear in the declaration of class Eos_fitting:
65namespace Lorene {
66class Tbl ;
67class Cmp ;
68class Param ;
69class Eos ;
70
71//-----------------------------------------------------------------------//
72// class Eos_fitting for the analytical fitting of realistic EOS //
73//-----------------------------------------------------------------------//
74
80class Eos_fitting : public Eos {
81
82 // Data :
83 // -----
84 protected:
86 char dataname[160] ;
87
89 double* pp ;
90
91 // Constructors - Destructor
92 // -------------------------
93 protected:
94
101 Eos_fitting(const char* name_i, const char* data, const char* path) ;
102
103 // Eos_fitting(const Eos_fitting& ) ; ///< Copy constructor
104
105 protected:
112 Eos_fitting(FILE* ) ;
113
122 Eos_fitting(ifstream& ist, const char* data) ;
123
125 friend Eos* Eos::eos_from_file(FILE* ) ;
126 friend Eos* Eos::eos_from_file(ifstream& ) ;
127
128 public:
129 virtual ~Eos_fitting() ;
130
131 // Outputs
132 // -------
133 public:
134 virtual void sauve(FILE *) const ;
135
136 // Miscellaneous
137 // -------------
138 protected:
142 void read_coef() ;
143
144 // Computational functions
145 // -----------------------
146 public:
156 virtual double nbar_ent_p(double ent, const Param* par=0x0) const ;
157
166 virtual double ener_ent_p(double ent, const Param* par=0x0) const ;
167
176 virtual double press_ent_p(double ent, const Param* par=0x0) const ;
177
186 virtual double der_nbar_ent_p(double ent, const Param* par=0x0) const ;
187
196 virtual double der_ener_ent_p(double ent, const Param* par=0x0) const ;
197
206 virtual double der_press_ent_p(double ent, const Param* par=0x0) const ;
207
208};
209
210
211 //--------------------------------------//
212 // class Eos_fit_SLy4 //
213 //--------------------------------------//
214
219class Eos_fit_SLy4 : public Eos_fitting {
220
221 // Constructors - Destructor
222 // -------------------------
223 public:
224
229 Eos_fit_SLy4(const char* path) ;
230
231 protected:
238 Eos_fit_SLy4(FILE* ) ;
239
248 Eos_fit_SLy4(ifstream& ) ;
249
251 friend Eos* Eos::eos_from_file(FILE* ) ;
252 friend Eos* Eos::eos_from_file(ifstream& ) ;
253
254 public:
255 virtual ~Eos_fit_SLy4() ;
256
257 // Outputs
258 // -------
259 protected:
260 virtual ostream& operator>>(ostream &) const ;
261
262 // Miscellaneous
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};
277
278
279 //-------------------------------------//
280 // class Eos_fit_FPS //
281 //-------------------------------------//
282
287class Eos_fit_FPS : public Eos_fitting {
288
289 // Constructors - Destructor
290 // -------------------------
291 public:
292
297 Eos_fit_FPS(const char* path) ;
298
299 protected:
306 Eos_fit_FPS(FILE* ) ;
307
316 Eos_fit_FPS(ifstream& ) ;
317
319 friend Eos* Eos::eos_from_file(FILE* ) ;
320 friend Eos* Eos::eos_from_file(ifstream& ) ;
321
322 public:
323 virtual ~Eos_fit_FPS() ;
324
325 // Outputs
326 // -------
327 protected:
328 virtual ostream& operator>>(ostream &) const ;
329
330 // Miscellaneous
331 // -------------
332 public :
334 virtual bool operator==(const Eos& ) const ;
335
337 virtual bool operator!=(const Eos& ) const ;
338
342 virtual int identify() const ;
343
344};
345
346
347 //-----------------------------------------//
348 // class Eos_fit_AkmalPR //
349 //-----------------------------------------//
350
356
357 // Constructors - Destructor
358 // -------------------------
359 public:
360
365 Eos_fit_AkmalPR(const char* path) ;
366
367 protected:
374 Eos_fit_AkmalPR(FILE* ) ;
375
384 Eos_fit_AkmalPR(ifstream& ) ;
385
387 friend Eos* Eos::eos_from_file(FILE* ) ;
388 friend Eos* Eos::eos_from_file(ifstream& ) ;
389
390 public:
391 virtual ~Eos_fit_AkmalPR() ;
392
393 // Outputs
394 // -------
395 protected:
396 virtual ostream& operator>>(ostream &) const ;
397
398 // Miscellaneous
399 // -------------
400 public :
402 virtual bool operator==(const Eos& ) const ;
403
405 virtual bool operator!=(const Eos& ) const ;
406
410 virtual int identify() const ;
411
412};
413
414}
415#endif
Fitted equation of state of AkmalPR.
virtual bool operator!=(const Eos &) const
Comparison operator (difference)
virtual ~Eos_fit_AkmalPR()
Destructor.
virtual ostream & operator>>(ostream &) const
Operator >>
virtual int identify() const
Returns a number to identify the sub-classe of Eos the object belongs to.
virtual bool operator==(const Eos &) const
Comparison operator (egality)
Fitted equation of state of FPS.
virtual ostream & operator>>(ostream &) const
Operator >>
virtual ~Eos_fit_FPS()
Destructor.
Definition eos_fit_fps.C:77
virtual bool operator!=(const Eos &) const
Comparison operator (difference)
virtual int identify() const
Returns a number to identify the sub-classe of Eos the object belongs to.
virtual bool operator==(const Eos &) const
Comparison operator (egality)
Definition eos_fit_fps.C:87
Fitted equation of state of SLy4.
virtual int identify() const
Returns a number to identify the sub-classe of Eos the object belongs to.
virtual ~Eos_fit_SLy4()
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 >>
Base class for the analytically fitted equation of state.
Definition eos_fitting.h:80
virtual double der_ener_ent_p(double ent, const Param *par=0x0) const
Computes the logarithmic derivative from the log-enthalpy.
virtual ~Eos_fitting()
Destructor.
virtual double der_nbar_ent_p(double ent, const Param *par=0x0) const
Computes the logarithmic derivative from the log-enthalpy.
void read_coef()
Reading coefficients of the fitting equation for the energy density, the pressure,...
char dataname[160]
Name of the file containing the fitting data.
Definition eos_fitting.h:86
virtual double der_press_ent_p(double ent, const Param *par=0x0) const
Computes the logarithmic derivative from the log-enthalpy.
double * pp
Array of the coefficients of the fitting data.
Definition eos_fitting.h:89
virtual double nbar_ent_p(double ent, const Param *par=0x0) const
Computes the baryon density from the log-enthalpy.
virtual double ener_ent_p(double ent, const Param *par=0x0) const
Computes the total energy density from the log-enthalpy.
virtual double press_ent_p(double ent, const Param *par=0x0) const
Computes the pressure from the log-enthalpy.
virtual void sauve(FILE *) const
Save in a file.
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