00001 /* 00002 ------------------------------------------------------------------- 00003 00004 Copyright (C) 2006, 2007, 2008, 2009, Andrew W. Steiner 00005 00006 This file is part of O2scl. 00007 00008 O2scl is free software; you can redistribute it and/or modify 00009 it under the terms of the GNU General Public License as published by 00010 the Free Software Foundation; either version 3 of the License, or 00011 (at your option) any later version. 00012 00013 O2scl is distributed in the hope that it will be useful, 00014 but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00016 GNU General Public License for more details. 00017 00018 You should have received a copy of the GNU General Public License 00019 along with O2scl. If not, see <http://www.gnu.org/licenses/>. 00020 00021 ------------------------------------------------------------------- 00022 */ 00023 #ifndef O2SCL_EFF_BOSON_H 00024 #define O2SCL_EFF_BOSON_H 00025 00026 #include <string> 00027 #include <iostream> 00028 #include <fstream> 00029 #include <cmath> 00030 #include <o2scl/constants.h> 00031 #include <o2scl/funct.h> 00032 #include <o2scl/mm_funct.h> 00033 #include <o2scl/root.h> 00034 #include <o2scl/mroot.h> 00035 #include <o2scl/inte.h> 00036 #include <o2scl/boson.h> 00037 #include <o2scl/cern_mroot_root.h> 00038 #include <o2scl/gsl_mroot_hybrids.h> 00039 00040 #ifndef DOXYGENP 00041 namespace o2scl { 00042 #endif 00043 00044 /** 00045 \brief Boson class from fitting method 00046 00047 \todo Better documentation (see eff_fermion) 00048 \todo Remove the 'meth2' stuff 00049 \todo Remove static variables fix_density and stat_temper 00050 */ 00051 class eff_boson : public boson { 00052 00053 public: 00054 00055 /// Create a boson with mass \c m and degeneracy \c g 00056 eff_boson(double m=0.0, double g=0.0); 00057 00058 virtual ~eff_boson(); 00059 00060 /** 00061 \brief Load coefficients for finite-temperature approximation 00062 00063 Presently acceptable values of \c fn are: \c boselat3 from 00064 Lattimer's notes \c bosejel21, \c bosejel22, \c bosejel34, and 00065 \c bosejel34cons from \ref Johns96. 00066 */ 00067 static int load_coefficients(int ctype); 00068 /// A set of coefficients from Jim Lattimer 00069 static const int cf_boselat3=1; 00070 /// A set of coefficients from \ref Johns96 00071 static const int cf_bosejel21=2; 00072 /// A set of coefficients from \ref Johns96 00073 static const int cf_bosejel22=3; 00074 /// A set of coefficients from \ref Johns96 00075 static const int cf_bosejel34=4; 00076 /** \brief The set of coefficients from \ref Johns96 which retains 00077 better thermodynamic consistency 00078 */ 00079 static const int cf_bosejel34cons=5; 00080 00081 /** 00082 \brief Calculate thermodynamic 00083 properties as function of chemical potential 00084 */ 00085 virtual int calc_mu(const double temper); 00086 00087 /** 00088 \brief Calculate thermodynamic 00089 properties as function of density 00090 */ 00091 virtual int calc_density(const double temper); 00092 00093 /** \brief Calculate thermodynamic properties with antiparticles 00094 as function of chemical potential 00095 */ 00096 virtual int pair_mu(const double temper); 00097 00098 /** \brief Calculate thermodynamic properties with antiparticles 00099 as function of density 00100 */ 00101 virtual int pair_density(const double temper); 00102 00103 /** \brief Set the solver for use in calculating \f$ \psi \f$ 00104 */ 00105 int set_psi_root(root<double,funct<double> > &rp) { 00106 psi_root=&rp; 00107 return 0; 00108 } 00109 00110 /** \brief Set the solver for use in calculating the chemical 00111 potential from the density 00112 */ 00113 int set_density_mroot(mroot<int ,mm_funct<int> > &rp) { 00114 density_mroot=&rp; 00115 return 0; 00116 } 00117 00118 /** \brief Set the solver for use in calculating the chemical 00119 potential from the density (meth2=true) 00120 */ 00121 int set_meth2_root(root<int ,funct<int> > &rp) { 00122 meth2_root=&rp; 00123 return 0; 00124 } 00125 00126 /** \brief The default solver for calc_density() and pair_density() 00127 */ 00128 gsl_mroot_hybrids<int ,mm_funct<int> > def_density_mroot; 00129 00130 /** \brief The default solver for \f$ \psi \f$ 00131 */ 00132 cern_mroot_root<double,funct<double> > def_psi_root; 00133 00134 /** \brief The default solver for calc_density() and pair_density() 00135 */ 00136 cern_mroot_root<int ,funct<int> > def_meth2_root; 00137 00138 virtual const char *type() { return "eff_boson"; } 00139 00140 #ifndef DOXYGEN_INTERNAL 00141 00142 friend class io_tlate<eff_boson>; 00143 00144 protected: 00145 00146 /// The coefficients 00147 static double **Pmnb; 00148 /// The number of coefficient rows 00149 static int sizem; 00150 /// The number of coefficient columns 00151 static int sizen; 00152 /// The parameter, \f$ a \f$ 00153 static double parma; 00154 /// Temporary storage 00155 static double fix_density; 00156 /// Temporary storage 00157 static double stat_temper; 00158 00159 /// The solver for calc_density() 00160 mroot<int ,mm_funct<int> > *density_mroot; 00161 00162 /// The solver to compute \f$ h \f$ from \f$ \psi \f$. 00163 root<double,funct<double> > *psi_root; 00164 00165 /// The solver for calc_density() 00166 root<int ,funct<int> > *meth2_root; 00167 00168 /// The function which solves for \f$ h \f$ from \f$ \psi \f$. 00169 int solve_fun(double x, double &y, double &psi); 00170 00171 /// Fix density for calc_density() 00172 int density_fun(size_t nv, const ovector_base &x, ovector_base &y, 00173 int &pa); 00174 00175 /// Fix density for pair_density() 00176 int pair_density_fun(size_t nv, const ovector_base &x, ovector_base &y, 00177 int &pa); 00178 00179 #endif 00180 }; 00181 00182 template<> int io_tlate<eff_boson>::input 00183 (cinput *co, in_file_format *ins, eff_boson *b); 00184 template<> int io_tlate<eff_boson>::output 00185 (coutput *co, out_file_format *outs, eff_boson *b); 00186 template<> const char *io_tlate<eff_boson>::type(); 00187 00188 typedef io_tlate<eff_boson> eff_boson_io_type; 00189 00190 #ifndef DOXYGENP 00191 } 00192 #endif 00193 00194 #endif
Documentation generated with Doxygen and provided under the GNU Free Documentation License. See License Information for details.
Project hosting provided by
,
O2scl Sourceforge Project Page