star_bin_global.C

00001 /*
00002  * Methods for computing global quantities within the class Star_bin
00003  *
00004  * (see file star.h for documentation)
00005  */
00006 
00007 /*
00008  *   Copyright (c) 2004 Francois Limousin
00009  *
00010  *   This file is part of LORENE.
00011  *
00012  *   LORENE is free software; you can redistribute it and/or modify
00013  *   it under the terms of the GNU General Public License as published by
00014  *   the Free Software Foundation; either version 2 of the License, or
00015  *   (at your option) any later version.
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 
00029 char star_bin_global_C[] = "$Header: /cvsroot/Lorene/C++/Source/Star/star_bin_global.C,v 1.5 2005/09/13 19:38:31 f_limousin Exp $" ;
00030 
00031 /*
00032  * $Id: star_bin_global.C,v 1.5 2005/09/13 19:38:31 f_limousin Exp $
00033  * $Log: star_bin_global.C,v $
00034  * Revision 1.5  2005/09/13 19:38:31  f_limousin
00035  * Reintroduction of the resolution of the equations in cartesian coordinates.
00036  *
00037  * Revision 1.4  2005/02/17 17:33:25  f_limousin
00038  * Change the name of some quantities to be consistent with other classes
00039  * (for instance nnn is changed to nn, shift to beta, beta to lnq...)
00040  *
00041  * Revision 1.3  2004/02/27 09:54:24  f_limousin
00042  * Generalisation of the formulas for mass_b and mass_g for non
00043  * conformally flat metrics.
00044  *
00045  * Revision 1.2  2004/01/20 15:18:17  f_limousin
00046  * First version
00047  *
00048  *
00049  * $Header: /cvsroot/Lorene/C++/Source/Star/star_bin_global.C,v 1.5 2005/09/13 19:38:31 f_limousin Exp $
00050  *
00051  */
00052 
00053 // Headers C
00054 
00055 // Headers Lorene
00056 #include "star.h"
00057 #include "utilitaires.h"
00058 
00059             //--------------------------//
00060             //  Baryon mass     //
00061             //--------------------------//
00062 
00063 double Star_bin::mass_b() const {
00064 
00065     if (p_mass_b == 0x0) {    // a new computation is required
00066 
00067     Scalar det_gamma = gamma.determinant() ;
00068     
00069     Scalar dens = sqrt(det_gamma) * gam_euler * nbar ;
00070 
00071 //  Scalar dens = psi4 * sqrt(psi4) * gam_euler * nbar ;
00072     
00073     dens.std_spectral_base() ; 
00074     
00075     p_mass_b = new double( dens.integrale() ) ;
00076     
00077     }
00078     
00079     return *p_mass_b ; 
00080 
00081 } 
00082 
00083 
00084 
00085             //----------------------------//
00086             //  Gravitational mass    //
00087             //----------------------------//
00088 
00089 double Star_bin::mass_g() const {
00090 
00091     if (p_mass_g == 0x0) {    // a new computation is required
00092     
00093     Scalar det_gamma = gamma.determinant() ;
00094 
00095     Scalar dens = sqrt(det_gamma) * nn
00096         * ( ener_euler + s_euler ) ;
00097     
00098     dens.std_spectral_base() ; 
00099     
00100     p_mass_g = new double( dens.integrale() ) ;
00101 
00102     }
00103     
00104     return *p_mass_g ; 
00105 
00106 } 
00107 
00108         
00109             //----------------------------------//
00110             //  X coordinate of the barycenter  //
00111             //----------------------------------//
00112 
00113 
00114 double Star_bin::xa_barycenter() const {
00115 
00116     if (p_xa_barycenter == 0x0) {    // a new computation is required
00117     
00118     Scalar xxa(mp) ; 
00119     xxa = mp.xa ;   // Absolute X coordinate
00120     xxa.std_spectral_base() ;
00121 
00122     Scalar det_gamma = gamma.determinant() ;
00123 
00124     Scalar dens = sqrt(det_gamma) * gam_euler * nbar * xxa ; 
00125     
00126     int nzone = mp.get_mg()->get_nzone() ;
00127     dens.annule_domain(nzone - 1) ;
00128 
00129     dens.std_spectral_base() ; 
00130 
00131     p_xa_barycenter = new double( dens.integrale() / mass_b() ) ;
00132     
00133     }
00134     
00135     return *p_xa_barycenter ; 
00136 
00137 }
00138 

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