| 1 |
/* |
| 2 |
* Method of class Eos_fit_FPS |
| 3 |
* |
| 4 |
* (see file eos_fitting.h for documentation). |
| 5 |
* |
| 6 |
*/ |
| 7 |
|
| 8 |
/* |
| 9 |
* Copyright (c) 2004 Keisuke Taniguchi |
| 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 version 2 |
| 15 |
* as published by the Free Software Foundation. |
| 16 |
* |
| 17 |
* LORENE is distributed in the hope that it will be useful, |
| 18 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 19 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 20 |
* GNU General Public License for more details. |
| 21 |
* |
| 22 |
* You should have received a copy of the GNU General Public License |
| 23 |
* along with LORENE; if not, write to the Free Software |
| 24 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 25 |
* |
| 26 |
*/ |
| 27 |
|
| 28 |
char eos_fit_fps_C[] = "$Header: /cvsroot/Lorene/C++/Source/Eos/eos_fit_fps.C,v 1.3 2014/10/13 08:52:52 j_novak Exp $" ; |
| 29 |
|
| 30 |
/* |
| 31 |
* $Id: eos_fit_fps.C,v 1.3 2014/10/13 08:52:52 j_novak Exp $ |
| 32 |
* $Log: eos_fit_fps.C,v $ |
| 33 |
* Revision 1.3 2014/10/13 08:52:52 j_novak |
| 34 |
* Lorene classes and functions now belong to the namespace Lorene. |
| 35 |
* |
| 36 |
* Revision 1.2 2004/10/24 19:14:53 k_taniguchi |
| 37 |
* Correction of the file name which is called in the constructor from file. |
| 38 |
* |
| 39 |
* Revision 1.1 2004/09/26 18:55:10 k_taniguchi |
| 40 |
* Initial revision |
| 41 |
* |
| 42 |
* |
| 43 |
* $Header: /cvsroot/Lorene/C++/Source/Eos/eos_fit_fps.C,v 1.3 2014/10/13 08:52:52 j_novak Exp $ |
| 44 |
* |
| 45 |
*/ |
| 46 |
|
| 47 |
// Lorene headers |
| 48 |
#include "headcpp.h" |
| 49 |
#include "eos.h" |
| 50 |
#include "eos_fitting.h" |
| 51 |
|
| 52 |
//--------------------------------// |
| 53 |
// Constructors // |
| 54 |
//--------------------------------// |
| 55 |
|
| 56 |
// Standard constructor |
| 57 |
// -------------------- |
| 58 |
namespace Lorene { |
| 59 |
Eos_fit_FPS::Eos_fit_FPS(const char* path) |
| 60 |
: Eos_fitting("EOS fitted to FPS", "eos_fit_fps.d", path) |
| 61 |
{} |
| 62 |
|
| 63 |
// Constructor from binary file |
| 64 |
// ---------------------------- |
| 65 |
Eos_fit_FPS::Eos_fit_FPS(FILE* fich) : Eos_fitting(fich) {} |
| 66 |
|
| 67 |
// Constructor from a formatted file |
| 68 |
// --------------------------------- |
| 69 |
Eos_fit_FPS::Eos_fit_FPS(ifstream& fich) |
| 70 |
: Eos_fitting(fich, "eos_fit_fps.d") |
| 71 |
{} |
| 72 |
|
| 73 |
//------------------------------// |
| 74 |
// Destructor // |
| 75 |
//------------------------------// |
| 76 |
|
| 77 |
Eos_fit_FPS::~Eos_fit_FPS() { |
| 78 |
|
| 79 |
// does nothing |
| 80 |
|
| 81 |
} |
| 82 |
|
| 83 |
//----------------------------------------// |
| 84 |
// Comparison operators // |
| 85 |
//----------------------------------------// |
| 86 |
|
| 87 |
bool Eos_fit_FPS::operator==(const Eos& eos_i) const { |
| 88 |
|
| 89 |
bool resu = true ; |
| 90 |
|
| 91 |
if ( eos_i.identify() != identify() ) { |
| 92 |
cout << "The second EOS is not of type Eos_fit_FPS !" << endl ; |
| 93 |
resu = false ; |
| 94 |
} |
| 95 |
|
| 96 |
return resu ; |
| 97 |
|
| 98 |
} |
| 99 |
|
| 100 |
bool Eos_fit_FPS::operator!=(const Eos& eos_i) const { |
| 101 |
|
| 102 |
return !(operator==(eos_i)) ; |
| 103 |
|
| 104 |
} |
| 105 |
|
| 106 |
//---------------------------// |
| 107 |
// Outputs // |
| 108 |
//---------------------------// |
| 109 |
|
| 110 |
ostream& Eos_fit_FPS::operator>>(ostream& ost) const { |
| 111 |
|
| 112 |
ost << |
| 113 |
"EOS of class Eos_fit_FPS : " |
| 114 |
<< endl ; |
| 115 |
|
| 116 |
ost << " composition : n, p, e, mu" << endl ; |
| 117 |
ost << " model : effective nucleon energy functional, FPS" << endl ; |
| 118 |
|
| 119 |
return ost ; |
| 120 |
|
| 121 |
} |
| 122 |
} |