LORENE
pseudopolytrope_1D.C
1 /*
2  * Methods of the class Pseudo_polytrope_1D.
3  *
4  * (see file eos.h for documentation).
5  */
6 
7 /*
8  * Copyright (c) 2023 GaĆ«l Servignat
9  *
10  * This file is part of LORENE.
11  *
12  * LORENE is free software; you can redistribute it and/or modify
13  * it under the terms of the GNU General Public License as published by
14  * the Free Software Foundation; either version 2 of the License, or
15  * (at your option) any later version.
16  *
17  * LORENE is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  * GNU General Public License for more details.
21  *
22  * You should have received a copy of the GNU General Public License
23  * along with LORENE; if not, write to the Free Software
24  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25  *
26  */
27 
28 
29 
30 
31 /*
32 
33  */
34 
35 // Headers C
36 #include <cstdlib>
37 #include <cstring>
38 #include <cmath>
39 
40 // Headers Lorene
41 #include "eos.h"
42 #include "cmp.h"
43 #include "unites.h"
44 
45  //--------------//
46  // Constructors //
47  //--------------//
48 
49 // Standard constructor
50 // --------------------
51 namespace Lorene {
52 Pseudo_polytrope_1D::Pseudo_polytrope_1D(const Tbl& coefs0, double n_lim0, double m_n0):
53  n_lim1(n_lim0), n_lim2(n_lim0), m_n(m_n0) {
54 
55  cerr << "Deprecated constructor, please do not use ! Aborting..." << endl; abort() ;
56  set_name("Pseudo-polytropic fit of cold, beta-equilibrated EoS") ;
57 
58  assert(coefs0.get_ndim() == 1) ;
59  coefs = new Tbl(coefs0) ;
60  n_coefs = coefs->get_taille() ;
61 
62  double x_lim = log(n_lim1*0.1) ;
63  double alpha = (*coefs)(n_coefs-1) ;
64  double sum_poly = 0., sum_der_poly = 0. ;
65  for (int i=0; i<n_coefs-1; i++){
66  sum_poly += (*coefs)(i)*pow(x_lim, double(i)) ;
67  sum_der_poly += (i == 0) ? 0. : (*coefs)(i)*double(i)*pow(x_lim, double(i-1)) ;
68  }
69  ent_lim1 = log1p(exp(alpha*x_lim)*((alpha+1)*sum_poly + sum_der_poly)) ;
70 
71 }
72 
73 
74 // Copy constructor
75 // ----------------
76 Pseudo_polytrope_1D::Pseudo_polytrope_1D(const Pseudo_polytrope_1D& eosi): Eos(eosi), coefs(eosi.coefs), gamma_low(eosi.gamma_low), kappa_low(eosi.kappa_low),
77  n_lim1(eosi.n_lim1), n_lim2(eosi.n_lim2), ent_lim1(eosi.ent_lim1), ent_lim2(eosi.ent_lim2),
78  m_n(eosi.m_n), Lambda(eosi.Lambda), ddd(eosi.ddd), Kappa_GPP(eosi.Kappa_GPP),
79  Gamma_GPP(eosi.Gamma_GPP), Lambda_GPP(eosi.Lambda_GPP), ddd_GPP(eosi.ddd_GPP), n_coefs(eosi.n_coefs) {}
80 
81 
82 // Constructor from a binary file
83 // ------------------------------
85 
86  fread_be(&n_coefs, sizeof(int), 1, fich) ;
87  coefs = new Tbl(fich) ;
88  fread_be(&kappa_low, sizeof(double), 1, fich) ;
89  fread_be(&gamma_low, sizeof(double), 1, fich) ;
90  fread_be(&n_lim1, sizeof(double), 1, fich) ;
91  fread_be(&ent_lim1, sizeof(double), 1, fich) ;
92  fread_be(&n_lim2, sizeof(double), 1, fich) ;
93  fread_be(&ent_lim2, sizeof(double), 1, fich) ;
94  fread_be(&m_n, sizeof(double), 1, fich) ;
95  fread_be(&Lambda, sizeof(double), 1, fich) ;
96  fread_be(&ddd, sizeof(double), 1, fich) ;
97  fread_be(&Kappa_GPP, sizeof(double), 1, fich) ;
98  fread_be(&Gamma_GPP, sizeof(double), 1, fich) ;
99  fread_be(&Lambda_GPP, sizeof(double), 1, fich) ;
100  fread_be(&ddd_GPP, sizeof(double), 1, fich) ;
101 
102  eos_low = new Eos_poly(gamma_low, kappa_low) ;
103 }
104 
105 // Constructor from a formatted file
106 // ---------------------------------
108 
109  fich >> n_coefs ; fich.ignore(1000, '\n') ;
110  coefs = new Tbl(n_coefs) ; coefs->set_etat_qcq() ;
111 
112  for (int i=0; i < n_coefs; i++)
113  fich >> coefs->set(i) ;
114  fich.ignore(1000, '\n') ;
115 
116  fich >> n_lim1 ; fich.ignore(1000, '\n') ;
117  fich >> n_lim2 ; fich.ignore(1000, '\n') ;
118 
119  fich >> kappa_low ; fich.ignore(1000, '\n') ;
120 
121  fich >> gamma_low ; fich.ignore(1000, '\n') ;
122 
123  fich >> m_n ; fich.ignore(1000, '\n') ;
124 
125  fich >> Lambda ; fich.ignore(1000, '\n') ;
126 
127  fich >> ddd ; fich.ignore(1000, '\n') ;
128 
129  fich >> Kappa_GPP ; fich.ignore(1000, '\n');
130 
131  fich >> Gamma_GPP ; fich.ignore(1000, '\n');
132 
133  fich >> Lambda_GPP ; fich.ignore(1000, '\n') ;
134 
135  fich >> ddd_GPP ; fich.ignore(1000, '\n') ;
136 
137  double x_lim2 = log(n_lim2*0.1) ;
138  double alpha = (*coefs)(n_coefs-1) ;
139  double sum_poly = 0., sum_der_poly = 0. ;
140  for (int i=0; i<n_coefs-1; i++){
141  sum_poly += (*coefs)(i)*pow(x_lim2, double(i)) ;
142  sum_der_poly += (i == 0) ? 0. : (*coefs)(i)*double(i)*pow(x_lim2, double(i-1)) ;
143  }
144  cout << setprecision(16) << "nlim1: " << n_lim1*0.1 << " n_lim2: " << n_lim2*0.1 << endl << " ddd: " << ddd << " et: " ;
145  ent_lim2 = log1p(ddd + exp(alpha*x_lim2)*((alpha+1)*sum_poly + sum_der_poly)) ;
146  ent_lim1 = log1p(ddd_GPP + Gamma_GPP*Kappa_GPP/(Gamma_GPP-1.) * pow(n_lim1, Gamma_GPP-1.)) ;
147  cout << ent_lim1 << endl;
148  cout << ent_lim2 << endl;
149 
150  eos_low = new Eos_poly(gamma_low, kappa_low) ;
151 
152 }
153 
154 
155  //--------------//
156  // Destructor //
157  //--------------//
158 
160 
161  if (coefs != 0x0) delete coefs ;
162  if (eos_low != 0x0) delete eos_low ;
163 
164 }
165  //--------------//
166  // Assignment //
167  //--------------//
168 
170 
171  set_name(eosi.name) ;
172 
173  coefs = eosi.coefs ;
174  n_lim1 = eosi.n_lim1 ;
175  n_lim2 = eosi.n_lim2 ;
176  n_coefs = eosi.n_coefs ;
177  gamma_low = eosi.gamma_low ;
178  kappa_low = eosi.kappa_low ;
179  m_n = eosi.m_n ;
180  ent_lim1 = eosi.ent_lim1 ;
181  ent_lim2 = eosi.ent_lim2 ;
182  Lambda = eosi.Lambda ;
183  ddd = eosi.ddd ;
184  Kappa_GPP = eosi.Kappa_GPP ;
185  Gamma_GPP = eosi.Gamma_GPP ;
186  Lambda_GPP = eosi.Lambda_GPP ;
187  ddd_GPP = eosi.ddd_GPP ;
188  eos_low = eosi.eos_low ;
189 
190 }
191  //------------------------//
192  // Comparison operators //
193  //------------------------//
194 
195 bool Pseudo_polytrope_1D::operator==(const Eos& eos_i) const {
196 
197  bool resu = true ;
198 
199  if ( eos_i.identify() != identify() ) {
200  cout << "The second EOS is not of type Pseudo_polytrope_1D !" << endl ;
201  resu = false ;
202  }
203  else{
204 
205  const Pseudo_polytrope_1D& eos = dynamic_cast<const Pseudo_polytrope_1D&>( eos_i ) ;
206 
207  for (int i=0; i < n_coefs; i++)
208  if ((*eos.coefs)(i) != (*coefs)(i)) {
209  cout
210  << "The two Pseudo_polytrope_1D have different coefficients: " << (*coefs)(i) << " <-> "
211  << (*eos.coefs)(i) << endl ;
212  resu = false ;
213  }
214 
215  if (eos.n_lim1 != n_lim1) {
216  cout
217  << "The two Pseudo_polytrope_1D have different limiting densities n_lim1: " << n_lim1 << " <-> "
218  << eos.n_lim1 << endl ;
219  resu = false ;
220  }
221 
222  if (eos.ent_lim1 != ent_lim1) {
223  cout
224  << "The two Pseudo_polytrope_1D have different limiting enthalpies ent_lim1: " << ent_lim1 << " <-> "
225  << eos.ent_lim1 << endl ;
226  resu = false ;
227  }
228 
229  if (eos.n_lim2 != n_lim2) {
230  cout
231  << "The two Pseudo_polytrope_1D have different limiting densities n_lim2: " << n_lim2 << " <-> "
232  << eos.n_lim2 << endl ;
233  resu = false ;
234  }
235 
236  if (eos.ent_lim2 != ent_lim2) {
237  cout
238  << "The two Pseudo_polytrope_1D have different limiting enthalpies ent_lim2: " << ent_lim2 << " <-> "
239  << eos.ent_lim2 << endl ;
240  resu = false ;
241  }
242 
243  if (eos.n_coefs != n_coefs) {
244  cout
245  << "The two Pseudo_polytrope_1D have different number of coefficients: " << n_coefs << " <-> "
246  << eos.n_coefs << endl ;
247  resu = false ;
248  }
249 
250  if (eos.kappa_low != kappa_low) {
251  cout
252  << "The two Pseudo_polytrope_1D have different kappa in low polytrope: " << kappa_low << " <-> "
253  << eos.kappa_low << endl ;
254  resu = false ;
255  }
256 
257  if (eos.gamma_low != gamma_low) {
258  cout
259  << "The two Pseudo_polytrope_1D have different kappa in low polytrope: " << gamma_low << " <-> "
260  << eos.gamma_low << endl ;
261  resu = false ;
262  }
263 
264  if (eos.ddd!= ddd) {
265  cout
266  << "The two Pseudo_polytrope_1D have different ddd: " << ddd << " <-> "
267  << eos.ddd << endl ;
268  resu = false ;
269  }
270 
271  if (eos.Lambda!= Lambda) {
272  cout
273  << "The two Pseudo_polytrope_1D have different Lambda: " << Lambda << " <-> "
274  << eos.Lambda << endl ;
275  resu = false ;
276  }
277 
278  if (eos.Kappa_GPP!= Kappa_GPP) {
279  cout
280  << "The two Pseudo_polytrope_1D have different Kappa_GPP: " << Kappa_GPP << " <-> "
281  << eos.Kappa_GPP << endl ;
282  resu = false ;
283  }
284 
285  if (eos.Gamma_GPP!= Gamma_GPP) {
286  cout
287  << "The two Pseudo_polytrope_1D have different Gamma_GPP: " << Gamma_GPP << " <-> "
288  << eos.Gamma_GPP << endl ;
289  resu = false ;
290  }
291 
292  if (eos.Lambda_GPP!= Lambda_GPP) {
293  cout
294  << "The two Pseudo_polytrope_1D have different Lambda_GPP: " << Lambda_GPP << " <-> "
295  << eos.Lambda_GPP << endl ;
296  resu = false ;
297  }
298 
299  if (eos.ddd_GPP!= ddd_GPP) {
300  cout
301  << "The two Pseudo_polytrope_1D have different ddd_GPP: " << ddd_GPP << " <-> "
302  << eos.ddd_GPP << endl ;
303  resu = false ;
304  }
305 
306  }
307 
308  return resu ;
309 
310 }
311 
312 bool Pseudo_polytrope_1D::operator!=(const Eos& eos_i) const {
313 
314  return !(operator==(eos_i)) ;
315 
316 }
317 
318 
319  //------------//
320  // Outputs //
321  //------------//
322 
323 void Pseudo_polytrope_1D::sauve(FILE* fich) const {
324 
325  Eos::sauve(fich) ;
326 
327  fwrite_be(&n_coefs, sizeof(int), 1, fich) ;
328  coefs->sauve(fich) ;
329  fwrite_be(&kappa_low, sizeof(double), 1, fich) ;
330  fwrite_be(&gamma_low, sizeof(double), 1, fich) ;
331  fwrite_be(&n_lim1, sizeof(double), 1, fich) ;
332  fwrite_be(&ent_lim1, sizeof(double), 1, fich) ;
333  fwrite_be(&n_lim2, sizeof(double), 1, fich) ;
334  fwrite_be(&ent_lim2, sizeof(double), 1, fich) ;
335  fwrite_be(&m_n, sizeof(double), 1, fich) ;
336  fwrite_be(&Lambda, sizeof(double), 1, fich) ;
337  fwrite_be(&ddd, sizeof(double), 1, fich) ;
338  fwrite_be(&Kappa_GPP, sizeof(double), 1, fich) ;
339  fwrite_be(&Gamma_GPP, sizeof(double), 1, fich) ;
340  fwrite_be(&Lambda_GPP, sizeof(double), 1, fich) ;
341  fwrite_be(&ddd_GPP, sizeof(double), 1, fich) ;
342 
343 
344 }
345 
346 ostream& Pseudo_polytrope_1D::operator>>(ostream & ost) const {
347 
348  ost << setprecision(16) << "EOS of class Pseudo_polytrope_1D (analytical fit of cold EoS): " << '\n' ;
349  ost << " Coefficients: " << *coefs << '\n' ;
350  ost << setprecision(16) << " Baryon mass: " << m_n << " [MeV]" << '\n' ;
351  ost << setprecision(16) << " ddd: " << ddd << " and Lambda: " << Lambda << '\n' ;
352  ost << setprecision(16) << " Kappa_GPP: " << Kappa_GPP << " and Gamma_GPP: " << Gamma_GPP << '\n' ;
353  ost << setprecision(16) << " Lambda_GPP: " << ddd << " and Lambda_GPP: " << Lambda << '\n' ;
354  ost << "Low densities polytrope :" << '\n' ;
355  cout << *eos_low << '\n' ;
356  ost << setprecision(16) << " Limiting density n_lim1: " << 0.1*n_lim1 << " [fm^-3]" << '\n' ;
357  ost << setprecision(16) << " Limiting enthalpy h_lim1: " << ent_lim1 << " [c^2]" << endl;
358  ost << setprecision(16) << " Limiting density n_lim2: " << 0.1*n_lim2 << " [fm^-3]" << '\n' ;
359  ost << setprecision(16) << " Limiting enthalpy h_lim2: " << ent_lim2 << " [c^2]" << endl;
360 
361  return ost ;
362 
363 }
364 
365 
366  //------------------------------//
367  // Computational routines //
368  //------------------------------//
369 
370 // Baryon density from enthalpy
371 //------------------------------
372 
373 double Pseudo_polytrope_1D::nbar_ent_p(double ent, const Param* ) const {
374 
375  if (ent >= ent_lim2 ) {
376 
377  auto ent_nb_p = [&](double nbar) {
378  double xx = log(nbar*0.1) ;
379  double alpha = (*coefs)(n_coefs-1) ;
380  double sum_poly = 0.;
381  for (int i=0; i < n_coefs-1; i++){
382  double cc1 = (alpha+1.)*(*coefs)(i) ;
383  double cc2 = (i == n_coefs - 2) ? 0. : double(i+1)*(*coefs)(i+1) ;
384  sum_poly += (cc1 + cc2)*pow(xx, double(i));
385  }
386  double arg = exp(alpha*xx)*sum_poly + ddd ;
387  return log1p(arg) - ent ;
388  } ;
389 
390  double a = n_lim2/2., b = max(100.*ent, 50.*n_lim2) ;
391  double f0 = ent_nb_p(a), f1 = ent_nb_p(b) ;
392  double c=1., c_old=2., f2 ;
393  double eps = 5e-16 ;
394  assert( f0 * f1 < 0.) ;
395  while(fabs((c-c_old)/c)>eps) {
396  c_old = c ;
397  c = (b*f0 - a*f1)/(f0 - f1) ;
398  f2 = ent_nb_p(c) ;
399 
400  if (f2*f0 < 0.){
401  b = c ;
402  f1 = f2 ;
403  }
404  else{
405  a = c ;
406  f0 = f2 ;
407  }
408  }
409  return c ;
410  }
411  else if ( (ent_lim1 <= ent) && (ent < ent_lim2)){
412 
413  return pow((expm1(ent)-ddd_GPP)*(Gamma_GPP-1.)/(Kappa_GPP*Gamma_GPP), 1./(Gamma_GPP-1.));
414  }
415  else if ( (0 < ent) && (ent < ent_lim1)){
416 
417  return eos_low->nbar_ent_p(ent) ;
418  }
419  else{
420  return 0 ;
421  }
422 }
423 
424 // Energy density from enthalpy
425 //------------------------------
426 
427 double Pseudo_polytrope_1D::ener_ent_p(double ent, const Param* ) const {
428  if (ent >= ent_lim2 ) {
429 
430  double nbar = nbar_ent_p(ent) ;
431  double xx = log(nbar*0.1) ;
432 
433  double alpha = (*coefs)(n_coefs-1) ;
434  double sum_poly = 0.;
435  for (int i=0; i < n_coefs-1; i++)
436  sum_poly += (*coefs)(i)*pow(xx, double(i));
437  return m_n*Unites::mevpfm3*(exp(xx)*(1.+ddd) + exp((alpha+1) * xx)*sum_poly) - Lambda ;
438  }
439  else if ( (ent_lim1 <= ent) && (ent < ent_lim2)){
440  double nbar = pow((expm1(ent)-ddd_GPP)*(Gamma_GPP-1.)/(Kappa_GPP*Gamma_GPP), 1./(Gamma_GPP-1.));
441  return nbar*(1 + (Gamma_GPP-1.)/Gamma_GPP * (1./(Gamma_GPP-1.) * expm1(ent) + ddd_GPP)) - Lambda_GPP;
442  }
443  else if ( (0 < ent) && (ent < ent_lim1)){
444 
445  return eos_low->ener_ent_p(ent) ;
446  }
447  else{
448  return 0 ;
449  }
450 }
451 
452 // Pressure from enthalpy
453 //------------------------
454 
455 double Pseudo_polytrope_1D::press_ent_p(double ent, const Param* ) const {
456  if (ent >= ent_lim2 ) {
457 
458  double nbar = nbar_ent_p(ent) ;
459 
460  double xx = log(nbar*0.1) ;
461 
462  double alpha = (*coefs)(n_coefs-1) ;
463  double sum_poly = 0.;
464  for (int i=0; i < n_coefs-1; i++){
465  double cc1 = alpha*(*coefs)(i) ;
466  double cc2 = (i == n_coefs - 2) ? 0. : double(i+1)*(*coefs)(i+1) ;
467  sum_poly += (cc1 + cc2)*pow(xx, double(i));
468  }
469 
470  return m_n*Unites::mevpfm3*(exp((alpha+1.)*xx) * sum_poly) + Lambda;
471  }
472  else if ( (ent_lim1 <= ent) && (ent < ent_lim2)){
473  return Kappa_GPP*pow((expm1(ent)-ddd_GPP)*(Gamma_GPP-1.)/(Kappa_GPP*Gamma_GPP), Gamma_GPP/(Gamma_GPP-1.)) + Lambda_GPP;
474  }
475  else if ( (0 < ent) && (ent < ent_lim1)){
476  return eos_low->press_ent_p(ent) ;
477  }
478  else{
479  return 0 ;
480  }
481 }
482 
483 // dln(n)/ln(h) from enthalpy
484 //---------------------------
485 
486 double Pseudo_polytrope_1D::der_nbar_ent_p(double , const Param* ) const {
487  c_est_pas_fait("Pseudo_polytrope_1D::der_nbar_ent_p") ;
488  return 0.;
489 }
490 
491 // dln(e)/ln(h) from enthalpy
492 //---------------------------
493 
494 double Pseudo_polytrope_1D::der_ener_ent_p(double, const Param* ) const {
495  c_est_pas_fait("Pseudo_polytrope_1D::der_ener_ent_p") ;
496  return 0.;
497 }
498 
499 // dln(p)/ln(h) from enthalpy
500 //---------------------------
501 
502 double Pseudo_polytrope_1D::der_press_ent_p(double, const Param* ) const {
503  c_est_pas_fait("Pseudo_polytrope_1D::der_press_ent_p") ;
504  return 0. ;
505 }
506 
507 double Pseudo_polytrope_1D::csound_square_ent_p(double ent, const Param*) const {
508  if (ent >= ent_lim2 ) {
509  double nbar = nbar_ent_p(ent) ;
510  double xx = log(nbar*0.1) ;
511 
512  double alpha = (*coefs)(n_coefs-1) ;
513  double sum_poly = 0., sum_der_poly = 0., sum_der2_poly = 0.;
514  for (int i=0; i < n_coefs-1; i++){
515  sum_poly += (*coefs)(i)*pow(xx, double(i));
516  sum_der_poly += (i == 0) ? 0. : double(i) * (*coefs)(i) * pow(xx, double(i-1)) ;
517  sum_der2_poly += (i < 2) ? 0. : double(i) * double(i-1) * (*coefs)(i) * pow(xx, double(i-2)) ;
518  }
519  double num = (alpha*(alpha+1.) * sum_poly + (2.*alpha+1.) * sum_der_poly + sum_der2_poly)*exp(alpha*xx) ;
520  double denom = 1. + ddd + ((alpha+1.) * sum_poly + sum_der_poly)*exp(alpha*xx) ;
521 
522  return num/denom ;
523  }
524  else if ( (ent_lim1 <= ent) && (ent < ent_lim2)){
525  return (Gamma_GPP-1.)*(1.-exp(-ent)*(1.+ddd_GPP));
526  }
527  else if ( (0 < ent) && (ent < ent_lim1)){
528 
529  return eos_low->csound_square_ent_p(ent) ;
530  }
531  else{
532  return 0 ;
533  }
534 }
535 
536 }
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
Cmp log(const Cmp &)
Neperian logarithm.
Definition: cmp_math.C:299
Cmp exp(const Cmp &)
Exponential.
Definition: cmp_math.C:273
virtual int identify() const
Returns a number to identify the sub-classe of Eos the object belongs to.
Lorene prototypes.
Definition: app_hor.h:67
Equation of state base class.
Definition: eos.h:209
double & set(int i)
Read/write of a particular element (index i) (1D case)
Definition: tbl.h:301
virtual int identify() const =0
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 csound_square_ent_p(double, const Param *) const
Computes the sound speed squared from the enthapy with extra parameters (virtual function implemente...
virtual void sauve(FILE *) const
Save in a file.
Definition: eos.C:189
void set_etat_qcq()
Sets the logical state to ETATQCQ (ordinary state).
Definition: tbl.C:364
int get_ndim() const
Gives the number of dimensions (ie dim.ndim)
Definition: tbl.h:420
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.
Pseudo_polytrope_1D(const Tbl &, double, double)
Standard constructor.
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 press_ent_p(double ent, const Param *par=0x0) const
Computes the pressure from the specific enthalpy.
Parameter storage.
Definition: param.h:125
Polytropic equation of state (relativistic case).
Definition: eos.h:812
Tbl max(const Cmp &)
Maximum values of a Cmp in each domain.
Definition: cmp_math.C:438
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
int fwrite_be(const int *aa, int size, int nb, FILE *fich)
Writes integer(s) into a binary file according to the big endian convention.
Definition: fwrite_be.C:73
virtual double press_ent_p(double ent, const Param *par=0x0) const
Computes the pressure from the log-enthalpy.
Definition: eos_poly.C:410
Cmp pow(const Cmp &, int)
Power .
Definition: cmp_math.C:351
int fread_be(int *aa, int size, int nb, FILE *fich)
Reads integer(s) from a binary file according to the big endian convention.
Definition: fread_be.C:72
void operator=(const Pseudo_polytrope_1D &)
Assignment to another Pseudo_polytrope_1D.
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.
void c_est_pas_fait(const char *)
Helpful function to say something is not implemented yet.
void set_name(const char *name_i)
Sets the EOS name.
Definition: eos.C:173
char name[100]
EOS name.
Definition: eos.h:215
void sauve(FILE *) const
Save in a file.
Definition: tbl.C:329
Basic array class.
Definition: tbl.h:164
virtual ~Pseudo_polytrope_1D()
Destructor.
virtual double der_nbar_ent_p(double ent, const Param *par=0x0) const
Computes the logarithmic derivative from the specific enthalpy.
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 (difference)
virtual void sauve(FILE *) const
Save in a file.