| 1 |
/* |
| 2 |
* Method Star_bin_xcts::kinematics |
| 3 |
* (see file star.h for documentation) |
| 4 |
*/ |
| 5 |
|
| 6 |
/* |
| 7 |
* Copyright (c) 2010 Michal Bejger |
| 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 version 2 |
| 13 |
* as published by the Free Software Foundation. |
| 14 |
* |
| 15 |
* LORENE is distributed in the hope that it will be useful, |
| 16 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 17 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 18 |
* GNU General Public License for more details. |
| 19 |
* |
| 20 |
* You should have received a copy of the GNU General Public License |
| 21 |
* along with LORENE; if not, write to the Free Software |
| 22 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 23 |
* |
| 24 |
*/ |
| 25 |
|
| 26 |
char star_bin_kinema_xcts_C[] = "$Header: /cvsroot/Lorene/C++/Source/Star/star_bin_kinema_xcts.C,v 1.6 2014/10/13 08:53:38 j_novak Exp $" ; |
| 27 |
|
| 28 |
/* |
| 29 |
* $Id: star_bin_kinema_xcts.C,v 1.6 2014/10/13 08:53:38 j_novak Exp $ |
| 30 |
* $Log: star_bin_kinema_xcts.C,v $ |
| 31 |
* Revision 1.6 2014/10/13 08:53:38 j_novak |
| 32 |
* Lorene classes and functions now belong to the namespace Lorene. |
| 33 |
* |
| 34 |
* Revision 1.5 2014/10/06 15:13:17 j_novak |
| 35 |
* Modified #include directives to use c++ syntax. |
| 36 |
* |
| 37 |
* Revision 1.4 2010/12/09 10:43:53 m_bejger |
| 38 |
* Small changes, annule --> annule_domain |
| 39 |
* |
| 40 |
* Revision 1.3 2010/10/26 19:57:02 m_bejger |
| 41 |
* Various cleanups |
| 42 |
* |
| 43 |
* Revision 1.2 2010/06/04 19:57:52 m_bejger |
| 44 |
* Added condition for mp.get_rot_phi |
| 45 |
* |
| 46 |
* Revision 1.1 2010/05/04 07:51:05 m_bejger |
| 47 |
* Initial version |
| 48 |
* |
| 49 |
* $Header: /cvsroot/Lorene/C++/Source/Star/star_bin_kinema_xcts.C,v 1.6 2014/10/13 08:53:38 j_novak Exp $ |
| 50 |
* |
| 51 |
*/ |
| 52 |
|
| 53 |
#include <cmath> |
| 54 |
|
| 55 |
// Headers Lorene |
| 56 |
#include "star.h" |
| 57 |
|
| 58 |
namespace Lorene { |
| 59 |
void Star_bin_xcts::kinematics(double omega, double x_axe) { |
| 60 |
|
| 61 |
int nzm1 = mp.get_mg()->get_nzone() - 1 ; |
| 62 |
|
| 63 |
// -------------------- |
| 64 |
// Computation of B^i/N |
| 65 |
// -------------------- |
| 66 |
|
| 67 |
// 1/ Computation of omega m^i |
| 68 |
|
| 69 |
const Coord& xa = mp.xa ; |
| 70 |
const Coord& ya = mp.ya ; |
| 71 |
|
| 72 |
bsn.change_triad(mp.get_bvect_cart()) ; |
| 73 |
|
| 74 |
if (fabs(mp.get_rot_phi()) < 1e-10) { |
| 75 |
|
| 76 |
bsn.set(1) = - omega * ya ; |
| 77 |
bsn.set(2) = omega * (xa - x_axe) ; |
| 78 |
bsn.set(3) = 0 ; |
| 79 |
|
| 80 |
} else { |
| 81 |
|
| 82 |
bsn.set(1) = omega * ya ; |
| 83 |
bsn.set(2) = - omega * (xa - x_axe) ; |
| 84 |
bsn.set(3) = 0 ; |
| 85 |
|
| 86 |
} |
| 87 |
|
| 88 |
bsn.annule_domain(nzm1) ; // set to zero in the ZEC |
| 89 |
|
| 90 |
// Addition of beta and division by lapse |
| 91 |
// Eq. 47 from Gourgoulhon et al. (2001) |
| 92 |
// New convention : l = Nn + B ==> B = \beta + \Omega d\phi |
| 93 |
//--------------------------------------------------------- |
| 94 |
|
| 95 |
bsn = ( bsn + beta ) / nn ; |
| 96 |
|
| 97 |
bsn.annule_domain(nzm1) ; // set to zero in the ZEC |
| 98 |
bsn.std_spectral_base() ; |
| 99 |
|
| 100 |
//---------------------- |
| 101 |
// Centrifugal potential |
| 102 |
//---------------------- |
| 103 |
|
| 104 |
// Lorentz factor between the co-orbiting observer |
| 105 |
// and the Eulerian one |
| 106 |
// Eq. 23 from Gourgoulhon et al. (2001) |
| 107 |
|
| 108 |
Sym_tensor gamma_cov (gamma.cov()) ; |
| 109 |
gamma_cov.change_triad(mp.get_bvect_cart()) ; |
| 110 |
|
| 111 |
Scalar gam0 = 1 / sqrt(1 - contract(gamma_cov, 0, 1, bsn * bsn, 0, 1)) ; |
| 112 |
pot_centri = - log( gam0 ) ; |
| 113 |
|
| 114 |
pot_centri.annule_domain(nzm1) ; // set to zero in the external domain |
| 115 |
pot_centri.std_spectral_base() ; // set the bases for spectral expansions |
| 116 |
|
| 117 |
// The derived quantities are obsolete |
| 118 |
// ----------------------------------- |
| 119 |
|
| 120 |
del_deriv() ; |
| 121 |
|
| 122 |
} |
| 123 |
} |