eos_multi_poly.h

00001 /*
00002  *  Definition of Lorene class Eos_multi_poly
00003  *
00004  */
00005 
00006 /*
00007  *   Copyright (c) 2009 Keisuke Taniguchi
00008  *   Copyright (c) 2004 Keisuke Taniguchi
00009  *
00010  *   This file is part of LORENE.
00011  *
00012  *   LORENE is free software; you can redistribute it and/or modify
00013  *   it under the terms of the GNU General Public License version 2
00014  *   as published by the Free Software Foundation.
00015  *
00016  *   LORENE is distributed in the hope that it will be useful,
00017  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
00018  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00019  *   GNU General Public License for more details.
00020  *
00021  *   You should have received a copy of the GNU General Public License
00022  *   along with LORENE; if not, write to the Free Software
00023  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00024  *
00025  */
00026 
00027 #ifndef __EOS_MULTI_POLY_H_
00028 #define __EOS_MULTI_POLY_H_
00029 
00030 /*
00031  * $Id: eos_multi_poly.h,v 1.4 2009/06/23 14:33:31 k_taniguchi Exp $
00032  * $Log: eos_multi_poly.h,v $
00033  * Revision 1.4  2009/06/23 14:33:31  k_taniguchi
00034  * Completely revised.
00035  *
00036  * Revision 1.3  2004/05/14 11:35:17  k_taniguchi
00037  * Minor changes in some comments.
00038  *
00039  * Revision 1.2  2004/05/07 13:04:01  j_novak
00040  * Forgotten #include<assert.h>
00041  *
00042  * Revision 1.1  2004/05/07 08:09:56  k_taniguchi
00043  * Initial revision
00044  *
00045  *
00046  *
00047  * $Header: /cvsroot/Lorene/C++/Include/eos_multi_poly.h,v 1.4 2009/06/23 14:33:31 k_taniguchi Exp $
00048  *
00049  */
00050 
00051 // Standard C++
00052 #include "headcpp.h"
00053 
00054 // Headers C
00055 #include <stdio.h>
00056 #include <assert.h>
00057 
00058 // Lorene classes
00059 #include "eos.h"
00060 #include "param.h"
00061 class Tbl ;
00062 class Cmp ;
00063 class Param ;
00064 class Eos ;
00065 
00066            //-------------------------------------------//
00067            //   base class Eos for multiple polytrope   //
00068            //-------------------------------------------//
00069 
00077 class Eos_multi_poly : public Eos {
00078 
00079     // Data : 
00080     // -----
00081 
00082     protected:
00084     int npeos ;
00085 
00087     double* gamma ;
00088 
00092     double kappa0 ;
00093 
00095     double logP1 ;
00096 
00098     double* logRho ;
00099 
00106     double* kappa ;
00107 
00111     double* nbCrit ;
00112 
00116     double* entCrit ;
00117 
00122     double* decInc ;
00123 
00127     double m0 ;
00128 
00135         double* mu0 ;
00136 
00137 
00138     // Constructors - Destructor
00139     // -------------------------
00140     public:
00153     Eos_multi_poly(int npoly, double* gamma_i, double kappa0_i,
00154                double logP1_i, double* logRho_i, double* decInc_i) ;
00155 
00156     Eos_multi_poly(const Eos_multi_poly& ) ;     
00157 
00158     protected:
00165     Eos_multi_poly(FILE* ) ;            
00166 
00172     Eos_multi_poly(ifstream& ) ;
00173 
00175     friend Eos* Eos::eos_from_file(FILE* ) ;
00176     friend Eos* Eos::eos_from_file(ifstream& ) ;
00177 
00178     public:
00179     virtual ~Eos_multi_poly() ;         
00180  
00181 
00182     // Assignment
00183     // ----------
00184     public:
00186     void operator=(const Eos_multi_poly&) ; 
00187 
00189     //  double& set_kappa(int n) ;
00190 
00191 
00192     // Miscellaneous
00193     // -------------
00194     public:
00196     virtual bool operator==(const Eos& ) const ;
00197 
00199     virtual bool operator!=(const Eos& ) const ;
00200 
00204     virtual int identify() const ;
00205 
00207     const int& get_npeos() const { return npeos ; } ;
00208 
00210     const double& get_gamma(int n) const { 
00211         assert(n>=0 && n<npeos) ;
00212         return gamma[n] ;
00213     } ;
00214 
00216     const double& get_kappa0() const { return kappa0 ; } ;
00217 
00219     const double& get_logP1() const { return logP1 ; } ;
00220 
00222     const double& get_logRho(int n) const {
00223         assert(n>=0 && n<npeos-1) ;
00224         return logRho[n] ;
00225     } ;
00226 
00233     const double& get_kappa(int n) const { 
00234         assert(n>=0 && n<npeos) ;
00235         return kappa[n] ;
00236     } ;
00237 
00239     const double& get_nbCrit(int n) const { 
00240         assert(n>=0 && n<npeos-1) ;
00241         return nbCrit[n] ;
00242     } ;
00243 
00245     const double& get_entCrit(int n) const { 
00246         assert(n>=0 && n<npeos-1) ;
00247         return entCrit[n] ;
00248     } ;
00249 
00250     protected:
00252     void set_auxiliary() ;
00253 
00254 
00255     // Outputs
00256     // -------
00257     public:
00258     virtual void sauve(FILE *) const ;      
00259     
00260     protected: 
00261     virtual ostream& operator>>(ostream &) const ;    
00262 
00263 
00264     // Computational functions
00265     // -----------------------
00266     public:
00276         virtual double nbar_ent_p(double ent, const Param* par=0x0) const ;
00277 
00286         virtual double ener_ent_p(double ent, const Param* par=0x0) const ;
00287 
00296         virtual double press_ent_p(double ent, const Param* par=0x0) const ;
00297 
00306         virtual double der_nbar_ent_p(double ent, const Param* par=0x0) const ;
00307 
00316         virtual double der_ener_ent_p(double ent, const Param* par=0x0) const ;
00317 
00326         virtual double der_press_ent_p(double ent, const Param* par=0x0) const ;
00327 
00336         virtual double der_press_nbar_p(double ent, const Param* par=0x0) const ;
00337 };
00338 
00339 #endif

Generated on Tue Feb 7 01:35:16 2012 for LORENE by  doxygen 1.4.6