00001 /* 00002 * Methods for computing global quantities within the class Etoile_bin 00003 * 00004 * (see file etoile.h for documentation) 00005 */ 00006 00007 /* 00008 * Copyright (c) 2000-2001 Eric Gourgoulhon 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 et_bin_global_C[] = "$Header: /cvsroot/Lorene/C++/Source/Etoile/et_bin_global.C,v 1.11 2004/12/30 17:24:42 f_limousin Exp $" ; 00030 00031 /* 00032 * $Id: et_bin_global.C,v 1.11 2004/12/30 17:24:42 f_limousin Exp $ 00033 * $Log: et_bin_global.C,v $ 00034 * Revision 1.11 2004/12/30 17:24:42 f_limousin 00035 * Remove #include "et_bin_ncp.h" 00036 * 00037 * Revision 1.10 2004/12/30 17:22:25 f_limousin 00038 * Remove all functions belonging to the class Et_bin_ncp 00039 * 00040 * Revision 1.9 2003/06/20 14:02:44 f_limousin 00041 * pow(gamma(), 1./2.) is changed to pow(a_car(), 3./2.) 00042 * 00043 * Revision 1.8 2003/02/06 17:25:56 f_limousin 00044 * Add global quantities for the class et_bin_ncp 00045 * 00046 * Revision 1.7 2003/01/17 13:32:27 f_limousin 00047 * Add comments 00048 * 00049 * Revision 1.6 2002/12/17 09:48:21 k_taniguchi 00050 * Suppress every desaliasing multiplications using "%". 00051 * 00052 * Revision 1.5 2002/12/16 17:32:47 k_taniguchi 00053 * Suppress the things I did in the previous version. 00054 * 00055 * Revision 1.4 2002/12/16 16:59:39 k_taniguchi 00056 * Set some Cmp to the state of "std_base_scal()". 00057 * 00058 * Revision 1.3 2002/12/16 14:36:39 k_taniguchi 00059 * Introduce a new Cmp for the calculation of gravitational mass. 00060 * 00061 * Revision 1.2 2002/12/10 15:45:25 k_taniguchi 00062 * Change the multiplication "*" to "%". 00063 * 00064 * Revision 1.1.1.1 2001/11/20 15:19:28 e_gourgoulhon 00065 * LORENE 00066 * 00067 * Revision 2.4 2000/07/06 10:02:22 eric 00068 * *** empty log message *** 00069 * 00070 * Revision 2.3 2000/07/06 09:40:37 eric 00071 * Ajout de la fonction xa_barycenter(). 00072 * 00073 * Revision 2.2 2000/02/02 09:23:12 eric 00074 * 1ere version operationnelle dans le cas relativiste. 00075 * 00076 * Revision 2.1 2000/02/01 16:00:13 eric 00077 * Le calcul de mass_b est implemente dans le cas relativiste. 00078 * 00079 * Revision 2.0 2000/01/31 15:57:21 eric 00080 * *** empty log message *** 00081 * 00082 * 00083 * $Header: /cvsroot/Lorene/C++/Source/Etoile/et_bin_global.C,v 1.11 2004/12/30 17:24:42 f_limousin Exp $ 00084 * 00085 */ 00086 00087 // Headers C 00088 00089 // Headers Lorene 00090 #include "etoile.h" 00091 00092 //--------------------------// 00093 // Baryon mass // 00094 //--------------------------// 00095 00096 double Etoile_bin::mass_b() const { 00097 00098 if (p_mass_b == 0x0) { // a new computation is required 00099 00100 if (relativistic) { 00101 00102 Cmp sqrt_acar = sqrt(a_car()) ; 00103 sqrt_acar.std_base_scal() ; 00104 00105 // See Eq (69) from Gourgoulhon et al. (2001) 00106 // Cmp dens = a_car() % sqrt_acar % gam_euler() % nbar() ; 00107 00108 Cmp dens = a_car() * sqrt( a_car() ) * gam_euler() * nbar() ; 00109 00110 dens.std_base_scal() ; 00111 00112 p_mass_b = new double( dens.integrale() ) ; 00113 00114 } 00115 else{ 00116 assert(nbar.get_etat() == ETATQCQ) ; 00117 00118 p_mass_b = new double( nbar().integrale() ) ; 00119 00120 } 00121 00122 } 00123 00124 return *p_mass_b ; 00125 00126 } 00127 00128 00129 //----------------------------// 00130 // Gravitational mass // 00131 //----------------------------// 00132 00133 double Etoile_bin::mass_g() const { 00134 00135 if (p_mass_g == 0x0) { // a new computation is required 00136 00137 if (relativistic) { 00138 00139 00140 Cmp sqrt_acar = sqrt(a_car()) ; 00141 sqrt_acar.std_base_scal() ; 00142 Cmp dens = a_car() * sqrt( a_car() ) * nnn() 00143 * ( ener_euler() + s_euler() ) ; 00144 00145 dens.std_base_scal() ; 00146 00147 p_mass_g = new double( dens.integrale() ) ; 00148 00149 } 00150 else{ 00151 p_mass_g = new double( mass_b() ) ; // in the Newtonian case 00152 // M_g = M_b 00153 } 00154 } 00155 00156 return *p_mass_g ; 00157 00158 } 00159 00160 00161 00162 //----------------------------------// 00163 // X coordinate of the barycenter // 00164 //----------------------------------// 00165 00166 double Etoile_bin::xa_barycenter() const { 00167 00168 if (p_xa_barycenter == 0x0) { // a new computation is required 00169 00170 Cmp xxa(mp) ; 00171 xxa = mp.xa ; // Absolute X coordinate 00172 xxa.std_base_scal() ; 00173 00174 Cmp dens = a_car() * sqrt( a_car() ) * gam_euler() * nbar() * xxa ; 00175 00176 dens.std_base_scal() ; 00177 00178 p_xa_barycenter = new double( dens.integrale() / mass_b() ) ; 00179 00180 } 00181 00182 return *p_xa_barycenter ; 00183 00184 } 00185 00186 00187
1.4.6