time_slice_access.C

00001 /*
00002  *  Methods of class Time_slice to access the various fields
00003  *
00004  *    (see file time_slice.h for documentation).
00005  *
00006  */
00007 
00008 /*
00009  *   Copyright (c) 2004 Eric Gourgoulhon, Jose Luis Jaramillo & 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 version 2
00015  *   as published by the Free Software Foundation.
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 char time_slice_access_C[] = "$Header: /cvsroot/Lorene/C++/Source/Time_slice/time_slice_access.C,v 1.7 2008/12/02 15:02:22 j_novak Exp $" ;
00029 
00030 /*
00031  * $Id: time_slice_access.C,v 1.7 2008/12/02 15:02:22 j_novak Exp $
00032  * $Log: time_slice_access.C,v $
00033  * Revision 1.7  2008/12/02 15:02:22  j_novak
00034  * Implementation of the new constrained formalism, following Cordero et al. 2009
00035  * paper. The evolution eqs. are solved as a first-order system. Not tested yet!
00036  *
00037  * Revision 1.6  2004/05/12 15:24:20  e_gourgoulhon
00038  * Reorganized the #include 's, taking into account that
00039  * time_slice.h contains now an #include "metric.h".
00040  *
00041  * Revision 1.5  2004/04/05 11:52:36  j_novak
00042  * First operational (but not tested!) version of checks of Eintein equation.
00043  *
00044  * Revision 1.4  2004/04/01 16:09:02  j_novak
00045  * Trace of K_ij is now member of Time_slice (it was member of Time_slice_conf).
00046  * Added new methods for checking 3+1 Einstein equations (preliminary).
00047  *
00048  * Revision 1.3  2004/03/29 12:00:16  e_gourgoulhon
00049  * Computation of extrinsic curvature now performed via new methods
00050  *  Vector::ope_killing.
00051  *
00052  * Revision 1.2  2004/03/28 21:29:45  e_gourgoulhon
00053  * Evolution_std's renamed with suffix "_evol"
00054  * Method gam() modified
00055  * Added special constructor for derived classes.
00056  *
00057  * Revision 1.1  2004/03/26 13:33:02  j_novak
00058  * New methods for accessing/updating members (nn(), beta(), gam_uu(), k_uu(), ...)
00059  *
00060  *
00061  *
00062  * $Header: /cvsroot/Lorene/C++/Source/Time_slice/time_slice_access.C,v 1.7 2008/12/02 15:02:22 j_novak Exp $
00063  *
00064  */
00065 
00066 // C headers
00067 #include <assert.h>
00068 
00069 // Lorene headers
00070 #include "time_slice.h"
00071 
00072 const Scalar& Time_slice::nn() const {
00073 
00074     assert( n_evol.is_known(jtime) ) ; 
00075     return n_evol[jtime] ; 
00076 
00077 }
00078 
00079 
00080 const Vector& Time_slice::beta() const {
00081 
00082     assert( beta_evol.is_known(jtime) ) ; 
00083     return beta_evol[jtime] ; 
00084 
00085 
00086 }
00087 
00088 const Metric& Time_slice::gam() const {
00089 
00090     if (p_gamma == 0x0) {
00091         gam_dd() ; // may force the computation of p_gamma
00092         if (p_gamma == 0x0) p_gamma = new Metric( gam_dd() ) ; 
00093     }
00094     
00095     return *p_gamma ; 
00096 
00097 }
00098 
00099 
00100 const Sym_tensor& Time_slice::gam_dd() const {
00101 
00102     if (!( gam_dd_evol.is_known(jtime)) ) {
00103         assert( gam_uu_evol.is_known(jtime) ) ; 
00104         if (p_gamma == 0x0) {
00105             p_gamma = new Metric( gam_uu_evol[jtime] ) ; 
00106         }
00107         
00108         gam_dd_evol.update(p_gamma->cov(), jtime, the_time[jtime] ) ; 
00109     }
00110 
00111     return gam_dd_evol[jtime] ;
00112 
00113 }
00114 
00115 const Sym_tensor& Time_slice::gam_uu() const {
00116 
00117     if (!( gam_uu_evol.is_known(jtime)) ) {
00118       assert( gam_dd_evol.is_known(jtime) ) ; 
00119       gam_uu_evol.update(gam().con(), jtime, the_time[jtime] ) ; 
00120     }
00121 
00122     return gam_uu_evol[jtime] ;
00123 
00124 }
00125 
00126 
00127 
00128 const Sym_tensor& Time_slice::k_dd() const {
00129 
00130     if ( ! (k_dd_evol.is_known(jtime)) ) {
00131        
00132       Vector beta_d = beta().down(0, gam()) ;
00133 
00134       gam_dd() ; // to make sure that gam_dd is up to date before taking its
00135                  // time derivative
00136       
00137       Sym_tensor resu = beta_d.ope_killing(gam()) 
00138                         - gam_dd_evol.time_derive(jtime, scheme_order) ; 
00139             
00140       resu = resu / (2*nn()) ;
00141 
00142       k_dd_evol.update(resu, jtime, the_time[jtime]) ;
00143         
00144     }
00145 
00146     return k_dd_evol[jtime] ;
00147 
00148 }
00149 
00150 const Sym_tensor& Time_slice::k_uu() const {
00151 
00152     if ( ! (k_uu_evol.is_known(jtime)) ) {
00153        
00154       gam_uu() ; // to make sure that gam_uu is up to date before taking its
00155                  // time derivative
00156       
00157       Sym_tensor resu =  beta().ope_killing(gam())
00158                         + gam_uu_evol.time_derive(jtime, scheme_order) ;
00159             
00160       resu = resu / (2*nn()) ;
00161       
00162       k_uu_evol.update(resu, jtime, the_time[jtime]) ;
00163         
00164     }
00165 
00166     return k_uu_evol[jtime] ;
00167 
00168 }
00169 
00170 const Scalar& Time_slice::trk() const {
00171 
00172   if ( ! (trk_evol.is_known(jtime)) ) {
00173 
00174     if ( k_uu_evol.is_known(jtime) )
00175       trk_evol.update( k_uu().trace(gam()), jtime, the_time[jtime] ) ;
00176     else 
00177       trk_evol.update( k_dd().trace(gam()), jtime, the_time[jtime] ) ;
00178 
00179   }
00180 
00181   return trk_evol[jtime] ; 
00182 
00183 }
00184 
00185 
00186 
00187 
00188 
00189 
00190 
00191 
00192 
00193 

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