binaire_ana_shift.C

00001 /*
00002  * Method of class Binaire to set some analytical form to the shift vector.
00003  *
00004  * (see file binaire.h for documentation).
00005  */
00006 
00007 /*
00008  *   Copyright (c) 2000-2001 Eric Gourgoulhon
00009  *   Copyright (c) 2000-2001 Keisuke Taniguchi
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 binaire_ana_shift_C[] = "$Header: /cvsroot/Lorene/C++/Source/Binaire/binaire_ana_shift.C,v 1.2 2004/03/25 10:28:59 j_novak Exp $" ;
00031 
00032 /*
00033  * $Id: binaire_ana_shift.C,v 1.2 2004/03/25 10:28:59 j_novak Exp $
00034  * $Log: binaire_ana_shift.C,v $
00035  * Revision 1.2  2004/03/25 10:28:59  j_novak
00036  * All LORENE's units are now defined in the namespace Unites (in file unites.h).
00037  *
00038  * Revision 1.1.1.1  2001/11/20 15:19:30  e_gourgoulhon
00039  * LORENE
00040  *
00041  * Revision 2.3  2000/03/17  15:36:26  eric
00042  * Suppression de l'appel a analytical_omega().
00043  *
00044  * Revision 2.2  2000/03/17  15:27:11  eric
00045  * Appel de la fonction analytical_omega() pour fixer la valeur de omega.
00046  *
00047  * Revision 2.1  2000/03/16  09:37:28  eric
00048  * Utilisation du cas incompressible plutot que n=1.
00049  *
00050  * Revision 2.0  2000/03/15  16:43:35  eric
00051  * *** empty log message ***
00052  *
00053  *
00054  * $Header: /cvsroot/Lorene/C++/Source/Binaire/binaire_ana_shift.C,v 1.2 2004/03/25 10:28:59 j_novak Exp $
00055  *
00056  */
00057 
00058 // Headers C
00059 #include "math.h"
00060 
00061 // Headers Lorene
00062 #include "binaire.h"
00063 #include "unites.h"
00064 
00065 void Binaire::analytical_shift(){
00066     
00067     // Does nothing for a Newtonian star
00068     // ---------------------------------
00069     if ( !star1.is_relativistic() ){
00070     assert( !star2.is_relativistic() ) ; 
00071     return ; 
00072     }
00073 
00074 
00075     using namespace Unites ;
00076         
00077     for (int i=0; i<2; i++) {
00078 
00079     // Radius of the star:
00080     double a0 = et[i]->ray_eq() ; 
00081     
00082     // Mass ratio
00083     double p_mass = et[i]->mass_g() / et[1-i]->mass_g() ; 
00084     
00085     // G M Omega R / (1+p) 
00086     double www = ggrav * et[i]->mass_g() * omega 
00087             * separation() / (1. + p_mass) ;  
00088     
00089     const Map& mp = et[i]->get_mp() ; 
00090     Cmp tmp(mp) ;  
00091     Cmp tmp_ext(mp) ;  
00092     int nzet = et[i]->get_nzet() ; 
00093     int nzm1 = mp.get_mg()->get_nzone() - 1 ; 
00094     
00095     // Computation of w_shift 
00096     // ----------------------
00097     et[i]->set_w_shift().set_etat_qcq() ; 
00098 
00099     // X component
00100     // -----------
00101     et[i]->set_w_shift().set(0) = 0 ; 
00102 
00103     // Y component
00104     // -----------
00105 
00106 // For the incompressible case :
00107     tmp = - 6  * www / a0 * ( 1 - (mp.r)*(mp.r) / (3*a0*a0) ) ; 
00108 
00109 // For the compressible (n=1) case : 
00110 //  Mtbl xi = M_PI * mp.r / a0 ; 
00111 //  Mtbl sinc = sin(xi) / xi ;  
00112 //   The value of sinc is set to 1 at the origin
00113 //  for (int k=0; k<mp.get_mg()->get_np(0); k++) {
00114 //      for (int j=0; j<mp.get_mg()->get_nt(0); j++) {
00115 //      sinc.set(0, k, j, 0) = 1 ; 
00116 //      }
00117 //  }
00118 //  tmp = - 4 * www / a0 * ( 1 + sinc ) ; 
00119 
00120     tmp.annule(nzet, nzm1) ; 
00121     tmp_ext = - 4 * www / mp.r ;
00122     tmp_ext.annule(0, nzet-1) ; 
00123     
00124     et[i]->set_w_shift().set(1) = tmp + tmp_ext ; 
00125 
00126     // Z component
00127     // -----------
00128     et[i]->set_w_shift().set(2) = 0 ; 
00129 
00130     // Sets the standard spectral bases for Cartesian components
00131     et[i]->set_w_shift().set_std_base() ; 
00132         
00133     // Computation of khi_shift
00134     // ------------------------
00135 
00136     tmp = 2 * www / a0 * (mp.y) * ( 1 - 3 * (mp.r)*(mp.r) / (5*a0*a0) ) ;
00137     tmp.annule(nzet, nzm1) ; 
00138     tmp_ext = 0.8 * www * a0*a0 * (mp.sint) * (mp.sinp) 
00139                         / (mp.r * mp.r) ;   
00140     tmp_ext.annule(0, nzet-1) ; 
00141 
00142     et[i]->set_khi_shift() = tmp + tmp_ext ; 
00143 
00144     // Sets the standard spectral bases for a scalar field
00145     et[i]->set_khi_shift().set_std_base() ;         
00146     
00147     }
00148     
00149 }

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