Equation of State Sub-Library: Version 0.910
sym4_eos.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  
00024 #ifndef O2SCL_SYM4_EOS_H
00025 #define O2SCL_SYM4_EOS_H
00026 
00027 #include <iostream>
00028 #include <o2scl/ovector_tlate.h>
00029 #include <o2scl/apr_eos.h>
00030 #include <o2scl/rmf_eos.h>
00031 #include <o2scl/skyrme_eos.h>
00032 #include <o2scl/gen_potential_eos.h>
00033 #include <o2scl/test_mgr.h>
00034 
00035 #ifndef DOXYGENP
00036 namespace o2scl {
00037 #endif
00038 
00039   /** \brief A class to compute quartic contributions to the symmetry 
00040       energy [abstract base]
00041 
00042       The standard usage is that a child class implements the virtual
00043       function calc_e_sep() which is then used by calc_e_alpha()
00044       and calc_muhat(). These functions are employed by \ref sym4_eos
00045       to compute the EOS for an arbitrary dependence of the 
00046       symmetry energy on the isospin.
00047 
00048       \hline
00049       <b>References:</b>
00050 
00051       Created for \ref Steiner06.
00052 
00053       \bug Testing was disabled in HDF conversion. Fix this.
00054    */
00055   class sym4_eos_base {
00056 
00057 #ifndef DOXYGEN_INTERNAL
00058 
00059   protected:
00060 
00061     /// An electron for the computation of the \f$ \hat{\mu}\f$
00062     fermion e;
00063 
00064     /// Desc
00065     fermion_zerot fzt2;
00066 
00067 #endif
00068 
00069   public:
00070 
00071     sym4_eos_base();
00072   
00073     virtual ~sym4_eos_base() {}
00074 
00075     /** \brief Compute alpha at the specified density
00076      */
00077     virtual int calc_e_alpha(fermion &ne, fermion &pr, thermo &lth,
00078                              double &alphak, double &alphap, double &alphat,
00079                              double &diff_kin, double &diff_pot,
00080                              double &ed_kin_nuc, double &ed_pot_nuc);
00081     
00082     /** \brief Compute \f$ \hat{\mu} \f$, the out-of-whack parameter
00083      */
00084     virtual double calc_muhat(fermion &ne, fermion &pr);
00085 
00086     /** \brief Compute the potential and kinetic parts separately (to
00087         be overwritten in children)
00088      */
00089     virtual int calc_e_sep(fermion &ne, fermion &pr, double &ed_kin, 
00090                            double &ed_pot, double &mu_n_kin, double &mu_p_kin, 
00091                            double &mu_n_pot, double &mu_p_pot)=0;
00092 
00093   };
00094 
00095   /** \brief A version of \ref rmf_eos to separate potential and kinetic
00096       contributions
00097 
00098       \hline
00099       <b>References:</b>
00100 
00101       Created for \ref Steiner06.
00102    */
00103   class rmf4_eos : public rmf_eos, public sym4_eos_base {
00104 
00105   public:
00106   
00107     rmf4_eos();
00108   
00109     /** \brief Compute the potential and kinetic parts separately
00110      */
00111     virtual int calc_e_sep(fermion &ne, fermion &pr, double &ed_kin, 
00112                            double &ed_pot, double &mu_n_kin, double &mu_p_kin, 
00113                            double &mu_n_pot, double &mu_p_pot);
00114 
00115   };
00116 
00117   /** \brief A version of \ref apr_eos to separate potential and kinetic
00118       contributions
00119 
00120       \hline
00121       <b>References:</b>
00122 
00123       Created for \ref Steiner06.
00124    */
00125   class apr4_eos : public apr_eos, public sym4_eos_base {
00126 
00127   public:
00128 
00129     /** \brief Compute the potential and kinetic parts separately
00130      */
00131     virtual int calc_e_sep(fermion &ne, fermion &pr, double &ed_kin, 
00132                            double &ed_pot, double &mu_n_kin, double &mu_p_kin, 
00133                            double &mu_n_pot, double &mu_p_pot);
00134   };
00135 
00136   /** \brief A version of \ref skyrme_eos to separate potential and kinetic
00137       contributions
00138 
00139       \hline
00140       <b>References:</b>
00141 
00142       Created for \ref Steiner06.
00143    */
00144   class skyrme4_eos : public skyrme_eos, public sym4_eos_base {
00145 
00146   public:
00147 
00148     /** \brief Compute the potential and kinetic parts separately
00149      */
00150     virtual int calc_e_sep(fermion &ne, fermion &pr, double &ed_kin, 
00151                            double &ed_pot, double &mu_n_kin, double &mu_p_kin, 
00152                            double &mu_n_pot, double &mu_p_pot);
00153   };
00154   
00155   /** \brief A version of \ref gen_potential_eos to 
00156       separate potential and kinetic contributions
00157 
00158       \hline
00159       <b>References:</b>
00160 
00161       Created for \ref Steiner06.
00162    */
00163   class mdi4_eos : public gen_potential_eos, public sym4_eos_base {
00164 
00165 #ifndef DOXYGEN_INTERNAL
00166 
00167   protected:
00168     
00169     /// Compute the kinetic part of the energy density
00170     double energy_kin(double var);
00171 
00172     /// Compute the potential part of the energy density
00173     double energy_pot(double var);
00174 
00175 #endif
00176     
00177   public:
00178 
00179     /** \brief Compute the potential and kinetic parts separately
00180      */
00181     virtual int calc_e_sep(fermion &ne, fermion &pr, double &ed_kin, 
00182                            double &ed_pot, double &mu_n_kin, double &mu_p_kin, 
00183                            double &mu_n_pot, double &mu_p_pot);
00184 
00185     /// Test the separation of the potential and kinetic energy parts
00186     virtual int test_separation(fermion &ne, fermion &pr, test_mgr &t);
00187 
00188   };
00189 
00190   /** \brief Construct an EOS with an arbitrary choice for the terms
00191       in the symmetry energy that are quartic in the isospin asymmetry
00192 
00193       \hline
00194       <b>References:</b>
00195 
00196       Created for \ref Steiner06.
00197   */
00198   class sym4_eos : public hadronic_eos_eden {
00199 
00200 #ifndef DOXYGEN_INTERNAL
00201 
00202   protected:
00203 
00204     /// The base equation of state to use
00205     sym4_eos_base *sp;
00206 
00207 #endif
00208 
00209   public:
00210 
00211     /// The strength of the quartic terms
00212     double alpha;
00213 
00214     /// Set the base equation of state
00215     int set_base_eos(sym4_eos_base &seb);
00216   
00217     /** \brief Test the equation of state 
00218     
00219         This compares the chemical potentials from calc_e_sep() to
00220         their finite-difference approximations in order to ensure that
00221         the separation into potential and kinetic parts is done
00222         properly.
00223      */
00224     virtual int test_eos(fermion &ne, fermion &pr, thermo &lth);
00225 
00226     /** \brief Equation of state as a function of density
00227     */
00228     virtual int calc_e(fermion &ne, fermion &pr, thermo &lth);
00229 
00230   };
00231 
00232 #ifndef DOXYGENP
00233 }
00234 #endif
00235 
00236 #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.