| 1 |
/* |
| 2 |
* Main code for testing the class Eos_Fermi |
| 3 |
* |
| 4 |
*/ |
| 5 |
|
| 6 |
/* |
| 7 |
* Copyright (c) 2012 Eric Gourgoulhon |
| 8 |
* |
| 9 |
* This file is part of LORENE. |
| 10 |
* |
| 11 |
* LORENE is free software; you can redistribute it and/or modify |
| 12 |
* it under the terms of the GNU General Public License as published by |
| 13 |
* the Free Software Foundation; either version 2 of the License, or |
| 14 |
* (at your option) any later version. |
| 15 |
* |
| 16 |
* LORENE is distributed in the hope that it will be useful, |
| 17 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 18 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 19 |
* GNU General Public License for more details. |
| 20 |
* |
| 21 |
* You should have received a copy of the GNU General Public License |
| 22 |
* along with LORENE; if not, write to the Free Software |
| 23 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 24 |
* |
| 25 |
*/ |
| 26 |
|
| 27 |
char test_eos_fermi_C[] = "$Header: /cvsroot/Lorene/Codes/Test/Eos/test_eos_fermi.C,v 1.2 2014/10/13 08:54:00 j_novak Exp $" ; |
| 28 |
|
| 29 |
/* |
| 30 |
* $Id: test_eos_fermi.C,v 1.2 2014/10/13 08:54:00 j_novak Exp $ |
| 31 |
* $Log: test_eos_fermi.C,v $ |
| 32 |
* Revision 1.2 2014/10/13 08:54:00 j_novak |
| 33 |
* Lorene classes and functions now belong to the namespace Lorene. |
| 34 |
* |
| 35 |
* Revision 1.1 2012/10/26 14:10:04 e_gourgoulhon |
| 36 |
* Simple code to test the class Eos |
| 37 |
* |
| 38 |
* |
| 39 |
* $Header: /cvsroot/Lorene/Codes/Test/Eos/test_eos_fermi.C,v 1.2 2014/10/13 08:54:00 j_novak Exp $ |
| 40 |
* |
| 41 |
*/ |
| 42 |
|
| 43 |
// C headers |
| 44 |
#include <cstdlib> |
| 45 |
#include <cmath> |
| 46 |
#include <cstring> |
| 47 |
|
| 48 |
// Lorene headers |
| 49 |
#include "eos.h" |
| 50 |
#include "utilitaires.h" |
| 51 |
|
| 52 |
|
| 53 |
//****************************************************************************** |
| 54 |
|
| 55 |
using namespace Lorene ; |
| 56 |
|
| 57 |
int main(){ |
| 58 |
|
| 59 |
Eos_Fermi eos(5.11e5) ; |
| 60 |
|
| 61 |
cout << eos << endl ; |
| 62 |
|
| 63 |
double hmin = 0. ; |
| 64 |
double hmax = 4 ; |
| 65 |
int np = 100 ; |
| 66 |
double dh = (hmax - hmin) / double(np-1) ; |
| 67 |
for (int i = 0; i<np; i++) { |
| 68 |
double hh = hmin + i * dh ; |
| 69 |
double n = eos.nbar_ent_p(hh) ; |
| 70 |
double ener = eos.ener_ent_p(hh) ; |
| 71 |
double press = eos.press_ent_p(hh) ; |
| 72 |
cout << hh << " " << n << " " << ener << " " << press << endl ; |
| 73 |
} |
| 74 |
} |