et_rot_bifluid.C

00001 /*
00002  * Methods for two fluids rotating relativistic stars.
00003  *
00004  * See the file et_rot_bifluid.h for documentation
00005  *
00006  */
00007 
00008 /*
00009  *   Copyright (c) 2001 Jerome Novak
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 as published by
00015  *   the Free Software Foundation; either version 2 of the License, or
00016  *   (at your option) any later version.
00017  *
00018  *   LORENE is distributed in the hope that it will be useful,
00019  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
00020  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00021  *   GNU General Public License for more details.
00022  *
00023  *   You should have received a copy of the GNU General Public License
00024  *   along with LORENE; if not, write to the Free Software
00025  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00026  *
00027  */
00028 
00029 
00030 char et_rot_bifluid_C[] = "$Header: /cvsroot/Lorene/C++/Source/Etoile/et_rot_bifluid.C,v 1.12 2004/03/25 10:29:04 j_novak Exp $" ;
00031 
00032 /*
00033  * $Id: et_rot_bifluid.C,v 1.12 2004/03/25 10:29:04 j_novak Exp $
00034  * $Log: et_rot_bifluid.C,v $
00035  * Revision 1.12  2004/03/25 10:29:04  j_novak
00036  * All LORENE's units are now defined in the namespace Unites (in file unites.h).
00037  *
00038  * Revision 1.11  2003/12/04 14:28:26  r_prix
00039  * allow for the case of "slow-rot-style" EOS inversion, in which we need to adapt
00040  * the inner domain to n_outer=0 instead of mu_outer=0 ...
00041  * (this should only be used for comparison to analytic slow-rot solution!)
00042  *
00043  * Revision 1.10  2003/11/20 14:01:26  r_prix
00044  * changed member names to better conform to Lorene coding standards:
00045  * J_euler -> j_euler, EpS_euler -> enerps_euler, Delta_car -> delta_car
00046  *
00047  * Revision 1.9  2003/11/18 18:38:11  r_prix
00048  * use of new member EpS_euler: matter sources in equilibrium() and global quantities
00049  * no longer distinguish Newtonian/relativistic, as all terms should have the right limit...
00050  *
00051  * Revision 1.8  2003/11/17 13:49:43  r_prix
00052  * - moved superluminal check into hydro_euler()
00053  * - removed some warnings
00054  *
00055  * Revision 1.7  2003/11/13 12:07:57  r_prix
00056  * *) changed xxx2 -> Delta_car
00057  * *) added (non 2-fluid specific!) members sphph_euler J_euler
00058  * *) more or less rewritten hydro_euler() to see if I understand it ;)
00059  *   - somewhat simplified and more adapted to the notation used in our notes/paper.
00060  *   - Main difference: u_euler is no longer used!!, the "output" instead
00061  *     consists of ener_euler, s_euler, sphph_euler and J_euler, which are
00062  *     the general 3+1 components for Tmunu.
00063  *
00064  * Revision 1.6  2003/09/17 08:27:50  j_novak
00065  * New methods: mass_b1() and mass_b2().
00066  *
00067  * Revision 1.5  2002/10/18 08:42:58  j_novak
00068  * Take into account the sign for uuu and uuu2
00069  *
00070  * Revision 1.4  2002/01/16 15:03:28  j_novak
00071  * *** empty log message ***
00072  *
00073  * Revision 1.3  2002/01/11 14:09:34  j_novak
00074  * Added newtonian version for 2-fluid stars
00075  *
00076  * Revision 1.2  2001/12/04 21:27:53  e_gourgoulhon
00077  *
00078  * All writing/reading to a binary file are now performed according to
00079  * the big endian convention, whatever the system is big endian or
00080  * small endian, thanks to the functions fwrite_be and fread_be
00081  *
00082  * Revision 1.1.1.1  2001/11/20 15:19:28  e_gourgoulhon
00083  * LORENE
00084  *
00085  * Revision 1.3  2001/08/28  16:04:22  novak
00086  * Use of new definition of relative velocity and new declarations for EOS
00087  *
00088  * Revision 1.2  2001/08/27 09:58:43  novak
00089  * *** empty log message ***
00090  *
00091  * Revision 1.1  2001/06/22 15:39:17  novak
00092  * Initial revision
00093  *
00094  *
00095  * $Header: /cvsroot/Lorene/C++/Source/Etoile/et_rot_bifluid.C,v 1.12 2004/03/25 10:29:04 j_novak Exp $
00096  *
00097  */
00098 // Headers C
00099 #include "math.h"
00100 
00101 // Headers Lorene
00102 #include "et_rot_bifluid.h"
00103 #include "utilitaires.h"
00104 #include "unites.h"     
00105 
00106                 //--------------//
00107                 // Constructors //
00108                 //--------------//
00109 // Standard constructor
00110 // --------------------
00111 Et_rot_bifluid::Et_rot_bifluid(Map& mpi, int nzet_i, bool relat, const Eos_bifluid& eos_i):
00112   Etoile_rot(mpi, nzet_i, relat, *eos_i.trans2Eos()), 
00113   eos(eos_i),
00114   ent2(mpi),
00115   nbar2(mpi),
00116   sphph_euler(mpi),
00117   j_euler(mpi, 1, CON, mp.get_bvect_cart()), 
00118   enerps_euler(mpi),
00119   uuu2(mpi),
00120   gam_euler2(mpi),
00121   delta_car(mpi)
00122 {
00123   // All the matter quantities are initialized to zero :
00124   nbar2 = 0 ;
00125   ent2 = 0 ; 
00126   sphph_euler = 0;
00127   j_euler = 0;
00128   enerps_euler = 0;
00129 
00130   gam_euler.set_std_base() ; 
00131   
00132   // Initialization to a static state : 
00133   omega2 = 0 ; 
00134   uuu2 = 0 ; 
00135   gam_euler2 = 1 ; 
00136   delta_car = 0 ;
00137   
00138   // Pointers of derived quantities initialized to zero : 
00139   set_der_0x0() ;
00140   
00141 }
00142 
00143 // Copy constructor
00144 // ----------------
00145 
00146 Et_rot_bifluid::Et_rot_bifluid(const Et_rot_bifluid& et):
00147   Etoile_rot(et), 
00148   eos(et.eos),
00149   ent2(et.ent2),
00150   nbar2(et.nbar2),
00151   sphph_euler(et.sphph_euler),
00152   j_euler(et.j_euler),
00153   enerps_euler(et.enerps_euler),
00154   uuu2(et.uuu2),
00155   gam_euler2(et.gam_euler2),
00156   delta_car(et.delta_car)
00157 {
00158   omega2 = et.omega2 ; 
00159   
00160   // Pointers of derived quantities initialized to zero : 
00161   set_der_0x0() ;
00162 }    
00163 
00164 
00165 // Constructor from a file 
00166 // ------------------------
00167 Et_rot_bifluid::Et_rot_bifluid(Map& mpi, const Eos_bifluid& eos_i, FILE* fich):
00168   Etoile_rot(mpi, *eos_i.trans2Eos(), fich),
00169   eos(eos_i),
00170   ent2(mpi),
00171   nbar2(mpi),
00172   sphph_euler(mpi),
00173   j_euler(mpi, 1, CON, mp.get_bvect_cart()), 
00174   enerps_euler(mpi),
00175   uuu2(mpi),
00176   gam_euler2(mpi),
00177   delta_car(mpi)
00178 {
00179 
00180   // Etoile parameters
00181   // -----------------
00182   // omega2 is read in the file:     
00183   fread_be(&omega2, sizeof(double), 1, fich) ;      
00184   
00185   
00186   // Read of the saved fields:
00187   // ------------------------
00188   
00189   Tenseur ent2_file(mp, fich) ; 
00190   ent2 = ent2_file ; 
00191         
00192   // All other fields are initialized to zero : 
00193   // ----------------------------------------
00194   uuu2 = 0 ;
00195   delta_car = 0 ;
00196   
00197   // Pointers of derived quantities initialized to zero 
00198   // --------------------------------------------------
00199   set_der_0x0() ;
00200   
00201 }
00202 
00203                 //------------//
00204                 // Destructor //
00205                 //------------//
00206 
00207 Et_rot_bifluid::~Et_rot_bifluid(){
00208 
00209   del_deriv() ; 
00210 
00211 }
00212 
00213         //----------------------------------//
00214         // Management of derived quantities //
00215         //----------------------------------//
00216 
00217 void Et_rot_bifluid::del_deriv() const {
00218 
00219   Etoile_rot::del_deriv() ; 
00220   
00221   if (p_ray_eq2 != 0x0) delete p_ray_eq2 ; 
00222   if (p_ray_eq2_pis2 != 0x0) delete p_ray_eq2_pis2 ; 
00223   if (p_ray_eq2_pi != 0x0) delete p_ray_eq2_pi ; 
00224   if (p_ray_pole2 != 0x0) delete p_ray_pole2 ; 
00225   if (p_l_surf2 != 0x0) delete p_l_surf2 ; 
00226   if (p_xi_surf2 != 0x0) delete p_xi_surf2 ;
00227   if (p_r_circ2 != 0x0) delete p_r_circ2 ;
00228   if (p_aplat2 != 0x0) delete p_aplat2 ; 
00229   if (p_mass_b1 != 0x0) delete p_mass_b1 ;
00230   if (p_mass_b2 != 0x0) delete p_mass_b2 ;
00231   
00232   set_der_0x0() ; 
00233 }               
00234 
00235 
00236 
00237 
00238 void Et_rot_bifluid::set_der_0x0() const {
00239 
00240   Etoile_rot::set_der_0x0() ;
00241   
00242   p_ray_eq2 = 0x0 ;
00243   p_ray_eq2_pis2 = 0x0 ; 
00244   p_ray_eq2_pi = 0x0 ; 
00245   p_ray_pole2 = 0x0 ; 
00246   p_l_surf2 = 0x0 ; 
00247   p_xi_surf2 = 0x0 ; 
00248   p_r_circ2 = 0x0 ;
00249   p_aplat2 = 0x0 ;
00250   p_mass_b1 = 0x0;
00251   p_mass_b2 = 0x0;
00252 }               
00253 
00254 void Et_rot_bifluid::del_hydro_euler() {
00255 
00256   Etoile_rot::del_hydro_euler() ; 
00257   sphph_euler.set_etat_nondef();
00258   j_euler.set_etat_nondef();
00259   enerps_euler.set_etat_nondef();
00260   uuu2.set_etat_nondef();
00261   gam_euler2.set_etat_nondef() ; 
00262   delta_car.set_etat_nondef();
00263   
00264   del_deriv() ; 
00265 }               
00266 
00267 // Assignment of the enthalpy field
00268 // --------------------------------
00269 
00270 void Et_rot_bifluid::set_enthalpies(const Cmp& ent_i, const Cmp& ent2_i) {
00271     
00272   ent = ent_i ; 
00273   ent2 = ent2_i ;
00274     
00275   // Update of (nbar, ener, press) :
00276   equation_of_state() ; 
00277     
00278   // The derived quantities are obsolete:
00279   del_deriv() ; 
00280     
00281 }
00282 
00283 
00284                 //--------------//
00285                 //  Assignment  //
00286                 //--------------//
00287 
00288 // Assignment to another Et_rot_bifluid
00289 // --------------------------------
00290 void Et_rot_bifluid::operator=(const Et_rot_bifluid& et) {
00291 
00292     // Assignment of quantities common to all the derived classes of Etoile
00293     Etoile_rot::operator=(et) ;     
00294 
00295     assert( &(et.eos) == &eos ) ;       // Same EOS
00296     // Assignement of proper quantities of class Et_rot_bifluid
00297     omega2 = et.omega2 ; 
00298 
00299     ent2 = et.ent2 ;
00300     nbar2 = et.nbar2 ;
00301     sphph_euler = et.sphph_euler;
00302     j_euler = et.j_euler;
00303     enerps_euler = et.enerps_euler;
00304     uuu2 = et.uuu2 ;
00305     gam_euler2 = et.gam_euler2 ;
00306     delta_car = et.delta_car ;
00307 
00308     
00309     del_deriv() ;  // Deletes all derived quantities
00310 
00311 }   
00312 
00313                 //--------------//
00314                 //    Outputs   //
00315                 //--------------//
00316 
00317 // Save in a file
00318 // --------------
00319 void Et_rot_bifluid::sauve(FILE* fich) const {
00320     
00321     Etoile_rot::sauve(fich) ; 
00322     
00323     fwrite_be(&omega2, sizeof(double), 1, fich) ;       
00324     
00325     ent2.sauve(fich) ; 
00326     
00327     
00328 }
00329 
00330 // Printing
00331 // --------
00332 
00333 ostream& Et_rot_bifluid::operator>>(ostream& ost) const {
00334     
00335   using namespace Unites ;
00336 
00337     Etoile::operator>>(ost) ; 
00338     
00339     ost << endl ; 
00340     ost << "Bifluid rotating star" << endl ; 
00341     ost << "-------------" << endl ; 
00342     
00343     double freq = omega / (2.*M_PI) ;  
00344     ost << "Omega1 : " << omega * f_unit 
00345         << " rad/s     f : " << freq * f_unit << " Hz" << endl ; 
00346     ost << "Rotation period 1: " << 1000. / (freq * f_unit) << " ms"
00347         << endl ;
00348        
00349     double freq2 = omega2 / (2.*M_PI) ;  
00350     ost << "Omega2 : " << omega2 * f_unit 
00351         << " rad/s     f : " << freq2 * f_unit << " Hz" << endl ; 
00352     ost << "Rotation period 2: " << 1000. / (freq2 * f_unit) << " ms"
00353         << endl ;
00354        
00355     double nphi_c = nphi()(0, 0, 0, 0) ;
00356     if ( (omega==0) && (nphi_c==0) ) {
00357         ost << "Central N^phi :               " << nphi_c << endl ;
00358     }
00359     else{
00360         ost << "Central N^phi/Omega :    " << nphi_c / omega << endl ;
00361     }
00362     if (omega2!=0) 
00363       ost << "Central N^phi/Omega2 :     " << nphi_c / omega2 << endl ;
00364     
00365     ost << "Error on the virial identity GRV2 : " << endl ; 
00366     ost << "GRV2 = " << grv2() << endl ; 
00367     ost << "Error on the virial identity GRV3 : " << endl ; 
00368     double xgrv3 = grv3(&ost) ; 
00369     ost << "GRV3 = " << xgrv3 << endl ; 
00370 
00371     ost << "Circumferential equatorial radius R_circ :     " 
00372     << r_circ()/km << " km" << endl ;  
00373     ost << "Coordinate equatorial radius r_eq : " << ray_eq()/km << " km" 
00374      << endl ;  
00375     ost << "Flattening r_pole/r_eq :        " << aplat() << endl ; 
00376     ost << "Circumferential equatorial radius R_circ2 :     " 
00377     << r_circ2()/km << " km" << endl ;  
00378     ost << "Coordinate equatorial radius r_eq2 : " << ray_eq2()/km << " km" 
00379      << endl ;  
00380     ost << "Flattening r_pole2/r_eq2 :        " << aplat2() << endl ; 
00381 
00382     int lsurf = nzet - 1; 
00383     int nt = mp.get_mg()->get_nt(lsurf) ; 
00384     int nr = mp.get_mg()->get_nr(lsurf) ; 
00385     ost << "Equatorial value of the velocity U:         " 
00386      << uuu()(nzet-1, 0, nt-1, nr-1) << " c" << endl ; 
00387     ost << "Equatorial value of the velocity U2:         " 
00388      << uuu2()(nzet-1, 0, nt-1, nr-1) << " c" << endl ; 
00389     ost << "Redshift at the equator (forward) : " << z_eqf() << endl ; 
00390     ost << "Redshift at the equator (backward): " << z_eqb() << endl ; 
00391     ost << "Redshift at the pole              : " << z_pole() << endl ; 
00392 
00393 
00394     ost << "Central value of log(N)        : " 
00395     << logn()(0, 0, 0, 0) << endl ; 
00396 
00397     ost << "Central value of dzeta=log(AN) : " 
00398     << dzeta()(0, 0, 0, 0) << endl ; 
00399 
00400     ost << "Central value of B^2 : " << b_car()(0,0,0,0) <<  endl ; 
00401 
00402     Tbl diff_a_b = diffrel( a_car(), b_car() ) ;
00403     ost << 
00404     "Relative discrepancy in each domain between the metric coef. A^2 and B^2 : "
00405        << endl ;
00406     for (int l=0; l<diff_a_b.get_taille(); l++) {
00407         ost << diff_a_b(l) << "  " ;
00408     }
00409     ost << endl ;       
00410 
00411     return ost ;
00412     
00413 }
00414 
00415 
00416 void Et_rot_bifluid::partial_display(ostream& ost) const {
00417     
00418   using namespace Unites ;
00419 
00420     double freq = omega / (2.*M_PI) ;  
00421     ost << "Omega : " << omega * f_unit 
00422         << " rad/s     f : " << freq * f_unit << " Hz" << endl ; 
00423     ost << "Rotation period : " << 1000. / (freq * f_unit) << " ms"
00424      << endl ;
00425     ost << endl << "Central enthalpy : " << ent()(0,0,0,0) << " c^2" << endl ; 
00426     ost << "Central proper baryon density : " << nbar()(0,0,0,0) 
00427     << " x 0.1 fm^-3" << endl ; 
00428     double freq2 = omega2 / (2.*M_PI) ;  
00429     ost << "Omega2 : " << omega2 * f_unit 
00430         << " rad/s     f : " << freq2 * f_unit << " Hz" << endl ; 
00431     ost << "Rotation period 2: " << 1000. / (freq2 * f_unit) << " ms"
00432      << endl ;
00433     ost << endl << "Central enthalpy 2: " << ent2()(0,0,0,0) << " c^2" << endl ; 
00434     ost << "Central proper baryon density 2: " << nbar2()(0,0,0,0) 
00435     << " x 0.1 fm^-3" << endl ; 
00436    ost << "Central proper energy density : " << ener()(0,0,0,0) 
00437     << " rho_nuc c^2" << endl ; 
00438     ost << "Central pressure : " << press()(0,0,0,0) 
00439     << " rho_nuc c^2" << endl ; 
00440 
00441     ost << "Central value of log(N)        : " 
00442     << logn()(0, 0, 0, 0) << endl ; 
00443     ost << "Central lapse N :      " << nnn()(0,0,0,0) <<  endl ; 
00444     ost << "Central value of dzeta=log(AN) : " 
00445     << dzeta()(0, 0, 0, 0) << endl ; 
00446     ost << "Central value of A^2 : " << a_car()(0,0,0,0) <<  endl ; 
00447     ost << "Central value of B^2 : " << b_car()(0,0,0,0) <<  endl ; 
00448 
00449     double nphi_c = nphi()(0, 0, 0, 0) ;
00450     if ( (omega==0) && (nphi_c==0) ) {
00451         ost << "Central N^phi :               " << nphi_c << endl ;
00452     }
00453     else{
00454         ost << "Central N^phi/Omega :         " << nphi_c / omega << endl ;
00455     }
00456         
00457 
00458     int lsurf = nzet - 1; 
00459     int nt = mp.get_mg()->get_nt(lsurf) ; 
00460     int nr = mp.get_mg()->get_nr(lsurf) ; 
00461     ost << "Equatorial value of the velocity U:         " 
00462      << uuu()(nzet-1, 0, nt-1, nr-1) << " c" << endl ; 
00463 
00464     ost << "Equatorial value of the velocity U2:         " 
00465      << uuu2()(nzet-1, 0, nt-1, nr-1) << " c" << endl ; 
00466 
00467     ost << endl 
00468     << "Coordinate equatorial radius r_eq =    " 
00469     << ray_eq()/km << " km" << endl ;  
00470     ost << "Flattening r_pole/r_eq :        " << aplat() << endl ; 
00471     ost << endl 
00472     << "Coordinate equatorial radius r_eq2 =    " 
00473     << ray_eq2()/km << " km" << endl ;  
00474     ost << "Flattening r_pole2/r_eq2 :        " << aplat2() << endl ; 
00475 
00476 }
00477 
00478 //
00479 //   Equation of state
00480 //
00481 
00482 void Et_rot_bifluid::equation_of_state() {
00483 
00484   Cmp ent_eos = ent() ;
00485   Cmp ent2_eos = ent2() ;
00486   Tenseur rel_vel(delta_car) ;
00487 
00488   if (nzet > 1) {
00489     // Slight rescale of the enthalpy field in case of 2 domains inside the
00490     //  star
00491   
00492     if (nzet > 2) {
00493       cout << "Et_rot_bifluid::equation_of_state: not ready yet for nzet > 2 !" << endl ;       
00494     }
00495     
00496     double epsilon = 1.e-12 ;
00497   
00498     const Mg3d* mg = mp.get_mg() ;
00499     int nz = mg->get_nzone() ;
00500     
00501     Mtbl xi(mg) ;
00502     xi.set_etat_qcq() ;
00503     for (int l=0; l<nz; l++) {
00504       xi.t[l]->set_etat_qcq() ;
00505       for (int k=0; k<mg->get_np(l); k++) {
00506     for (int j=0; j<mg->get_nt(l); j++) {
00507       for (int i=0; i<mg->get_nr(l); i++) {
00508         xi.set(l,k,j,i) =
00509           mg->get_grille3d(l)->x[i] ;
00510       }
00511     }
00512       }
00513       
00514     }
00515   
00516     Cmp fact_ent(mp) ;
00517     fact_ent.allocate_all() ;
00518     
00519     fact_ent.set(0) = 1 + epsilon * xi(0) * xi(0) ;
00520     fact_ent.set(1) = 1 - 0.25 * epsilon * (xi(1) - 1) * (xi(1) - 1) ;
00521   
00522     for (int l=nzet; l<nz; l++) {
00523       fact_ent.set(l) = 1 ;
00524     }
00525 
00526     ent_eos = fact_ent * ent_eos ;
00527     ent2_eos = fact_ent * ent2_eos ;
00528     ent_eos.std_base_scal() ;
00529     ent2_eos.std_base_scal() ;
00530 
00531   } // if nzet > 1
00532   
00533   
00534   // Call to the EOS
00535   nbar.set_etat_qcq() ;
00536   nbar2.set_etat_qcq() ;
00537   ener.set_etat_qcq() ;
00538   press.set_etat_qcq() ;
00539 
00540   eos.calcule_tout(ent_eos, ent2_eos, rel_vel(), nbar.set(), nbar2.set(), 
00541            ener.set(), press.set(), nzet)  ; 
00542   
00543   // Set the bases for spectral expansion 
00544   nbar.set_std_base() ; 
00545   nbar2.set_std_base() ; 
00546   ener.set_std_base() ; 
00547   press.set_std_base() ; 
00548   
00549   // The derived quantities are obsolete
00550   del_deriv() ; 
00551   
00552 }
00553 
00554 //
00555 // Computation of hydro quantities
00556 //
00557 
00558 void Et_rot_bifluid::hydro_euler(){
00559 
00560   const Mg3d* mg = mp.get_mg(); 
00561   int nz = mg->get_nzone() ; 
00562   int nzm1 = nz - 1 ; 
00563 
00564     // RP: I prefer to use the 3-vector j_euler instead of u_euler
00565     // for better physical "encapsulation" 
00566     // (i.e. --> use same form of Poisson-equations for all etoile sub-classes!)
00567     u_euler.set_etat_nondef(); // make sure it's not used
00568 
00569     // (Norm of) Euler-velocity of the first fluid
00570     //------------------------------
00571     uuu.set_etat_qcq();
00572 
00573     uuu.set() = bbb() * (omega - nphi() ) / nnn();
00574     uuu.annule(nzm1) ; 
00575 
00576     // gosh, we have to exclude the thing being zero here... :(
00577     if( uuu.get_etat() != ETATZERO )
00578       {
00579     (uuu.set()).std_base_scal() ;
00580     (uuu.set()).mult_rsint();
00581       }
00582     uuu.set_std_base();
00583     
00584 
00585     // (Norm of) Euler-velocity of the second fluid
00586     //----------------------------------------
00587     uuu2.set_etat_qcq();
00588     
00589     uuu2.set() = bbb() * (omega2 - nphi() ) / nnn();
00590     uuu2.annule(nzm1) ; 
00591 
00592     if( uuu2.get_etat() != ETATZERO )
00593       {
00594     (uuu2.set()).std_base_scal();
00595     (uuu2.set()).mult_rsint();
00596       }
00597     uuu2.set_std_base();
00598 
00599     // Sanity check:
00600     // Is one of the new velocities larger than c in the equatorial plane ?
00601     //----------------------------------------
00602 
00603     // Index of the point at phi=0, theta=pi/2 at the surface of the star:
00604     int l_b = nzet - 1 ; 
00605     int j_b = mg->get_nt(l_b) - 1 ; 
00606 
00607     bool superlum = false ; 
00608     if (relativistic) {
00609       for (int l=0; l<nzet; l++) {
00610     for (int i=0; i<mg->get_nr(l); i++) {
00611       
00612       double u1 = uuu()(l, 0, j_b, i) ; 
00613       double u2 = uuu2()(l, 0, j_b, i) ;
00614       if ((u1 >= 1.) || (u2>=1.)) {     // superluminal velocity
00615         superlum = true ; 
00616         cout << "U > c  for l, i : " << l << "  " << i 
00617          << "   U1 = " << u1 << endl ;
00618         cout << "   U2 = " << u2 << endl ;
00619       }
00620     }
00621       }
00622       if ( superlum ) {
00623     cout << "**** VELOCITY OF LIGHT REACHED ****" << endl ; 
00624     abort() ;
00625       }
00626     }
00627 
00628 
00629     Tenseur uuu_car = uuu * uuu;
00630     Tenseur uuu2_car = uuu2 * uuu2;
00631 
00632     // Lorentz factors
00633     // --------------
00634     Tenseur gam_car = 1.0 / (1.0 - unsurc2 * uuu_car) ; 
00635     gam_euler = sqrt(gam_car) ; 
00636     gam_euler.set_std_base() ;  // sets the standard spectral bases for a scalar field
00637 
00638     Tenseur gam2_car = 1.0 /(1.0 - unsurc2 * uuu2_car) ;
00639     gam_euler2 = sqrt(gam2_car) ;
00640     gam_euler2.set_std_base() ;
00641 
00642     // Update of "relative velocity" squared: $\Delta^2$
00643     // ---------------------------
00644     delta_car = (uuu - uuu2)*(uuu - uuu2) / ( (1 - unsurc2* uuu*uuu2) *(1 - unsurc2* uuu*uuu2 ) ) ;
00645     delta_car.set_std_base() ;
00646 
00647     // some auxiliary EOS variables
00648     Tenseur Ann(ent) ;
00649     Ann = gam_car()*nbar()*nbar() * eos.get_Knn(nbar(), nbar2(), delta_car(), nzet);
00650     Tenseur Anp(ent) ;
00651     Anp = gam_euler()*gam_euler2()* nbar()*nbar2()* eos.get_Knp(nbar(),nbar2(),delta_car(),nzet);
00652     Tenseur App(ent) ;
00653     App = gam2_car()*nbar2()*nbar2() *eos.get_Kpp(nbar(), nbar2(), delta_car(), nzet);
00654   
00655 
00656     //  Energy density E with respect to the Eulerian observer
00657     //------------------------------------
00658     // use of ener_euler is deprecated, because it's useless in Newtonian limit!
00659     ener_euler.set_etat_nondef(); // make sure, it's not used
00660 
00661     Tenseur E_euler(mp);
00662     E_euler =  Ann + 2*Anp + App - press ;
00663     E_euler.set_std_base() ; 
00664     
00665 
00666     // S^phi_phi component of stress-tensor S^i_j
00667     //------------------------------------
00668     sphph_euler = press() + Ann()*uuu_car() + 2*Anp()*uuu()*uuu2() + App()* uuu2_car();
00669     sphph_euler.set_std_base();
00670 
00671 
00672     // Trace of the stress tensor with respect to the Eulerian observer
00673     //------------------------------------
00674     s_euler = 2*press() + sphph_euler();
00675     s_euler.set_std_base() ; 
00676 
00677     // The combination enerps_euler := (E + S_i^i) which has Newtonian limit -> rho
00678     if (relativistic)
00679       enerps_euler = E_euler + s_euler;
00680     else
00681       enerps_euler = eos.get_m1() * nbar() + eos.get_m2() * nbar2();
00682 
00683 
00684     // the (flat-space) angular-momentum 3-vector j_euler^i
00685     //-----------------------------------
00686     Tenseur Jph(mp);   // the normalized phi-component of J^i: Sqrt[g_phiphi]*J^phi
00687     Jph = Ann*uuu + Anp*(uuu + uuu2) + App*uuu2 ;
00688 
00689     j_euler.set_etat_qcq();
00690 
00691     j_euler.set(0) = 0;     // r tetrad component
00692     j_euler.set(1) = 0;     // theta tetrad component
00693     j_euler.set(2) = Jph()/ bbb(); // phi tetrad component ... = J^phi r sin(th)
00694     j_euler.set_triad (mp.get_bvect_spher());
00695     j_euler.set_std_base();
00696 
00697     // RP: it seems that j_euler _HAS_ to have cartesian triad set on exit from here...!!
00698     j_euler.change_triad( mp.get_bvect_cart() ) ;   // Triad = Cartesian triad
00699 
00700     if( (j_euler(0).get_etat() == ETATZERO)&&(j_euler(1).get_etat() == ETATZERO)&&(j_euler(2).get_etat()==ETATZERO))
00701       j_euler = 0;
00702 
00703     // The derived quantities are obsolete
00704     // -----------------------------------
00705     del_deriv() ;                
00706 
00707 } // hydro_euler()

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