binary_anashift.C

00001 /*
00002  * Method of class Binary to set some analytical form to the shift vector.
00003  *
00004  * (see file binary.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 binary_anashift_C[] = "$Header: /cvsroot/Lorene/C++/Source/Binary/binary_anashift.C,v 1.8 2005/09/13 19:38:31 f_limousin Exp $" ;
00030 
00031 /*
00032  * $Id: binary_anashift.C,v 1.8 2005/09/13 19:38:31 f_limousin Exp $
00033  * $Log: binary_anashift.C,v $
00034  * Revision 1.8  2005/09/13 19:38:31  f_limousin
00035  * Reintroduction of the resolution of the equations in cartesian coordinates.
00036  *
00037  * Revision 1.7  2005/02/17 17:34:50  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.6  2004/03/25 10:29:01  j_novak
00042  * All LORENE's units are now defined in the namespace Unites (in file unites.h).
00043  *
00044  * Revision 1.5  2004/02/27 10:01:32  f_limousin
00045  * Correct sign of shift_auto to agree with the new convention
00046  * for shift.
00047  *
00048  * Revision 1.4  2004/01/22 10:09:41  f_limousin
00049  * First executable version
00050  *
00051  * Revision 1.3  2004/01/20 15:21:23  f_limousin
00052  * First version
00053  *
00054  *
00055  * $Header: /cvsroot/Lorene/C++/Source/Binary/binary_anashift.C,v 1.8 2005/09/13 19:38:31 f_limousin Exp $
00056  *
00057  */
00058 
00059 // Headers C
00060 #include "math.h"
00061 
00062 // Headers Lorene
00063 #include "binary.h"
00064 #include "tenseur.h"
00065 #include "unites.h"
00066 
00067 void Binary::analytical_shift(){
00068     
00069   using namespace Unites ;
00070         
00071     for (int i=0; i<2; i++) {
00072 
00073     // Radius of the star:
00074     double a0 = et[i]->ray_eq() ; 
00075     
00076     // Mass ratio
00077     double p_mass = et[i]->mass_g() / et[1-i]->mass_g() ; 
00078     
00079     // G M Omega R / (1+p) 
00080     double www = ggrav * et[i]->mass_g() * omega 
00081             * separation() / (1. + p_mass) ;  
00082     
00083     const Map& mp = et[i]->get_mp() ; 
00084     Scalar tmp(mp) ;  
00085     Scalar tmp_ext(mp) ;  
00086     int nzet = et[i]->get_nzet() ; 
00087     int nzm1 = mp.get_mg()->get_nzone() - 1 ; 
00088     
00089     Vector w_beta (mp, CON, mp.get_bvect_cart()) ;
00090     Scalar khi_beta (mp) ;
00091 
00092     // Computation of w_beta 
00093     // ----------------------
00094     // X component
00095     // -----------
00096 
00097     w_beta.set(1) = 0 ; 
00098 
00099     // Y component
00100     // -----------
00101 
00102         // For the incompressible case :
00103     tmp = - 6  * www / a0 * ( 1 - (mp.r)*(mp.r) / (3*a0*a0) ) ; 
00104 
00105     tmp.annule(nzet, nzm1) ; 
00106     tmp_ext = - 4 * www / mp.r ;
00107     tmp_ext.annule(0, nzet-1) ; 
00108     
00109     w_beta.set(2) = tmp + tmp_ext ; 
00110 
00111     // Z component
00112     // -----------
00113     w_beta.set(3) = 0 ; 
00114 
00115     w_beta.std_spectral_base() ; 
00116         
00117     // Computation of khi_beta
00118     // ------------------------
00119 
00120     tmp = 2 * www / a0 * (mp.y) * ( 1 - 3 * (mp.r)*(mp.r) / (5*a0*a0) ) ;
00121     tmp.annule(nzet, nzm1) ; 
00122     tmp_ext = 0.8 * www * a0*a0 * (mp.sint) * (mp.sinp) 
00123                         / (mp.r * mp.r) ;   
00124     tmp_ext.annule(0, nzet-1) ; 
00125 
00126     khi_beta = tmp + tmp_ext ; 
00127 
00128     // Sets the standard spectral bases for a scalar field
00129     khi_beta.std_spectral_base() ;      
00130     
00131 
00132     // Computation of beta auto.
00133     // --------------------------
00134     
00135     Tensor xdw_temp (w_beta.derive_con(et[i]->get_flat())) ;
00136 
00137     Tenseur x_d_w_temp (et[i]->get_mp(),2,CON,et[i]->get_mp().get_bvect_cart()) ;
00138     x_d_w_temp.set_etat_qcq() ;
00139     for (int j=0; j<3; j++) 
00140       for (int k=0; k<3; k++) 
00141         x_d_w_temp.set(j,k) = xdw_temp(k+1, j+1) ;
00142 
00143     Tenseur x_d_w = skxk (x_d_w_temp) ;
00144     x_d_w.dec_dzpuis() ;
00145 
00146     Vector xdw (et[i]->get_mp(), CON, et[i]->get_mp().get_bvect_cart()) ;
00147     for (int j=0; j<3; j++) 
00148       xdw.set(j+1) = x_d_w(j) ;
00149 
00150     // See Eq (92) from Gourgoulhon et al.(2001) and with the new 
00151     // convention for shift = - N^i
00152     
00153     Vector d_khi = khi_beta.derive_con(et[i]->get_flat()) ;
00154     d_khi.dec_dzpuis(2) ;
00155     
00156     et[i]->set_beta_auto() = - 7./8. * w_beta + 1./8. * 
00157       (d_khi + xdw)  ;
00158 
00159     et[i]->set_beta_auto().std_spectral_base() ;
00160 
00161     }
00162 
00163 }

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