star_rot_upmetr.C

00001 /*
00002  * Methods Star_rot::update_metric and Star_rot::extrinsic_curvature
00003  *
00004  * (see file star_rot.h for documentation)
00005  *
00006  */
00007 
00008 /*
00009  *   Copyright (c) 2010 Eric Gourgoulhon
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 star_rot_upmetr_C[] = "$Header: /cvsroot/Lorene/C++/Source/Star/star_rot_upmetr.C,v 1.1 2010/01/25 18:15:52 e_gourgoulhon Exp $" ;
00031 
00032 /*
00033  * $Id: star_rot_upmetr.C,v 1.1 2010/01/25 18:15:52 e_gourgoulhon Exp $
00034  * $Log: star_rot_upmetr.C,v $
00035  * Revision 1.1  2010/01/25 18:15:52  e_gourgoulhon
00036  * First version.
00037  *
00038  *
00039  * $Header: /cvsroot/Lorene/C++/Source/Star/star_rot_upmetr.C,v 1.1 2010/01/25 18:15:52 e_gourgoulhon Exp $
00040  *
00041  */
00042 
00043 // Headers Lorene
00044 #include "star_rot.h"
00045 
00046 
00047 void Star_rot::update_metric() {
00048  
00049     // Lapse function N
00050     // ----------------
00051     
00052     nn = exp( unsurc2 * logn ) ; 
00053 
00054     nn.std_spectral_base() ;   // set the bases for spectral expansions
00055     
00056     
00057     // Metric factor A^2
00058     // -----------------
00059     
00060     a_car = exp( 2*unsurc2*( dzeta - logn ) ) ; 
00061 
00062     a_car.std_spectral_base() ;   // set the bases for spectral expansions
00063 
00064     // Metric factor B
00065     // ---------------
00066     
00067     Scalar tmp = tggg ; 
00068     tmp.div_rsint() ;           //... Division of tG by r sin(theta)
00069 
00070     bbb = (1 + tmp) / nn ; 
00071 
00072     bbb.std_spectral_base() ;   // set the bases for spectral expansions
00073         
00074     b_car = bbb * bbb ; 
00075     
00076     // Full 3-metric
00077     // -------------
00078 
00079     Sym_tensor gam(mp, COV, mp.get_bvect_spher()) ; 
00080     gam.set(1,1) = a_car ; 
00081     gam.set(1,2) = 0 ; 
00082     gam.set(1,3) = 0 ; 
00083     gam.set(2,2) = a_car ; 
00084     gam.set(2,3) = 0 ; 
00085     gam.set(3,3) = b_car ;
00086 
00087     gamma = gam ;
00088 
00089     // Tensor B^{-2} K_{ij} and Scalar A^2 K_{ij} K^{ij}
00090     // -------------------------------------------------
00091     
00092     extrinsic_curvature() ; 
00093     
00094   
00095     // The derived quantities are no longer up to date : 
00096     // -----------------------------------------------
00097 
00098     del_deriv() ;  
00099 
00100 }
00101 
00102 
00103 /*************************************************************************************/
00104 
00105 
00106 void Star_rot::extrinsic_curvature(){
00107     
00108 
00109     // ---------------------------------------
00110     // Special treatment for axisymmetric case
00111     // ---------------------------------------
00112     
00113     if ( (mp.get_mg())->get_np(0) == 1) {
00114     
00115         tkij.set_etat_zero() ;      // initialisation
00116                 
00117         // Computation of K_xy
00118         // -------------------
00119         
00120         Scalar dnpdr = nphi.dsdr() ;        // d/dr (N^phi)
00121         Scalar dnpdt = nphi.srdsdt() ;      // 1/r d/dtheta (N^phi)
00122         
00123         // What follows is valid only for a mapping of class Map_radial :   
00124         assert( dynamic_cast<const Map_radial*>(&mp) != 0x0 ) ;
00125         
00126         if (dnpdr.get_etat() == ETATQCQ) {
00127             // multiplication by sin(theta)
00128             dnpdr.set_spectral_va() = (dnpdr.get_spectral_va()).mult_st() ; 
00129         }
00130         
00131         if (dnpdt.get_etat() == ETATQCQ) {
00132             // multiplication by cos(theta)
00133             dnpdt.set_spectral_va() = (dnpdt.get_spectral_va()).mult_ct() ; 
00134         }
00135     
00136         Scalar tmp = dnpdr + dnpdt ;
00137     
00138         tmp.mult_rsint() ;  // multiplication by r sin(theta)
00139     
00140         tkij.set(1,2) = - 0.5 * tmp / nn ;  // component (x,y)
00141     
00142     
00143         // Computation of K_yz
00144         // -------------------
00145     
00146         dnpdr = nphi.dsdr() ;       // d/dr (N^phi)
00147         dnpdt = nphi.srdsdt() ;         // 1/r d/dtheta (N^phi)
00148         
00149         if (dnpdr.get_etat() == ETATQCQ) {
00150             // multiplication by cos(theta)
00151             dnpdr.set_spectral_va() = (dnpdr.get_spectral_va()).mult_ct() ; 
00152         }
00153         
00154         if (dnpdt.get_etat() == ETATQCQ) {
00155             // multiplication by sin(theta)
00156             dnpdt.set_spectral_va() = (dnpdt.get_spectral_va()).mult_st() ; 
00157         }
00158     
00159         tmp = dnpdr - dnpdt ;
00160         
00161         tmp.mult_rsint() ;  // multiplication by r sin(theta)
00162         
00163         tkij.set(2,3) = - 0.5 * tmp / nn ;  // component (y,z)
00164     
00165         // The other components are set to zero
00166         // ------------------------------------
00167         tkij.set(1,1) = 0 ; // component (x,x)
00168         tkij.set(1,3) = 0 ;     // component (x,z)
00169         tkij.set(2,2) = 0 ;     // component (y,y)
00170         tkij.set(3,3) = 0 ;     // component (z,z)
00171     
00172     }
00173     else {
00174 
00175     // ------------
00176     // General case
00177     // ------------
00178 
00179         // Gradient (Cartesian components) of the shift
00180         // D_j N^i
00181     
00182         Tensor dn = - beta.derive_cov( mp.flat_met_cart() ) ;
00183     
00184         // Trace of D_j N^i = divergence of N^i :
00185         Scalar divn = contract(dn, 0, 1) ;
00186     
00187         if (divn.get_etat() == ETATQCQ) {
00188     
00189         // Computation of B^{-2} K_{ij}
00190         // ----------------------------
00191         tkij.set_etat_qcq() ;
00192         for (int i=1; i<=3; i++) {
00193             for (int j=i; j<=3; j++) {
00194               tkij.set(i, j) = dn(i, j) + dn(j, i)  ;
00195             }
00196             tkij.set(i, i) -= double(2) /double(3) * divn ;
00197         }
00198     
00199         tkij = - 0.5 * tkij / nn ;
00200     
00201         }
00202         else{
00203         assert( divn.get_etat() == ETATZERO ) ;
00204         tkij.set_etat_zero() ;
00205         }
00206    }
00207     
00208     // Computation of A^2 K_{ij} K^{ij}
00209     // --------------------------------
00210         
00211     ak_car = 0 ;
00212     
00213     for (int i=1; i<=3; i++) {
00214     for (int j=1; j<=3; j++) {
00215     
00216         ak_car += tkij(i, j) * tkij(i, j) ;
00217     
00218     }
00219     }
00220     
00221     ak_car = b_car * ak_car ;
00222     
00223 }
00224 

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