00001 /* 00002 * Methods for computing global quantities within the class Et_rot_diff 00003 * 00004 * (see file et_rot_diff.h for documentation) 00005 */ 00006 00007 /* 00008 * Copyright (c) 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_rot_diff_global_C[] = "$Header: /cvsroot/Lorene/C++/Source/Etoile/et_rot_diff_global.C,v 1.2 2003/12/19 16:21:42 j_novak Exp $" ; 00030 00031 /* 00032 * $Id: et_rot_diff_global.C,v 1.2 2003/12/19 16:21:42 j_novak Exp $ 00033 * $Log: et_rot_diff_global.C,v $ 00034 * Revision 1.2 2003/12/19 16:21:42 j_novak 00035 * Shadow hunt 00036 * 00037 * Revision 1.1.1.1 2001/11/20 15:19:28 e_gourgoulhon 00038 * LORENE 00039 * 00040 * Revision 1.2 2001/10/24 16:06:53 eric 00041 * fonction tsw(): correction erreur ener. cin. (facteur 0.5). 00042 * 00043 * Revision 1.1 2001/10/19 08:18:30 eric 00044 * Initial revision 00045 * 00046 * 00047 * $Header: /cvsroot/Lorene/C++/Source/Etoile/et_rot_diff_global.C,v 1.2 2003/12/19 16:21:42 j_novak Exp $ 00048 * 00049 */ 00050 00051 // Headers C 00052 #include <math.h> 00053 00054 // Headers Lorene 00055 #include "et_rot_diff.h" 00056 //----------------------------// 00057 // T/W // 00058 //----------------------------// 00059 00060 double Et_rot_diff::tsw() const { 00061 00062 if (p_tsw == 0x0) { // a new computation is required 00063 00064 Cmp dens = uuu() ; 00065 00066 dens.mult_r() ; // Multiplication by 00067 dens.va = (dens.va).mult_st() ; // r sin(theta) 00068 00069 if (relativistic) { 00070 dens = omega_field() * a_car() * b_car() * (ener_euler() + press()) 00071 * dens ; 00072 } 00073 else { // Newtonian case 00074 dens = omega_field() * nbar() * dens ; 00075 } 00076 00077 dens.std_base_scal() ; 00078 00079 double tcin = 0.5 * dens.integrale() ; 00080 00081 if (relativistic) { 00082 00083 Cmp dens2 = a_car() * bbb() * gam_euler() * ener() ; 00084 dens2.std_base_scal() ; 00085 double mass_p = dens2.integrale() ; 00086 00087 p_tsw = new double( tcin / ( mass_p + tcin - mass_g() ) ) ; 00088 00089 } 00090 else { // Newtonian case 00091 Cmp dens2 = 0.5 * nbar() * logn() ; 00092 dens2.std_base_scal() ; 00093 double wgrav = dens2.integrale() ; 00094 p_tsw = new double( tcin / fabs(wgrav) ) ; 00095 } 00096 00097 00098 } 00099 00100 return *p_tsw ; 00101 00102 } 00103
1.4.6