LORENE
eos.h
1 /*
2  * Definition of Lorene classes Eos
3  * Eos_poly
4  * Eos_poly_newt
5  * Eos_incomp
6  * Eos_incomp_newt
7  * Eos_strange
8  * Eos_strange_c
9  *
10  */
11 
12 /*
13  * Copyright (c) 2000-2001 Eric Gourgoulhon
14  *
15  * This file is part of LORENE.
16  *
17  * LORENE is free software; you can redistribute it and/or modify
18  * it under the terms of the GNU General Public License as published by
19  * the Free Software Foundation; either version 2 of the License, or
20  * (at your option) any later version.
21  *
22  * LORENE is distributed in the hope that it will be useful,
23  * but WITHOUT ANY WARRANTY; without even the implied warranty of
24  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25  * GNU General Public License for more details.
26  *
27  * You should have received a copy of the GNU General Public License
28  * along with LORENE; if not, write to the Free Software
29  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
30  *
31  */
32 
33 
34 #ifndef __EOS_H_
35 #define __EOS_H_
36 
37 /*
38  * $Id: eos.h,v 1.28 2024/01/26 17:44:25 g_servignat Exp $
39  * $Log: eos.h,v $
40  * Revision 1.28 2024/01/26 17:44:25 g_servignat
41  * Updated the Pseudopolytrope_1D class to be consistent with the paper (i.e. with a GPP in the middle)
42  *
43  * Revision 1.27 2023/06/28 13:27:31 g_servignat
44  * Updated eos_from_file constructor and data of Pseudo_polytrope_1D to support GPP-like formalism in the fitted region
45  *
46  * Revision 1.26 2023/06/14 15:52:09 g_servignat
47  * Files that implement the analytical formulae for the Pseudo-polytrope and Generalised Piecewise-polytrope (not fully working yet)
48  *
49  * Revision 1.25 2021/05/14 15:39:22 g_servignat
50  * Added sound speed computation from enthalpy to Eos class and tabulated+polytropic derived classes
51  *
52  * Revision 1.24 2021/05/06 14:33:17 j_novak
53  * New conversion function from Eos to Dyn_eos.
54  *
55  * Revision 1.23 2017/12/15 15:36:37 j_novak
56  * Improvement of the MEos class. Implementation of automatic offset computation accross different EoSs/domains.
57  *
58  * Revision 1.22 2015/08/04 14:41:28 j_novak
59  * Back to previous version for Eos_CompOSE. Enthalpy-consistent EoS can be accessed using Eos_consistent class (derived from Eos_CompOSE).
60  *
61  * Revision 1.21 2015/03/17 14:19:59 j_novak
62  * New class Hot_eos to deal with temperature-dependent EOSs.
63  *
64  * Revision 1.20 2014/10/13 08:52:33 j_novak
65  * Lorene classes and functions now belong to the namespace Lorene.
66  *
67  * Revision 1.19 2014/10/06 15:09:39 j_novak
68  * Modified #include directives to use c++ syntax.
69  *
70  * Revision 1.18 2012/10/26 14:09:13 e_gourgoulhon
71  * Added new class Eos_Fermi
72  *
73  * Revision 1.17 2011/06/16 10:49:18 j_novak
74  * New class Eos_mag for EOSs depending on density and magnetic field.
75  *
76  * Revision 1.16 2010/02/02 13:21:52 j_novak
77  * New class Eos_Compstar.
78  *
79  * Revision 1.15 2010/01/23 16:27:11 e_gourgoulhon
80  * Improved documentation.
81  *
82  * Revision 1.14 2005/05/22 20:49:12 k_taniguchi
83  * Introduction of a new class Eos_fit_AkmalPR.
84  *
85  * Revision 1.13 2004/09/26 18:51:47 k_taniguchi
86  * Introduction of new classes Eos_fitting, Eos_fit_SLy4, and Eos_fit_FPS
87  *
88  * Revision 1.12 2004/05/07 08:08:29 k_taniguchi
89  * Add the case of Eos_multi_poly.C
90  *
91  * Revision 1.11 2004/03/22 16:10:20 j_novak
92  * Excluding some files
93  *
94  * Revision 1.10 2004/03/22 13:12:40 j_novak
95  * Modification of comments to use doxygen instead of doc++
96  *
97  * Revision 1.9 2004/01/14 15:52:26 f_limousin
98  * Added methods calcule, nbar_ent, der_nbar_ent and der_ener_ent for Scalar.
99  *
100  * Revision 1.8 2003/12/08 15:48:12 m_bejger
101  * GlendNH3 (Glendenning 1985, case 3) added
102  *
103  * Revision 1.7 2002/10/16 14:36:28 j_novak
104  * Reorganization of #include instructions of standard C++, in order to
105  * use experimental version 3 of gcc.
106  *
107  * Revision 1.6 2002/09/13 09:17:31 j_novak
108  * Modif. commentaires
109  *
110  * Revision 1.5 2002/06/17 14:05:16 j_novak
111  * friend functions are now also declared outside the class definition
112  *
113  * Revision 1.4 2002/04/11 13:27:48 e_gourgoulhon
114  * *** empty log message ***
115  *
116  * Revision 1.3 2002/04/09 15:19:03 e_gourgoulhon
117  * Add EOS number 100 in the comments of eos_from_file
118  *
119  * Revision 1.2 2002/04/09 14:32:14 e_gourgoulhon
120  * 1/ Added extra parameters in EOS computational functions (argument par)
121  * 2/ New class MEos for multi-domain EOS
122  *
123  * Revision 1.1.1.1 2001/11/20 15:19:27 e_gourgoulhon
124  * LORENE
125  *
126  * Revision 2.15 2001/09/12 15:54:17 eric
127  * Modif documentation eos_from_file.
128  *
129  * Revision 2.14 2001/06/13 14:12:18 eric
130  * Modif commentaires (mise en conformite Doc++ 3.4.7)
131  *
132  * Revision 2.13 2001/02/07 09:33:42 eric
133  * Suppression des fonctions derent_ent et derent_ent_p.
134  * Ajout des fonctions donnant les derivees de l'EOS:
135  * der_nbar_ent
136  * der_ener_ent
137  * der_press_ent
138  *
139  * Revision 2.12 2000/11/23 14:45:33 eric
140  * Ajout de l'EOS Eos_strange_cr.
141  *
142  * Revision 2.11 2000/11/22 19:28:45 eric
143  * Ajout de #include "eos_tabul.h" a la fin.
144  *
145  * Revision 2.10 2000/10/25 10:55:08 eric
146  * Eos_strange: modif commentaires.
147  *
148  * Revision 2.9 2000/10/24 15:28:43 eric
149  * Ajout de l'EOS matiere etrange (Eos_strange).
150  *
151  * Revision 2.8 2000/06/20 08:34:20 eric
152  * Ajout des membres get_gam(), ... a Eos_ploy
153  *
154  * Revision 2.7 2000/02/14 14:43:22 eric
155  * Modif commentaires.
156  *
157  * Revision 2.6 2000/02/14 14:32:46 eric
158  * Ajout des constructeurs par lecture de fichier formate.
159  *
160  * Revision 2.5 2000/01/21 16:21:12 eric
161  * Modif commentaires.
162  *
163  * Revision 2.4 2000/01/21 15:16:10 eric
164  * Ajout de la fonction identify()
165  * Ajout de la fonction de construction a partir d'un fichier
166  * static Eos* Eos::eos_from_file(FILE* ).
167  * Ajout des operateurs de comparaison == et !=
168  *
169  * Revision 2.3 2000/01/18 16:10:57 eric
170  * Ajout des EOS Eos_incomp et Eos_incomp_newt.
171  *
172  * Revision 2.2 2000/01/18 15:13:28 eric
173  * Ajout de l'equation d'etat Eos_poly_newt.
174  *
175  * Revision 2.1 2000/01/18 13:46:50 eric
176  * Premiere version operationnelle
177  *
178  * Revision 2.0 2000/01/18 10:46:08 eric
179  * *** empty log message ***
180  *
181  *
182  * $Header: /cvsroot/Lorene/C++/Include/eos.h,v 1.28 2024/01/26 17:44:25 g_servignat Exp $
183  *
184  */
185 
186 // Standard C++
187 #include "headcpp.h"
188 #include "utilitaires.h"
189 
190 // Headers C
191 #include <cstdio>
192 
193 // Lorene classes
194 namespace Lorene {
195 class Tbl ;
196 class Cmp ;
197 class Scalar ;
198 class Param ;
199 
200  //------------------------------------//
201  // base class Eos //
202  //------------------------------------//
203 
209 class Eos {
210 
211  // Data :
212  // -----
213 
214  protected:
215  char name[100] ;
216 
217 
218  // Constructors - Destructor
219  // -------------------------
220  protected:
221  Eos() ;
222 
224  explicit Eos(const char* name_i) ;
225 
226  Eos(const Eos& ) ;
227 
228  protected:
235  Eos(FILE* ) ;
236 
242  Eos(ifstream& ) ;
243 
244 
245  public:
246  virtual ~Eos() ;
247 
248 
249  // Name manipulation
250  // -----------------
251  public:
252  const char* get_name() const ;
253 
254 
256  void set_name(const char* name_i) ;
257 
258  // Miscellaneous
259  // -------------
260  public:
264  static Eos* eos_from_file(FILE* ) ;
265 
297  static Eos* eos_from_file(ifstream& ) ;
298 
300  virtual bool operator==(const Eos& ) const = 0 ;
301 
303  virtual bool operator!=(const Eos& ) const = 0 ;
304 
308  virtual int identify() const = 0 ;
309 
310  // Outputs
311  // -------
312 
313  public:
314  virtual void sauve(FILE* ) const ;
315 
317  friend ostream& operator<<(ostream& , const Eos& ) ;
318 
319  protected:
320  virtual ostream& operator>>(ostream &) const = 0 ;
321 
322 
323  // Computational functions
324  // -----------------------
325  protected:
343  void calcule(const Cmp& thermo, int nzet, int l_min,
344  double (Eos::*fait)(double, const Param*) const,
345  Param* par, Cmp& resu) const ;
346 
366  void calcule(const Scalar& thermo, int nzet, int l_min,
367  double (Eos::*fait)(double, const Param*) const,
368  Param* par, Scalar& resu) const ;
369 
370  public:
383  virtual double nbar_ent_p(double ent, const Param* par=0x0) const = 0 ;
384 
405  Cmp nbar_ent(const Cmp& ent, int nzet, int l_min = 0, Param* par=0x0) const ;
406 
428  Scalar nbar_ent(const Scalar& ent, int nzet, int l_min = 0, Param* par=0x0) const ;
429 
442  virtual double ener_ent_p(double ent, const Param* par=0x0) const = 0 ;
443 
463  Cmp ener_ent(const Cmp& ent, int nzet, int l_min = 0, Param* par=0x0) const ;
464 
485  Scalar ener_ent(const Scalar& ent, int nzet, int l_min = 0, Param* par=0x0) const ;
486 
499  virtual double press_ent_p(double ent, const Param* par=0x0) const = 0 ;
500 
501 
521  Cmp press_ent(const Cmp& ent, int nzet, int l_min = 0, Param* par=0x0) const ;
522 
543  Scalar press_ent(const Scalar& ent, int nzet, int l_min = 0, Param* par=0x0) const ;
544 
557  virtual double der_nbar_ent_p(double ent, const Param* par=0x0) const = 0 ;
558 
580  Cmp der_nbar_ent(const Cmp& ent, int nzet, int l_min = 0, Param* par=0x0) const ;
581 
604  Scalar der_nbar_ent(const Scalar& ent, int nzet, int l_min = 0, Param* par=0x0) const ;
605 
618  virtual double der_ener_ent_p(double ent, const Param* par=0x0) const = 0 ;
619 
641  Cmp der_ener_ent(const Cmp& ent, int nzet, int l_min = 0, Param* par=0x0) const ;
642 
665  Scalar der_ener_ent(const Scalar& ent, int nzet, int l_min = 0, Param* par=0x0) const ;
666 
679  virtual double der_press_ent_p(double ent, const Param* par=0x0) const = 0 ;
680 
702  Cmp der_press_ent(const Cmp& ent, int nzet, int l_min = 0, Param* par=0x0) const ;
703 
726  Scalar der_press_ent(const Scalar& ent, int nzet, int l_min = 0, Param* par=0x0) const ;
727 
738  virtual double csound_square_ent_p(double ent, const Param* par=0x0) const = 0 ;
739 
759  Scalar csound_square_ent(const Scalar& ent, int nzet, int l_min = 0, Param* par=0x0) const ;
760 };
761 ostream& operator<<(ostream& , const Eos& ) ;
762 
763 
764  //------------------------------------//
765  // class Eos_poly //
766  //------------------------------------//
767 
768 
812 class Eos_poly : public Eos {
813 
814  // Data :
815  // -----
816 
817  protected:
819  double gam ;
820 
826  double kap ;
827 
831  double m_0 ;
832 
837  double mu_0 ;
838 
839 
840 
841  double gam1 ;
842  double unsgam1 ;
843  double gam1sgamkap ;
844  double rel_mu_0 ;
845  double ent_0 ;
846 
847  // Constructors - Destructor
848  // -------------------------
849  public:
850 
864  Eos_poly(double gamma, double kappa) ;
865 
878  Eos_poly(double gamma, double kappa, double mass) ;
879 
896  Eos_poly(double gamma, double kappa, double mass, double mu_zero) ;
897 
898  Eos_poly(const Eos_poly& ) ;
899 
900  protected:
907  Eos_poly(FILE* ) ;
908 
914  Eos_poly(ifstream& ) ;
915 
917  friend Eos* Eos::eos_from_file(FILE* ) ;
918  friend Eos* Eos::eos_from_file(ifstream& ) ;
919 
920  public:
921  virtual ~Eos_poly() ;
922 
923  // Assignment
924  // ----------
926  void operator=(const Eos_poly& ) ;
927 
928 
929  // Miscellaneous
930  // -------------
931 
932  public :
934  virtual bool operator==(const Eos& ) const ;
935 
937  virtual bool operator!=(const Eos& ) const ;
938 
942  virtual int identify() const ;
943 
945  double get_gam() const ;
946 
952  double get_kap() const ;
953 
958  double get_m_0() const ;
959 
963  double get_mu_0() const ;
964 
965  protected:
969  void set_auxiliary() ;
970 
971 
972  // Outputs
973  // -------
974 
975  public:
976  virtual void sauve(FILE* ) const ;
977 
978  protected:
979  virtual ostream& operator>>(ostream &) const ;
980 
981 
982  // Computational functions
983  // -----------------------
984 
985  public:
995  virtual double nbar_ent_p(double ent, const Param* par=0x0) const ;
996 
1006  virtual double ener_ent_p(double ent, const Param* par=0x0) const ;
1007 
1017  virtual double press_ent_p(double ent, const Param* par=0x0) const ;
1018 
1028  virtual double der_nbar_ent_p(double ent, const Param* par=0x0) const ;
1029 
1039  virtual double der_ener_ent_p(double ent, const Param* par=0x0) const ;
1040 
1050  virtual double der_press_ent_p(double ent, const Param* par=0x0) const ;
1051 
1062  virtual double csound_square_ent_p(double ent, const Param* par=0x0) const ;
1063 };
1064 
1065  //------------------------------------//
1066  // class Eos_poly_newt //
1067  //------------------------------------//
1068 
1069 
1070 
1110 class Eos_poly_newt : public Eos_poly {
1111 
1112  // Data :
1113  // -----
1114 
1115  // no new data with respect to Eos_poly
1116 
1117  // Constructors - Destructor
1118  // -------------------------
1119  public:
1120 
1134  Eos_poly_newt(double gamma, double kappa) ;
1135 
1136  Eos_poly_newt(const Eos_poly_newt& ) ;
1137 
1138  protected:
1145  Eos_poly_newt(FILE* ) ;
1146 
1152  Eos_poly_newt(ifstream& ) ;
1153 
1155  friend Eos* Eos::eos_from_file(FILE* ) ;
1156  friend Eos* Eos::eos_from_file(ifstream& ) ;
1157 
1158 
1159  public:
1160  virtual ~Eos_poly_newt() ;
1161 
1162  // Assignment
1163  // ----------
1165  void operator=(const Eos_poly_newt& ) ;
1166 
1167  // Miscellaneous
1168  // -------------
1169 
1170  public :
1172  virtual bool operator==(const Eos& ) const ;
1173 
1175  virtual bool operator!=(const Eos& ) const ;
1176 
1180  virtual int identify() const ;
1181 
1182  // Outputs
1183  // -------
1184 
1185  public:
1186  virtual void sauve(FILE* ) const ;
1187 
1188  protected:
1189  virtual ostream& operator>>(ostream &) const ;
1190 
1191 
1192  // Computational functions
1193  // -----------------------
1194 
1195  public:
1204  virtual double nbar_ent_p(double ent, const Param* par=0x0) const ;
1205 
1214  virtual double ener_ent_p(double ent, const Param* par=0x0) const ;
1215 
1224  virtual double press_ent_p(double ent, const Param* par=0x0) const ;
1225 
1234  virtual double der_nbar_ent_p(double ent, const Param* par=0x0) const ;
1235 
1244  virtual double der_ener_ent_p(double ent, const Param* par=0x0) const ;
1245 
1254  virtual double der_press_ent_p(double ent, const Param* par=0x0) const ;
1255 
1266  virtual double csound_square_ent_p(double, const Param*) const {
1267  c_est_pas_fait(__FILE__) ;
1268  return 0;
1269  } ;
1270 };
1271 
1272  //------------------------------------//
1273  // class Pseudo_polytrope_1D //
1274  //------------------------------------//
1275 
1276 /*
1277  Pseudo-polytropic fit of cold EoS
1278  [Doc to be written]
1279 */
1280 class Pseudo_polytrope_1D : public Eos {
1281  // Data :
1282  // -----
1283 
1284  Tbl* coefs;
1285  double gamma_low, kappa_low, n_lim1, n_lim2, ent_lim1, ent_lim2, m_n, Lambda, ddd, Kappa_GPP, Gamma_GPP, Lambda_GPP, ddd_GPP;
1286  int n_coefs ;
1287  Eos_poly* eos_low ;
1288 
1289 
1290  // Constructors - Destructor
1291  // -------------------------
1292  public:
1293 
1302  Pseudo_polytrope_1D(const Tbl&, double, double) ;
1303 
1305 
1306  protected:
1313  Pseudo_polytrope_1D(FILE* ) ;
1314 
1320  Pseudo_polytrope_1D(ifstream& ) ;
1321 
1323  friend Eos* Eos::eos_from_file(FILE* ) ;
1324  friend Eos* Eos::eos_from_file(ifstream& ) ;
1325 
1326 
1327  public:
1328  virtual ~Pseudo_polytrope_1D() ;
1329 
1330  // Assignment
1331  // ----------
1333  void operator=(const Pseudo_polytrope_1D& ) ;
1334 
1335  // Miscellaneous
1336  // -------------
1337 
1338  public :
1340  virtual bool operator==(const Eos& ) const ;
1341 
1343  virtual bool operator!=(const Eos& ) const ;
1344 
1348  virtual int identify() const ;
1349 
1350  // Outputs
1351  // -------
1352 
1353  public:
1354  virtual void sauve(FILE* ) const ;
1355 
1356  protected:
1357  virtual ostream& operator>>(ostream &) const ;
1358 
1359 
1360  // Computational functions
1361  // -----------------------
1362 
1363  public:
1372  virtual double nbar_ent_p(double ent, const Param* par=0x0) const ;
1373 
1382  virtual double ener_ent_p(double ent, const Param* par=0x0) const ;
1383 
1392  virtual double press_ent_p(double ent, const Param* par=0x0) const ;
1393 
1402  virtual double der_nbar_ent_p(double ent, const Param* par=0x0) const ;
1403 
1412  virtual double der_ener_ent_p(double ent, const Param* par=0x0) const ;
1413 
1422  virtual double der_press_ent_p(double ent, const Param* par=0x0) const ;
1423 
1434  virtual double csound_square_ent_p(double, const Param*) const ;
1435 
1436  double get_ent_lim1() const { return ent_lim1 ;} ;
1437  double get_n_lim1() const { return n_lim1 ;} ;
1438  double get_ent_lim2() const { return ent_lim2 ;} ;
1439  double get_n_lim2() const { return n_lim2 ;} ;
1440 };
1441 
1442  //------------------------------------//
1443  // class Piecewise_polytrope_1D //
1444  //------------------------------------//
1445 
1446 /*
1447  Pseudo-polytropic fit of cold EoS
1448  [Doc to be written]
1449 */
1450 class Piecewise_polytrope_1D : public Eos {
1451  // Data :
1452  // -----
1453 
1454  Tbl *gamma_high, *kappa_high, *Lambda_high, *a_high, *n_lim_high, *ent_lim_high;
1455  double gamma_low, kappa_low, n_lim, ent_lim;
1456  int n_param_high ;
1457  Eos_poly* eos_low ;
1458 
1459 
1460  // Constructors - Destructor
1461  // -------------------------
1462  public:
1463 
1481  Piecewise_polytrope_1D(const Tbl&, const Tbl&, const Tbl&, const Tbl&, const Tbl&, const Tbl&, double, double, double) ;
1482 
1484 
1485  protected:
1492  Piecewise_polytrope_1D(FILE* ) ;
1493 
1499  Piecewise_polytrope_1D(ifstream& ) ;
1500 
1502  friend Eos* Eos::eos_from_file(FILE* ) ;
1503  friend Eos* Eos::eos_from_file(ifstream& ) ;
1504 
1505 
1506  public:
1507  virtual ~Piecewise_polytrope_1D() ;
1508 
1509  // Assignment
1510  // ----------
1512  void operator=(const Piecewise_polytrope_1D& ) ;
1513 
1514  // Miscellaneous
1515  // -------------
1516 
1517  public :
1519  virtual bool operator==(const Eos& ) const ;
1520 
1522  virtual bool operator!=(const Eos& ) const ;
1523 
1527  virtual int identify() const ;
1528 
1529  // Outputs
1530  // -------
1531 
1532  public:
1533  virtual void sauve(FILE* ) const ;
1534 
1535  protected:
1536  virtual ostream& operator>>(ostream &) const ;
1537 
1538 
1539  // Computational functions
1540  // -----------------------
1541 
1542  public:
1551  virtual double nbar_ent_p(double ent, const Param* par=0x0) const ;
1552 
1561  virtual double ener_ent_p(double ent, const Param* par=0x0) const ;
1562 
1571  virtual double press_ent_p(double ent, const Param* par=0x0) const ;
1572 
1581  virtual double der_nbar_ent_p(double ent, const Param* par=0x0) const ;
1582 
1591  virtual double der_ener_ent_p(double ent, const Param* par=0x0) const ;
1592 
1601  virtual double der_press_ent_p(double ent, const Param* par=0x0) const ;
1602 
1613  virtual double csound_square_ent_p(double, const Param*) const ;
1614 
1615  double get_ent_lim() const { return ent_lim ;} ;
1616  Tbl* get_gamma_high() const { return gamma_high;} ;
1617  Tbl* get_kappa_high() const { return kappa_high;} ;
1618  Tbl* get_n_lim_high() const { return n_lim_high;} ;
1619  Tbl* get_ent_lim_high() const { return ent_lim_high;} ;
1620  Tbl* get_Lambda_high() const { return Lambda_high;} ;
1621  Tbl* get_a_high() const { return a_high;} ;
1622 };
1623 
1624  //------------------------------------//
1625  // class Eos_incomp //
1626  //------------------------------------//
1627 
1628 
1637 class Eos_incomp : public Eos {
1638 
1639  // Data :
1640  // -----
1641 
1642  protected:
1644  double rho0 ;
1645 
1649  double ent0 ;
1650 
1651  // Constructors - Destructor
1652  // -------------------------
1653  public:
1654 
1664  Eos_incomp(double rho_c) ;
1665 
1676  Eos_incomp(double rho_c, double ent_c) ;
1677 
1678  Eos_incomp(const Eos_incomp& ) ;
1679 
1680  protected:
1687  Eos_incomp(FILE* ) ;
1688 
1694  Eos_incomp(ifstream& ) ;
1695 
1697  friend Eos* Eos::eos_from_file(FILE* ) ;
1698  friend Eos* Eos::eos_from_file(ifstream& ) ;
1699 
1700  public:
1701  virtual ~Eos_incomp() ;
1702 
1703  // Assignment
1704  // ----------
1706  void operator=(const Eos_incomp& ) ;
1707 
1708 
1709  // Miscellaneous
1710  // -------------
1711 
1712  public :
1714  virtual bool operator==(const Eos& ) const ;
1715 
1717  virtual bool operator!=(const Eos& ) const ;
1718 
1722  virtual int identify() const ;
1723 
1724  // Outputs
1725  // -------
1726 
1727  public:
1728  virtual void sauve(FILE* ) const ;
1729 
1730  protected:
1731  virtual ostream& operator>>(ostream &) const ;
1732 
1733 
1734  // Computational functions
1735  // -----------------------
1736 
1737  public:
1745  virtual double nbar_ent_p(double ent, const Param* par=0x0) const ;
1746 
1754  virtual double ener_ent_p(double ent, const Param* par=0x0) const ;
1755 
1763  virtual double press_ent_p(double ent, const Param* par=0x0) const ;
1764 
1772  virtual double der_nbar_ent_p(double ent, const Param* par=0x0) const ;
1773 
1781  virtual double der_ener_ent_p(double ent, const Param* par=0x0) const ;
1782 
1790  virtual double der_press_ent_p(double ent, const Param* par=0x0) const ;
1791 
1802  virtual double csound_square_ent_p(double, const Param*) const {
1803  c_est_pas_fait(__FILE__) ;
1804  return 0;
1805  } ;
1806 };
1807 
1808  //------------------------------------//
1809  // class Eos_incomp_newt //
1810  //------------------------------------//
1811 
1812 
1821 class Eos_incomp_newt : public Eos_incomp {
1822 
1823  // Data :
1824  // -----
1825 
1826  // no new data with respect to Eos_incomp
1827 
1828  // Constructors - Destructor
1829  // -------------------------
1830  public:
1831 
1841  Eos_incomp_newt(double rho_c) ;
1842 
1853  Eos_incomp_newt(double rho_c, double ent_c) ;
1854 
1855  Eos_incomp_newt(const Eos_incomp_newt& ) ;
1856 
1857  protected:
1864  Eos_incomp_newt(FILE* ) ;
1865 
1871  Eos_incomp_newt(ifstream& ) ;
1872 
1874  friend Eos* Eos::eos_from_file(FILE* ) ;
1875  friend Eos* Eos::eos_from_file(ifstream& ) ;
1876 
1877  public:
1878  virtual ~Eos_incomp_newt() ;
1879 
1880  // Assignment
1881  // ----------
1883  void operator=(const Eos_incomp_newt& ) ;
1884 
1885 
1886  // Miscellaneous
1887  // -------------
1888 
1889  public :
1891  virtual bool operator==(const Eos& ) const ;
1892 
1894  virtual bool operator!=(const Eos& ) const ;
1895 
1899  virtual int identify() const ;
1900 
1901  // Outputs
1902  // -------
1903 
1904  public:
1905  virtual void sauve(FILE* ) const ;
1906 
1907  protected:
1908  virtual ostream& operator>>(ostream &) const ;
1909 
1910 
1911  // Computational functions
1912  // -----------------------
1913 
1914  public:
1922  virtual double nbar_ent_p(double ent, const Param* par=0x0) const ;
1923 
1931  virtual double ener_ent_p(double ent, const Param* par=0x0) const ;
1932 
1940  virtual double press_ent_p(double ent, const Param* par=0x0) const ;
1941 
1949  virtual double der_nbar_ent_p(double ent, const Param* par=0x0) const ;
1950 
1958  virtual double der_ener_ent_p(double ent, const Param* par=0x0) const ;
1959 
1967  virtual double der_press_ent_p(double ent, const Param* par=0x0) const ;
1968 
1979  virtual double csound_square_ent_p(double, const Param*) const {
1980  c_est_pas_fait(__FILE__) ;
1981  return 0;
1982  } ;
1983 };
1984 
1985 
1986  //------------------------------------//
1987  // class Eos_strange //
1988  //------------------------------------//
1989 
1990 
1999 class Eos_strange : public Eos {
2000 
2001  // Data :
2002  // -----
2003 
2004  protected:
2008  double n0_b60 ;
2009 
2011  double b60 ;
2012 
2016  double ent0 ;
2017 
2022  double eps_fit ;
2023 
2027  double rho0_b60 ;
2028 
2032  double n0 ;
2033 
2038  double rho0 ;
2039 
2043  double b34 ;
2044 
2048  double fach ;
2049 
2050  // Constructors - Destructor
2051  // -------------------------
2052  public:
2053 
2069  Eos_strange(double n0_b60_i, double b60_i, double ent0_i,
2070  double eps_fit_i, double rho0_b60_i) ;
2071 
2072 
2073  Eos_strange(const Eos_strange& ) ;
2074 
2075  protected:
2082  Eos_strange(FILE* ) ;
2083 
2089  Eos_strange(ifstream& ) ;
2090 
2092  friend Eos* Eos::eos_from_file(FILE* ) ;
2093  friend Eos* Eos::eos_from_file(ifstream& ) ;
2094 
2095  public:
2096  virtual ~Eos_strange() ;
2097 
2098  // Assignment
2099  // ----------
2101  void operator=(const Eos_strange& ) ;
2102 
2103 
2104  // Miscellaneous
2105  // -------------
2106 
2107  public :
2109  virtual bool operator==(const Eos& ) const ;
2110 
2112  virtual bool operator!=(const Eos& ) const ;
2113 
2117  virtual int identify() const ;
2118 
2122  double get_n0_b60() const {return n0_b60;} ;
2123 
2125  double get_b60() const {return b60;} ;
2126 
2130  double get_ent0() const {return ent0;} ;
2131 
2136  double get_eps_fit() const {return eps_fit;} ;
2137 
2141  double get_rho0_b60() const {return rho0_b60;} ;
2142 
2143  protected:
2148  void set_auxiliary() ;
2149 
2150 
2151  // Outputs
2152  // -------
2153 
2154  public:
2155  virtual void sauve(FILE* ) const ;
2156 
2157  protected:
2158  virtual ostream& operator>>(ostream &) const ;
2159 
2160 
2161  // Computational functions
2162  // -----------------------
2163 
2164  public:
2172  virtual double nbar_ent_p(double ent, const Param* par=0x0) const ;
2173 
2181  virtual double ener_ent_p(double ent, const Param* par=0x0) const ;
2182 
2190  virtual double press_ent_p(double ent, const Param* par=0x0) const ;
2191 
2199  virtual double der_nbar_ent_p(double ent, const Param* par=0x0) const ;
2200 
2208  virtual double der_ener_ent_p(double ent, const Param* par=0x0) const ;
2209 
2217  virtual double der_press_ent_p(double ent, const Param* par=0x0) const ;
2218 
2229  virtual double csound_square_ent_p(double, const Param*) const {
2230  c_est_pas_fait(__FILE__) ;
2231  return 0;
2232  } ;
2233 };
2234 
2235 
2236  //------------------------------------//
2237  // class Eos_strange_cr //
2238  //------------------------------------//
2239 
2240 
2252 class Eos_strange_cr : public Eos {
2253 
2254  // Data :
2255  // -----
2256 
2257  protected:
2261  double n0_b60 ;
2262 
2264  double b60 ;
2265 
2269  double ent0 ;
2270 
2275  double eps_fit ;
2276 
2280  double rho0_b60 ;
2281 
2286  double ent_nd ;
2287 
2293  double rho_nd ;
2294 
2298  double gam ;
2299 
2300  // Derived data:
2301  // -------------
2302 
2306  double n0 ;
2307 
2312  double rho0 ;
2313 
2317  double b34 ;
2318 
2322  double fach ;
2323 
2329  double rho_nd_nucl ;
2330 
2334  double x_nd ;
2335 
2337  double ncr_nd ;
2338 
2340  double delent ;
2341 
2343  double unsgam1 ;
2344 
2346  double gam1sx ;
2347 
2348 
2349  // Constructors - Destructor
2350  // -------------------------
2351  public:
2352 
2374  Eos_strange_cr(double n0_b60_i, double b60_i, double ent0_i,
2375  double eps_fit_i, double rho0_b60_i,
2376  double ent_nd_i, double rho_nd_i,
2377  double gam_i) ;
2378 
2379 
2380  Eos_strange_cr(const Eos_strange_cr& ) ;
2381 
2382  protected:
2389  Eos_strange_cr(FILE* ) ;
2390 
2396  Eos_strange_cr(ifstream& ) ;
2397 
2399  friend Eos* Eos::eos_from_file(FILE* ) ;
2400  friend Eos* Eos::eos_from_file(ifstream& ) ;
2401 
2402  public:
2403  virtual ~Eos_strange_cr() ;
2404 
2405  // Assignment
2406  // ----------
2408  void operator=(const Eos_strange_cr& ) ;
2409 
2410 
2411  // Miscellaneous
2412  // -------------
2413 
2414  public :
2416  virtual bool operator==(const Eos& ) const ;
2417 
2419  virtual bool operator!=(const Eos& ) const ;
2420 
2424  virtual int identify() const ;
2425 
2429  double get_n0_b60() const {return n0_b60;} ;
2430 
2432  double get_b60() const {return b60;} ;
2433 
2437  double get_ent0() const {return ent0;} ;
2438 
2443  double get_eps_fit() const {return eps_fit;} ;
2444 
2448  double get_rho0_b60() const {return rho0_b60;} ;
2449 
2453  double get_ent_nd() const {return ent_nd;} ;
2454 
2460  double get_rho_nd() const {return rho_nd;} ;
2461 
2464  double get_gam() const {return gam;} ;
2465 
2466 
2467 
2468  protected:
2473  void set_auxiliary() ;
2474 
2475 
2476  // Outputs
2477  // -------
2478 
2479  public:
2480  virtual void sauve(FILE* ) const ;
2481 
2482  protected:
2483  virtual ostream& operator>>(ostream &) const ;
2484 
2485 
2486  // Computational functions
2487  // -----------------------
2488 
2489  public:
2497  virtual double nbar_ent_p(double ent, const Param* par=0x0) const ;
2498 
2506  virtual double ener_ent_p(double ent, const Param* par=0x0) const ;
2507 
2515  virtual double press_ent_p(double ent, const Param* par=0x0) const ;
2516 
2524  virtual double der_nbar_ent_p(double ent, const Param* par=0x0) const ;
2525 
2533  virtual double der_ener_ent_p(double ent, const Param* par=0x0) const ;
2534 
2542  virtual double der_press_ent_p(double ent, const Param* par=0x0) const ;
2543 
2554  virtual double csound_square_ent_p(double, const Param*) const {
2555  c_est_pas_fait(__FILE__) ;
2556  return 0;
2557  } ;
2558 };
2559 
2560 
2561  //----------------------------//
2562  // class Eos_Fermi //
2563  //----------------------------//
2564 
2565 
2577 class Eos_Fermi : public Eos {
2578 
2579  // Data :
2580  // -----
2581 
2582  protected:
2586  double m_0 ;
2587 
2590  int g_s ;
2591 
2592 
2594  double n_0 ;
2595 
2599  double ener_0 ;
2600 
2601 
2605  double p_0 ;
2606 
2607  // Constructors - Destructor
2608  // -------------------------
2609  public:
2610 
2616  Eos_Fermi(double mass) ;
2617 
2624  Eos_Fermi(double mass, int g_degen) ;
2625 
2626  Eos_Fermi(const Eos_Fermi& ) ;
2627 
2628  protected:
2635  Eos_Fermi(FILE* ) ;
2636 
2642  Eos_Fermi(ifstream& ) ;
2643 
2645  friend Eos* Eos::eos_from_file(FILE* ) ;
2646  friend Eos* Eos::eos_from_file(ifstream& ) ;
2647 
2648  public:
2649  virtual ~Eos_Fermi() ;
2650 
2651  // Assignment
2652  // ----------
2654  void operator=(const Eos_Fermi& ) ;
2655 
2656 
2657  // Miscellaneous
2658  // -------------
2659 
2660  public :
2662  virtual bool operator==(const Eos& ) const ;
2663 
2665  virtual bool operator!=(const Eos& ) const ;
2666 
2670  virtual int identify() const ;
2671 
2673  double get_m() const ;
2674 
2676  int get_g_degen() const ;
2677 
2678  protected:
2681  void set_auxiliary() ;
2682 
2683 
2684  // Outputs
2685  // -------
2686 
2687  public:
2688  virtual void sauve(FILE* ) const ;
2689 
2690  protected:
2691  virtual ostream& operator>>(ostream &) const ;
2692 
2693 
2694  // Computational functions
2695  // -----------------------
2696 
2697  public:
2705  virtual double nbar_ent_p(double ent, const Param* par=0x0) const ;
2706 
2714  virtual double ener_ent_p(double ent, const Param* par=0x0) const ;
2715 
2723  virtual double press_ent_p(double ent, const Param* par=0x0) const ;
2724 
2732  virtual double der_nbar_ent_p(double ent, const Param* par=0x0) const ;
2733 
2741  virtual double der_ener_ent_p(double ent, const Param* par=0x0) const ;
2742 
2750  virtual double der_press_ent_p(double ent, const Param* par=0x0) const ;
2751 
2762  virtual double csound_square_ent_p(double, const Param*) const {
2763  c_est_pas_fait(__FILE__) ;
2764  return 0;
2765  } ;
2766 };
2767 
2768 
2769 
2770 
2771  //------------------------------//
2772  // EOS with domain dependency //
2773  //------------------------------//
2774 
2780 class MEos : public Eos {
2781 
2782  // Data :
2783  // -----
2784 
2785  protected:
2787  const Eos** mono_eos ;
2788 
2790  int ndom ;
2791 
2794 
2795  // Constructors - Destructor
2796  // -------------------------
2797  public:
2798 
2803  MEos(int ndom_i, const Eos** mono_eos_i) ;
2804 
2806  MEos(const Eos& eos1, const Eos& eos2) ;
2807 
2809  MEos(const Eos& eos1, const Eos& eos2, const Eos& eos3) ;
2810 
2812  MEos(const Eos& eos1, const Eos& eos2, const Eos& eos3, const Eos& eos4) ;
2813 
2814  MEos(const MEos& ) ;
2815 
2816  protected:
2823  MEos(FILE* ) ;
2824 
2830  MEos(ifstream& ) ;
2831 
2833  friend Eos* Eos::eos_from_file(FILE* ) ;
2834  friend Eos* Eos::eos_from_file(ifstream& ) ;
2835 
2836  public:
2837  virtual ~MEos() ;
2838 
2839  // Assignment
2840  // ----------
2842  void operator=(const MEos& ) ;
2843 
2844 
2845  // Miscellaneous
2846  // -------------
2847 
2848  public :
2850  virtual bool operator==(const Eos& ) const ;
2851 
2853  virtual bool operator!=(const Eos& ) const ;
2854 
2858  virtual int identify() const ;
2859 
2860  // Outputs
2861  // -------
2862 
2863  public:
2864  virtual void sauve(FILE* ) const ;
2865 
2866  protected:
2867  virtual ostream& operator>>(ostream &) const ;
2868 
2869 
2870  // Computational functions
2871  // -----------------------
2872 
2873  public:
2883  virtual double nbar_ent_p(double ent, const Param* par=0x0) const ;
2884 
2894  virtual double ener_ent_p(double ent, const Param* par=0x0) const ;
2895 
2905  virtual double press_ent_p(double ent, const Param* par=0x0) const ;
2906 
2916  virtual double der_nbar_ent_p(double ent, const Param* par=0x0) const ;
2917 
2927  virtual double der_ener_ent_p(double ent, const Param* par=0x0) const ;
2928 
2938  virtual double der_press_ent_p(double ent, const Param* par=0x0) const ;
2939 
2950  virtual double csound_square_ent_p(double, const Param*) const {
2951  c_est_pas_fait(__FILE__) ;
2952  return 0;
2953  } ;
2954 };
2955 
2956 }
2957  //------------------//
2958  // Remaining EOS //
2959  //------------------//
2960 
2961 #include "eos_tabul.h"
2962 #include "eos_compose.h"
2963 #include "eos_mag.h"
2964 
2965 #endif
virtual double ener_ent_p(double ent, const Param *par=0x0) const
Computes the total energy density from the log-enthalpy.
Definition: eos_poly.C:398
virtual bool operator==(const Eos &) const =0
Comparison operator (egality)
double eps_fit
Fitting parameter related to the square of sound velocity by .
Definition: eos.h:2275
virtual double nbar_ent_p(double ent, const Param *par=0x0) const
Computes the baryon density from the log-enthalpy.
Definition: eos_strange.C:317
double get_rho0_b60() const
Returns the energy density at zero pressure divided by .
Definition: eos.h:2141
virtual ostream & operator>>(ostream &) const
Operator >>
virtual bool operator==(const Eos &) const
Comparison operator (egality)
double get_n0_b60() const
Returns the baryon density at zero pressure divided by [unit: ].
Definition: eos.h:2122
virtual int identify() const
Returns a number to identify the sub-classe of Eos the object belongs to.
virtual double nbar_ent_p(double ent, const Param *par=0x0) const
Computes the baryon density from the specific enthalpy.
virtual double der_press_ent_p(double ent, const Param *par=0x0) const
Computes the logarithmic derivative from the log-enthalpy.
Definition: eos_poly.C:455
virtual ~Eos_incomp_newt()
Destructor.
double unsgam1
Definition: eos.h:842
virtual double ener_ent_p(double ent, const Param *par=0x0) const
Computes the total energy density from the specific enthalpy.
virtual int identify() const
Returns a number to identify the sub-classe of Eos the object belongs to.
double b34
Definition: eos.h:2043
int get_g_degen() const
Returns the degeneracy factor.
Definition: eos_fermi.C:169
virtual double ener_ent_p(double ent, const Param *par=0x0) const
Computes the total energy density from the log-enthalpy.
Definition: eos_strange.C:332
virtual bool operator!=(const Eos &) const
Comparison operator (difference)
virtual double der_nbar_ent_p(double ent, const Param *par=0x0) const
Computes the logarithmic derivative from the log-enthalpy.
Definition: meos.C:326
virtual int identify() const
Returns a number to identify the sub-classe of Eos the object belongs to.
virtual double der_press_ent_p(double ent, const Param *par=0x0) const
Computes the logarithmic derivative from the log-enthalpy.
Definition: meos.C:348
Component of a tensorial field *** DEPRECATED : use class Scalar instead ***.
Definition: cmp.h:446
double rho_nd_nucl
Energy density at neutron drip point, defining the boundary between crust and core [unit: rho_unit ]...
Definition: eos.h:2329
Cmp ener_ent(const Cmp &ent, int nzet, int l_min=0, Param *par=0x0) const
Computes the total energy density from the log-enthalpy and extra parameters.
Definition: eos.C:387
virtual double der_press_ent_p(double ent, const Param *par=0x0) const
Computes the logarithmic derivative from the log-enthalpy.
void operator=(const Eos_poly_newt &)
Assignment to another Eos_poly_newt.
virtual int identify() const
Returns a number to identify the sub-classe of Eos the object belongs to.
virtual double der_press_ent_p(double ent, const Param *par=0x0) const =0
Computes the logarithmic derivative from the log-enthalpy and extra parameters (virtual function imp...
virtual double press_ent_p(double ent, const Param *par=0x0) const
Computes the pressure from the specific enthalpy.
virtual double der_nbar_ent_p(double ent, const Param *par=0x0) const =0
Computes the logarithmic derivative from the log-enthalpy and extra parameters (virtual function imp...
Cmp der_nbar_ent(const Cmp &ent, int nzet, int l_min=0, Param *par=0x0) const
Computes the logarithmic derivative from the log-enthalpy and extra parameters.
Definition: eos.C:431
const char * get_name() const
Returns the EOS name.
Definition: eos.C:179
virtual ostream & operator>>(ostream &) const
Operator >>
void operator=(const Eos_strange &)
Assignment to another Eos_strange.
Definition: eos_strange.C:175
double x_nd
Ratio of pressure to energy density at neutron drip point.
Definition: eos.h:2334
virtual double der_ener_ent_p(double ent, const Param *par=0x0) const
Computes the logarithmic derivative from the log-enthalpy.
Definition: eos_strange.C:382
virtual int identify() const
Returns a number to identify the sub-classe of Eos the object belongs to.
virtual double der_ener_ent_p(double ent, const Param *par=0x0) const
Computes the logarithmic derivative from the log-enthalpy.
Definition: eos_fermi.C:314
void operator=(const MEos &)
Assignment to another MEos.
Definition: meos.C:204
virtual double csound_square_ent_p(double, const Param *) const
Computes the sound speed squared from the enthapy with extra parameters (virtual function implemente...
Definition: eos.h:1802
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: meos.C:248
Lorene prototypes.
Definition: app_hor.h:67
virtual ~Eos_Fermi()
Destructor.
Definition: eos_fermi.C:126
MEos(int ndom_i, const Eos **mono_eos_i)
Standard constructor.
Definition: meos.C:88
Equation of state base class.
Definition: eos.h:209
virtual int identify() const
Returns a number to identify the sub-classe of Eos the object belongs to.
void operator=(const Piecewise_polytrope_1D &)
Assignment to another Piecewise_polytrope_1D.
virtual ~Eos_incomp()
Destructor.
Definition: eos_incomp.C:148
int ndom
Number of domains.
Definition: eos.h:2790
virtual bool operator!=(const Eos &) const
Comparison operator (difference)
Definition: eos_incomp.C:202
virtual int identify() const =0
Returns a number to identify the sub-classe of Eos the object belongs to.
virtual double der_nbar_ent_p(double ent, const Param *par=0x0) const
Computes the logarithmic derivative from the log-enthalpy.
Definition: eos_incomp.C:286
Tensor field of valence 0 (or component of a tensorial field).
Definition: scalar.h:393
Scalar csound_square_ent(const Scalar &ent, int nzet, int l_min=0, Param *par=0x0) const
Computes the sound speed squared from the enthalpy with extra parameters.
Definition: eos.C:499
virtual bool operator!=(const Eos &) const
Comparison operator (difference)
virtual ~Eos_poly()
Destructor.
Definition: eos_poly.C:230
virtual double der_nbar_ent_p(double ent, const Param *par=0x0) const
Computes the logarithmic derivative from the specific enthalpy.
virtual void sauve(FILE *) const
Save in a file.
Definition: eos_strange.C:278
virtual bool operator==(const Eos &) const
Comparison operator (egality)
Definition: eos_strange.C:214
virtual void sauve(FILE *) const
Save in a file.
double get_gam() const
Returns the adiabatic index for the crust model.
Definition: eos.h:2464
virtual double der_press_ent_p(double ent, const Param *par=0x0) const
Computes the logarithmic derivative from the specific enthalpy.
virtual void sauve(FILE *) const
Save in a file.
virtual double der_nbar_ent_p(double ent, const Param *par=0x0) const
Computes the logarithmic derivative from the log-enthalpy.
Definition: eos_fermi.C:304
void operator=(const Eos_Fermi &)
Assignment to another Eos_Fermi.
Definition: eos_fermi.C:135
double ent_nd
Log-enthalpy at neutron drip point, defining the boundary between crust and core. ...
Definition: eos.h:2286
virtual double der_nbar_ent_p(double ent, const Param *par=0x0) const
Computes the logarithmic derivative from the log-enthalpy.
double rho0
Constant density .
Definition: eos.h:1644
virtual double nbar_ent_p(double ent, const Param *par=0x0) const
Computes the baryon density from the log-enthalpy.
Definition: eos_fermi.C:251
double rel_mu_0
Definition: eos.h:844
double rho_nd
Energy density at neutron drip point, defining the boundary between crust and core [unit: ]...
Definition: eos.h:2293
virtual double nbar_ent_p(double ent, const Param *par=0x0) const
Computes the baryon density from the specific enthalpy.
virtual double csound_square_ent_p(double, const Param *) const
Computes the sound speed squared from the enthapy with extra parameters (virtual function implemente...
virtual double der_nbar_ent_p(double ent, const Param *par=0x0) const
Computes the logarithmic derivative from the log-enthalpy.
Definition: eos_poly.C:421
virtual ostream & operator>>(ostream &) const
Operator >>
Definition: meos.C:228
double get_b60() const
Returns the bag constant [unit: ].
Definition: eos.h:2432
double ent_0
Enthalpy at zero pressure ( )
Definition: eos.h:845
virtual double der_ener_ent_p(double ent, const Param *par=0x0) const
Computes the logarithmic derivative from the specific enthalpy.
double ener_0
Energy density scale [unit: ], where ].
Definition: eos.h:2599
double rho0_b60
Energy density at zero pressure divided by .
Definition: eos.h:2027
virtual bool operator!=(const Eos &) const =0
Comparison operator (difference)
virtual double press_ent_p(double ent, const Param *par=0x0) const =0
Computes the pressure from the log-enthalpy and extra parameters (virtual function implemented in the...
virtual ostream & operator>>(ostream &) const
Operator >>
Definition: eos_incomp.C:223
EOS with domain dependency.
Definition: eos.h:2780
double n0_b60
Baryon density at zero pressure divided by .
Definition: eos.h:2008
Piecewise_polytrope_1D(const Tbl &, const Tbl &, const Tbl &, const Tbl &, const Tbl &, const Tbl &, double, double, double)
Standard constructor.
double get_gam() const
Returns the adiabatic index (cf. Eq. (3))
Definition: eos_poly.C:271
virtual void sauve(FILE *) const
Save in a file.
Definition: eos_fermi.C:224
virtual double der_ener_ent_p(double ent, const Param *par=0x0) const
Computes the logarithmic derivative from the specific enthalpy.
Eos_strange_cr(double n0_b60_i, double b60_i, double ent0_i, double eps_fit_i, double rho0_b60_i, double ent_nd_i, double rho_nd_i, double gam_i)
Standard constructor.
void set_auxiliary()
Computes the auxiliary quantities n_0 , ener_0.
Definition: eos_fermi.C:151
double kap
Pressure coefficient (cf.
Definition: eos.h:826
virtual void sauve(FILE *) const
Save in a file.
Definition: eos.C:189
Eos()
Standard constructor.
Definition: eos.C:118
virtual double der_press_ent_p(double ent, const Param *par=0x0) const
Computes the logarithmic derivative from the log-enthalpy.
Definition: eos_fermi.C:324
virtual double ener_ent_p(double ent, const Param *par=0x0) const =0
Computes the total energy density from the log-enthalpy and extra parameters (virtual function implem...
virtual double der_ener_ent_p(double ent, const Param *par=0x0) const
Computes the logarithmic derivative from the log-enthalpy.
double ncr_nd
Rescaled number density at neutron drip point.
Definition: eos.h:2337
double ent0
Log-enthalpy threshold for setting the energy density to a non zero value (should be negative)...
Definition: eos.h:2016
Cmp nbar_ent(const Cmp &ent, int nzet, int l_min=0, Param *par=0x0) const
Computes the baryon density field from the log-enthalpy field and extra parameters.
Definition: eos.C:362
virtual void sauve(FILE *) const
Save in a file.
Definition: eos_incomp.C:214
double get_b60() const
Returns the bag constant [unit: ].
Definition: eos.h:2125
Strange matter EOS (MIT Bag model).
Definition: eos.h:1999
double gam1sgamkap
Definition: eos.h:843
virtual double der_press_ent_p(double ent, const Param *par=0x0) const
Computes the logarithmic derivative from the log-enthalpy.
Definition: eos_incomp.C:314
virtual double press_ent_p(double ent, const Param *par=0x0) const
Computes the pressure from the log-enthalpy.
Definition: meos.C:315
virtual ostream & operator>>(ostream &) const
Operator >>
Definition: eos_fermi.C:233
double gam1
Definition: eos.h:841
Eos_strange(double n0_b60_i, double b60_i, double ent0_i, double eps_fit_i, double rho0_b60_i)
Standard constructor.
Definition: eos_strange.C:101
virtual bool operator!=(const Eos &) const
Comparison operator (difference)
Degenerate ideal Fermi gas.
Definition: eos.h:2577
virtual ostream & operator>>(ostream &) const
Operator >>
Definition: eos_poly.C:362
double n0
Baryon density at zero pressure.
Definition: eos.h:2306
virtual double csound_square_ent_p(double, const Param *) const
Computes the sound speed squared from the enthapy with extra parameters (virtual function implemente...
Definition: eos.h:2229
double rho0
Energy density at zero pressure.
Definition: eos.h:2038
virtual double nbar_ent_p(double ent, const Param *par=0x0) const =0
Computes the baryon density from the log-enthalpy and extra parameters (virtual function implemented ...
double m_0
Individual particule mass (cf.
Definition: eos.h:831
static Eos * eos_from_file(FILE *)
Construction of an EOS from a binary file.
void set_auxiliary()
Computes the auxiliary quantities gam1 , unsgam1 , gam1sgamkap from the values of gam and kap...
Definition: eos_poly.C:257
double get_kap() const
Returns the pressure coefficient (cf.
Definition: eos_poly.C:275
double get_m_0() const
Return the individual particule mass (cf.
Definition: eos_poly.C:279
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 (egality)
virtual double ener_ent_p(double ent, const Param *par=0x0) const
Computes the total energy density from the specific enthalpy.
double get_ent0() const
Returns the log-enthalpy threshold for setting the energy density to a non zero value (should be nega...
Definition: eos.h:2130
Pseudo_polytrope_1D(const Tbl &, double, double)
Standard constructor.
double p_0
Pressure scale [unit: ], where ].
Definition: eos.h:2605
double fach
Factor .
Definition: eos.h:2048
void operator=(const Eos_poly &)
Assignment to another Eos_poly.
Definition: eos_poly.C:239
const Eos ** mono_eos
Array (upon the domains) containing the various EOS.
Definition: eos.h:2787
virtual ~Eos_strange_cr()
Destructor.
virtual double der_nbar_ent_p(double ent, const Param *par=0x0) const
Computes the logarithmic derivative from the log-enthalpy.
Definition: eos_strange.C:367
virtual double nbar_ent_p(double ent, const Param *par=0x0) const
Computes the baryon density from the log-enthalpy.
virtual double nbar_ent_p(double ent, const Param *par=0x0) const
Computes the baryon density from the log-enthalpy.
Definition: eos_poly.C:383
virtual double der_ener_ent_p(double ent, const Param *par=0x0) const
Computes the logarithmic derivative from the log-enthalpy.
Definition: eos_incomp.C:300
virtual double press_ent_p(double ent, const Param *par=0x0) const
Computes the pressure from the specific enthalpy.
double delent
Enthalpy shift in quark phase.
Definition: eos.h:2340
Parameter storage.
Definition: param.h:125
Polytropic equation of state (relativistic case).
Definition: eos.h:812
virtual double press_ent_p(double ent, const Param *par=0x0) const
Computes the pressure from the specific enthalpy.
double m_0
Individual particule mass [unit: eV/c2].
Definition: eos.h:2586
virtual void sauve(FILE *) const
Save in a file.
Definition: eos_poly.C:350
virtual double csound_square_ent_p(double, const Param *) const
Computes the sound speed squared from the enthapy with extra parameters (virtual function implemente...
virtual double csound_square_ent_p(double ent, const Param *par=0x0) const
Computes the sound speed squared from the enthapy with extra parameters (virtual function implemente...
Definition: eos_poly.C:469
double fach
Factor .
Definition: eos.h:2322
virtual double csound_square_ent_p(double ent, const Param *par=0x0) const =0
Computes the sound speed squared from the enthapy with extra parameters (virtual function implemente...
virtual double der_nbar_ent_p(double ent, const Param *par=0x0) const
Computes the logarithmic derivative from the specific enthalpy.
Eos_poly(double gamma, double kappa)
Standard constructor (sets both m_0 and mu_0 to 1).
Definition: eos_poly.C:141
void operator=(const Eos_strange_cr &)
Assignment to another Eos_strange.
double ent0
Log-enthalpy threshold for setting the energy density to a non zero value (should be negative)...
Definition: eos.h:2269
virtual bool operator==(const Eos &) const
Comparison operator (egality)
virtual bool operator==(const Eos &) const
Comparison operator (egality)
Definition: eos_incomp.C:170
virtual double press_ent_p(double ent, const Param *par=0x0) const
Computes the pressure from the log-enthalpy.
Definition: eos_poly.C:410
double get_ent0() const
Returns the log-enthalpy threshold for setting the energy density to a non zero value (should be nega...
Definition: eos.h:2437
double rho0_b60
Energy density at zero pressure divided by .
Definition: eos.h:2280
double get_eps_fit() const
Returns the fitting parameter related to the square of sound velocity by .
Definition: eos.h:2136
double get_mu_0() const
Return the relativistic chemical potential at zero pressure [unit: , with ].
Definition: eos_poly.C:283
virtual bool operator!=(const Eos &) const
Comparison operator (difference)
virtual double der_ener_ent_p(double ent, const Param *par=0x0) const
Computes the logarithmic derivative from the specific enthalpy.
virtual bool operator==(const Eos &) const
Comparison operator (egality)
virtual double ener_ent_p(double ent, const Param *par=0x0) const
Computes the total energy density from the log-enthalpy.
Definition: meos.C:303
virtual double ener_ent_p(double ent, const Param *par=0x0) const
Computes the total energy density from the log-enthalpy.
Definition: eos_incomp.C:257
virtual double nbar_ent_p(double ent, const Param *par=0x0) const
Computes the baryon density from the log-enthalpy.
Definition: eos_incomp.C:243
virtual double csound_square_ent_p(double, const Param *) const
Computes the sound speed squared from the enthapy with extra parameters (virtual function implemente...
Definition: eos.h:2762
virtual bool operator!=(const Eos &) const
Comparison operator (difference)
Definition: eos_strange.C:268
double rho0
Energy density at zero pressure.
Definition: eos.h:2312
virtual double csound_square_ent_p(double, const Param *) const
Computes the sound speed squared from the enthapy with extra parameters (virtual function implemente...
Definition: eos.h:2554
bool constructed_from_file
Indicates wether the EOS has been constructed from a file.
Definition: eos.h:2793
virtual int identify() const
Returns a number to identify the sub-classe of Eos the object belongs to.
virtual double der_nbar_ent_p(double ent, const Param *par=0x0) const
Computes the logarithmic derivative from the specific enthalpy.
Polytropic equation of state (Newtonian case).
Definition: eos.h:1110
void operator=(const Eos_incomp_newt &)
Assignment to another Eos_incomp_newt.
void set_auxiliary()
Computes the auxiliary quantities n0 , rh0 , b34 and fach from the values of the other parameters...
virtual double ener_ent_p(double ent, const Param *par=0x0) const
Computes the total energy density from the specific enthalpy.
virtual bool operator!=(const Eos &) const
Comparison operator (difference)
Definition: eos_fermi.C:213
virtual double csound_square_ent_p(double, const Param *) const
Computes the sound speed squared from the enthapy with extra parameters (virtual function implemente...
Definition: eos.h:2950
virtual double der_ener_ent_p(double ent, const Param *par=0x0) const
Computes the logarithmic derivative from the log-enthalpy.
Definition: meos.C:337
double get_rho0_b60() const
Returns the energy density at zero pressure divided by .
Definition: eos.h:2448
double n0
Baryon density at zero pressure.
Definition: eos.h:2032
double gam
Adiabatic index (cf. Eq. (3))
Definition: eos.h:819
virtual bool operator==(const Eos &) const
Comparison operator (egality)
Definition: eos_poly.C:293
void operator=(const Pseudo_polytrope_1D &)
Assignment to another Pseudo_polytrope_1D.
virtual ostream & operator>>(ostream &) const
Operator >>
Definition: eos_strange.C:290
double ent0
Log-enthalpy threshold for setting the energy density to a non zero value (should be negative)...
Definition: eos.h:1649
virtual double press_ent_p(double ent, const Param *par=0x0) const
Computes the pressure from the log-enthalpy.
Definition: eos_strange.C:350
virtual int identify() const
Returns a number to identify the sub-classe of Eos the object belongs to.
virtual ostream & operator>>(ostream &) const
Operator >>
virtual double der_press_ent_p(double ent, const Param *par=0x0) const
Computes the logarithmic derivative from the specific enthalpy.
double eps_fit
Fitting parameter related to the square of sound velocity by .
Definition: eos.h:2022
virtual double press_ent_p(double ent, const Param *par=0x0) const
Computes the pressure from the log-enthalpy.
Definition: eos_incomp.C:271
virtual double der_press_ent_p(double ent, const Param *par=0x0) const
Computes the logarithmic derivative from the specific enthalpy.
void c_est_pas_fait(const char *)
Helpful function to say something is not implemented yet.
virtual ~Eos()
Destructor.
Definition: eos.C:162
double gam
Adiabatic index for the crust model.
Definition: eos.h:2298
void set_name(const char *name_i)
Sets the EOS name.
Definition: eos.C:173
virtual bool operator!=(const Eos &) const
Comparison operator (difference)
Definition: eos_poly.C:339
double n0_b60
Baryon density at zero pressure divided by .
Definition: eos.h:2261
void set_auxiliary()
Computes the auxiliary quantities n0 , rh0 , b34 and fach from the values of the other parameters...
Definition: eos_strange.C:194
Cmp der_ener_ent(const Cmp &ent, int nzet, int l_min=0, Param *par=0x0) const
Computes the logarithmic derivative from the log-enthalpy and extra parameters.
Definition: eos.C:454
void operator=(const Eos_incomp &)
Assignment to another Eos_incomp.
Definition: eos_incomp.C:157
double n_0
Number density scale [unit: ].
Definition: eos.h:2594
double get_n0_b60() const
Returns the baryon density at zero pressure divided by [unit: ].
Definition: eos.h:2429
virtual ~MEos()
Destructor.
Definition: meos.C:188
virtual double ener_ent_p(double ent, const Param *par=0x0) const
Computes the total energy density from the log-enthalpy.
virtual double der_press_ent_p(double ent, const Param *par=0x0) const
Computes the logarithmic derivative from the specific enthalpy.
virtual double nbar_ent_p(double ent, const Param *par=0x0) const
Computes the baryon density from the specific enthalpy.
double b60
Bag constant [unit: ].
Definition: eos.h:2264
virtual ostream & operator>>(ostream &) const =0
Operator >>
double get_m() const
Returns the fermion mass in eV/c2.
Definition: eos_fermi.C:165
double b60
Bag constant [unit: ].
Definition: eos.h:2011
double get_rho_nd() const
Returns the energy density at neutron drip point, defining the boundary between crust and core [unit:...
Definition: eos.h:2460
char name[100]
EOS name.
Definition: eos.h:215
virtual double press_ent_p(double ent, const Param *par=0x0) const
Computes the pressure from the specific enthalpy.
virtual bool operator==(const Eos &) const
Comparison operator (egality)
Definition: eos_fermi.C:180
virtual bool operator!=(const Eos &) const
Comparison operator (difference)
Definition: meos.C:276
int g_s
Degeneracy parameter.
Definition: eos.h:2590
Basic array class.
Definition: tbl.h:164
virtual double press_ent_p(double ent, const Param *par=0x0) const
Computes the pressure from the log-enthalpy.
Definition: eos_fermi.C:285
virtual ~Eos_poly_newt()
Destructor.
Eos_incomp_newt(double rho_c)
Standard constructor.
virtual ~Pseudo_polytrope_1D()
Destructor.
double get_eps_fit() const
Returns the fitting parameter related to the square of sound velocity by .
Definition: eos.h:2443
virtual ~Piecewise_polytrope_1D()
Destructor.
virtual ostream & operator>>(ostream &) const
Operator >>
double get_ent_nd() const
Returns the log-enthalpy at neutron drip point, defining the boundary between crust and core...
Definition: eos.h:2453
virtual ostream & operator>>(ostream &) const
Operator >>
Equation of state of incompressible matter (Newtonian case).
Definition: eos.h:1821
double mu_0
Relativistic chemical potential at zero pressure [unit: , with ].
Definition: eos.h:837
Cmp der_press_ent(const Cmp &ent, int nzet, int l_min=0, Param *par=0x0) const
Computes the logarithmic derivative from the log-enthalpy and extra parameters.
Definition: eos.C:476
virtual double der_press_ent_p(double ent, const Param *par=0x0) const
Computes the logarithmic derivative from the log-enthalpy.
Definition: eos_strange.C:400
virtual double ener_ent_p(double ent, const Param *par=0x0) const
Computes the total energy density from the specific enthalpy.
virtual double der_nbar_ent_p(double ent, const Param *par=0x0) const
Computes the logarithmic derivative from the specific enthalpy.
Eos_incomp(double rho_c)
Standard constructor.
Definition: eos_incomp.C:102
virtual double csound_square_ent_p(double, const Param *) const
Computes the sound speed squared from the enthapy with extra parameters (virtual function implemente...
Definition: eos.h:1979
virtual void sauve(FILE *) const
Save in a file.
virtual double der_ener_ent_p(double ent, const Param *par=0x0) const
Computes the logarithmic derivative from the specific enthalpy.
Strange matter EOS (MIT Bag model) with crust.
Definition: eos.h:2252
virtual int identify() const
Returns a number to identify the sub-classe of Eos the object belongs to.
void calcule(const Cmp &thermo, int nzet, int l_min, double(Eos::*fait)(double, const Param *) const, Param *par, Cmp &resu) const
General computational method for Cmp &#39;s.
Definition: eos.C:213
virtual bool operator==(const Eos &) const
Comparison operator (egality)
virtual double der_ener_ent_p(double ent, const Param *par=0x0) const
Computes the logarithmic derivative from the log-enthalpy.
Definition: eos_poly.C:436
friend ostream & operator<<(ostream &, const Eos &)
Display.
Definition: eos.C:201
virtual double csound_square_ent_p(double, const Param *) const
Computes the sound speed squared from the enthapy with extra parameters (virtual function implemente...
Definition: eos.h:1266
Equation of state of incompressible matter (relativistic case).
Definition: eos.h:1637
virtual double der_ener_ent_p(double ent, const Param *par=0x0) const =0
Computes the logarithmic derivative from the log-enthalpy with extra parameters (virtual function im...
virtual double ener_ent_p(double ent, const Param *par=0x0) const
Computes the total energy density from the log-enthalpy.
Definition: eos_fermi.C:267
virtual double nbar_ent_p(double ent, const Param *par=0x0) const
Computes the baryon density from the log-enthalpy.
Definition: meos.C:290
Cmp press_ent(const Cmp &ent, int nzet, int l_min=0, Param *par=0x0) const
Computes the pressure from the log-enthalpy and extra parameters.
Definition: eos.C:409
virtual double nbar_ent_p(double ent, const Param *par=0x0) const
Computes the baryon density from the specific enthalpy.
Eos_poly_newt(double gamma, double kappa)
Standard constructor.
Definition: eos_poly_newt.C:97
virtual void sauve(FILE *) const
Save in a file.
Definition: meos.C:216
virtual ~Eos_strange()
Destructor.
Definition: eos_strange.C:165
Eos_Fermi(double mass)
Standard constructor (sets g_s to 2).
Definition: eos_fermi.C:65
virtual void sauve(FILE *) const
Save in a file.
virtual bool operator!=(const Eos &) const
Comparison operator (difference)
virtual void sauve(FILE *) const
Save in a file.