00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031 char eos_strange_C[] = "$Header: /cvsroot/Lorene/C++/Source/Eos/eos_strange.C,v 1.5 2004/03/25 10:29:02 j_novak Exp $" ;
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075 #include <stdlib.h>
00076 #include <string.h>
00077 #include <math.h>
00078
00079
00080 #include "eos.h"
00081 #include "cmp.h"
00082 #include "utilitaires.h"
00083 #include "unites.h"
00084
00085
00086
00087
00088
00089
00090
00091 Eos_strange::Eos_strange(double n0_b60_i, double b60_i, double ent0_i,
00092 double eps_fit_i, double rho0_b60_i) :
00093 Eos("Strange matter EOS from Zdunik (2000)"),
00094 n0_b60(n0_b60_i),
00095 b60(b60_i),
00096 ent0(ent0_i),
00097 eps_fit(eps_fit_i),
00098 rho0_b60(rho0_b60_i) {
00099
00100 set_auxiliary() ;
00101
00102 }
00103
00104
00105
00106
00107 Eos_strange::Eos_strange(const Eos_strange& eos_i) :
00108 Eos(eos_i),
00109 n0_b60(eos_i.n0_b60),
00110 b60(eos_i.b60),
00111 ent0(eos_i.ent0),
00112 eps_fit(eos_i.eps_fit),
00113 rho0_b60(eos_i.rho0_b60) {
00114
00115 set_auxiliary() ;
00116
00117 }
00118
00119
00120
00121
00122 Eos_strange::Eos_strange(FILE* fich) :
00123 Eos(fich) {
00124
00125 fread_be(&n0_b60, sizeof(double), 1, fich) ;
00126 fread_be(&b60, sizeof(double), 1, fich) ;
00127 fread_be(&ent0, sizeof(double), 1, fich) ;
00128 fread_be(&eps_fit, sizeof(double), 1, fich) ;
00129 fread_be(&rho0_b60, sizeof(double), 1, fich) ;
00130
00131 set_auxiliary() ;
00132
00133 }
00134
00135
00136
00137 Eos_strange::Eos_strange(ifstream& fich) :
00138 Eos(fich) {
00139
00140 char blabla[80] ;
00141
00142 fich >> n0_b60 ; fich.getline(blabla, 80) ;
00143 fich >> b60 ; fich.getline(blabla, 80) ;
00144 fich >> ent0 ; fich.getline(blabla, 80) ;
00145 fich >> eps_fit ; fich.getline(blabla, 80) ;
00146 fich >> rho0_b60 ; fich.getline(blabla, 80) ;
00147
00148 set_auxiliary() ;
00149
00150 }
00151
00152
00153
00154
00155 Eos_strange::~Eos_strange(){
00156
00157
00158
00159 }
00160
00161
00162
00163
00164
00165 void Eos_strange::operator=(const Eos_strange& eosi) {
00166
00167 set_name(eosi.name) ;
00168
00169 n0_b60 = eosi.n0_b60 ;
00170 b60 = eosi.b60 ;
00171 ent0 = eosi.ent0 ;
00172 eps_fit = eosi.eps_fit ;
00173 rho0_b60 = eosi.rho0_b60 ;
00174
00175 set_auxiliary() ;
00176
00177 }
00178
00179
00180
00181
00182
00183
00184 void Eos_strange::set_auxiliary() {
00185
00186 using namespace Unites ;
00187
00188 rho0 = b60 * rho0_b60 * mevpfm3 ;
00189
00190 b34 = pow(b60, double(0.75)) ;
00191
00192 n0 = b34 * n0_b60 * double(10) ;
00193
00194 fach = (double(4) + eps_fit) / (double(1) + eps_fit) ;
00195
00196 }
00197
00198
00199
00200
00201
00202
00203
00204 bool Eos_strange::operator==(const Eos& eos_i) const {
00205
00206 bool resu = true ;
00207
00208 if ( eos_i.identify() != identify() ) {
00209 cout << "The second EOS is not of type Eos_strange !" << endl ;
00210 resu = false ;
00211 }
00212 else{
00213
00214 const Eos_strange& eos = dynamic_cast<const Eos_strange&>( eos_i ) ;
00215
00216 if (eos.n0_b60 != n0_b60) {
00217 cout
00218 << "The two Eos_strange have different n0_b60 : " << n0_b60 << " <-> "
00219 << eos.n0_b60 << endl ;
00220 resu = false ;
00221 }
00222
00223 if (eos.b60 != b60) {
00224 cout
00225 << "The two Eos_strange have different b60 : " << b60 << " <-> "
00226 << eos.b60 << endl ;
00227 resu = false ;
00228 }
00229
00230 if (eos.ent0 != ent0) {
00231 cout
00232 << "The two Eos_strange have different ent0 : " << ent0 << " <-> "
00233 << eos.ent0 << endl ;
00234 resu = false ;
00235 }
00236
00237 if (eos.eps_fit != eps_fit) {
00238 cout
00239 << "The two Eos_strange have different eps_fit : " << eps_fit
00240 << " <-> " << eos.eps_fit << endl ;
00241 resu = false ;
00242 }
00243
00244 if (eos.rho0_b60 != rho0_b60) {
00245 cout
00246 << "The two Eos_strange have different rho0_b60 : " << rho0_b60
00247 << " <-> " << eos.rho0_b60 << endl ;
00248 resu = false ;
00249 }
00250
00251
00252 }
00253
00254 return resu ;
00255
00256 }
00257
00258 bool Eos_strange::operator!=(const Eos& eos_i) const {
00259
00260 return !(operator==(eos_i)) ;
00261
00262 }
00263
00264
00265
00266
00267
00268 void Eos_strange::sauve(FILE* fich) const {
00269
00270 Eos::sauve(fich) ;
00271
00272 fwrite_be(&n0_b60, sizeof(double), 1, fich) ;
00273 fwrite_be(&b60, sizeof(double), 1, fich) ;
00274 fwrite_be(&ent0, sizeof(double), 1, fich) ;
00275 fwrite_be(&eps_fit, sizeof(double), 1, fich) ;
00276 fwrite_be(&rho0_b60, sizeof(double), 1, fich) ;
00277
00278 }
00279
00280 ostream& Eos_strange::operator>>(ostream & ost) const {
00281
00282 ost <<
00283 "EOS of class Eos_strange (Strange matter EOS from Zdunik (2000)) : "
00284 << endl ;
00285 ost << " Baryon density at zero pressure : " << n0_b60
00286 << " * B_{60}^{3/4}" << endl ;
00287 ost << " Bag constant B : " << b60 << " * 60 MeV/fm^3"<< endl ;
00288 ost <<
00289 " Log-enthalpy threshold for setting the energy density to non-zero: "
00290 << endl << " " << ent0 << endl ;
00291 ost << " Fitting parameter eps_fit : " << eps_fit << endl ;
00292 ost << " Energy density at zero pressure : " << rho0_b60
00293 << " * B_{60} MeV/fm^3" << endl ;
00294
00295 return ost ;
00296
00297 }
00298
00299
00300
00301
00302
00303
00304
00305
00306
00307 double Eos_strange::nbar_ent_p(double ent, const Param* ) const {
00308
00309 if ( ent > ent0 ) {
00310
00311 return n0 * exp( double(3) * ent / (double(1) + eps_fit)) ;
00312
00313 }
00314 else{
00315 return 0 ;
00316 }
00317 }
00318
00319
00320
00321
00322 double Eos_strange::ener_ent_p(double ent, const Param* ) const {
00323
00324
00325 if ( ent > ent0 ) {
00326
00327 double pp = ( exp(fach * ent) - 1) / fach * rho0 ;
00328
00329 return rho0 + double(3) * pp / (double(1) + eps_fit) ;
00330
00331 }
00332 else{
00333 return 0 ;
00334 }
00335 }
00336
00337
00338
00339
00340 double Eos_strange::press_ent_p(double ent, const Param* ) const {
00341
00342 if ( ent > ent0 ) {
00343
00344 return ( exp(fach * ent) - 1) / fach * rho0 ;
00345
00346 }
00347 else{
00348 return 0 ;
00349 }
00350 }
00351
00352
00353
00354
00355
00356
00357 double Eos_strange::der_nbar_ent_p(double ent, const Param* ) const {
00358
00359 if ( ent > ent0 ) {
00360
00361 return double(3) * ent / ( double(1) + eps_fit ) ;
00362
00363 }
00364 else{
00365 return 0 ;
00366 }
00367 }
00368
00369
00370
00371
00372 double Eos_strange::der_ener_ent_p(double ent, const Param* ) const {
00373
00374 if ( ent > ent0 ) {
00375
00376 double xx = fach * ent ;
00377
00378 return xx / ( double(1) +
00379 ( double(1) + eps_fit ) / double(3) * exp(-xx) ) ;
00380
00381 }
00382 else{
00383 return 0 ;
00384 }
00385 }
00386
00387
00388
00389
00390 double Eos_strange::der_press_ent_p(double ent, const Param* ) const {
00391
00392 if ( ent > ent0 ) {
00393
00394 double xx = fach * ent ;
00395
00396 return xx / ( double(1) - exp(-xx) ) ;
00397
00398 }
00399 else{
00400 return 0 ;
00401 }
00402 }
00403