00001 /* 00002 ------------------------------------------------------------------- 00003 00004 Copyright (C) 2006, 2007, 2008, 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_REL_BOSON_H 00024 #define O2SCL_REL_BOSON_H 00025 00026 #include <string> 00027 #include <iostream> 00028 #include <fstream> 00029 #include <cmath> 00030 #include <o2scl/constants.h> 00031 #include <o2scl/root.h> 00032 #include <o2scl/mroot.h> 00033 #include <o2scl/inte.h> 00034 #include <o2scl/boson.h> 00035 #include <o2scl/cern_mroot_root.h> 00036 #include <o2scl/gsl_inte_qag.h> 00037 #include <o2scl/gsl_inte_qagiu.h> 00038 00039 #ifndef DOXYGENP 00040 namespace o2scl { 00041 #endif 00042 00043 /** 00044 \brief Equation of state for a relativistic boson 00045 00046 \todo Testing not completely finished. 00047 */ 00048 class rel_boson : public boson { 00049 00050 public: 00051 00052 /// Create a boson with mass \c m and degeneracy \c g 00053 rel_boson(double m=0.0, double g=0.0); 00054 00055 virtual ~rel_boson(); 00056 00057 /// The error value from mroot 00058 int mroot_err; 00059 00060 /// The error value from inte 00061 int inte_err; 00062 00063 /** 00064 \brief Calculate properties as function of chemical potential 00065 */ 00066 virtual int calc_mu(const double temper); 00067 00068 /** 00069 \brief Calculate properties as function of density 00070 */ 00071 virtual int calc_density(const double temper); 00072 00073 /** \brief Calculate properties with antiparticles as function of 00074 chemical potential 00075 */ 00076 virtual int pair_mu(const double temper); 00077 00078 /// Calculate effective chemical potential from density 00079 virtual int nu_from_n(const double temper); 00080 00081 /// Set inte object 00082 int set_inte(inte<void *,funct<void *> > &l_nit, 00083 inte<void *,funct<void *> > &l_dit); 00084 00085 /** \brief Set the solver for use in calculating the chemical 00086 potential from the density */ 00087 int set_density_root(root<void *,funct<void *> > &rp) { 00088 density_root=&rp; 00089 return 0; 00090 } 00091 00092 /// The default solver for calc_density(). 00093 cern_mroot_root<void *,funct<void *> > def_density_root; 00094 00095 /// Default nondegenerate integrator 00096 gsl_inte_qagiu<void *,funct<void *> > def_nit; 00097 00098 /// Default degenerate integrator 00099 gsl_inte_qag<void *,funct<void *> > def_dit; 00100 00101 /// Return string denoting type ("rel_boson") 00102 virtual const char *type() { return "rel_boson"; } 00103 00104 protected: 00105 00106 #ifndef DOXYGENP 00107 00108 friend class io_tlate<rel_boson>; 00109 00110 /// The non-degenerate integrator 00111 inte<void *,funct<void *> > *nit; 00112 /// The degenerate integrator 00113 inte<void *,funct<void *> > *dit; 00114 /// The solver for calc_density() 00115 root<void *,funct<void *> > *density_root; 00116 00117 /// Non-degenerate density integral 00118 double density_fun(double u, void *&pa); 00119 /// Non-degenerate energy density integral 00120 double energy_fun(double u, void *&pa); 00121 /// Non-degenerate entropy integral 00122 double entropy_fun(double u, void *&pa); 00123 /// Degenerate density integral 00124 double deg_density_fun(double u, void *&pa); 00125 /// Degenerate energy density integral 00126 double deg_energy_fun(double u, void *&pa); 00127 /// Degenerate entropy integral 00128 double deg_entropy_fun(double u, void *&pa); 00129 /// Solve for the density in calc_density() 00130 int solve_fun(double x, double &yy, void *&pa); 00131 00132 #endif 00133 00134 }; 00135 00136 #ifndef DOXYGENP 00137 } 00138 #endif 00139 00140 #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