Debian Codegraph @

C++/Source/Star/star_bin_kinema.C

raw
1 /*
2 * Method Star_bin::kinematics
3 *
4 * (see file star.h for documentation)
5 *
6 */
7
8 /*
9 * Copyright (c) 2004 Francois Limousin
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 char star_bin_kinema_C[] = "$Header: /cvsroot/Lorene/C++/Source/Star/star_bin_kinema.C,v 1.10 2014/10/13 08:53:38 j_novak Exp $" ;
31
32 /*
33 * $Id: star_bin_kinema.C,v 1.10 2014/10/13 08:53:38 j_novak Exp $
34 * $Log: star_bin_kinema.C,v $
35 * Revision 1.10 2014/10/13 08:53:38 j_novak
36 * Lorene classes and functions now belong to the namespace Lorene.
37 *
38 * Revision 1.9 2014/10/06 15:13:17 j_novak
39 * Modified #include directives to use c++ syntax.
40 *
41 * Revision 1.8 2006/04/11 14:24:44 f_limousin
42 * New version of the code : improvement of the computation of some
43 * critical sources, estimation of the dirac gauge, helical symmetry...
44 *
45 * Revision 1.7 2005/09/13 19:38:31 f_limousin
46 * Reintroduction of the resolution of the equations in cartesian coordinates.
47 *
48 * Revision 1.6 2005/02/17 17:33:54 f_limousin
49 * Change the name of some quantities to be consistent with other classes
50 * (for instance nnn is changed to nn, shift to beta, beta to lnq...)
51 *
52 * Revision 1.5 2004/06/22 12:51:59 f_limousin
53 * Simplify the computation of gam_pot to improve the convergence of the code.
54 *
55 * Revision 1.4 2004/05/25 14:21:26 f_limousin
56 * New method to compute pot_centri to improve the convergence of the code.
57 *
58 * Revision 1.3 2004/02/27 09:56:10 f_limousin
59 * Correction of an error on the computation of bsn.
60 *
61 * Revision 1.2 2004/01/20 15:18:45 f_limousin
62 * First version
63 *
64 *
65 * $Header: /cvsroot/Lorene/C++/Source/Star/star_bin_kinema.C,v 1.10 2014/10/13 08:53:38 j_novak Exp $
66 *
67 */
68
69 #include <cmath>
70
71 // Headers Lorene
72 #include "star.h"
73
74 namespace Lorene {
75 void Star_bin::kinematics(double omega, double x_axe) {
76
77 int nz = mp.get_mg()->get_nzone() ;
78 int nzm1 = nz - 1 ;
79
80 // --------------------
81 // Computation of B^i/N
82 // --------------------
83
84 // 1/ Computation of omega m^i
85
86 const Coord& xa = mp.xa ;
87 const Coord& ya = mp.ya ;
88
89 bsn.change_triad(mp.get_bvect_cart()) ;
90
91 if (fabs(mp.get_rot_phi()) < 1e-10){
92 bsn.set(1) = - omega * ya ;
93 bsn.set(2) = omega * (xa - x_axe) ;
94 bsn.set(3) = 0 ;
95 }
96 else {
97 bsn.set(1) = omega * ya ;
98 bsn.set(2) = - omega * (xa - x_axe) ;
99 bsn.set(3) = 0 ;
100 }
101
102 bsn.std_spectral_base() ;
103
104 bsn.annule(nzm1, nzm1) ; // set to zero in the ZEC
105
106 // 2/ Addition of beta and division by lapse
107 // See Eq (47) from Gourgoulhon et al. (2001)
108 // New convention : l = Nn + B ==> B = \beta + \Omega d\phi
109
110 bsn = ( bsn + beta ) / nn ;
111
112 bsn.annule(nzm1, nzm1) ; // set to zero in the ZEC
113
114 //-------------------------
115 // Centrifugal potential
116 //-------------------------
117
118 // Lorentz factor between the co-orbiting observer and the Eulerian one
119 // See Eq (23) from Gourgoulhon et al. (2001)
120
121 Sym_tensor gamma_cov (gamma.cov()) ;
122 gamma_cov.change_triad(mp.get_bvect_cart()) ;
123
124 Scalar gam0 = 1 / sqrt(1 - contract(gamma_cov, 0, 1, bsn * bsn, 0, 1)) ;
125 pot_centri = - log( gam0 ) ;
126
127 pot_centri.annule(nzm1, nzm1) ; // set to zero in the external domain
128 pot_centri.std_spectral_base() ; // set the bases for spectral expansions
129
130 // The derived quantities are obsolete
131 // -----------------------------------
132
133 del_deriv() ;
134
135 }
136 }