Debian Codegraph @

Codes/Rot_star/Geodesics/interpol2.C

raw
1
2 /*
3 * Copyright (c) 2003 CHABBERT Jean-Philippe
4 *
5 * This file is part of LORENE.
6 *
7 * LORENE is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2
9 * as published by the Free Software Foundation.
10 *
11 * LORENE is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with LORENE; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 *
20 */
21
22 char interpol2_C[] = "$Header: /cvsroot/Lorene/Codes/Rot_star/Geodesics/interpol2.C,v 1.2 2014/10/06 15:12:51 j_novak Exp $" ;
23
24 /*
25 * $Id: interpol2.C,v 1.2 2014/10/06 15:12:51 j_novak Exp $
26 * $Log: interpol2.C,v $
27 * Revision 1.2 2014/10/06 15:12:51 j_novak
28 * Modified #include directives to use c++ syntax.
29 *
30 * Revision 1.1 2003/02/07 17:31:52 jp_chabbert
31 * First version with rotstar input data
32 *
33 *
34 *
35 *
36 * $Header: /cvsroot/Lorene/Codes/Rot_star/Geodesics/interpol2.C,v 1.2 2014/10/06 15:12:51 j_novak Exp $
37 *
38 */
39
40 // C++ headers
41
42 // C headers
43 #include <cmath>
44
45 // Lorene headers
46 #include "etoile.h"
47 #include "main.h"
48
49 point interpol2( double r0, double theta, const Etoile_rot& star )
50 {
51 double r=r0/10; // passage en unite Lorene
52 point p;
53 double nu=star.get_logn()().val_point(r,theta,0.);
54 double dzeta=star.get_dzeta()().val_point(r,theta,0.);
55 double b=star.get_bbb()().val_point(r,theta,0.);
56 p.omega=star.get_nphi()().val_point(r,theta,0.)/10.;
57 p.alpha=dzeta-nu;
58 double beta=log(b);
59 p.gamma=nu+beta;
60 p.rho=nu-beta;
61
62 double dnudr=star.get_logn()().dsdr().val_point(r,theta,0.);
63 double dnudt=r*star.get_logn()().srdsdt().val_point(r,theta,0.);
64 double dbdr=star.get_bbb()().dsdr().val_point(r,theta,0.);
65 double dbdt=r*star.get_bbb()().srdsdt().val_point(r,theta,0.);
66 double ddzetadr=star.get_dzeta()().dsdr().val_point(r,theta,0.);
67 double ddzetadt=r*star.get_dzeta()().srdsdt().val_point(r,theta,0.);
68 double dbetadr=dbdr/b;
69 double dbetadt=dbdt/b;
70
71 p.drhodr=(dnudr-dbetadr)/10.;
72 p.drhodtheta=(dnudt-dbetadt);
73 p.dgammadr=(dnudr+dbetadr)/10.;
74 p.dgammadtheta=(dnudt+dbetadt);
75 p.dalphadr=(ddzetadr-dnudr)/10.;
76 p.dalphadtheta=(ddzetadt-dnudt);
77 p.domegadr=star.get_nphi()().dsdr().val_point(r,theta,0.)/100.;
78 p.domegadtheta=r*star.get_nphi()().srdsdt().val_point(r,theta,0.)/10.;
79
80 // cout << p.rho << endl;
81 //cout << p.gamma << endl;
82 //cout << p.alpha << endl;
83 //cout << p.omega << endl;
84
85
86 return p;
87 }