| 1 |
/* |
| 2 |
* Methods for computing global quantities within the class Star_rot_Dirac_diff |
| 3 |
* |
| 4 |
* (see file star.h for documentation). |
| 5 |
* |
| 6 |
*/ |
| 7 |
|
| 8 |
/* |
| 9 |
* Copyright (c) 2005 Motoyuki Saijo |
| 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 version 2 |
| 15 |
* as published by the Free Software Foundation. |
| 16 |
* |
| 17 |
* LORENE is distributed in the hope that it will be useful, |
| 18 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 19 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 20 |
* GNU General Public License for more details. |
| 21 |
* |
| 22 |
* You should have received a copy of the GNU General Public License |
| 23 |
* along with LORENE; if not, write to the Free Software |
| 24 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 25 |
* |
| 26 |
*/ |
| 27 |
|
| 28 |
char strot_dirac_diff_global_C[] = "$Header: /cvsroot/Lorene/C++/Source/Star/strot_dirac_diff_global.C,v 1.3 2014/10/13 08:53:40 j_novak Exp $" ; |
| 29 |
|
| 30 |
/* |
| 31 |
* $Header: /cvsroot/Lorene/C++/Source/Star/strot_dirac_diff_global.C,v 1.3 2014/10/13 08:53:40 j_novak Exp $ |
| 32 |
* |
| 33 |
*/ |
| 34 |
|
| 35 |
|
| 36 |
// C headers |
| 37 |
#include <cmath> |
| 38 |
|
| 39 |
// Lorene headers |
| 40 |
#include "star_rot_dirac_diff.h" |
| 41 |
|
| 42 |
|
| 43 |
//---------------------// |
| 44 |
// T/W // |
| 45 |
//---------------------// |
| 46 |
|
| 47 |
namespace Lorene { |
| 48 |
double Star_rot_Dirac_diff::tsw() const { |
| 49 |
|
| 50 |
if (p_tsw == 0x0) { // a new computation is required |
| 51 |
|
| 52 |
Vector phi_kill(mp, CON, mp.get_bvect_spher()) ; |
| 53 |
|
| 54 |
phi_kill.set(1).set_etat_zero() ; |
| 55 |
phi_kill.set(2).set_etat_zero() ; |
| 56 |
phi_kill.set(3) = 1. ; |
| 57 |
phi_kill.set(3).std_spectral_base() ; |
| 58 |
phi_kill.set(3).mult_rsint() ; |
| 59 |
|
| 60 |
Scalar j_source = contract(contract(gamma.cov(), 0, j_euler, 0), |
| 61 |
0, phi_kill, 0) ; |
| 62 |
|
| 63 |
Scalar dens = sqrt( gamma.determinant() ) * j_source * omega_field ; |
| 64 |
|
| 65 |
dens.std_spectral_base() ; |
| 66 |
|
| 67 |
double tcin = 0.5 * dens.integrale() ; |
| 68 |
|
| 69 |
Scalar dens2 = sqrt( gamma.determinant() ) * gam_euler * ener ; |
| 70 |
|
| 71 |
dens2.std_spectral_base() ; |
| 72 |
|
| 73 |
double mass_p = dens2.integrale() ; |
| 74 |
|
| 75 |
p_tsw = new double( tcin / ( mass_p + tcin - mass_g() ) ) ; |
| 76 |
|
| 77 |
} |
| 78 |
|
| 79 |
return *p_tsw ; |
| 80 |
|
| 81 |
cout << "T/W : " << p_tsw << '\n' ; |
| 82 |
|
| 83 |
} |
| 84 |
} |