Equation of State Sub-Library: Version 0.910
tov_eos_fast.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 #ifndef O2SCL_TOV_EOS_FAST_H
00024 #define O2SCL_TOV_EOS_FAST_H
00025 
00026 #include <cmath>
00027 #include <iostream>
00028 #include <fstream>
00029 
00030 #include <o2scl/tov_eos.h>
00031 
00032 #ifndef DOXYGENP
00033 namespace o2scl {
00034 #endif
00035 
00036   /** \brief An EOS 
00037   */
00038   class tov_eos_fast : public tov_eos {
00039     
00040   public:
00041     
00042     tov_eos_fast();
00043 
00044     virtual ~tov_eos_fast();
00045 
00046     /// Given the pressure, produce the energy and number densities
00047     virtual int get_eden(double pres, double &ed, double &nb);
00048 
00049     /// Desc
00050     int set_crust_core(size_t n_crust, ovector_base &crust_e, 
00051                        ovector_base &crust_p, ovector_base &crust_nb, 
00052                        size_t n_core, ovector_base &core_e, 
00053                        ovector_base &core_p, ovector_base &core_nb);
00054 
00055     /** \brief If true, check the EOS for stability and ordering
00056         (default true)
00057     */
00058     bool check_eos;
00059 
00060 #ifndef DOXYGEN_INTERNAL
00061 
00062   protected:
00063 
00064     /// Desc
00065     size_t nlines;
00066 
00067     /// Desc
00068     ovector edv;
00069 
00070     /// Desc
00071     ovector prv;
00072 
00073     /// Desc
00074     ovector nbv;
00075 
00076     /// Desc
00077     bool eos_set;
00078 
00079     /// Linear EOS interpolation
00080     void interp(const ovector_base &x, const ovector_base &y, 
00081                 double xx, double &yy, int n1, int n2);
00082 
00083 #endif
00084 
00085   };
00086 
00087 #ifndef DOXYGENP
00088 }
00089 #endif
00090 
00091 #endif
00092 
00093 
 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.