Debian Codegraph @

Codes/Nrotstar/read_star.C

raw
1 /*
2 * Main code for reading output files from stationary axisymmetric rotating stars.
3 *
4 */
5
6 /*
7 * Copyright (c) 2010 Frederic Vincent
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 read_star_C[] = "$Header: /cvsroot/Lorene/Codes/Nrotstar/read_star.C,v 1.2 2014/10/13 08:53:58 j_novak Exp $" ;
28
29 /*
30 * $Id: read_star.C,v 1.2 2014/10/13 08:53:58 j_novak Exp $
31 * $Log: read_star.C,v $
32 * Revision 1.2 2014/10/13 08:53:58 j_novak
33 * Lorene classes and functions now belong to the namespace Lorene.
34 *
35 * Revision 1.1 2010/03/22 12:44:55 f_vincent
36 * Added read_star.C for reading output files computed by nrotstar.C
37 *
38 *
39 *
40 * $Header: /cvsroot/Lorene/Codes/Nrotstar/read_star.C,v 1.2 2014/10/13 08:53:58 j_novak Exp $
41 */
42
43 // C headers
44 #include <cstdlib>
45 #include <cmath>
46 #include <cstring>
47
48 // Lorene headers
49 #include "star_rot.h"
50 #include "eos.h"
51 #include "utilitaires.h"
52 #include "graphique.h"
53 #include "nbr_spx.h"
54 #include "unites.h"
55
56 using namespace Lorene ;
57
58 int main(){
59 FILE* res=fopen("resu.d","r");
60
61 Mg3d mg(res);
62
63 cout << "mg= " << mg << endl;
64
65 Map_et mp(mg,res);
66
67 cout << "mp= " << mp << endl;
68
69 Eos* p_eos = Eos::eos_from_file(res);
70
71 cout << "eos=" << *p_eos << endl;
72
73 Star_rot star(mp,*p_eos,res);
74
75 star.equation_of_state();
76 star.update_metric();
77 star.hydro_euler();
78 cout << "star=" << star << endl;
79
80 Metric gg=star.get_gamma();
81
82 cout << "metric=" << gg << endl;
83
84 Scalar g_11=gg.cov()(1,1);
85
86 cout << "g11=" << g_11.val_point(1.,M_PI,0.) << endl;
87
88 Scalar d1g11=g_11.dsdr();
89
90 cout << "der " << d1g11.val_point(1.,M_PI,0.) << endl;
91 }