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