Particles and Nuclei Sub-Library: Version 0.910
nonrel_fermion.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_NONREL_FERMION_H
00024 #define O2SCL_NONREL_FERMION_H
00025 
00026 #include <string>
00027 #include <iostream>
00028 #include <fstream>
00029 #include <cmath>
00030 #include <o2scl/constants.h>
00031 #include <o2scl/mroot.h>
00032 #include <o2scl/inte.h>
00033 #include <o2scl/cern_mroot_root.h>
00034 #include <o2scl/gsl_inte_qagiu.h>
00035 
00036 #include <o2scl/fermion.h>
00037 
00038 #ifndef DOXYGENP
00039 namespace o2scl {
00040 #endif
00041 
00042   /** \brief Nonrelativistic fermion class
00043 
00044       The rest mass energy density is given by n*m not n*ms. Note that
00045       the effective mass here is the Landau mass, not the Dirac mass.
00046       
00047       Pressure is computed with
00048       \f[
00049       P = 2 \varepsilon/3
00050       \f]
00051       and entropy density with
00052       \f[
00053       s = \frac{5 \varepsilon}{3 T} - \frac{n \mu}{T}
00054       \f]
00055       These relations can be verified with an integration by
00056       parts. See, e.g. \ref Callen pg. 403 or \ref Landau pg. 164.
00057       
00058       The functions fermion::pair_density() and pair_mu() have not 
00059       been implemented. 
00060 
00061       \todo Check behaviour of calc_density() at zero density, and
00062       compare with that from eff_fermion, rel_fermion, and \ref
00063       classical.
00064 
00065       \todo Implement pair_density() and pair_mu().
00066 
00067       \todo Make sure to test with non-interacting equal to 
00068       true or false, and document whether or not it works
00069       with both inc_rest_mass equal to true or false
00070 
00071       \future This could be improved by performing a Chebyshev
00072       approximation (for example) to invert the density integral so
00073       that we don't need to use a solver.
00074   */
00075   class nonrel_fermion : public fermion_eval_thermo {
00076 
00077   public:
00078 
00079     /// Create a nonrelativistic fermion with mass 'm' and degeneracy 'g'
00080     nonrel_fermion();
00081     
00082     virtual ~nonrel_fermion();
00083     
00084     /** \brief Zero temperature fermions
00085     */
00086     virtual void calc_mu_zerot(fermion &f);
00087 
00088     /** \brief Zero temperature fermions
00089     */
00090     virtual void calc_density_zerot(fermion &f);
00091     
00092     /** \brief Calculate properties as function of chemical potential
00093      */
00094     virtual void calc_mu(fermion &f, double temper);
00095 
00096     /** \brief Calculate properties as function of density
00097 
00098         If the density is zero, this function just sets part::mu,
00099         part::nu, part::ed, part::pr, and part::en to zero and returns
00100         without calling the error handler (even though at 
00101         zero density and finite temperature, the chemical potentials
00102         formally are equal to \f$ -\infty \f$). 
00103      */
00104     virtual void calc_density(fermion &f, double temper);
00105 
00106     virtual void pair_mu(fermion &f, double temper) {
00107       return;
00108     }
00109 
00110     virtual void pair_density(fermion &f, double temper) {
00111       return;
00112     }
00113     
00114     /// Calculate effective chemical potential from density
00115     virtual void nu_from_n(fermion &f, double temper);
00116 
00117     /** \brief Set the solver for use in calculating the chemical
00118         potential from the density 
00119     */
00120     int set_density_root(root<funct> &rp) {
00121       density_root=&rp;
00122       return 0;
00123     }
00124 
00125     /// The default solver for calc_density().
00126     cern_mroot_root<funct> def_density_root;
00127 
00128     /// Return string denoting type ("nonrel_fermion")
00129     virtual const char *type() { return "nonrel_fermion"; }
00130 
00131   protected:
00132 
00133 #ifndef DOXYGENP
00134 
00135     /// Solver to compute chemical potential from density
00136     root<funct > *density_root;
00137     
00138     /// Function to compute chemical potential from density
00139     double solve_fun(double x);
00140 
00141     fermion *fp;
00142     double T;
00143 
00144   private:
00145 
00146     nonrel_fermion(const nonrel_fermion &);
00147     nonrel_fermion& operator=(const nonrel_fermion&);
00148 
00149 #endif
00150 
00151   };
00152 
00153 #ifndef DOXYGENP
00154 }
00155 #endif
00156 
00157 #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.