Particles and Nuclei Sub-Library: Version 0.910
rel_boson.h
00001 /*
00002   -------------------------------------------------------------------
00003   
00004   Copyright (C) 2006-2012, 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/cern_mroot_root.h>
00035 #include <o2scl/gsl_inte_qag.h>
00036 #include <o2scl/gsl_inte_qagiu.h>
00037 
00038 #include <o2scl/boson.h>
00039 
00040 #ifndef DOXYGENP
00041 namespace o2scl {
00042 #endif
00043 
00044   /** \brief Equation of state for a relativistic boson
00045 
00046       \todo Testing not completely finished.
00047   */
00048   class rel_boson {
00049 
00050   public:
00051 
00052     /// Create a boson with mass \c m and degeneracy \c g
00053     rel_boson();
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     /** \brief Calculate properties as function of chemical potential
00064     */
00065     virtual void calc_mu(boson &b, double temper);
00066     
00067     /** \brief Calculate properties as function of density
00068     */
00069     virtual void calc_density(boson &b, double temper);
00070     
00071     /** \brief Calculate properties with antiparticles as function of
00072         chemical potential
00073     */
00074     virtual void pair_mu(boson &b, double temper);
00075 
00076     /** \brief Calculate properties with antiparticles as function of
00077         density
00078     */
00079     virtual void pair_density(boson &b, double temper) {
00080       O2SCL_ERR("Function rel_boson::pair_density() unimplemented.",
00081                 gsl_eunimpl);
00082     }
00083 
00084     /// Calculate effective chemical potential from density
00085     virtual void nu_from_n(boson &b, double temper);
00086 
00087     /// Set inte object
00088     void set_inte(inte<funct > &l_nit, inte<funct > &l_dit);
00089 
00090     /** \brief Set the solver for use in calculating the chemical
00091         potential from the density */
00092     void set_density_root(root<funct > &rp) {
00093       density_root=&rp;
00094       return;
00095     }
00096 
00097     /// The default solver for calc_density().
00098     cern_mroot_root<funct > def_density_root;
00099 
00100     /// Default nondegenerate integrator
00101     gsl_inte_qagiu<funct > def_nit;
00102 
00103     /// Default degenerate integrator
00104     gsl_inte_qag<funct > def_dit;
00105 
00106     /// Return string denoting type ("rel_boson")
00107     virtual const char *type() { return "rel_boson"; }
00108 
00109   protected:
00110 
00111 #ifndef DOXYGENP
00112 
00113     /// The non-degenerate integrator
00114     inte<funct> *nit;
00115     /// The degenerate integrator
00116     inte<funct> *dit;
00117     /// The solver for calc_density()
00118     root<funct> *density_root;
00119 
00120     /// Desc
00121     boson *bp;
00122 
00123     /// Desc
00124     double T;
00125     
00126     /// Non-degenerate density integral
00127     double density_fun(double u);
00128     /// Non-degenerate energy density integral
00129     double energy_fun(double u);
00130     /// Non-degenerate entropy integral
00131     double entropy_fun(double u);
00132     /// Degenerate density integral
00133     double deg_density_fun(double u);
00134     /// Degenerate energy density integral
00135     double deg_energy_fun(double u);
00136     /// Degenerate entropy integral
00137     double deg_entropy_fun(double u);
00138     /// Solve for the density in calc_density()
00139     double solve_fun(double x);
00140 
00141 #endif
00142 
00143   };
00144 
00145 #ifndef DOXYGENP
00146 }
00147 #endif
00148 
00149 #endif
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Friends

Documentation generated with Doxygen. Provided under the GNU Free Documentation License (see License Information).

Get Object-oriented Scientific Computing
Lib at SourceForge.net. Fast, secure and Free Open Source software
downloads.