| 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 |
char eos_bbb2_C[] = "$Header: /cvsroot/Lorene/C++/Source/Eos/eos_bbb2.C,v 1.3 2014/10/13 08:52:52 j_novak Exp $" ; |
| 32 |
|
| 33 |
/* |
| 34 |
* $Id: eos_bbb2.C,v 1.3 2014/10/13 08:52:52 j_novak Exp $ |
| 35 |
* $Log: eos_bbb2.C,v $ |
| 36 |
* Revision 1.3 2014/10/13 08:52:52 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:23:00 eric |
| 47 |
* *** empty log message *** |
| 48 |
* |
| 49 |
* |
| 50 |
* $Header: /cvsroot/Lorene/C++/Source/Eos/eos_bbb2.C,v 1.3 2014/10/13 08:52:52 j_novak Exp $ |
| 51 |
* |
| 52 |
*/ |
| 53 |
|
| 54 |
|
| 55 |
// Headers Lorene |
| 56 |
#include "eos.h" |
| 57 |
|
| 58 |
//----------------------------// |
| 59 |
// Constructors // |
| 60 |
//----------------------------// |
| 61 |
|
| 62 |
// Standard constructor |
| 63 |
// -------------------- |
| 64 |
namespace Lorene { |
| 65 |
Eos_BBB2::Eos_BBB2(const char* path) |
| 66 |
: Eos_tabul( |
| 67 |
"EOS BBB2 [Baldo, Bombaci & Burgio (1997)]", |
| 68 |
"eos_bbb2.d", path) |
| 69 |
{} |
| 70 |
|
| 71 |
|
| 72 |
// Constructor from binary file |
| 73 |
// ---------------------------- |
| 74 |
Eos_BBB2::Eos_BBB2(FILE* fich) : Eos_tabul(fich) {} |
| 75 |
|
| 76 |
|
| 77 |
|
| 78 |
// Constructor from a formatted file |
| 79 |
// --------------------------------- |
| 80 |
Eos_BBB2::Eos_BBB2(ifstream& fich) : Eos_tabul(fich, "eos_bbb2.d") {} |
| 81 |
|
| 82 |
|
| 83 |
|
| 84 |
//--------------// |
| 85 |
// Destructor // |
| 86 |
//--------------// |
| 87 |
|
| 88 |
Eos_BBB2::~Eos_BBB2(){ |
| 89 |
|
| 90 |
// does nothing |
| 91 |
|
| 92 |
} |
| 93 |
|
| 94 |
|
| 95 |
//------------------------// |
| 96 |
// Comparison operators // |
| 97 |
//------------------------// |
| 98 |
|
| 99 |
|
| 100 |
bool Eos_BBB2::operator==(const Eos& eos_i) const { |
| 101 |
|
| 102 |
bool resu = true ; |
| 103 |
|
| 104 |
if ( eos_i.identify() != identify() ) { |
| 105 |
cout << "The second EOS is not of type Eos_BBB2 !" << endl ; |
| 106 |
resu = false ; |
| 107 |
} |
| 108 |
|
| 109 |
return resu ; |
| 110 |
|
| 111 |
} |
| 112 |
|
| 113 |
bool Eos_BBB2::operator!=(const Eos& eos_i) const { |
| 114 |
|
| 115 |
return !(operator==(eos_i)) ; |
| 116 |
|
| 117 |
} |
| 118 |
|
| 119 |
//------------// |
| 120 |
// Outputs // |
| 121 |
//------------// |
| 122 |
|
| 123 |
|
| 124 |
ostream& Eos_BBB2::operator>>(ostream & ost) const { |
| 125 |
|
| 126 |
ost << |
| 127 |
"EOS of class Eos_BBB2 (Baldo, Bombaci & Burgio 1997) : " |
| 128 |
<< endl ; |
| 129 |
|
| 130 |
ost << " model : BHF (Paris +TBF) " << endl ; |
| 131 |
|
| 132 |
return ost ; |
| 133 |
|
| 134 |
} |
| 135 |
|
| 136 |
|
| 137 |
} |