eos_tabul.h

00001 /*
00002  *  Definition of Lorene classes Eos_tabul
00003  *                   Eos_SLy4
00004  *                   Eos_FPS
00005  *               Eos_BPAL12
00006  *               Eos_AkmalPR
00007  *               Eos_BBB2
00008  *               Eos_BalbN1H1
00009  *                               Eos_GlendNH3
00010  */
00011 
00012 /*
00013  *   Copyright (c) 2000-2001 Eric Gourgoulhon
00014  *
00015  *   This file is part of LORENE.
00016  *
00017  *   LORENE is free software; you can redistribute it and/or modify
00018  *   it under the terms of the GNU General Public License as published by
00019  *   the Free Software Foundation; either version 2 of the License, or
00020  *   (at your option) any later version.
00021  *
00022  *   LORENE is distributed in the hope that it will be useful,
00023  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
00024  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00025  *   GNU General Public License for more details.
00026  *
00027  *   You should have received a copy of the GNU General Public License
00028  *   along with LORENE; if not, write to the Free Software
00029  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00030  *
00031  */
00032 
00033 
00034 #ifndef __EOS_TABUL_H_
00035 #define __EOS_TABUL_H_
00036 
00037 /*
00038  * $Id: eos_tabul.h,v 1.10 2010/02/02 14:26:10 j_novak Exp $
00039  * $Log: eos_tabul.h,v $
00040  * Revision 1.10  2010/02/02 14:26:10  j_novak
00041  * *** empty log message ***
00042  *
00043  * Revision 1.9  2010/02/02 13:21:52  j_novak
00044  * New class Eos_Compstar.
00045  *
00046  * Revision 1.8  2004/03/22 13:12:41  j_novak
00047  * Modification of comments to use doxygen instead of doc++
00048  *
00049  * Revision 1.7  2003/12/08 15:48:43  m_bejger
00050  * GlendNH3 EOS (Glendenning 1985, case 3) added
00051  *
00052  * Revision 1.6  2003/11/25 13:44:15  m_bejger
00053  * Declared some vectors for Eos_tabul::read_table()
00054  *
00055  * Revision 1.5  2003/11/21 16:19:09  m_bejger
00056  * Added new tables: lognb, dlpsdlnb
00057  *
00058  * Revision 1.4  2002/10/16 14:36:29  j_novak
00059  * Reorganization of #include instructions of standard C++, in order to
00060  * use experimental version 3 of gcc.
00061  *
00062  * Revision 1.3  2002/09/13 09:17:31  j_novak
00063  * Modif. commentaires
00064  *
00065  * Revision 1.2  2002/04/09 14:32:15  e_gourgoulhon
00066  * 1/ Added extra parameters in EOS computational functions (argument par)
00067  * 2/ New class MEos for multi-domain EOS
00068  *
00069  * Revision 1.1.1.1  2001/11/20 15:19:27  e_gourgoulhon
00070  * LORENE
00071  *
00072  * Revision 2.5  2001/09/11  16:15:46  eric
00073  * Ajout des classes Eos_BBB2 et Eos_BalbN1H1
00074  *
00075  * Revision 2.4  2001/09/11  15:05:48  eric
00076  * Ajout de la classe Eos_AkmalPR
00077  *
00078  * Revision 2.3  2001/03/23  13:40:23  eric
00079  * Modifs commentaires.
00080  *
00081  * Revision 2.2  2001/02/07  09:45:28  eric
00082  * Suppression de la fonction derent_ent_p.
00083  * Ajout des fonctions donnant les derivees de l'EOS:
00084  *      der_nbar_ent_p
00085  *  der_ener_ent_p
00086  *  der_press_ent_p
00087  *
00088  * Revision 2.1  2000/11/23  22:33:48  eric
00089  * Ajout de Eos_BPAL12.
00090  *
00091  * Revision 2.0  2000/11/22  19:29:18  eric
00092  * *** empty log message ***
00093  *
00094  *
00095  * $Header: /cvsroot/Lorene/C++/Include/eos_tabul.h,v 1.10 2010/02/02 14:26:10 j_novak Exp $
00096  *
00097  */
00098 
00099 // Standard C++
00100 #include "headcpp.h"
00101 
00102 // Headers C
00103 #include <stdio.h>
00104 
00105 // Lorene classes
00106 class Tbl ;
00107 class Cmp ;
00108 
00109         
00110             //------------------------------------//
00111             //      class Eos_tabul       //
00112             //------------------------------------//
00113 
00114 
00129 class Eos_tabul : public Eos {
00130 
00131     // Data :
00132     // -----
00133 
00134     protected:
00136         char tablename[160] ;
00137         
00139         double hmin ;
00140         
00142         double hmax ;
00143         
00145         Tbl* logh ;
00146         
00148         Tbl* logp ;
00149         
00151         Tbl* dlpsdlh ;
00152 
00154         Tbl* lognb ;
00155         
00157         Tbl* dlpsdlnb ;
00158 
00159         double* press ; 
00160         double* nb ; 
00161         double* ro ;
00162         
00163                 
00164     // Constructors - Destructor
00165     // -------------------------
00166     protected:
00167 
00174     Eos_tabul(const char* name_i, const char* table, const char* path) ;    
00175 
00182     Eos_tabul(const char* name_i, const char* file_name) ;
00183 
00184     Eos_tabul(const Eos_tabul& ) ;  
00185     
00186     protected:
00187     
00194     Eos_tabul(FILE* ) ;
00195     
00206     Eos_tabul(ifstream& ist, const char* table) ;
00207     
00218     Eos_tabul(ifstream& ist) ;
00219     
00221     friend Eos* Eos::eos_from_file(FILE* ) ;
00222     friend Eos* Eos::eos_from_file(ifstream& ) ;
00223 
00224     public:
00225     virtual ~Eos_tabul() ;          
00226 
00227 
00228     // Miscellaneous
00229     // -------------
00230 
00231     protected:  
00235         void read_table() ;
00236 
00237 
00238     // Outputs
00239     // -------
00240 
00241     public:
00242     virtual void sauve(FILE* ) const ;  
00243 
00244 
00245     // Computational functions
00246     // -----------------------
00247 
00248     public:
00256         virtual double nbar_ent_p(double ent, const Param* par=0x0) const ;
00257     /* mb test version for linear interpolation 
00258 
00259         virtual double nbar_ent_p_mbtest(double ent, const Param* par=0x0) const ;
00260          */       
00261 
00269         virtual double ener_ent_p(double ent, const Param* par=0x0) const ;
00270 
00278         virtual double press_ent_p(double ent, const Param* par=0x0) const ;
00279     /* mb test version for linear interpolation 
00280         virtual double press_ent_p_mbtest(double ent, const Param* par=0x0) const ;
00281         */
00282 
00290         virtual double der_nbar_ent_p(double ent, const Param* par=0x0) const ; 
00291        
00299         virtual double der_ener_ent_p(double ent, const Param* par=0x0) const ; 
00300        
00308         virtual double der_press_ent_p(double ent, const Param* par=0x0) const ; 
00309 
00318         virtual double der_press_nbar_p(double ent, const Param* par=0x0) const ; 
00319 
00320 };
00321 
00322             //------------------------------------//
00323             //      class Eos_SLy4        //
00324             //------------------------------------//
00325 
00326 
00339 class Eos_SLy4 : public Eos_tabul {
00340 
00341 
00342     // Constructors - Destructor
00343     // -------------------------
00344     public:
00345 
00350     Eos_SLy4(const char* path) ;    
00351 
00352     
00353     protected:
00360     Eos_SLy4(FILE* ) ;
00361     
00367     Eos_SLy4(ifstream& ) ;
00368 
00369     private:    
00373     Eos_SLy4(const Eos_SLy4& ) ;    
00374     
00375     
00377     friend Eos* Eos::eos_from_file(FILE* ) ;
00378     friend Eos* Eos::eos_from_file(ifstream& ) ;
00379 
00380     public:
00381     virtual ~Eos_SLy4() ;           
00382 
00383     // Miscellaneous
00384     // -------------
00385 
00386     public :
00388     virtual bool operator==(const Eos& ) const ;
00389 
00391     virtual bool operator!=(const Eos& ) const ;
00392 
00396     virtual int identify() const ;
00397 
00398     // Outputs
00399     // -------
00400 
00401     protected:
00402     virtual ostream& operator>>(ostream &) const ;    
00403 
00404 
00405 };
00406 
00407             //------------------------------------//
00408             //      class Eos_FPS         //
00409             //------------------------------------//
00410 
00411 
00418 class Eos_FPS : public Eos_tabul {
00419 
00420 
00421     // Constructors - Destructor
00422     // -------------------------
00423     public:
00424 
00429     Eos_FPS(const char* path) ; 
00430 
00431     
00432     protected:
00439     Eos_FPS(FILE* ) ;
00440     
00446     Eos_FPS(ifstream& ) ;
00447 
00448     private:    
00452     Eos_FPS(const Eos_FPS& ) ;  
00453     
00454     
00456     friend Eos* Eos::eos_from_file(FILE* ) ;
00457     friend Eos* Eos::eos_from_file(ifstream& ) ;
00458 
00459     public:
00460     virtual ~Eos_FPS() ;            
00461 
00462     // Miscellaneous
00463     // -------------
00464 
00465     public :
00467     virtual bool operator==(const Eos& ) const ;
00468 
00470     virtual bool operator!=(const Eos& ) const ;
00471 
00475     virtual int identify() const ;
00476 
00477     // Outputs
00478     // -------
00479 
00480     protected:
00481     virtual ostream& operator>>(ostream &) const ;    
00482 
00483 
00484 };
00485 
00486             //------------------------------------//
00487             //      class Eos_BPAL12      //
00488             //------------------------------------//
00489 
00490 
00496 class Eos_BPAL12 : public Eos_tabul {
00497 
00498 
00499     // Constructors - Destructor
00500     // -------------------------
00501     public:
00502 
00507     Eos_BPAL12(const char* path) ;  
00508 
00509     
00510     protected:
00517     Eos_BPAL12(FILE* ) ;
00518     
00524     Eos_BPAL12(ifstream& ) ;
00525 
00526     private:    
00530     Eos_BPAL12(const Eos_BPAL12& ) ;    
00531     
00532     
00534     friend Eos* Eos::eos_from_file(FILE* ) ;
00535     friend Eos* Eos::eos_from_file(ifstream& ) ;
00536 
00537     public:
00538     virtual ~Eos_BPAL12() ;         
00539 
00540     // Miscellaneous
00541     // -------------
00542 
00543     public :
00545     virtual bool operator==(const Eos& ) const ;
00546 
00548     virtual bool operator!=(const Eos& ) const ;
00549 
00553     virtual int identify() const ;
00554 
00555     // Outputs
00556     // -------
00557 
00558     protected:
00559     virtual ostream& operator>>(ostream &) const ;    
00560 
00561 
00562 };
00563 
00564 
00565             //------------------------------------//
00566             //      class Eos_AkmalPR     //
00567             //------------------------------------//
00568 
00569 
00583 class Eos_AkmalPR : public Eos_tabul {
00584 
00585 
00586     // Constructors - Destructor
00587     // -------------------------
00588     public:
00589 
00594     Eos_AkmalPR(const char* path) ; 
00595 
00596     
00597     protected:
00604     Eos_AkmalPR(FILE* ) ;
00605     
00611     Eos_AkmalPR(ifstream& ) ;
00612 
00613     private:    
00617     Eos_AkmalPR(const Eos_AkmalPR& ) ;  
00618     
00619     
00621     friend Eos* Eos::eos_from_file(FILE* ) ;
00622     friend Eos* Eos::eos_from_file(ifstream& ) ;
00623 
00624     public:
00625     virtual ~Eos_AkmalPR() ;            
00626 
00627     // Miscellaneous
00628     // -------------
00629 
00630     public :
00632     virtual bool operator==(const Eos& ) const ;
00633 
00635     virtual bool operator!=(const Eos& ) const ;
00636 
00640     virtual int identify() const ;
00641 
00642     // Outputs
00643     // -------
00644 
00645     protected:
00646     virtual ostream& operator>>(ostream &) const ;    
00647 
00648 
00649 };
00650 
00651             //------------------------------------//
00652             //      class Eos_BBB2            //
00653             //------------------------------------//
00654 
00655 
00666 class Eos_BBB2 : public Eos_tabul {
00667 
00668 
00669     // Constructors - Destructor
00670     // -------------------------
00671     public:
00672 
00677     Eos_BBB2(const char* path) ;    
00678 
00679     
00680     protected:
00687     Eos_BBB2(FILE* ) ;
00688     
00694     Eos_BBB2(ifstream& ) ;
00695 
00696     private:    
00700     Eos_BBB2(const Eos_BBB2& ) ;    
00701     
00702     
00704     friend Eos* Eos::eos_from_file(FILE* ) ;
00705     friend Eos* Eos::eos_from_file(ifstream& ) ;
00706 
00707     public:
00708     virtual ~Eos_BBB2() ;           
00709 
00710     // Miscellaneous
00711     // -------------
00712 
00713     public :
00715     virtual bool operator==(const Eos& ) const ;
00716 
00718     virtual bool operator!=(const Eos& ) const ;
00719 
00723     virtual int identify() const ;
00724 
00725     // Outputs
00726     // -------
00727 
00728     protected:
00729     virtual ostream& operator>>(ostream &) const ;    
00730 
00731 
00732 };
00733 
00734 
00735             //------------------------------------//
00736             //      class Eos_BalbN1H1    //
00737             //------------------------------------//
00738 
00739 
00745 class Eos_BalbN1H1 : public Eos_tabul {
00746 
00747 
00748     // Constructors - Destructor
00749     // -------------------------
00750     public:
00751 
00756     Eos_BalbN1H1(const char* path) ;    
00757 
00758     
00759     protected:
00766     Eos_BalbN1H1(FILE* ) ;
00767     
00773     Eos_BalbN1H1(ifstream& ) ;
00774 
00775     private:    
00779     Eos_BalbN1H1(const Eos_BalbN1H1& ) ;    
00780     
00781     
00783     friend Eos* Eos::eos_from_file(FILE* ) ;
00784     friend Eos* Eos::eos_from_file(ifstream& ) ;
00785 
00786     public:
00787     virtual ~Eos_BalbN1H1() ;           
00788 
00789     // Miscellaneous
00790     // -------------
00791 
00792     public :
00794     virtual bool operator==(const Eos& ) const ;
00795 
00797     virtual bool operator!=(const Eos& ) const ;
00798 
00802     virtual int identify() const ;
00803 
00804     // Outputs
00805     // -------
00806 
00807     protected:
00808     virtual ostream& operator>>(ostream &) const ;    
00809 
00810 
00811 };
00812 
00813 
00814 
00815             //------------------------------------//
00816             //      class Eos_GlendNH3    //
00817             //------------------------------------//
00818 
00819 
00826 class Eos_GlendNH3 : public Eos_tabul {
00827 
00828 
00829     // Constructors - Destructor
00830     // -------------------------
00831     public:
00832 
00837     Eos_GlendNH3(const char* path) ;    
00838 
00839     
00840     protected:
00847     Eos_GlendNH3(FILE* ) ;
00848     
00854     Eos_GlendNH3(ifstream& ) ;
00855 
00856     private:    
00860     Eos_GlendNH3(const Eos_GlendNH3& ) ;    
00861     
00862     
00864     friend Eos* Eos::eos_from_file(FILE* ) ;
00865     friend Eos* Eos::eos_from_file(ifstream& ) ;
00866 
00867     public:
00868     virtual ~Eos_GlendNH3() ;           
00869 
00870     // Miscellaneous
00871     // -------------
00872 
00873     public :
00875     virtual bool operator==(const Eos& ) const ;
00876 
00878     virtual bool operator!=(const Eos& ) const ;
00879 
00883     virtual int identify() const ;
00884 
00885     // Outputs
00886     // -------
00887 
00888     protected:
00889     virtual ostream& operator>>(ostream &) const ;    
00890 
00891 
00892 };
00893 
00894             //------------------------------------//
00895             //       class Eos_Compstar           //
00896             //------------------------------------//
00897 
00898 
00910 class Eos_Compstar : public Eos_tabul {
00911 
00912 
00913     // Constructors - Destructor
00914     // -------------------------
00915     public:
00916 
00922     Eos_Compstar(const char* file_name) ;   
00923 
00924     
00925     protected:
00932     Eos_Compstar(FILE* ) ;
00933     
00939     Eos_Compstar(ifstream& ) ;
00940 
00941     private:    
00945     Eos_Compstar(const Eos_Compstar& ) ;    
00946     
00947     
00949     friend Eos* Eos::eos_from_file(FILE* ) ;
00950     friend Eos* Eos::eos_from_file(ifstream& ) ;
00951 
00952     public:
00953     virtual ~Eos_Compstar() ;           
00954 
00955     // Miscellaneous
00956     // -------------
00957 
00958     public :
00960     virtual bool operator==(const Eos& ) const ;
00961 
00963     virtual bool operator!=(const Eos& ) const ;
00964 
00968     virtual int identify() const ;
00969 
00970     // Outputs
00971     // -------
00972 
00973     protected:
00974     virtual ostream& operator>>(ostream &) const ;    
00975 
00976 
00977 };
00978 
00979 
00980 
00981 #endif
00982 

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