strot_dirac_diff_global.C

00001 /*
00002  *  Methods for computing global quantities within the class Star_rot_Dirac_diff
00003  *
00004  *    (see file star.h for documentation).
00005  *
00006  */
00007 
00008 /*
00009  *   Copyright (c) 2005 Motoyuki Saijo
00010  *
00011  *   This file is part of LORENE.
00012  *
00013  *   LORENE is free software; you can redistribute it and/or modify
00014  *   it under the terms of the GNU General Public License version 2
00015  *   as published by the Free Software Foundation.
00016  *
00017  *   LORENE is distributed in the hope that it will be useful,
00018  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
00019  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00020  *   GNU General Public License for more details.
00021  *
00022  *   You should have received a copy of the GNU General Public License
00023  *   along with LORENE; if not, write to the Free Software
00024  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00025  *
00026  */
00027 
00028 char strot_dirac_diff_global_C[] = "$Header: /cvsroot/Lorene/C++/Source/Star/strot_dirac_diff_global.C,v 1.1 2005/08/13 19:49:18 m_saijo Exp $" ;
00029 
00030 /*
00031  * $Header: /cvsroot/Lorene/C++/Source/Star/strot_dirac_diff_global.C,v 1.1 2005/08/13 19:49:18 m_saijo Exp $
00032  *
00033  */
00034 
00035 
00036 // C headers
00037 #include <math.h>
00038 
00039 // Lorene headers
00040 #include "star_rot_dirac_diff.h"
00041 
00042 
00043                      //---------------------//
00044                      //        T/W          //
00045                      //---------------------//
00046 
00047 double Star_rot_Dirac_diff::tsw() const {
00048 
00049   if (p_tsw == 0x0) {    // a new computation is required
00050 
00051     Vector phi_kill(mp, CON, mp.get_bvect_spher()) ;
00052 
00053     phi_kill.set(1).set_etat_zero() ;
00054     phi_kill.set(2).set_etat_zero() ;
00055     phi_kill.set(3) = 1. ;
00056     phi_kill.set(3).std_spectral_base() ;
00057     phi_kill.set(3).mult_rsint() ;
00058 
00059     Scalar j_source = contract(contract(gamma.cov(), 0, j_euler, 0),
00060                                0, phi_kill, 0) ;
00061 
00062     Scalar dens = sqrt( gamma.determinant() ) * j_source * omega_field ;
00063 
00064     dens.std_spectral_base() ;
00065 
00066     double tcin = 0.5 * dens.integrale() ;
00067 
00068     Scalar dens2 = sqrt( gamma.determinant() ) * gam_euler * ener ;
00069     
00070     dens2.std_spectral_base() ;
00071     
00072     double mass_p = dens2.integrale() ;
00073 
00074     p_tsw = new double( tcin / ( mass_p + tcin - mass_g() ) ) ;
00075 
00076  }
00077 
00078   return *p_tsw ;
00079 
00080     cout << "T/W :             " << p_tsw << '\n' ;
00081 
00082 }

Generated on Tue Feb 7 01:35:20 2012 for LORENE by  doxygen 1.4.6