![]() |
Particles and Nuclei Sub-Library: Version 0.910
|
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_PART_H 00024 #define O2SCL_PART_H 00025 00026 #include <string> 00027 #include <iostream> 00028 #include <cmath> 00029 #include <o2scl/constants.h> 00030 #include <o2scl/inte.h> 00031 #include <o2scl/funct.h> 00032 #include <o2scl/mroot.h> 00033 00034 /** \file part.h 00035 \brief File for definitions for \ref thermo and \ref part 00036 */ 00037 00038 #ifndef DOXYGENP 00039 namespace o2scl { 00040 #endif 00041 00042 /** \brief A class for the thermodynamical variables (energy 00043 density, pressure, entropy density) 00044 */ 00045 class thermo { 00046 00047 public: 00048 00049 /// pressure 00050 double pr; 00051 /// energy density 00052 double ed; 00053 /// entropy density 00054 double en; 00055 00056 /// Return string denoting type ("thermo") 00057 const char *type() { return "thermo"; } 00058 00059 }; 00060 00061 /** \brief Addition operator 00062 */ 00063 extern thermo operator+(const thermo &left, const thermo &right); 00064 00065 /** \brief Subtraction operator 00066 */ 00067 extern thermo operator-(const thermo &left, const thermo &right); 00068 00069 /** \brief Particle base class 00070 00071 Calculate the properties of particles from their chemical 00072 potential (calc_mu() and pair_mu()) or from the density 00073 (calc_density() and pair_density()). 00074 00075 When non-interacting is false, the thermodynamic integrals need 00076 both a value of "mu" and "nu". "nu" is an effective chemical 00077 potential which appears in the argument of the exponential of 00078 the Fermi-function. 00079 00080 Keep in mind, that the pair functions use anti(), which assumes 00081 that nu -> -nu and mu -> -mu for the anti-particles, which might 00082 not be true for interacting particles. When non-interacting is 00083 true, then "ms" is set equal to "m", and "nu" is set equal to 00084 "mu", everywhere. 00085 00086 The "density" functions use the value of nu (or mu when 00087 non_interacting is true) for an initial guess. Zero is very 00088 likely a bad guess, but these functions will not warn you about 00089 this. 00090 00091 */ 00092 class part { 00093 00094 public: 00095 00096 /// degeneracy 00097 double g; 00098 /// mass 00099 double m; 00100 /// density 00101 double n; 00102 /// energy density 00103 double ed; 00104 /// pressure 00105 double pr; 00106 /// chemical potential 00107 double mu; 00108 /// entropy 00109 double en; 00110 /// effective mass (Dirac unless otherwise specified) 00111 double ms; 00112 /// effective chemical potential 00113 double nu; 00114 /// derivative of energy with respect to effective mass 00115 bool inc_rest_mass; 00116 /// True if the particle is non-interacting (default true) 00117 bool non_interacting; 00118 00119 /// make a particle of mass \c m and degeneracy \c g. 00120 part(double m=0.0, double g=0.0); 00121 00122 virtual ~part(); 00123 00124 /// Set the mass \c m and degeneracy \c g. 00125 virtual int init(double m, double g); 00126 00127 /// Make an anti-particle 00128 virtual int anti(part &ax); 00129 00130 /// Return string denoting type ("part") 00131 virtual const char *type() { return "part"; } 00132 00133 }; 00134 00135 /** \brief Addition operator 00136 */ 00137 extern thermo operator+(const thermo &left, const part &right); 00138 00139 /** \brief Subtraction operator 00140 */ 00141 extern thermo operator-(const thermo &left, const part &right); 00142 00143 #ifndef DOXYGENP 00144 } 00145 #endif 00146 00147 #endif
Documentation generated with Doxygen. Provided under the GNU Free Documentation License (see License Information).