00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef O2SCL_HAD_GIBBS_NSEOS_H
00024 #define O2SCL_HAD_GIBBS_NSEOS_H
00025
00026 #include <cmath>
00027 #include <o2scl/constants.h>
00028 #include <o2scl/hadronic_eos.h>
00029
00030 #ifndef DOXYGENP
00031 namespace o2scl {
00032 #endif
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046 class had_gibbs_nseos {
00047
00048 public:
00049
00050 had_gibbs_nseos();
00051
00052 virtual ~had_gibbs_nseos();
00053
00054
00055
00056
00057
00058 virtual int calc_e(double nb, fermion &n1, fermion &p1, thermo &th1,
00059 fermion &n2, fermion &p2, thermo &th2, double &chi,
00060 int type);
00061
00062
00063
00064
00065
00066 virtual int fixed_chi(double chi, fermion &n1, fermion &p1, thermo &th1,
00067 fermion &n2, fermion &p2, thermo &th2, double &nb,
00068 int type);
00069
00070
00071 int set_hadronic_eos1(hadronic_eos &he) {
00072 hep1=&he;
00073 return 0;
00074 }
00075
00076
00077 int set_hadronic_eos2(hadronic_eos &he) {
00078 hep2=&he;
00079 return 0;
00080 }
00081
00082
00083 gsl_mroot_hybrids<void *,mm_funct<void *> > def_solver;
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094 int set_solver(mroot<void *,mm_funct<void *> > &mr) {
00095 solverp=&mr;
00096 return 0;
00097 }
00098
00099
00100
00101
00102 int phase_guess;
00103
00104
00105
00106
00107 static const int phase1=1;
00108 static const int phase2=2;
00109 static const int mixed_phase=3;
00110
00111
00112
00113
00114
00115 static const int nuclear_matter=1;
00116 static const int neutron_matter=2;
00117 static const int nstar_matter=3;
00118
00119
00120 #ifndef DOXYGEN_INTERNAL
00121
00122 protected:
00123
00124
00125
00126
00127 typedef struct solvepar_s {
00128 fermion *n1;
00129 fermion *p1;
00130 fermion *n2;
00131 fermion *p2;
00132 thermo *th1;
00133 thermo *th2;
00134 double nb;
00135 } solvepar;
00136
00137
00138
00139
00140 typedef struct chipar_s {
00141 fermion *n1;
00142 fermion *p1;
00143 fermion *n2;
00144 fermion *p2;
00145 thermo *th1;
00146 thermo *th2;
00147 double chi;
00148 } chipar;
00149
00150
00151 int phase1_nstar(size_t nv, const ovector_view &x, ovector_view &y,
00152 void *&pa);
00153
00154
00155 int phase2_nstar(size_t nv, const ovector_view &x, ovector_view &y,
00156 void *&pa);
00157
00158
00159 int gibbs_nstar(size_t nv, const ovector_view &x, ovector_view &y,
00160 void *&pa);
00161
00162
00163 int fixed_chi_nstar(size_t nv, const ovector_view &x, ovector_view &y,
00164 void *&pa);
00165
00166
00167 int gibbs_nuc(size_t nv, const ovector_view &x, ovector_view &y,
00168 void *&pa);
00169
00170
00171 int fixed_chi_nuc(size_t nv, const ovector_view &x, ovector_view &y,
00172 void *&pa);
00173
00174
00175 int gibbs_neut(size_t nv, const ovector_view &x, ovector_view &y,
00176 void *&pa);
00177
00178
00179 int fixed_chi_neut(size_t nv, const ovector_view &x, ovector_view &y,
00180 void *&pa);
00181
00182
00183 hadronic_eos *hep1;
00184
00185
00186 hadronic_eos *hep2;
00187
00188
00189 fermion elec;
00190
00191
00192 fermion mu;
00193
00194
00195 mroot<void *,mm_funct<void *> > *solverp;
00196
00197
00198
00199 ovector gx;
00200 ovector px;
00201
00202 #endif
00203
00204 };
00205
00206 #ifndef DOXYGENP
00207 }
00208 #endif
00209
00210 #endif