sym4_eos.h

00001 /*
00002   -------------------------------------------------------------------
00003   
00004   Copyright (C) 2006, 2007, 2008, 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 
00034 #ifndef DOXYGENP
00035 namespace o2scl {
00036 #endif
00037 
00038   /** \brief A class to compute quartic contributions to the symmetry energy
00039    */
00040   class sym4_eos_base {
00041 
00042 #ifndef DOXYGEN_INTERNAL
00043 
00044   protected:
00045 
00046     /// An electron for the computation of the \f$ \hat{\mu}\f$
00047     fermion e;
00048 
00049 #endif
00050 
00051   public:
00052 
00053     sym4_eos_base();
00054   
00055     virtual ~sym4_eos_base() {}
00056 
00057     /** \brief Compute alpha at the specified density
00058      */
00059     virtual int calc_e_alpha(fermion &ne, fermion &pr, thermo &lth,
00060                              double &alphak, double &alphap, double &alphat,
00061                              double &diff_kin, double &diff_pot,
00062                              double &ed_kin_nuc, double &ed_pot_nuc);
00063     
00064     /** \brief Compute \f$ \hat{\mu} \f$, the out-of-whack parameter
00065      */
00066     virtual double calc_muhat(fermion &ne, fermion &pr);
00067 
00068     /** \brief Compute the potential and kinetic parts separately (to
00069         be overwritten in children)
00070      */
00071     virtual int calc_e_sep(fermion &ne, fermion &pr, double &ed_kin, 
00072                            double &ed_pot, double &mu_n_kin, double &mu_p_kin, 
00073                            double &mu_n_pot, double &mu_p_pot);
00074 
00075   };
00076 
00077   /** \brief A version of \ref rmf_eos to separate potential and kinetic
00078       contributions
00079    */
00080   class rmf4_eos : public rmf_eos, public sym4_eos_base {
00081 
00082   public:
00083   
00084     rmf4_eos();
00085   
00086     /** \brief Compute the potential and kinetic parts separately
00087      */
00088     virtual int calc_e_sep(fermion &ne, fermion &pr, double &ed_kin, 
00089                            double &ed_pot, double &mu_n_kin, double &mu_p_kin, 
00090                            double &mu_n_pot, double &mu_p_pot);
00091 
00092   };
00093 
00094   /** \brief A version of \ref apr_eos to separate potential and kinetic
00095       contributions
00096    */
00097   class apr4_eos : public apr_eos, public sym4_eos_base {
00098 
00099   public:
00100 
00101     /** \brief Compute the potential and kinetic parts separately
00102      */
00103     virtual int calc_e_sep(fermion &ne, fermion &pr, double &ed_kin, 
00104                            double &ed_pot, double &mu_n_kin, double &mu_p_kin, 
00105                            double &mu_n_pot, double &mu_p_pot);
00106   };
00107 
00108   /** \brief A version of \ref skyrme_eos to separate potential and kinetic
00109       contributions
00110    */
00111   class skyrme4_eos : public skyrme_eos, public sym4_eos_base {
00112 
00113   public:
00114 
00115     /** \brief Compute the potential and kinetic parts separately
00116      */
00117     virtual int calc_e_sep(fermion &ne, fermion &pr, double &ed_kin, 
00118                            double &ed_pot, double &mu_n_kin, double &mu_p_kin, 
00119                            double &mu_n_pot, double &mu_p_pot);
00120   };
00121   
00122   /** \brief A version of \ref gen_potential_eos to 
00123       separate potential and kinetic contributions
00124    */
00125   class mdi4_eos : public gen_potential_eos, public sym4_eos_base {
00126 
00127 #ifndef DOXYGEN_INTERNAL
00128 
00129   protected:
00130     
00131     /// Compute the kinetic part of the energy density
00132     double energy_kin(double var);
00133 
00134     /// Compute the potential part of the energy density
00135     double energy_pot(double var);
00136 
00137 #endif
00138     
00139   public:
00140 
00141     /** \brief Compute the potential and kinetic parts separately
00142      */
00143     virtual int calc_e_sep(fermion &ne, fermion &pr, double &ed_kin, 
00144                            double &ed_pot, double &mu_n_kin, double &mu_p_kin, 
00145                            double &mu_n_pot, double &mu_p_pot);
00146 
00147     /// Test the separation of the potential and kinetic energy parts
00148     virtual int test_separation(fermion &ne, fermion &pr, test_mgr &t);
00149 
00150   };
00151 
00152   /** \brief Construct an EOS with an arbitrary choice for the terms
00153       in the symmetry energy that are quartic in the isospin asymmetry
00154   */
00155   class sym4_eos : public hadronic_eos {
00156 
00157 #ifndef DOXYGEN_INTERNAL
00158 
00159   protected:
00160 
00161     /// The base equation of state to use
00162     sym4_eos_base *sp;
00163 
00164 #endif
00165 
00166   public:
00167 
00168     /// The strength of the quartic terms
00169     double alpha;
00170 
00171     /// Set the base equation of state
00172     int set_base_eos(sym4_eos_base &seb);
00173   
00174     /** 
00175         \brief Test the equation of state 
00176     
00177         This compares the chemical potentials from calc_e_sep() to
00178         their finite-difference approximations in order to ensure that
00179         the separation into potential and kinetic parts is done
00180         properly.
00181      */
00182     virtual int test_eos(fermion &ne, fermion &pr, thermo &lth);
00183 
00184     /** 
00185         \brief Equation of state as a function of density
00186     */
00187     virtual int calc_e(fermion &ne, fermion &pr, thermo &lth);
00188 
00189   };
00190 
00191 #ifndef DOXYGENP
00192 }
00193 #endif
00194 
00195 #endif

Documentation generated with Doxygen and provided under the GNU Free Documentation License. See License Information for details.

Project hosting provided by SourceForge.net Logo, O2scl Sourceforge Project Page