metric.h

00001  /*
00002  *  Definition of Lorene class Metric
00003  *
00004  */
00005 
00006 /*
00007  *   Copyright (c) 2003 Eric Gourgoulhon & Jerome Novak
00008  *
00009  *   Copyright (c) 1999-2001 Philippe Grandclement (for previous class Metrique)
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 #ifndef __METRIC_H_ 
00029 #define __METRIC_H_ 
00030 
00031 /*
00032  * $Id: metric.h,v 1.8 2004/11/18 12:23:42 jl_jaramillo Exp $
00033  * $Log: metric.h,v $
00034  * Revision 1.8  2004/11/18 12:23:42  jl_jaramillo
00035  * radial vector normal to a spherical slicing and pointing towards
00036  * spatial infinity
00037  *
00038  * Revision 1.7  2004/03/22 13:12:42  j_novak
00039  * Modification of comments to use doxygen instead of doc++
00040  *
00041  * Revision 1.6  2003/12/30 23:04:58  e_gourgoulhon
00042  * Important reorganization of class Metric:
00043  *  -- suppression of virtual methods fait_* : the actual computations
00044  *     are now performed via the virtual methods con(), cov(), connect(),
00045  *     ricci(), ricci_scal(), determinant()
00046  *  -- the member p_connect is now treated as an ordinary derived data
00047  *     member
00048  *  -- the construction of the associated connection (member p_connect)
00049  *     is performed thanks to the new methods Map::flat_met_spher() and
00050  *     Map::flat_met_cart().
00051  *
00052  * Revision 1.5  2003/11/06 14:43:37  e_gourgoulhon
00053  * Gave a name to const arguments in certain method prototypes (e.g.
00054  * constructors) to correct a bug of DOC++.
00055  *
00056  * Revision 1.4  2003/10/06 15:30:32  j_novak
00057  * Defined methods for flat metric.
00058  *
00059  * Revision 1.3  2003/10/06 13:58:45  j_novak
00060  * The memory management has been improved.
00061  * Implementation of the covariant derivative with respect to the exact Tensor
00062  * type.
00063  *
00064  * Revision 1.2  2003/10/03 11:21:45  j_novak
00065  * More methods for the class Metric
00066  *
00067  * Revision 1.1  2003/10/02 15:45:48  j_novak
00068  * New class Metric
00069  *
00070  *
00071  *
00072  *
00073  * $Header: /cvsroot/Lorene/C++/Include/metric.h,v 1.8 2004/11/18 12:23:42 jl_jaramillo Exp $
00074  *
00075  */
00076 
00077 // Lorene headers
00078 #include "connection.h"
00079 
00080 #define N_TENSOR_DEPEND 200
00081 
00086 class Metric {
00087 
00088     // Data : 
00089     // -----
00090     protected:
00091     const Map* const mp ;   
00092 
00096     mutable Sym_tensor* p_met_cov ;
00097 
00101     mutable Sym_tensor* p_met_con ;
00102 
00103 
00104     // Derived data : 
00105     // ------------
00106     protected:
00107     
00108     mutable Connection* p_connect ; 
00109 
00115     mutable Scalar* p_ricci_scal ;
00116 
00121     mutable Vector* p_radial_vect ;
00122 
00123 
00124     
00128     mutable Scalar* p_determinant ;
00129     
00135     mutable const Tensor* tensor_depend[N_TENSOR_DEPEND] ;
00136     
00137     // Constructors - Destructor
00138     // -------------------------
00139     public:
00145     explicit Metric(const Sym_tensor& tens) ;  
00146          
00147     Metric(const Metric& met) ;     
00148 
00150     Metric(const Map&, FILE* ) ;            
00151 
00152     protected:
00154     explicit Metric(const Map& mpi) ;
00155 
00156     public:
00157     virtual ~Metric() ;         
00158  
00159 
00160     // Memory management
00161     // -----------------
00162     protected:
00164     void del_deriv() const ; 
00165     
00167     void set_der_0x0() const ; 
00168 
00174     void del_tensor_depend() const ;
00175         
00177     void set_tensor_depend_0x0() const ;
00178         
00179 
00180     // Mutators / assignment
00181     // ---------------------
00182     public:
00184     void operator=(const Metric& met) ; 
00185 
00192     virtual void operator=(const Sym_tensor& tens) ;
00193     
00194     // Accessors
00195     // ---------
00196     public:
00198     const Map& get_mp() const {return *mp ; } ;
00199 
00201     virtual const Sym_tensor& cov() const ;
00202 
00204     virtual const Sym_tensor& con() const ;
00205 
00207     virtual const Connection& connect() const ;
00208 
00212     const Sym_tensor& ricci() const ;
00213     
00215     virtual const Scalar& ricci_scal() const ;
00216 
00221     virtual const Vector& radial_vect() const ;
00222 
00223 
00230     virtual const Scalar& determinant() const ;
00231 
00232 
00233 
00234 
00235 
00236     // Outputs
00237     // -------
00238     public:
00239     virtual void sauve(FILE *) const ;      
00240     
00242     friend ostream& operator<<(ostream& , const Metric& ) ; 
00243 
00244     protected:
00246     virtual ostream& operator>>(ostream& ) const ;    
00247 
00248 
00249     friend class Tensor ;
00250 
00251 };
00252 
00257 class Metric_flat: public Metric {
00258 
00259     // Data : 
00260     // -----
00261     protected:
00262     
00266   const Base_vect* triad ; 
00267 
00268     // Constructors - Destructor
00269     // -------------------------
00270     public:
00275     Metric_flat(const Map&, const Base_vect& ) ;   
00276 
00277     Metric_flat(const Metric_flat& ) ;      
00278 
00280     Metric_flat(const Map&, FILE* ) ;           
00281 
00282    public:
00283     virtual ~Metric_flat() ;            
00284  
00285 
00286     // Mutators / assignment
00287     // ---------------------
00288     public:
00290     void operator=(const Metric_flat&) ;    
00291 
00296     virtual void operator=(const Sym_tensor& tens) ;
00297 
00298 
00299     // Accessors
00300     // ---------
00301     public:
00305     const Base_vect* get_triad() const {return triad;} ; 
00306     
00308     virtual const Sym_tensor& cov() const ;
00309 
00311     virtual const Sym_tensor& con() const ;
00312 
00314     virtual const Connection& connect() const ;
00315 
00317     virtual const Scalar& ricci_scal() const ;
00318 
00325     virtual const Scalar& determinant() const ;
00326 
00327 
00328     // Outputs
00329     // -------
00330     public:
00331     virtual void sauve(FILE *) const ;      
00332     
00333     protected:
00335     virtual ostream& operator>>(ostream& ) const ;    
00336 
00337 
00338 };
00339 
00340 
00341 
00342 #endif

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