All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
fermion_nonrel.h
Go to the documentation of this file.
1 /*
2  -------------------------------------------------------------------
3 
4  Copyright (C) 2006-2014, Andrew W. Steiner
5 
6  This file is part of O2scl.
7 
8  O2scl is free software; you can redistribute it and/or modify
9  it under the terms of the GNU General Public License as published by
10  the Free Software Foundation; either version 3 of the License, or
11  (at your option) any later version.
12 
13  O2scl is distributed in the hope that it will be useful,
14  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  GNU General Public License for more details.
17 
18  You should have received a copy of the GNU General Public License
19  along with O2scl. If not, see <http://www.gnu.org/licenses/>.
20 
21  -------------------------------------------------------------------
22 */
23 #ifndef O2SCL_NONREL_FERMION_H
24 #define O2SCL_NONREL_FERMION_H
25 
26 /** \file fermion_nonrel.h
27  \brief File defining \ref o2scl::fermion_nonrel
28 */
29 
30 #include <string>
31 #include <iostream>
32 #include <fstream>
33 #include <cmath>
34 #include <o2scl/constants.h>
35 #include <o2scl/mroot.h>
36 #include <o2scl/inte.h>
37 #include <o2scl/root_cern.h>
38 #include <o2scl/inte_qagiu_gsl.h>
39 
40 #include <o2scl/fermion.h>
41 
42 #ifndef DOXYGEN_NO_O2NS
43 namespace o2scl {
44 #endif
45 
46  /** \brief Nonrelativistic fermion class
47 
48  The rest mass energy density is given by n*m not n*ms. Note that
49  the effective mass here is the Landau mass, not the Dirac mass.
50 
51  Pressure is computed with
52  \f[
53  P = 2 \varepsilon/3
54  \f]
55  and entropy density with
56  \f[
57  s = \frac{5 \varepsilon}{3 T} - \frac{n \mu}{T}
58  \f]
59  These relations can be verified with an integration by
60  parts. See, e.g. \ref Callen pg. 403 or \ref Landau pg. 164.
61 
62  The functions pair_density() and pair_mu() have not
63  been implemented.
64 
65  \todo Check behaviour of calc_density() at zero density, and
66  compare with that from \ref o2scl::fermion_eff, \ref
67  o2scl::fermion_rel, and \ref o2scl::classical.
68 
69  \todo Implement pair_density() and pair_mu().
70 
71  \todo Make sure to test with non-interacting equal to
72  true or false, and document whether or not it works
73  with both inc_rest_mass equal to true or false
74 
75  \future This could be improved by performing a Chebyshev
76  approximation (for example) to invert the density integral so
77  that we don't need to use a solver.
78  */
80 
81  public:
82 
83  /// Create a nonrelativistic fermion with mass 'm' and degeneracy 'g'
85 
86  virtual ~fermion_nonrel();
87 
88  /** \brief Zero temperature fermions
89  */
90  virtual void calc_mu_zerot(fermion &f);
91 
92  /** \brief Zero temperature fermions
93  */
94  virtual void calc_density_zerot(fermion &f);
95 
96  /** \brief Calculate properties as function of chemical potential
97  */
98  virtual void calc_mu(fermion &f, double temper);
99 
100  /** \brief Calculate properties as function of density
101 
102  If the density is zero, this function just sets part::mu,
103  part::nu, part::ed, part::pr, and part::en to zero and returns
104  without calling the error handler (even though at
105  zero density and finite temperature, the chemical potentials
106  formally are equal to \f$ -\infty \f$).
107  */
108  virtual int calc_density(fermion &f, double temper);
109 
110  virtual void pair_mu(fermion &f, double temper) {
111  O2SCL_ERR2("Function fermion_nonrel::pair_mu() not ",
112  "implemented.",exc_eunimpl);
113  return;
114  }
115 
116  virtual int pair_density(fermion &f, double temper) {
117  O2SCL_ERR2("Function fermion_nonrel::pair_density() not ",
118  "implemented.",exc_eunimpl);
119  return 0;
120  }
121 
122  /// Calculate effective chemical potential from density
123  virtual void nu_from_n(fermion &f, double temper);
124 
125  /** \brief Set the solver for use in calculating the chemical
126  potential from the density
127  */
129  density_root=&rp;
130  return;
131  }
132 
133  /// The default solver for calc_density().
135 
136  /// Return string denoting type ("fermion_nonrel")
137  virtual const char *type() { return "fermion_nonrel"; }
138 
139  protected:
140 
141 #ifndef DOXYGEN_NO_O2NS
142 
143  /// Solver to compute chemical potential from density
145 
146  /** \brief Function to compute chemical potential from density
147 
148  Variable \c nog is the target baryon density divided by
149  the spin degeneracy, and \c msT is the effective mass
150  times the temperature.
151  */
152  double solve_fun(double x, double nog, double msT);
153 
154  private:
155 
157  fermion_nonrel& operator=(const fermion_nonrel&);
158 
159 #endif
160 
161  };
162 
163 #ifndef DOXYGEN_NO_O2NS
164 }
165 #endif
166 
167 #endif
virtual void calc_mu_zerot(fermion &f)
Zero temperature fermions.
virtual int calc_density(fermion &f, double temper)
Calculate properties as function of density.
root * density_root
Solver to compute chemical potential from density.
virtual void pair_mu(fermion &f, double temper)
Calculate properties with antiparticles as function of chemical potential.
Fermion class.
Definition: fermion.h:52
double solve_fun(double x, double nog, double msT)
Function to compute chemical potential from density.
Fermion with finite-temperature thermodynamics [abstract base].
Definition: fermion.h:162
virtual void calc_density_zerot(fermion &f)
Zero temperature fermions.
root_cern def_density_root
The default solver for calc_density().
virtual int pair_density(fermion &f, double temper)
Calculate properties with antiparticles as function of density.
virtual void nu_from_n(fermion &f, double temper)
Calculate effective chemical potential from density.
#define O2SCL_ERR2(d, d2, n)
virtual void calc_mu(fermion &f, double temper)
Calculate properties as function of chemical potential.
fermion_nonrel()
Create a nonrelativistic fermion with mass 'm' and degeneracy 'g'.
virtual const char * type()
Return string denoting type ("fermion_nonrel")
void set_density_root(root<> &rp)
Set the solver for use in calculating the chemical potential from the density.
Nonrelativistic fermion class.

Documentation generated with Doxygen. Provided under the GNU Free Documentation License (see License Information).
Hosted at Get Object-oriented Scientific Computing
Lib at SourceForge.net. Fast, secure and Free Open Source software
downloads..