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