LORENE
eos_bbb2.C
1 /*
2  * Methods of class Eos_BBB2
3  *
4  * (see file eos_tabul.h for documentation).
5  *
6  */
7 
8 /*
9  * Copyright (c) 2001 Eric Gourgoulhon
10  * Copyright (c) 2001 J. Leszek Zdunik
11  *
12  * This file is part of LORENE.
13  *
14  * LORENE is free software; you can redistribute it and/or modify
15  * it under the terms of the GNU General Public License as published by
16  * the Free Software Foundation; either version 2 of the License, or
17  * (at your option) any later version.
18  *
19  * LORENE is distributed in the hope that it will be useful,
20  * but WITHOUT ANY WARRANTY; without even the implied warranty of
21  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22  * GNU General Public License for more details.
23  *
24  * You should have received a copy of the GNU General Public License
25  * along with LORENE; if not, write to the Free Software
26  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
27  *
28  */
29 
30 
31 
32 
33 /*
34  * $Id: eos_bbb2.C,v 1.4 2016/12/05 16:17:51 j_novak Exp $
35  * $Log: eos_bbb2.C,v $
36  * Revision 1.4 2016/12/05 16:17:51 j_novak
37  * Suppression of some global variables (file names, loch, ...) to prevent redefinitions
38  *
39  * Revision 1.3 2014/10/13 08:52:52 j_novak
40  * Lorene classes and functions now belong to the namespace Lorene.
41  *
42  * Revision 1.2 2002/10/16 14:36:34 j_novak
43  * Reorganization of #include instructions of standard C++, in order to
44  * use experimental version 3 of gcc.
45  *
46  * Revision 1.1.1.1 2001/11/20 15:19:27 e_gourgoulhon
47  * LORENE
48  *
49  * Revision 2.0 2001/09/11 16:23:00 eric
50  * *** empty log message ***
51  *
52  *
53  * $Header: /cvsroot/Lorene/C++/Source/Eos/eos_bbb2.C,v 1.4 2016/12/05 16:17:51 j_novak Exp $
54  *
55  */
56 
57 
58 // Headers Lorene
59 #include "eos.h"
60 
61  //----------------------------//
62  // Constructors //
63  //----------------------------//
64 
65 // Standard constructor
66 // --------------------
67 namespace Lorene {
68 Eos_BBB2::Eos_BBB2(const char* path)
69  : Eos_tabul(
70  "EOS BBB2 [Baldo, Bombaci & Burgio (1997)]",
71  "eos_bbb2.d", path)
72 {}
73 
74 
75 // Constructor from binary file
76 // ----------------------------
77 Eos_BBB2::Eos_BBB2(FILE* fich) : Eos_tabul(fich) {}
78 
79 
80 
81 // Constructor from a formatted file
82 // ---------------------------------
83 Eos_BBB2::Eos_BBB2(ifstream& fich) : Eos_tabul(fich, "eos_bbb2.d") {}
84 
85 
86 
87  //--------------//
88  // Destructor //
89  //--------------//
90 
92 
93  // does nothing
94 
95 }
96 
97 
98  //------------------------//
99  // Comparison operators //
100  //------------------------//
101 
102 
103 bool Eos_BBB2::operator==(const Eos& eos_i) const {
104 
105  bool resu = true ;
106 
107  if ( eos_i.identify() != identify() ) {
108  cout << "The second EOS is not of type Eos_BBB2 !" << endl ;
109  resu = false ;
110  }
111 
112  return resu ;
113 
114 }
115 
116 bool Eos_BBB2::operator!=(const Eos& eos_i) const {
117 
118  return !(operator==(eos_i)) ;
119 
120 }
121 
122  //------------//
123  // Outputs //
124  //------------//
125 
126 
127 ostream& Eos_BBB2::operator>>(ostream & ost) const {
128 
129  ost <<
130  "EOS of class Eos_BBB2 (Baldo, Bombaci & Burgio 1997) : "
131  << endl ;
132 
133  ost << " model : BHF (Paris +TBF) " << endl ;
134 
135  return ost ;
136 
137 }
138 
139 
140 }
virtual ostream & operator>>(ostream &) const
Operator >>
Definition: eos_bbb2.C:127
virtual bool operator!=(const Eos &) const
Comparison operator (difference)
Definition: eos_bbb2.C:116
Lorene prototypes.
Definition: app_hor.h:67
Equation of state base class.
Definition: eos.h:209
virtual int identify() const =0
Returns a number to identify the sub-classe of Eos the object belongs to.
virtual ~Eos_BBB2()
Destructor.
Definition: eos_bbb2.C:91
virtual bool operator==(const Eos &) const
Comparison operator (egality)
Definition: eos_bbb2.C:103
Base class for tabulated equations of state.
Definition: eos_tabul.h:185
virtual int identify() const
Returns a number to identify the sub-classe of Eos the object belongs to.
Eos_BBB2(const char *path)
Standard constructor.
Definition: eos_bbb2.C:68