LORENE
star_bin_kinema.C
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
30char 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
74namespace Lorene {
75void 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
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
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
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}
Active physical coordinates and mapping derivatives.
Definition coord.h:90
Time evolution with partial storage (*** under development ***).
Definition evolution.h:371
const Base_vect_cart & get_bvect_cart() const
Returns the Cartesian basis associated with the coordinates (x,y,z) of the mapping,...
Definition map.h:791
Coord ya
Absolute y coordinate.
Definition map.h:731
double get_rot_phi() const
Returns the angle between the x –axis and X –axis.
Definition map.h:775
Coord xa
Absolute x coordinate.
Definition map.h:730
const Mg3d * get_mg() const
Gives the Mg3d on which the mapping is defined.
Definition map.h:765
virtual const Sym_tensor & cov() const
Read-only access to the covariant representation.
Definition metric.C:280
Tensor field of valence 0 (or component of a tensorial field).
Definition scalar.h:387
virtual void std_spectral_base()
Sets the spectral bases of the Valeur va to the standard ones for a scalar field.
Definition scalar.C:784
virtual void annule(int l_min, int l_max)
Sets the Scalar to zero in several domains.
Definition scalar.C:391
Vector bsn
3-vector shift, divided by N, of the rotating coordinates, .
Definition star.h:518
virtual void del_deriv() const
Deletes all the derived quantities.
Definition star_bin.C:369
void kinematics(double omega, double x_axe)
Computes the quantities bsn and pot_centri.
Scalar pot_centri
Centrifugal potential.
Definition star.h:521
Scalar nn
Lapse function N .
Definition star.h:225
Metric gamma
3-metric
Definition star.h:235
Map & mp
Mapping associated with the star.
Definition star.h:180
Vector beta
Shift vector.
Definition star.h:228
Class intended to describe valence-2 symmetric tensors.
Definition sym_tensor.h:223
virtual void std_spectral_base()
Sets the standard spectal bases of decomposition for each component.
Definition vector.C:316
virtual void change_triad(const Base_vect &)
Sets a new vectorial basis (triad) of decomposition and modifies the components accordingly.
Scalar & set(int)
Read/write access to a component.
Definition vector.C:296
Cmp sqrt(const Cmp &)
Square root.
Definition cmp_math.C:220
Cmp log(const Cmp &)
Neperian logarithm.
Definition cmp_math.C:296
virtual void annule(int l_min, int l_max)
Sets the Tensor to zero in several domains.
Definition tensor.C:671
Tenseur contract(const Tenseur &, int id1, int id2)
Self contraction of two indices of a Tenseur .
Lorene prototypes.
Definition app_hor.h:64