et_rot_extr_curv.C

00001 /*
00002  * Member function of class Etoile_rot to compute the extrinsic curvature
00003  */
00004 
00005 /*
00006  *   Copyright (c) 2000-2001 Eric Gourgoulhon
00007  *
00008  *   This file is part of LORENE.
00009  *
00010  *   LORENE is free software; you can redistribute it and/or modify
00011  *   it under the terms of the GNU General Public License as published by
00012  *   the Free Software Foundation; either version 2 of the License, or
00013  *   (at your option) any later version.
00014  *
00015  *   LORENE is distributed in the hope that it will be useful,
00016  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
00017  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00018  *   GNU General Public License for more details.
00019  *
00020  *   You should have received a copy of the GNU General Public License
00021  *   along with LORENE; if not, write to the Free Software
00022  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00023  *
00024  */
00025 
00026 
00027 char et_rot_extr_curv_C[] = "$Header: /cvsroot/Lorene/C++/Source/Etoile/et_rot_extr_curv.C,v 1.1.1.1 2001/11/20 15:19:28 e_gourgoulhon Exp $" ;
00028 
00029 
00030 /*
00031  * $Id: et_rot_extr_curv.C,v 1.1.1.1 2001/11/20 15:19:28 e_gourgoulhon Exp $
00032  * $Log: et_rot_extr_curv.C,v $
00033  * Revision 1.1.1.1  2001/11/20 15:19:28  e_gourgoulhon
00034  * LORENE
00035  *
00036  * Revision 2.2  2000/11/18  17:14:35  eric
00037  * Traitement du cas np=1 (axisymetrie).
00038  *
00039  * Revision 2.1  2000/10/06  15:07:10  eric
00040  * Traitement des cas ETATZERO.
00041  *
00042  * Revision 2.0  2000/09/18  16:15:45  eric
00043  * *** empty log message ***
00044  *
00045  *
00046  * $Header: /cvsroot/Lorene/C++/Source/Etoile/et_rot_extr_curv.C,v 1.1.1.1 2001/11/20 15:19:28 e_gourgoulhon Exp $
00047  *
00048  */
00049 
00050 // Headers Lorene
00051 #include "etoile.h"
00052 
00053 void Etoile_rot::extrinsic_curvature(){
00054     
00055 
00056     // ---------------------------------------
00057     // Special treatment for axisymmetric case
00058     // ---------------------------------------
00059     
00060     if ( (mp.get_mg())->get_np(0) == 1) {
00061     
00062         tkij.set_etat_zero() ;      // initialisation
00063         
00064         
00065         // Computation of K_xy
00066         // -------------------
00067         
00068         Cmp dnpdr = nphi().dsdr() ;         // d/dr (N^phi)
00069         Cmp dnpdt = nphi().srdsdt() ;       // 1/r d/dtheta (N^phi)
00070         
00071         // What follows is valid only for a mapping of class Map_radial :   
00072         assert( dynamic_cast<const Map_radial*>(&mp) != 0x0 ) ;
00073         
00074         if (dnpdr.get_etat() == ETATQCQ) {
00075             dnpdr.va = (dnpdr.va).mult_st() ;   // multiplication by sin(theta)
00076         }
00077         
00078         if (dnpdt.get_etat() == ETATQCQ) {
00079             dnpdt.va = (dnpdt.va).mult_ct() ;   // multiplication by cos(theta)
00080         }
00081     
00082         Cmp tmp = dnpdr + dnpdt ;
00083     
00084         tmp.mult_rsint() ;          // multiplication by r sin(theta)
00085     
00086         if (tmp.get_etat() != ETATZERO) {
00087             tkij.set_etat_qcq() ;
00088             tkij.set(0,1) = - 0.5 * tmp / nnn() ;   // component (x,y)
00089         }
00090     
00091         // Computation of K_yz
00092         // -------------------
00093     
00094         dnpdr = nphi().dsdr() ;         // d/dr (N^phi)
00095         dnpdt = nphi().srdsdt() ;       // 1/r d/dtheta (N^phi)
00096         
00097         if (dnpdr.get_etat() == ETATQCQ) {
00098             dnpdr.va = (dnpdr.va).mult_ct() ;   // multiplication by cos(theta)
00099         }
00100         
00101         if (dnpdt.get_etat() == ETATQCQ) {
00102             dnpdt.va = (dnpdt.va).mult_st() ;   // multiplication by sin(theta)
00103         }
00104     
00105         tmp = dnpdr - dnpdt ;
00106         
00107         tmp.mult_rsint() ;          // multiplication by r sin(theta)
00108         
00109         if (tmp.get_etat() != ETATZERO) {
00110             if (tkij.get_etat() != ETATQCQ) {
00111                 tkij.set_etat_qcq() ;
00112             }
00113             tkij.set(1,2) = - 0.5 * tmp / nnn() ;   // component (y,z)
00114         }
00115     
00116         // The other components are set to zero
00117         // ------------------------------------
00118         if (tkij.get_etat() == ETATQCQ) {
00119             tkij.set(0,0) = 0 ;         // component (x,x)
00120             tkij.set(0,2) = 0 ;         // component (x,z)
00121             tkij.set(1,1) = 0 ;         // component (y,y)
00122             tkij.set(2,2) = 0 ;         // component (z,z)
00123         }   
00124     
00125     
00126     
00127     }
00128     else {
00129 
00130     // ------------
00131     // General case
00132     // ------------
00133 
00134         // Gradient (Cartesian components) of the shift
00135         // D_j N^i
00136     
00137         Tenseur dn = shift.gradient() ;
00138     
00139         // Trace of D_j N^i = divergence of N^i :
00140         Tenseur divn = contract(dn, 0, 1) ;
00141     
00142         if (divn.get_etat() == ETATQCQ) {
00143     
00144             // Computation of B^{-2} K_{ij}
00145             // ----------------------------
00146             tkij.set_etat_qcq() ;
00147             for (int i=0; i<3; i++) {
00148                 for (int j=i; j<3; j++) {
00149                     tkij.set(i, j) = dn(i, j) + dn(j, i)  ;
00150                 }
00151                 tkij.set(i, i) -= double(2) /double(3) * divn() ;
00152             }
00153     
00154             tkij = - 0.5 * tkij / nnn ;
00155     
00156         }
00157         else{
00158             assert( divn.get_etat() == ETATZERO ) ;
00159             tkij.set_etat_zero() ;
00160         }
00161     }
00162     
00163     // Computation of A^2 K_{ij} K^{ij}
00164     // --------------------------------
00165     
00166     if (tkij.get_etat() == ETATZERO) {
00167         ak_car = 0 ;
00168     }
00169     else {
00170         ak_car.set_etat_qcq() ;
00171     
00172         ak_car.set() = 0 ;
00173     
00174         for (int i=0; i<3; i++) {
00175             for (int j=0; j<3; j++) {
00176     
00177                 ak_car.set() += tkij(i, j) * tkij(i, j) ;
00178     
00179             }
00180         }
00181     
00182         ak_car = b_car * ak_car ;
00183     }
00184     
00185 }
00186 

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