boson_rel.h
Go to the documentation of this file.
1 /*
2  -------------------------------------------------------------------
3 
4  Copyright (C) 2006-2017, 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_BOSON_REL_H
24 #define O2SCL_BOSON_REL_H
25 
26 /** \file boson_rel.h
27  \brief File defining \ref o2scl::boson_rel
28 */
29 
30 #include <string>
31 #include <iostream>
32 #include <fstream>
33 #include <cmath>
34 #include <o2scl/constants.h>
35 #include <o2scl/root.h>
36 #include <o2scl/mroot.h>
37 #include <o2scl/inte.h>
38 #include <o2scl/root_cern.h>
39 #include <o2scl/inte_qag_gsl.h>
40 #include <o2scl/inte_qagiu_gsl.h>
41 
42 #include <o2scl/boson.h>
43 
44 #ifndef DOXYGEN_NO_O2NS
45 namespace o2scl {
46 #endif
47 
48  /** \brief Equation of state for a relativistic boson
49 
50  \todo Testing not completely finished.
51  */
52  class boson_rel {
53 
54  public:
55 
56  /// Create a boson with mass \c m and degeneracy \c g
57  boson_rel();
58 
59  virtual ~boson_rel();
60 
61  /** \brief Calculate properties as function of chemical potential
62  */
63  virtual void calc_mu(boson &b, double temper);
64 
65  /** \brief Calculate properties as function of density
66  */
67  virtual void calc_density(boson &b, double temper);
68 
69  /** \brief Calculate properties with antiparticles as function of
70  chemical potential
71  */
72  virtual void pair_mu(boson &b, double temper);
73 
74  /** \brief Calculate properties with antiparticles as function of
75  density
76  */
77  virtual void pair_density(boson &b, double temper) {
78  O2SCL_ERR("Function boson_rel::pair_density() unimplemented.",
79  exc_eunimpl);
80  }
81 
82  /// Calculate effective chemical potential from density
83  virtual void nu_from_n(boson &b, double temper);
84 
85  /// Set degenerate and nondegenerate integrators
86  void set_inte(inte<> &l_nit, inte<> &l_dit);
87 
88  /** \brief Set the solver for use in calculating the chemical
89  potential from the density */
91  density_root=&rp;
92  return;
93  }
94 
95  /// The default solver for calc_density().
97 
98  /// Default nondegenerate integrator
100 
101  /// Default degenerate integrator
103 
104  /// Return string denoting type ("boson_rel")
105  virtual const char *type() { return "boson_rel"; }
106 
107  protected:
108 
109 #ifndef DOXYGEN_NO_O2NS
110 
111  /// The non-degenerate integrator
113  /// The degenerate integrator
115  /// The solver for calc_density()
117 
118  /// Non-degenerate density integral
119  double density_fun(double u, boson &b, double T);
120  /// Non-degenerate energy density integral
121  double energy_fun(double u, boson &b, double T);
122  /// Non-degenerate entropy integral
123  double entropy_fun(double u, boson &b, double T);
124  /// Degenerate density integral
125  double deg_density_fun(double u, boson &b, double T);
126  /// Degenerate energy density integral
127  double deg_energy_fun(double u, boson &b, double T);
128  /// Degenerate entropy integral
129  double deg_entropy_fun(double u, boson &b, double T);
130  /// Solve for the density in calc_density()
131  double solve_fun(double x, boson &b, double T);
132 
133 #endif
134 
135  };
136 
137 #ifndef DOXYGEN_NO_O2NS
138 }
139 #endif
140 
141 #endif
boson_rel()
Create a boson with mass m and degeneracy g.
virtual void calc_density(boson &b, double temper)
Calculate properties as function of density.
virtual const char * type()
Return string denoting type ("boson_rel")
Definition: boson_rel.h:105
double energy_fun(double u, boson &b, double T)
Non-degenerate energy density integral.
root * density_root
The solver for calc_density()
Definition: boson_rel.h:116
root_cern def_density_root
The default solver for calc_density().
Definition: boson_rel.h:96
inte * nit
The non-degenerate integrator.
Definition: boson_rel.h:112
inte * dit
The degenerate integrator.
Definition: boson_rel.h:114
virtual void pair_mu(boson &b, double temper)
Calculate properties with antiparticles as function of chemical potential.
exc_eunimpl
virtual void nu_from_n(boson &b, double temper)
Calculate effective chemical potential from density.
double entropy_fun(double u, boson &b, double T)
Non-degenerate entropy integral.
#define O2SCL_ERR(d, n)
virtual void pair_density(boson &b, double temper)
Calculate properties with antiparticles as function of density.
Definition: boson_rel.h:77
void set_density_root(root<> &rp)
Set the solver for use in calculating the chemical potential from the density.
Definition: boson_rel.h:90
double solve_fun(double x, boson &b, double T)
Solve for the density in calc_density()
double deg_density_fun(double u, boson &b, double T)
Degenerate density integral.
double deg_entropy_fun(double u, boson &b, double T)
Degenerate entropy integral.
void set_inte(inte<> &l_nit, inte<> &l_dit)
Set degenerate and nondegenerate integrators.
Boson class.
Definition: boson.h:46
double density_fun(double u, boson &b, double T)
Non-degenerate density integral.
double deg_energy_fun(double u, boson &b, double T)
Degenerate energy density integral.
inte_qagiu_gsl def_nit
Default nondegenerate integrator.
Definition: boson_rel.h:99
inte_qag_gsl def_dit
Default degenerate integrator.
Definition: boson_rel.h:102
Equation of state for a relativistic boson.
Definition: boson_rel.h:52
virtual void calc_mu(boson &b, double temper)
Calculate properties as function of chemical potential.

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