61 #include "eos_bifluid.h" 65 #include "utilitaires.h" 73 void interpol_herm(
const Tbl& xtab,
const Tbl& ytab,
const Tbl& dytab,
74 double x,
int& i,
double& y,
double& dy) ;
85 const char* path,
double mass1,
double mass2) :
98 double mass1,
double mass2) :
111 char tmp_string[160] ;
112 fread(tmp_string,
sizeof(
char), 160, fich) ;
133 fich.ignore(1000,
'\n') ;
158 delete delta_car_n0 ;
161 delete delta_car_p0 ;
199 delta_car_n0 = eosi.delta_car_n0 ;
200 mu1_n0 = eosi.mu1_n0 ;
201 mu2_n0 = eosi.mu2_n0 ;
202 delta_car_p0 = eosi.delta_car_p0 ;
203 mu1_p0 = eosi.mu1_p0;
204 mu2_p0 = eosi.mu2_p0 ;
207 press_N = eosi.press_N;
210 press_P = eosi.press_P;
222 char tmp_string[160] ;
224 fwrite(tmp_string,
sizeof(
char), 160, fich) ;
232 "EOS of class Eos_bf_tabul : tabulated EOS depending on three variables (relative velocity and chemical potentials of neutrons and protons)." 234 ost <<
"Table read from " <<
tablename << endl ;
249 cout <<
"The second EOS is not of type Eos_bf_tabul !" << endl ;
257 "The two Eos_bf_tabul have different names and not refer to the same tables! " << endl ;
282 double m_b_si = rhonuc_si / 1e44;
291 cerr <<
"Eos_bf_tabul::read_table(): " << endl ;
292 cerr <<
"Problem in opening the EOS file!" << endl ;
293 cerr <<
"While trying to open " <<
tablename << endl ;
294 cerr <<
"Aborting..." << endl ;
298 fich.ignore(1000,
'\n') ;
302 for (
int i=0; i<5; i++) {
303 fich.ignore(1000,
'\n') ;
307 fich >> nbp ; fich.ignore(1000,
'\n') ;
309 int n_delta, n_mu1, n_mu2;
310 fich >> n_delta; fich.ignore(1000,
'\n') ;
311 fich >> n_mu1; fich.ignore(1000,
'\n') ;
312 fich >> n_mu2; fich.ignore(1000,
'\n') ;
315 cerr <<
"Eos_bf_tabul::read_table(): " << endl ;
316 cerr <<
"Wrong value for the number of lines!" << endl ;
317 cerr <<
"nbp = " << nbp << endl ;
318 cerr <<
"Aborting..." << endl ;
322 cerr <<
"Eos_bf_tabul::read_table(): " << endl ;
323 cerr <<
"Wrong value for the number of values of delta_car!" << endl ;
324 cerr <<
"n_delta = " << n_delta << endl ;
325 cerr <<
"Aborting..." << endl ;
329 cerr <<
"Eos_bf_tabul::read_table(): " << endl ;
330 cerr <<
"Wrong value for the number of values of mu_n!" << endl ;
331 cerr <<
"n_mu1 = " << n_mu1 << endl ;
332 cerr <<
"Aborting..." << endl ;
336 cerr <<
"Eos_bf_tabul::read_table(): " << endl ;
337 cerr <<
"Wrong value for the number of values of mu_p!" << endl ;
338 cerr <<
"n_mu2 = " << n_mu2 << endl ;
339 cerr <<
"Aborting..." << endl ;
342 if (n_mu2*n_mu1*n_delta != nbp ) {
343 cerr <<
"Eos_bf_tabul::read_table(): " << endl ;
344 cerr <<
"Wrong value for the number of lines!" << endl ;
345 cerr <<
"Aborting..." << endl ;
349 for (
int i=0; i<3; i++) {
350 fich.ignore(1000,
'\n') ;
357 n1_tab =
new Tbl(n_delta, n_mu1, n_mu2) ;
358 n2_tab =
new Tbl(n_delta, n_mu1, n_mu2) ;
380 double mu1_MeV, mu2_MeV, n1_fm3, n2_fm3;
381 double Knp_Mev_2, press_MeV_fm3;
382 double d2press_dmu1dmu2_MeV_fm3, dn1_ddelta_car_fm3, dn2_ddelta_car_fm3;
385 double delta_car_adim, mu1_adim, mu2_adim, n1_01fm3, n2_01fm3, Knp_adim ;
386 double press_adim, dpress_ddelta_car_adim, dn1_ddelta_car_adim, dn2_ddelta_car_adim ;
387 double d2press_dmu1dmu2_adim;
389 double hbarc = 197.33 ;
390 double hbarc3 = hbarc * hbarc * hbarc ;
393 for (
int j=0 ; j < n_delta ; j++) {
394 for (
int k=0 ; k < n_mu1 ; k++) {
395 for (
int l=0 ; l < n_mu2 ; l++) {
397 fich >> delta_car_adim ;
399 mu1_adim = mu1_MeV * mev_si / (m_b_si * v_unit * v_unit ) ;
401 mu2_adim = mu2_MeV * mev_si / (m_b_si * v_unit * v_unit ) ;
403 n1_01fm3 = 10. * n1_fm3 ;
405 n2_01fm3 = 10. * n2_fm3 ;
407 Knp_adim = Knp_Mev_2 / ( m_b_si * v_unit * v_unit *10. ) * (mev_si *hbarc3 ) ;
408 dpress_ddelta_car_adim = - Knp_adim * n1_01fm3 * n2_01fm3 *
pow( 1.-delta_car_adim, -1.5) / 2. ;
409 fich >> press_MeV_fm3 ;
410 press_adim = press_MeV_fm3 * mevpfm3 ;
411 fich >> d2press_dmu1dmu2_MeV_fm3 ;
412 d2press_dmu1dmu2_adim = d2press_dmu1dmu2_MeV_fm3 * (10. * m_b_si * v_unit * v_unit ) / mev_si ;
413 fich >> dn1_ddelta_car_fm3 ;
414 dn1_ddelta_car_adim = dn1_ddelta_car_fm3 * 10. ;
415 fich >> dn2_ddelta_car_fm3 ;
416 dn2_ddelta_car_adim = dn2_ddelta_car_fm3 * 10. ;
418 fich.ignore(1000,
'\n') ;
423 if ((n1_01fm3 <=0) && (n2_01fm3 <=0)) {press_adim = 0. ;}
427 if ((n1_01fm3 <= 0 ) || (n2_01fm3 <=0)) {
428 d2press_dmu1dmu2_adim = 0. ;
429 dpress_ddelta_car_adim = 0. ;
430 dn1_ddelta_car_adim = 0. ;
431 dn2_ddelta_car_adim = 0. ;
439 fich.ignore(1000,
'\n') ;
443 fich.ignore(1000,
'\n') ;
449 mu1_min = (*mu1_tab)(0, 0, 0) ;
450 mu1_max = (*mu1_tab)(0, n_mu1-1, 0) ;
451 mu2_min = (*mu2_tab)(0, 0, 0) ;
452 mu2_max = (*mu2_tab)(0, 0, n_mu2-1);
460 string tablename_1f_n =
tablename.c_str() ;
461 tablename_1f_n.replace(tablename_1f_n.end()-5,tablename_1f_n.end(),
"_1f_n.d");
464 fichN.open(tablename_1f_n.c_str()) ;
467 cerr <<
"Eos_bf_tabul::read_table(): " << endl ;
468 cerr <<
"Problem in opening the EOS file!" << endl ;
469 cerr <<
"While trying to open " <<
tablename << endl ;
470 cerr <<
"Aborting..." << endl ;
474 fichN.ignore(1000,
'\n') ;
476 fichN.ignore(1000,
'\n') ;
478 for (
int i=0; i<5; i++) {
479 fichN.ignore(1000,
'\n') ;
484 fichN.ignore(1000,
'\n') ;
487 fichN.ignore(1000,
'\n') ;
490 cerr <<
"Eos_bf_tabul::read_table(): " << endl ;
491 cerr <<
"Wrong value for the number of lines!" << endl ;
492 cerr <<
"nbp = " << nbp << endl ;
493 cerr <<
"Aborting..." << endl ;
497 cerr <<
"Eos_bf_tabul::read_table(): " << endl ;
498 cerr <<
"Wrong value for the number of values of mu_n!" << endl ;
499 cerr <<
"n_mu1 = " << n_mu1 << endl ;
500 cerr <<
"Aborting..." << endl ;
503 for (
int i=0; i<3; i++) {
504 fichN.ignore(1000,
'\n') ;
507 mu1_N =
new Tbl(n_mu1_N) ;
508 n_n_N =
new Tbl(n_mu1_N) ;
509 press_N =
new Tbl(n_mu1_N) ;
511 mu1_N ->set_etat_qcq() ;
512 n_n_N->set_etat_qcq() ;
513 press_N ->set_etat_qcq() ;
516 double mu1_MeV_N, n1_fm3_N, press_MeV_fm3_N;
519 double mu1_adimN, n1_01fm3N, press_adimN;
521 for (
int k=0 ; k < n_mu1_N ; k++) {
524 mu1_adimN = mu1_MeV_N * mev_si / (m_b_si * v_unit * v_unit ) ;
526 n1_01fm3N = 10. * n1_fm3_N ;
527 fichN >> press_MeV_fm3_N;
528 press_adimN = press_MeV_fm3_N * mevpfm3 ;
529 fichN.ignore(1000,
'\n') ;
531 if ( (n1_01fm3N<0) || (press_adimN < 0)){
532 cout <<
"Eos_tabul::read_table(): " << endl ;
533 cout <<
"Negative value in table!" << endl ;
534 cout <<
"n_neutrons = " << n1_01fm3N <<
", p = " << press_adimN <<
", "<< endl ;
535 cout <<
"Aborting..." << endl ;
539 mu1_N ->set(k) = mu1_adimN ;
540 n_n_N->set(k) = n1_01fm3N ;
541 press_N ->set(k) = press_adimN ;
550 string tablename_1f_p =
tablename.c_str() ;
551 tablename_1f_p.replace(tablename_1f_p.end()-5,tablename_1f_p.end(),
"_1f_p.d");
554 fichP.open(tablename_1f_p.c_str()) ;
557 cerr <<
"Eos_bf_tabul::read_table(): " << endl ;
558 cerr <<
"Problem in opening the EOS file!" << endl ;
559 cerr <<
"While trying to open " <<
tablename << endl ;
560 cerr <<
"Aborting..." << endl ;
564 fichP.ignore(1000,
'\n') ;
566 fichP.ignore(1000,
'\n') ;
568 for (
int i=0; i<5; i++) {
569 fichP.ignore(1000,
'\n') ;
574 fichP.ignore(1000,
'\n') ;
577 fichP.ignore(1000,
'\n') ;
580 cerr <<
"Eos_bf_tabul::read_table(): " << endl ;
581 cerr <<
"Wrong value for the number of lines!" << endl ;
582 cerr <<
"nbp = " << nbp << endl ;
583 cerr <<
"Aborting..." << endl ;
587 cerr <<
"Eos_bf_tabul::read_table(): " << endl ;
588 cerr <<
"Wrong value for the number of values of mu_p!" << endl ;
589 cerr <<
"n_mu2 = " << n_mu2 << endl ;
590 cerr <<
"Aborting..." << endl ;
594 for (
int i=0; i<3; i++) {
595 fichP.ignore(1000,
'\n') ;
598 mu2_P =
new Tbl(n_mu2_P) ;
599 n_p_P =
new Tbl(n_mu2_P) ;
600 press_P =
new Tbl(n_mu2_P) ;
602 mu2_P ->set_etat_qcq() ;
603 n_p_P->set_etat_qcq() ;
604 press_P ->set_etat_qcq() ;
607 double mu2_MeV_P, n2_fm3_P, press_MeV_fm3_P;
610 double mu2_adimP, n2_01fm3P, press_adimP;
612 for (
int l=0 ; l < n_mu2_P ; l++) {
615 mu2_adimP = mu2_MeV_P * mev_si / (m_b_si * v_unit * v_unit ) ;
617 n2_01fm3P = 10. * n2_fm3_P ;
618 fichP >> press_MeV_fm3_P;
619 press_adimP = press_MeV_fm3_P * mevpfm3 ;
620 fichP.ignore(1000,
'\n') ;
622 if ( (n2_01fm3P<0) || (press_adimP < 0)){
623 cout <<
"Eos_tabul::read_table(): " << endl ;
624 cout <<
"Pegative value in table!" << endl ;
625 cout <<
", n_protons " << n2_01fm3P <<
", p = " << press_adimP <<
", "<< endl ;
626 cout <<
"Aborting..." << endl ;
630 mu2_P ->set(l) = mu2_adimP ;
631 n_p_P->set(l) = n2_01fm3P ;
632 press_P ->set(l) = press_adimP ;
643 string tablename_np_0 =
tablename.c_str() ;
644 tablename_np_0.replace(tablename_np_0.end()-5,tablename_np_0.end(),
"_np=0.d");
647 fich1.open(tablename_np_0.c_str()) ;
650 cerr <<
"Eos_bf_tabul::read_table(): " << endl ;
651 cerr <<
"Problem in opening the EOS file!" << endl ;
652 cerr <<
"While trying to open " <<
tablename << endl ;
653 cerr <<
"Aborting..." << endl ;
657 int n_delta_n0, n_mu1_n0;
658 fich1 >> n_delta_n0;fich1.ignore(1000,
'\n') ;
659 fich1 >> n_mu1_n0;fich1.ignore(1000,
'\n') ;
660 fich1.ignore(1000,
'\n') ;
662 delta_car_n0 =
new Tbl(n_delta_n0, n_mu1_n0) ;
663 mu1_n0 =
new Tbl(n_delta_n0, n_mu1_n0) ;
664 mu2_n0 =
new Tbl(n_delta_n0, n_mu1_n0) ;
666 delta_car_n0 ->set_etat_qcq() ;
667 mu1_n0->set_etat_qcq() ;
668 mu2_n0->set_etat_qcq() ;
670 double delta_car_nn0, mu1_MeV_nn0, mu2_MeV_nn0;
672 for (
int o = 0; o < n_delta_n0 ; o++ ) {
674 for (
int p = 0 ; p < n_mu1_n0 ; p++) {
676 fich1 >> delta_car_nn0 ;
677 fich1 >> mu1_MeV_nn0 ;
678 fich1 >> mu2_MeV_nn0 ;
679 fich1.ignore(1000,
'\n') ;
681 delta_car_n0 ->set(o,p) = delta_car_nn0;
682 mu1_n0 ->set(o,p) = mu1_MeV_nn0 * mev_si / (m_b_si * v_unit * v_unit ) ;
683 mu2_n0 ->set(o,p) = mu2_MeV_nn0 * mev_si / (m_b_si * v_unit * v_unit ) ;
686 fich1.ignore(1000,
'\n') ;
697 string tablename_nn_0 =
tablename.c_str() ;
698 tablename_nn_0.replace(tablename_nn_0.end()-5,tablename_nn_0.end(),
"_nn=0.d");
701 fich2.open(tablename_nn_0.c_str()) ;
704 cerr <<
"Eos_bf_tabul::read_table(): " << endl ;
705 cerr <<
"Problem in opening the EOS file!" << endl ;
706 cerr <<
"While trying to open " <<
tablename << endl ;
707 cerr <<
"Aborting..." << endl ;
711 int n_delta_p0, n_mu2_p0;
712 fich2 >> n_delta_p0;fich2.ignore(1000,
'\n') ;
713 fich2 >> n_mu2_p0;fich2.ignore(1000,
'\n') ;
714 fich2.ignore(1000,
'\n') ;
716 delta_car_p0 =
new Tbl(n_delta_p0, n_mu2_p0) ;
717 mu1_p0 =
new Tbl(n_delta_p0, n_mu2_p0) ;
718 mu2_p0 =
new Tbl(n_delta_p0, n_mu2_p0) ;
720 delta_car_p0 ->set_etat_qcq() ;
721 mu1_p0->set_etat_qcq() ;
722 mu2_p0 ->set_etat_qcq() ;
724 double delta_car_np0, mu1_MeV_np0, mu2_MeV_np0;
726 for (
int o = 0; o < n_delta_p0 ; o++ ) {
728 for (
int p = 0 ; p < n_mu2_p0 ; p++) {
730 fich2 >> delta_car_np0 ;
731 fich2 >> mu1_MeV_np0 ;
732 fich2 >> mu2_MeV_np0 ;
733 fich2.ignore(1000,
'\n') ;
735 delta_car_p0 ->set(o,p) = delta_car_np0;
736 mu1_p0 ->set(o,p) = mu1_MeV_np0 * mev_si / (m_b_si * v_unit * v_unit ) ;
737 mu2_p0 ->set(o,p) = mu2_MeV_np0 * mev_si / (m_b_si * v_unit * v_unit ) ;
740 fich2.ignore(1000,
'\n') ;
760 int nzet,
int l_min)
const {
762 assert(ent1.
get_etat() != ETATNONDEF) ;
763 assert(ent2.
get_etat() != ETATNONDEF) ;
764 assert(delta2.
get_etat() != ETATNONDEF) ;
767 assert(mp == ent2.
get_mp()) ;
768 assert(mp == delta2.
get_mp()) ;
769 assert(mp == ener.
get_mp()) ;
795 const Mg3d* mg = mp->get_mg() ;
802 nbar1.
annule(0, l_min-1) ;
803 nbar2.
annule(0, l_min-1) ;
805 press.
annule(0, l_min-1) ;
809 alpha_eos.
annule(0, l_min-1) ;
813 if (l_min + nzet < nz) {
815 nbar1.
annule(l_min + nzet, nz - 1) ;
816 nbar2.
annule(l_min + nzet, nz - 1) ;
817 ener.
annule(l_min + nzet, nz - 1) ;
818 press.
annule(l_min + nzet, nz - 1) ;
819 K_nn.
annule(l_min + nzet, nz - 1) ;
820 K_np.
annule(l_min + nzet, nz - 1) ;
821 K_pp.
annule(l_min + nzet, nz - 1) ;
822 alpha_eos.
annule(l_min + nzet, nz - 1) ;
826 int np0 = mp->get_mg()->get_np(0) ;
827 int nt0 = mp->get_mg()->get_nt(0) ;
829 for (
int l=l_min; l<l_min+nzet; l++) {
830 assert(mp->get_mg()->get_np(l) == np0) ;
831 assert(mp->get_mg()->get_nt(l) == nt0) ;
834 for (
int k=0; k<np0; k++) {
835 for (
int j=0; j<nt0; j++) {
836 for (
int l=l_min; l< l_min + nzet; l++) {
837 for (
int i=0; i<mp->get_mg()->get_nr(l); i++) {
840 xx1 = ent1(l,k,j,i) ;
841 xx2 = ent2(l,k,j,i) ;
842 xx = delta2(l,k,j,i) ;
845 cout <<
"Eos_bf_tabul::calcule_tout : delta2 < delta_car_min !" << endl ;
849 cout <<
"Eos_bf_tabul::calcule_tout : delta2 > delta_car_max !" << endl ;
853 cout <<
"Eos_bf_tabul::calcule_tout : ent1 > mu1_max !" << endl ;
857 cout <<
"Eos_bf_tabul::calcule_tout : ent2 > mu2_max !" << endl ;
861 double n1 = 0 , n2 = 0, pressure = 0 ;
862 double alpha_int = 0, K11 = 0, K12 = 0, K22 = 0 ;
864 double mu1 =
m_1 *
exp(xx1);
865 double mu2 =
m_2 *
exp(xx2);
867 if ( (
exp(xx1) < 1.) && (
exp(xx2) < 1.) ) {
879 double p_interpol, dpsdent1_interpol, dpsdent2_interpol, alpha_interpol ;
883 n1 = dpsdent1_interpol ;
884 n2 = dpsdent2_interpol ;
885 pressure = p_interpol;
886 alpha_int = alpha_interpol ;
890 cout <<
"Eos_bf_tabul::calcule_tout : nbar1<0 !" << endl ;
895 cout <<
"Eos_bf_tabul::calcule_tout : nbar2<0 !" << endl ;
900 cout <<
"Eos_bf_tabul::calcule_tout : pressure < 0 !" << endl ;
907 K11 = mu1 / n1 - double(2) * alpha_int * ( 1. - xx) / ( n1 * n1 ) ;
911 K22 = mu2 / n2 - double(2) * alpha_int * ( 1. - xx) / ( n2 * n2 ) ;
914 if ((n1 <= 0.) || (n2 <= 0.) ) {
919 K12 = double(2) * alpha_int *
pow(1.-xx, 1.5)/ ( n1 * n2 );
922 nbar1.
set(l,k,j,i) = n1 ;
923 nbar2.
set(l,k,j,i) = n2 ;
924 press.
set(l,k,j,i) = pressure ;
925 ener.
set(l,k,j,i) = mu1 * n1 + mu2 * n2 - pressure ;
926 K_nn.
set(l,k,j,i) = K11 ;
927 K_np.
set(l,k,j,i) = K12;
928 K_pp.
set(l,k,j,i) = K22 ;
929 alpha_eos.
set(l,k,j,i) = alpha_int ;
944 const double delta2,
double& nbar1,
945 double& nbar2)
const {
947 bool one_fluid =
false;
950 cout <<
"Eos_bf_tabul::nbar_ent_p : delta2 < delta_car_min !" << endl ;
954 cout <<
"Eos_bf_tabul::nbar_ent_p : delta2 > delta_car_max !" << endl ;
958 cout <<
"Eos_bf_tabul::nbar_ent_p : ent1 > mu1_max !" << endl ;
962 cout <<
"Eos_bf_tabul::nbar_ent_p : ent2 > mu2_max !" << endl ;
966 if ( (
exp(ent1) < 1.) && (
exp(ent2) < 1.) ) {
972 double mu1 =
m_1 *
exp(ent1);
973 double mu2 =
m_2 *
exp(ent2);
976 double dpsdent1_interpol ;
977 double dpsdent2_interpol ;
981 p_interpol, dpsdent1_interpol, dpsdent2_interpol, alpha) ;
983 nbar1 = dpsdent1_interpol ;
984 nbar2 = dpsdent2_interpol ;
989 cout <<
"Eos_bf_tabul::nbar_ent_p : nbar1<0 !" << endl ;
994 cout <<
"Eos_bf_tabul::nbar_ent_p : nbar2<0 !" << endl ;
999 one_fluid = ((nbar1 <= 0.)||(nbar2 <= 0.)) ;
1061 const double delta2)
const{
1065 return nbar1 + nbar2 + delta2;
1074 const double delta2)
const {
1078 return nbar1 + nbar2 + delta2;
1090 cout <<
"Eos_bf_tabul::press_ent_p : delta2 < delta_car_min !" << endl ;
1094 cout <<
"Eos_bf_tabul::press_ent_p : delta2 > delta_car_max !" << endl ;
1098 cout <<
"Eos_bf_tabul::press_ent_p : ent1 > mu1_max !" << endl ;
1102 cout <<
"Eos_bf_tabul::press_ent_p : ent2 > mu2_max !" << endl ;
1108 if ( (
exp(ent1) < 1.) && (
exp(ent2) < 1.)) {
1114 double mu1 =
m_1 *
exp(ent1);
1115 double mu2 =
m_2 *
exp(ent2);
1118 double dpsdent1_interpol ;
1119 double dpsdent2_interpol ;
1123 p_interpol, dpsdent1_interpol, dpsdent2_interpol, alpha) ;
1125 pressure = p_interpol;
1129 if (pressure < 0 ) {
1130 cout <<
"Eos_bf_tabul::press_ent_p : pressure < 0 !" << endl ;
1143 const double delta2)
const {
1146 if ( (
exp(ent1) < 1.) && (
exp(ent2) < 1.)) {
1150 double mu1 =
m_1 *
exp(ent1);
1151 double mu2 =
m_2 *
exp(ent2);
1154 double dpsdent1_interpol ;
1155 double dpsdent2_interpol ;
1160 energy = mu1 * dpsdent1_interpol + mu2 * dpsdent2_interpol - p_interpol ;
1164 cout <<
"Eos_bf_tabul::ener_ent_p : energy < 0 !" << endl ;
1178 const double delta2)
const {
1181 cout <<
"Eos_bf_tabul::alpha_ent_p : delta2 < delta_car_min !" 1186 cout <<
"Eos_bf_tabul::alpha_ent_p : delta2 > delta_car_max !" 1191 cout <<
"Eos_bf_tabul::alpha_ent_p : ent1 > mu1_max !" << endl ;
1195 cout <<
"Eos_bf_tabul::alpha_ent_p : ent2 > mu2_max !" << endl ;
1201 if ((
exp(ent1) <= 1.) && (
exp(ent2) <= 1.) ) {
1205 double mu1 =
m_1 *
exp(ent1);
1206 double mu2 =
m_2 *
exp(ent2);
1208 double dpsdent1_interpol ;
1209 double dpsdent2_interpol ;
1226 double mu_1 =
m_1 *
exp(ent1);
1230 if ((
exp(ent1) <= 1.) && (
exp(ent2) <= 1.) ){
1239 xx = mu_1 / nbar1 - double(2) * alpha * ( 1. - delta2) / ( nbar1 * nbar1 ) ;
1250 double mu_2 =
m_2 *
exp (ent2) ;
1254 if ((
exp(ent1) <= 1.) && (
exp(ent2) <= 1.) ){
1263 xx = mu_2 / nbar2 - double(2) * alpha * ( 1. - delta2) / ( nbar2 * nbar2 ) ;
1275 if ((
exp(ent1) <= 1.) && (
exp(ent2) <= 1.) ){
1283 if ((nbar1 <= 0.) || (nbar2 <= 0.) ) {
1287 xx = double(2) * alpha *
pow(1.-delta2, 1.5)/ ( nbar1 * nbar2 );
1301 assert((*mu1_tab).dim == (*delta_car_tab).dim) ;
1302 assert((*mu2_tab).dim == (*delta_car_tab).dim) ;
1303 assert((*press_tab).dim == (*delta_car_tab).dim) ;
1304 assert((*n1_tab).dim == (*delta_car_tab).dim) ;
1305 assert((*n2_tab).dim == (*delta_car_tab).dim) ;
1306 assert((*d2psdmu1dmu2_tab ).dim == (*delta_car_tab).dim) ;
1308 int nbp1, nbp2, nbp3;
1309 nbp1 = (*delta_car_tab).get_dim(2) ;
1310 nbp2 = (*delta_car_tab).get_dim(1) ;
1311 nbp3 = (*delta_car_tab).get_dim(0) ;
1313 Tbl* null_tab =
new Tbl(nbp1,nbp2,nbp3) ;
1321 while ( ( (*
delta_car_tab)(i_near,0,0) <= delta2 ) && ( ( nbp1-1 ) > i_near ) ) {
1327 while ( ( (*
mu1_tab)(i_near,j_near, 0) <= mu1 ) && ( ( nbp2-1 ) > j_near ) ) {
1333 while ( ( (*
mu2_tab)( i_near, j_near, k_near) <= mu2) && ( ( nbp3-1 ) > k_near ) ) {
1339 int i1 = i_near + 1 ;
1340 int j1 = j_near + 1 ;
1341 int k1 = k_near + 1 ;
1344 if ( ( (*
delta_car_tab)( i_near, j_near, k_near) > delta2 ) && (i_near !=0 ) ) {
1348 if ( (delta2 > (*
delta_car_tab)( i1, j_near, k_near) ) && (i_near != nbp1 ) ) {
1352 if ( ( (*
mu1_tab)( i_near, j_near, k_near) > mu1 ) && (j_near !=0 ) ) {
1356 if ( ( mu1 > (*
mu1_tab)( i1, j1, k_near) ) && ( j_near != nbp2) ) {
1360 if ( ( (*
mu2_tab)( i_near, j_near, k_near) > mu2 ) && (k_near !=0 ) ) {
1364 if ( ( mu2 > (*
mu2_tab)( i1, j_near, k1) ) && ( k_near != nbp3) ) {
1371 cout <<
"bad location of delta2 in *delta_car_tab " << endl ;
1372 cout << (*delta_car_tab)( i_near, j_near, k_near) <<
" " << delta2 <<
" " << (*
delta_car_tab)( i1, j_near, k_near) << endl;
1375 if ( ( (*
mu1_tab)( i_near, j_near, k_near) > mu1 ) || (mu1 > (*
mu1_tab)( i1, j1, k_near) ) ) {
1376 cout <<
"bad location of mu1 in *mu1_tab " << endl ;
1377 cout << (*mu1_tab)( i_near, j_near, k_near) <<
" " << mu1 <<
" " << (*
mu1_tab)( i1, j1, k_near) << endl;
1380 if ( ( (*
mu2_tab)( i_near, j_near, k_near) > mu2 ) || ( mu2 > (*
mu2_tab)( i1, j_near, k1) ) ){
1381 cout <<
"bad location of mu2 in *mu2_tab "<< endl ;
1382 cout << (*mu2_tab)( i_near, j_near, k_near) <<
" " << mu2 <<
" " << (*
mu2_tab)( i1, j_near, k1) << endl;
1387 double press_i_near = 0. ;
1388 double nbar1_i_near = 0. ;
1389 double nbar2_i_near = 0. ;
1390 double malpha_i_near = 0. ;
1392 double press_i1 = 0. ;
1393 double nbar1_i1 = 0. ;
1394 double nbar2_i1 = 0. ;
1395 double malpha_i1 = 0. ;
1397 double malpha = 0. ;
1399 int n_deltaN = (*delta_car_n0).get_dim(1) ;
1400 int n_mu1N = (*delta_car_n0).get_dim(0) ;
1401 int n_deltaP = (*delta_car_p0).get_dim(1) ;
1402 int n_mu2P = (*delta_car_p0).get_dim(0) ;
1425 while ( ( (*delta_car_n0)(i_nearN_i,0) <= (*
delta_car_tab)(i_near, j_near, k_near) ) && ( ( n_deltaN-1 ) > i_nearN_i ) ) {
1428 if (i_nearN_i != 0) {
1431 while ( ( (*mu1_n0)(i_nearN_i,j_nearN_i) <= mu1 ) && ( ( n_mu1N-1 ) > j_nearN_i ) ) {
1434 if (j_nearN_i != 0) {
1439 if ( ( (*delta_car_n0)(i_nearN_i,0) > (*
delta_car_tab)(i_near, j_near, k_near) ) || ((*
delta_car_tab)(i_near, j_near, k_near) > (*delta_car_n0)(i_nearN_i+1,0) ) )
1441 cout <<
" bad location of delta_car_tab_i in *delta_car_n0 (courbe limite np = 0) " << endl ;
1442 cout << (*delta_car_n0)(i_nearN_i,0) <<
" " << (*
delta_car_tab)(i_near, j_near, k_near) <<
" " << (*delta_car_n0)(i_nearN_i+1,0) << endl;
1445 if ( ( (*mu1_n0)(i_nearN_i,j_nearN_i) > mu1 ) || (mu1 > (*mu1_n0)(i_nearN_i,j_nearN_i+1) ) )
1447 cout <<
" bad location of mu_n in *mu1_n0 (limit curve np = 0) " << endl ;
1448 cout << (*mu1_n0)(i_nearN_i,j_nearN_i) <<
" " << mu1 <<
" " << (*mu1_n0)(i_nearN_i,j_nearN_i+1) << endl;
1453 aN_i = ((*mu2_n0)(i_nearN_i,j_nearN_i+1) - (*mu2_n0)(i_nearN_i,j_nearN_i) ) / ((*mu1_n0)(i_nearN_i,j_nearN_i+1) - (*mu1_n0)(i_nearN_i,j_nearN_i) ) ;
1454 bN_i = (*mu2_n0)(i_nearN_i,j_nearN_i) - aN_i * (*mu1_n0)(i_nearN_i,j_nearN_i) ;
1455 double zN_i = aN_i * mu1 + bN_i ;
1480 while ( ( (*delta_car_p0)(i_nearP_i,0) <= (*
delta_car_tab)(i_near, j_near, k_near)) && ( ( n_deltaP-1 ) > i_nearP_i ) ) {
1483 if (i_nearP_i != 0) {
1486 while ( ( (*mu2_p0)(i_nearP_i,j_nearP_i) <= mu2 ) && ( ( n_mu2P-1 ) > j_nearP_i ) ) {
1489 if (j_nearP_i != 0) {
1494 if ( ( (*delta_car_p0)(i_nearP_i,0) > (*
delta_car_tab)(i_near, j_near, k_near) ) || ((*delta_car_tab)(i_near, j_near, k_near) > (*delta_car_p0)(i_nearP_i+1,0) ) )
1496 cout <<
" bad location of delta_car_tab_i in *delta_car_p0 (courbe limite nn = 0) " << endl ;
1497 cout << (*delta_car_p0)(i_nearP_i,0) <<
" " << (*
delta_car_tab)(i_near, j_near, k_near) <<
" " << (*delta_car_p0)(i_nearP_i+1,0) << endl;
1500 if ( ( (*mu2_p0)(i_nearP_i,j_nearP_i) > mu2 ) || (mu2 > (*mu2_p0)(i_nearP_i,j_nearP_i+1) ) ) {
1501 cout <<
" bad location of mu_p in *mu2_p0 (limit curve nn = 0) " << endl ;
1502 cout << (*mu2_p0)(i_nearP_i,j_nearP_i) <<
" " << mu2 <<
" " << (*mu2_p0)(i_nearP_i,j_nearP_i+1) << endl;
1507 aP_i = ( (*mu2_p0)(i_nearP_i,j_nearP_i+1) - (*mu2_p0)(i_nearP_i,j_nearP_i) ) / ( (*mu1_p0)(i_nearP_i,j_nearP_i+1) - (*mu1_p0)(i_nearP_i,j_nearP_i) ) ;
1508 bP_i = (*mu2_p0)(i_nearP_i,j_nearP_i) - aP_i * (*mu1_p0)(i_nearP_i,j_nearP_i) ;
1509 double yP_i = (mu2- bP_i) /aP_i ;
1537 else if (Placei == 1 )
1542 interpol_herm(*mu1_N, *press_N, *n_n_N, mu1, i, press_i_near , nbar1_i_near ) ;
1543 if (press_i_near < 0.) {
1544 cout <<
" INTERPOLATION FLUID N --> negative pressure " << endl ;
1547 if (nbar1_i_near < 0.) {
1548 cout <<
" INTERPOLATION FLUID N --> negative density " << endl ;
1552 else if (Placei == 2 )
1557 interpol_herm( *mu2_P, *press_P, *n_p_P, mu2, i, press_i_near, nbar2_i_near) ;
1558 if (press_i_near < 0.) {
1559 cout <<
" INTERPOLATION FLUID P --> negative pressure " << endl ;
1562 if (nbar2_i_near < 0.) {
1563 cout <<
" INTERPOLATION FLUID P --> negative density " << endl ;
1567 else if (Placei == 0 ) {
1573 mu1, mu2, press_i_near, nbar1_i_near , nbar2_i_near) ;
1576 double der1 = 0., der2 = 0. ;
1580 mu1, mu2, malpha_i_near, der1 , der2) ;
1582 if (press_i_near < 0.) {
1587 if (nbar1_i_near < 0.) {
1591 if (nbar2_i_near < 0.) {
1619 while ( ( (*delta_car_n0)(i_nearN_i1,0) <= (*
delta_car_tab)(i_near+1, j_near, k_near) ) && ( ( n_deltaN-1 ) > i_nearN_i1 ) ) {
1622 if (i_nearN_i1 != 0) {
1625 while ( ( (*mu1_n0)(i_nearN_i1,j_nearN_i1) <= mu1 ) && ( ( n_mu1N-1 ) > j_nearN_i1 ) ) {
1628 if (j_nearN_i1 != 0) {
1633 if ( ( (*delta_car_n0)(i_nearN_i1,0) > (*
delta_car_tab)(i_near+1, j_near, k_near) ) || ((*
delta_car_tab)(i_near+1, j_near, k_near) > (*delta_car_n0)(i_nearN_i1+1,0) ) )
1635 cout <<
" bad location of delta_car_tab_i+1 in *delta_car_n0 (courbe limite np = 0) " << endl ;
1636 cout << (*delta_car_n0)(i_nearN_i1,0) <<
" " << (*
delta_car_tab)(i_near+1, j_near, k_near) <<
" " << (*delta_car_n0)(i_nearN_i1+1,0) << endl;
1639 if ( ( (*mu1_n0)(i_nearN_i1,j_nearN_i1) > mu1 ) || (mu1 > (*mu1_n0)(i_nearN_i1,j_nearN_i1+1) ) )
1641 cout <<
" bad location of mu_n in *mu1_n0 (limit curve np = 0) " << endl ;
1642 cout << (*mu1_n0)(i_nearN_i1,j_nearN_i1) <<
" " << mu1 <<
" " << (*mu1_n0)(i_nearN_i1,j_nearN_i1+1) << endl;
1646 double aN_i1, bN_i1;
1647 aN_i1 = ((*mu2_n0)(i_nearN_i1,j_nearN_i1+1) - (*mu2_n0)(i_nearN_i1,j_nearN_i1) ) / ((*mu1_n0)(i_nearN_i1,j_nearN_i1+1) - (*mu1_n0)(i_nearN_i1,j_nearN_i1) ) ;
1648 bN_i1 = (*mu2_n0)(i_nearN_i1,j_nearN_i1) - aN_i1 * (*mu1_n0)(i_nearN_i1,j_nearN_i1) ;
1649 double zN_i1 = aN_i1 * mu1 + bN_i1 ;
1673 while ( ( (*delta_car_p0)(i_nearP_i1,0) <= (*
delta_car_tab)(i_near+1, j_near, k_near)) && ( ( n_deltaP-1 ) > i_nearP_i1) ) {
1676 if (i_nearP_i1 != 0) {
1679 while ( ( (*mu2_p0)(i_nearP_i1,j_nearP_i1) <= mu2 ) && ( ( n_mu2P-1 ) > j_nearP_i1 ) ) {
1682 if (j_nearP_i1 != 0) {
1687 if ( ( (*delta_car_p0)(i_nearP_i1,0) > (*
delta_car_tab)(i_near+1, j_near, k_near) ) || ((*delta_car_tab)(i_near+1, j_near, k_near) > (*delta_car_p0)(i_nearP_i1+1,0) ) )
1689 cout <<
" bad location of delta_car_tab_i+1 in *delta_car_p0 (courbe limite nn = 0) " << endl ;
1690 cout << (*delta_car_p0)(i_nearP_i1,0) <<
" " << (*
delta_car_tab)(i_near+1, j_near, k_near) <<
" " << (*delta_car_p0)(i_nearP_i1+1,0) << endl;
1693 if ( ( (*mu2_p0)(i_nearP_i1,j_nearP_i1) > mu2 ) || (mu2 > (*mu2_p0)(i_nearP_i1,j_nearP_i1+1) ) ) {
1694 cout <<
" bad location of mu_p in *mu2_p0 (limit curve nn = 0) " << endl ;
1695 cout << (*mu2_p0)(i_nearP_i1,j_nearP_i1) <<
" " << mu2 <<
" " << (*mu2_p0)(i_nearP_i1,j_nearP_i1+1) << endl;
1699 double aP_i1, bP_i1;
1700 aP_i1 = ( (*mu2_p0)(i_nearP_i1,j_nearP_i1+1) - (*mu2_p0)(i_nearP_i1,j_nearP_i1) ) / ( (*mu1_p0)(i_nearP_i1,j_nearP_i1+1) - (*mu1_p0)(i_nearP_i1,j_nearP_i1) ) ;
1701 bP_i1 = (*mu2_p0)(i_nearP_i1,j_nearP_i1) - aP_i1 * (*mu1_p0)(i_nearP_i1,j_nearP_i1) ;
1702 double yP_i1 = (mu2- bP_i1) /aP_i1 ;
1730 else if (Placei1 == 1 )
1735 interpol_herm(*mu1_N, *press_N, *n_n_N, mu1, i, press_i1 , nbar1_i1 ) ;
1736 if (press_i1 < 0.) {
1737 cout <<
" INTERPOLATION FLUID N i+1 --> negative pressure " << endl ;
1740 if (nbar1_i1 < 0.) {
1741 cout <<
" INTERPOLATION FLUID N i+1--> negative density " << endl ;
1745 else if (Placei1 == 2 )
1750 interpol_herm( *mu2_P, *press_P, *n_p_P, mu2, i, press_i1, nbar2_i1) ;
1751 if (press_i1 < 0.) {
1752 cout <<
" INTERPOLATION FLUID P i+1--> negative pressure " << endl ;
1755 if (nbar2_i1 < 0.) {
1756 cout <<
" INTERPOLATION FLUID P i+1 --> negative density " << endl ;
1760 else if (Placei1 == 0 ) {
1766 mu1, mu2, press_i1, nbar1_i1 , nbar2_i1) ;
1769 double der1b = 0., der2b = 0.;
1773 mu1, mu2, malpha_i1, der1b , der2b ) ;
1776 if (press_i1 < 0.) {
1781 if (nbar1_i1 < 0.) {
1785 if (nbar2_i1 < 0.) {
1797 double x1 = (*delta_car_tab)(i_near, 0, 0) ;
1798 double x2 = (*delta_car_tab)(i1, 0, 0) ;
1799 double x12 = x1-x2 ;
1802 double y1 = press_i_near;
1803 double y2 = press_i1;
1804 double a = (y1-y2)/x12 ;
1805 double b = (x1*y2-y1*x2)/x12 ;
1806 press = delta2*a+b ;
1810 double y1_y = nbar1_i_near;
1811 double y2_y = nbar1_i1;
1812 double a_y = (y1_y-y2_y)/x12 ;
1813 double b_y = (x1*y2_y-y1_y*x2)/x12 ;
1814 nbar1 = delta2*a_y+b_y ;
1817 double y1_z = nbar2_i_near;
1818 double y2_z = nbar2_i1;
1819 double a_z = (y1_z-y2_z)/x12 ;
1820 double b_z = (x1*y2_z-y1_z*x2)/x12 ;
1821 nbar2 = delta2*a_z+b_z ;
1824 double y1_alpha = malpha_i_near;
1825 double y2_alpha = malpha_i1;
1826 double a_alpha = (y1_alpha-y2_alpha)/x12 ;
1827 double b_alpha = (x1*y2_alpha-y1_alpha*x2)/x12 ;
1828 malpha = delta2*a_alpha+b_alpha ;
1840 const Tbl& ftab,
const Tbl& dfdytab,
const Tbl& dfdztab,
const Tbl& d2fdydztab,
1841 const double y,
const double z,
double& f,
double& dfdy,
double& dfdz)
const 1844 assert(dfdytab.
dim == ftab.
dim ) ;
1845 assert(dfdztab.
dim == ftab.
dim ) ;
1846 assert(d2fdydztab.
dim == ftab.
dim ) ;
1851 double dy = ytab(i, j1, k) - ytab(i, j, k) ;
1852 double dz = ztab(i, j, k1) - ztab(i, j, k) ;
1854 double u = (y - ytab(i, j, k)) / dy ;
1855 double v = (z - ztab(i, j, k)) / dz ;
1857 double u2 = u*u ;
double v2 = v*v ;
1858 double u3 = u2*u ;
double v3 = v2*v ;
1860 double psi0_u = 2.*u3 - 3.*u2 + 1. ;
1861 double psi0_1mu = -2.*u3 + 3.*u2 ;
1862 double psi1_u = u3 - 2.*u2 + u ;
1863 double psi1_1mu = -u3 + u2 ;
1864 double psi0_v = 2.*v3 - 3.*v2 + 1. ;
1865 double psi0_1mv = -2.*v3 + 3.*v2 ;
1866 double psi1_v = v3 - 2.*v2 + v ;
1867 double psi1_1mv = -v3 + v2 ;
1869 f = ftab(i, j, k) * psi0_u * psi0_v
1870 + ftab(i, j1, k) * psi0_1mu * psi0_v
1871 + ftab(i, j, k1) * psi0_u * psi0_1mv
1872 + ftab(i, j1, k1) * psi0_1mu * psi0_1mv ;
1874 f += (dfdytab(i, j, k) * psi1_u * psi0_v
1875 - dfdytab(i, j1, k) * psi1_1mu * psi0_v
1876 + dfdytab(i, j, k1) * psi1_u * psi0_1mv
1877 - dfdytab(i, j1, k1) * psi1_1mu * psi0_1mv) * dy ;
1879 f += (dfdztab(i, j, k) * psi0_u * psi1_v
1880 + dfdztab(i, j1, k) * psi0_1mu * psi1_v
1881 - dfdztab(i, j, k1) * psi0_u * psi1_1mv
1882 - dfdztab(i, j1, k1) * psi0_1mu * psi1_1mv) * dz ;
1884 f += (d2fdydztab(i, j, k) * psi1_u * psi1_v
1885 - d2fdydztab(i, j1, k) * psi1_1mu * psi1_v
1886 - d2fdydztab(i, j, k1) * psi1_u * psi1_1mv
1887 + d2fdydztab(i, j1, k1) * psi1_1mu * psi1_1mv) * dy * dz ;
1889 double dpsi0_u = 6.*(u2 - u) ;
1890 double dpsi0_1mu = 6.*(u2 - u) ;
1891 double dpsi1_u = 3.*u2 - 4.*u + 1. ;
1892 double dpsi1_1mu = 3.*u2 - 2.*u ;
1894 dfdy = (ftab(i, j, k) * dpsi0_u * psi0_v
1895 - ftab(i, j1, k) * dpsi0_1mu * psi0_v
1896 + ftab(i, j, k1) * dpsi0_u * psi0_1mv
1897 - ftab(i, j1, k1) * dpsi0_1mu * psi0_1mv ) / dy;
1899 dfdy += (dfdytab(i, j, k) * dpsi1_u * psi0_v
1900 + dfdytab(i, j1, k) * dpsi1_1mu * psi0_v
1901 + dfdytab(i, j, k1) * dpsi1_u * psi0_1mv
1902 + dfdytab(i, j1, k1) * dpsi1_1mu * psi0_1mv) ;
1904 dfdy += (dfdztab(i, j, k) * dpsi0_u* psi1_v
1905 - dfdztab(i, j1, k) * dpsi0_1mu * psi1_v
1906 - dfdztab(i, j, k1) * dpsi0_u * psi1_1mv
1907 + dfdztab(i, j1, k1) * dpsi0_1mu * psi1_1mv) * dz /dy ;
1909 dfdy += (d2fdydztab(i, j, k) * dpsi1_u * psi1_v
1910 + d2fdydztab(i, j1, k) * dpsi1_1mu * psi1_v
1911 - d2fdydztab(i, j, k1) * dpsi1_u * psi1_1mv
1912 - d2fdydztab(i, j1, k1) * dpsi1_1mu * psi1_1mv) * dz ;
1914 double dpsi0_v = 6.*(v2 - v) ;
1915 double dpsi0_1mv = 6.*(v2 - v) ;
1916 double dpsi1_v = 3.*v2 - 4.*v + 1. ;
1917 double dpsi1_1mv = 3.*v2 - 2.*v ;
1919 dfdz = (ftab(i, j, k) * psi0_u * dpsi0_v
1920 + ftab(i, j1, k) * psi0_1mu * dpsi0_v
1921 - ftab(i, j, k1) * psi0_u * dpsi0_1mv
1922 - ftab(i, j1, k1) * psi0_1mu * dpsi0_1mv) / dz ;
1924 dfdz += (dfdytab(i, j, k) * psi1_u * dpsi0_v
1925 - dfdytab(i, j1, k) * psi1_1mu * dpsi0_v
1926 - dfdytab(i, j, k1) * psi1_u * dpsi0_1mv
1927 + dfdytab(i, j1, k1) * psi1_1mu * dpsi0_1mv) * dy / dz ;
1929 dfdz += (dfdztab(i, j, k) * psi0_u * dpsi1_v
1930 + dfdztab(i, j1, k) * psi0_1mu * dpsi1_v
1931 + dfdztab(i, j, k1) * psi0_u * dpsi1_1mv
1932 + dfdztab(i, j1, k1) * psi0_1mu * dpsi1_1mv) ;
1934 dfdz += (d2fdydztab(i, j, k) * psi1_u* dpsi1_v
1935 - d2fdydztab(i, j1, k) * psi1_1mu * dpsi1_v
1936 + d2fdydztab(i, j, k1) * psi1_u* dpsi1_1mv
1937 - d2fdydztab(i, j1, k1) * psi1_1mu * dpsi1_1mv) * dy;
const Map * get_mp() const
Returns the mapping.
double mu1_max
Upper boundary of the chemical-potential interval (fluid 1 = n)
virtual void sauve(FILE *) const
Save in a file.
double m_1
Individual particle mass [unit: ].
void calcule_interpol(const Cmp &ent1, const Cmp &ent2, const Cmp &delta2, Cmp &nbar1, Cmp &nbar2, Cmp &ener, Cmp &press, Cmp &K_nn, Cmp &K_np, Cmp &K_pp, Cmp &alpha_eos, int nzet, int l_min=0) const
General computational method for Cmp 's, it computes both baryon densities, energy and pressure profi...
Component of a tensorial field *** DEPRECATED : use class Scalar instead ***.
Cmp exp(const Cmp &)
Exponential.
void annule(int l)
Sets the Cmp to zero in a given domain.
Standard units of space, time and mass.
Equation of state base class.
virtual int identify() const =0
Returns a number to identify the sub-classe of Eos_bifluid the object belongs to.
virtual ostream & operator>>(ostream &) const
Operator >>
int get_etat() const
Returns the logical state.
double & set(int i)
Read/write of a particular element (index i) (1D case)
Base class for coordinate mappings.
Tbl * dn1sddelta_car_tab
Table of .
Tbl * dn2sddelta_car_tab
Table of .
virtual double nbar_ent_p1(const double ent1) const
Computes baryon density out of the log-enthalpy asuming that only fluid 1 is present.
virtual double get_K11(const double delta2, const double ent1, const double ent2) const
Computes the derivative of the energy with respect to (baryonic density 1) .
virtual int identify() const
Returns a number to identify the sub-classe of Eos the object belongs to.
void operator=(const Eos_bifluid &)
Assignment to another Eos_bifluid.
virtual double ener_ent_p(const double ent1, const double ent2, const double delta_car) const
Computes the total energy density from the baryonic log-enthalpies and the relative velocity...
virtual double alpha_ent_p(const double ent1, const double ent2, const double delta_car) const
Computes alpha, the derivative of the total energy density with respect to from the baryonic log-ent...
Tbl * mu2_tab
Table of where .
Tbl * mu1_tab
Table of where .
2-fluids equation of state base class.
void set_etat_qcq()
Sets the logical state to ETATQCQ (ordinary state).
double m_2
Individual particle mass [unit: ].
void set_etat_zero()
Sets the logical state to ETATZERO (zero).
virtual double nbar_ent_p2(const double ent2) const
Computes baryon density out of the log-enthalpy assuming that only fluid 2 is present.
Dim_tbl dim
Number of dimensions, size,...
Tbl * dpsddelta_car_tab
Table of .
double delta_car_min
Lower boundary of the relative velocity interval.
virtual bool operator==(const Eos_bifluid &) const
Comparison operator (egality)
Polytropic equation of state (relativistic case).
int get_nzone() const
Returns the number of domains.
Tbl * d2psdmu1dmu2_tab
Table of .
virtual double get_K22(const double delta2, const double ent1, const double ent2) const
Computes the derivative of the energy/(baryonic density 2) .
virtual void sauve(FILE *) const
Save in a file.
virtual ~Eos_bf_tabul()
Destructor.
Cmp pow(const Cmp &, int)
Power .
void set_etat_zero()
Sets the logical state to ETATZERO (zero).
void read_table()
Reads the file containing the table and initializes the arrays mu1_tab, mu2_tab, delta_car_tab, press_tab, n1_tab, n2_tab, c\ d2psdmu1dmu2_tab , c\ dpsddelta_car_tab, c\ dn1sddelta_car_tab, c\ dn2sddelta_car_tab.
virtual bool operator!=(const Eos_bifluid &) const
Comparison operator (difference)
double mu2_max
Upper boundary of the chemical-potential interval (fluid 2 = p)
virtual double press_nbar_p(const double nbar1, const double nbar2, const double delta2) const
Computes the pressure from the baryonic densities and the relative velocity.
void allocate_all()
Sets the logical state to ETATQCQ (ordinary state) and performs the memory allocation of all the elem...
Tbl & set(int l)
Read/write of the value in a given domain.
virtual double ener_nbar_p(const double nbar1, const double nbar2, const double delta2) const
Computes the total energy density from the baryonic densities and the relative velocity.
virtual double press_ent_p(const double ent1, const double ent2, const double delta_car) const
Computes the pressure from the baryonic log-enthalpies and the relative velocity. ...
void c_est_pas_fait(const char *)
Helpful function to say something is not implemented yet.
Class for a two-fluid (tabulated) equation of state.
virtual double get_K12(const double delta2, const double ent1, const double ent2) const
Computes the derivative of the energy with respect to .
double delta_car_max
Upper boundary of the relative velocity interval.
void operator=(const Eos_bf_tabul &)
Assignment to another Eos_bf_tabul.
void interpol_2d_Tbl3d(const int i, const int j, const int k, const Tbl &ytab, const Tbl &ztab, const Tbl &ftab, const Tbl &dfdytab, const Tbl &dfdztab, const Tbl &d2fdydztab, const double y, const double z, double &f, double &dfdy, double &dfdz) const
Routine used by interpol_3d_bifluid to perform the 2D interpolation on the chemical potentials on eac...
virtual Eos * trans2Eos() const
Makes a translation from Eos_bifluid to Eos .
string tablename
Name of the file containing the tabulated data (be careful, Eos_bifluid uses char*) ...
Eos_bf_tabul(const char *name_i, const char *table, const char *path, double mass1, double mass2)
Standard constructor.
double mu2_min
Lower boundary of the chemical-potential interval (fluid 2 = p)
double mu1_min
Lower boundary of the chemical-potential interval (fluid 1 = n)
void interpol_3d_bifluid(const double delta2, const double mu1, const double mu2, double &press, double &nbar1, double &nbar2, double &alpha) const
General method computing the pressure, both baryon densities and alpha from the values of both chemic...
Tbl * press_tab
Table of .
virtual bool nbar_ent_p(const double ent1, const double ent2, const double delta2, double &nbar1, double &nbar2) const
Computes both baryon densities from the log-enthalpies.
Tbl * delta_car_tab
Table of .