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_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 /** \brief Calculate properties with antiparticles as function of 00079 density 00080 */ 00081 virtual int pair_density(const double temper) { 00082 O2SCL_ERR_RET("Function rel_boson::pair_density() unimplemented.", 00083 gsl_eunimpl); 00084 } 00085 00086 /// Calculate effective chemical potential from density 00087 virtual int nu_from_n(const double temper); 00088 00089 /// Set inte object 00090 int set_inte(inte<const double,funct<const double> > &l_nit, 00091 inte<const double,funct<const double> > &l_dit); 00092 00093 /** \brief Set the solver for use in calculating the chemical 00094 potential from the density */ 00095 int set_density_root(root<const double,funct<const double> > &rp) { 00096 density_root=&rp; 00097 return 0; 00098 } 00099 00100 /// The default solver for calc_density(). 00101 cern_mroot_root<const double,funct<const double> > def_density_root; 00102 00103 /// Default nondegenerate integrator 00104 gsl_inte_qagiu<const double,funct<const double> > def_nit; 00105 00106 /// Default degenerate integrator 00107 gsl_inte_qag<const double,funct<const double> > def_dit; 00108 00109 /// Return string denoting type ("rel_boson") 00110 virtual const char *type() { return "rel_boson"; } 00111 00112 protected: 00113 00114 #ifndef DOXYGENP 00115 00116 /// The non-degenerate integrator 00117 inte<const double,funct<const double> > *nit; 00118 /// The degenerate integrator 00119 inte<const double,funct<const double> > *dit; 00120 /// The solver for calc_density() 00121 root<const double,funct<const double> > *density_root; 00122 00123 /// Non-degenerate density integral 00124 double density_fun(double u, const double &temper); 00125 /// Non-degenerate energy density integral 00126 double energy_fun(double u, const double &temper); 00127 /// Non-degenerate entropy integral 00128 double entropy_fun(double u, const double &temper); 00129 /// Degenerate density integral 00130 double deg_density_fun(double u, const double &temper); 00131 /// Degenerate energy density integral 00132 double deg_energy_fun(double u, const double &temper); 00133 /// Degenerate entropy integral 00134 double deg_entropy_fun(double u, const double &temper); 00135 /// Solve for the density in calc_density() 00136 int solve_fun(double x, double &yy, const double &temper); 00137 00138 #endif 00139 00140 }; 00141 00142 #ifndef DOXYGENP 00143 } 00144 #endif 00145 00146 #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