LORENE
eos_balbn1h1.C
1 /*
2  * Methods of class Eos_BalbN1H1
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 char eos_balbn1h1_C[] = "$Header: /cvsroot/Lorene/C++/Source/Eos/eos_balbn1h1.C,v 1.3 2014/10/13 08:52:51 j_novak Exp $" ;
32 
33 /*
34  * $Id: eos_balbn1h1.C,v 1.3 2014/10/13 08:52:51 j_novak Exp $
35  * $Log: eos_balbn1h1.C,v $
36  * Revision 1.3 2014/10/13 08:52:51 j_novak
37  * Lorene classes and functions now belong to the namespace Lorene.
38  *
39  * Revision 1.2 2002/10/16 14:36:34 j_novak
40  * Reorganization of #include instructions of standard C++, in order to
41  * use experimental version 3 of gcc.
42  *
43  * Revision 1.1.1.1 2001/11/20 15:19:27 e_gourgoulhon
44  * LORENE
45  *
46  * Revision 2.0 2001/09/11 16:22:50 eric
47  * *** empty log message ***
48  *
49  *
50  * $Header: /cvsroot/Lorene/C++/Source/Eos/eos_balbn1h1.C,v 1.3 2014/10/13 08:52:51 j_novak Exp $
51  *
52  */
53 
54 
55 // Headers Lorene
56 #include "headcpp.h"
57 #include "eos.h"
58 
59  //----------------------------//
60  // Constructors //
61  //----------------------------//
62 
63 // Standard constructor
64 // --------------------
65 namespace Lorene {
66 Eos_BalbN1H1::Eos_BalbN1H1(const char* path)
67  : Eos_tabul(
68  "EOS BalbN1H1 [Balberg (2000)]",
69  "eos_balbn1h1.d", path)
70 {}
71 
72 
73 // Constructor from binary file
74 // ----------------------------
75 Eos_BalbN1H1::Eos_BalbN1H1(FILE* fich) : Eos_tabul(fich) {}
76 
77 
78 
79 // Constructor from a formatted file
80 // ---------------------------------
81 Eos_BalbN1H1::Eos_BalbN1H1(ifstream& fich) : Eos_tabul(fich, "eos_balbn1h1.d") {}
82 
83 
84 
85  //--------------//
86  // Destructor //
87  //--------------//
88 
90 
91  // does nothing
92 
93 }
94 
95 
96  //------------------------//
97  // Comparison operators //
98  //------------------------//
99 
100 
101 bool Eos_BalbN1H1::operator==(const Eos& eos_i) const {
102 
103  bool resu = true ;
104 
105  if ( eos_i.identify() != identify() ) {
106  cout << "The second EOS is not of type Eos_BalbN1H1 !" << endl ;
107  resu = false ;
108  }
109 
110  return resu ;
111 
112 }
113 
114 bool Eos_BalbN1H1::operator!=(const Eos& eos_i) const {
115 
116  return !(operator==(eos_i)) ;
117 
118 }
119 
120  //------------//
121  // Outputs //
122  //------------//
123 
124 
125 ostream& Eos_BalbN1H1::operator>>(ostream & ost) const {
126 
127  ost <<
128  "EOS of class Eos_BalbN1H1 (Balberg 2000) : "
129  << endl ;
130 
131  return ost ;
132 
133 }
134 
135 
136 }
Lorene::Eos_BalbN1H1::identify
virtual int identify() const
Returns a number to identify the sub-classe of Eos the object belongs to.
Definition: eos_from_file.C:151
Lorene::Eos_BalbN1H1::~Eos_BalbN1H1
virtual ~Eos_BalbN1H1()
Destructor.
Definition: eos_balbn1h1.C:89
Lorene
Lorene prototypes.
Definition: app_hor.h:64
Lorene::Eos_BalbN1H1::operator!=
virtual bool operator!=(const Eos &) const
Comparison operator (difference)
Definition: eos_balbn1h1.C:114
Lorene::Eos
Equation of state base class.
Definition: eos.h:190
Lorene::Eos_BalbN1H1::operator==
virtual bool operator==(const Eos &) const
Comparison operator (egality)
Definition: eos_balbn1h1.C:101
Lorene::Eos_BalbN1H1::operator>>
virtual ostream & operator>>(ostream &) const
Operator >>
Definition: eos_balbn1h1.C:125
Lorene::Eos_BalbN1H1::Eos_BalbN1H1
Eos_BalbN1H1(const char *path)
Standard constructor.
Definition: eos_balbn1h1.C:66
Lorene::Eos_tabul
Base class for tabulated equations of state.
Definition: eos_tabul.h:149
Lorene::Eos::identify
virtual int identify() const =0
Returns a number to identify the sub-classe of Eos the object belongs to.