connection.h

00001 /*
00002  *  Definition of Lorene class Connection
00003  *
00004  */
00005 
00006 /*
00007  *   Copyright (c) 2003-2004 Eric Gourgoulhon & Jerome Novak
00008  *
00009  *   This file is part of LORENE.
00010  *
00011  *   LORENE is free software; you can redistribute it and/or modify
00012  *   it under the terms of the GNU General Public License version 2
00013  *   as published by the Free Software Foundation.
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 #ifndef __CONNECTION_H_ 
00027 #define __CONNECTION_H_ 
00028 
00029 /*
00030  * $Id: connection.h,v 1.13 2004/03/22 13:12:40 j_novak Exp $
00031  * $Log: connection.h,v $
00032  * Revision 1.13  2004/03/22 13:12:40  j_novak
00033  * Modification of comments to use doxygen instead of doc++
00034  *
00035  * Revision 1.12  2004/01/04 20:50:24  e_gourgoulhon
00036  * Class Connection: data member delta is now of type Tensor_sym (and no
00037  *  longer of type Tensor_delta).
00038  *
00039  * Revision 1.11  2003/12/30 22:56:40  e_gourgoulhon
00040  * Replaced member flat_conn (flat connection) by flat_met (flat metric)
00041  * Added argument flat_met to the constructors of Connection.
00042  * Suppressed method fait_ricci() (the computation of the Ricci is
00043  * now devoted to the virtual method ricci()).
00044  *
00045  * Revision 1.10  2003/12/27 14:56:20  e_gourgoulhon
00046  * -- Method derive_cov() suppressed.
00047  * -- Change of the position of the derivation index from the first one
00048  *    to the last one in methods p_derive_cov() and p_divergence().
00049  *
00050  * Revision 1.9  2003/10/16 14:21:33  j_novak
00051  * The calculation of the divergence of a Tensor is now possible.
00052  *
00053  * Revision 1.8  2003/10/06 13:58:45  j_novak
00054  * The memory management has been improved.
00055  * Implementation of the covariant derivative with respect to the exact Tensor
00056  * type.
00057  *
00058  * Revision 1.7  2003/10/06 06:52:26  e_gourgoulhon
00059  * Corrected documentation.
00060  *
00061  * Revision 1.6  2003/10/05 21:04:25  e_gourgoulhon
00062  * Improved comments
00063  *
00064  * Revision 1.5  2003/10/03 14:07:23  e_gourgoulhon
00065  * Added derived class Connection_fcart.
00066  *
00067  * Revision 1.4  2003/10/02 21:31:11  e_gourgoulhon
00068  * Added methods fait_delta and update
00069  * flat_conn is now a modifiable pointer.
00070  *
00071  * Revision 1.3  2003/10/02 15:44:23  j_novak
00072  * The destructor is now public...
00073  *
00074  * Revision 1.2  2003/10/01 15:41:49  e_gourgoulhon
00075  * Added mapping
00076  *
00077  * Revision 1.1  2003/09/29 21:14:10  e_gourgoulhon
00078  * First version --- not ready yet.
00079  *
00080  *
00081  *
00082  * $Header: /cvsroot/Lorene/C++/Include/connection.h,v 1.13 2004/03/22 13:12:40 j_novak Exp $
00083  *
00084  */
00085 
00086 
00087 // Lorene headers
00088 #include "tensor.h"
00089 
00090 class Metric ; 
00091 class Metric_flat ; 
00092 
00093                 //--------------------------//
00094                 //     class Connection     // 
00095                 //--------------------------//
00096 
00109 class Connection {
00110 
00111     // Data : 
00112     // -----
00113     protected:
00114 
00115     const Map* const mp ;   
00116 
00120     const Base_vect* const triad ; 
00121     
00137     Tensor_sym delta ; 
00138 
00143     bool assoc_metric ;
00144 
00145 
00146     private:
00147 
00152     const Metric_flat* flat_met ;
00153 
00154 
00155     // Derived data : 
00156     // ------------
00157     protected:
00158 
00160     mutable Tensor* p_ricci ;   
00161 
00162     // Constructors - Destructor
00163     // -------------------------
00164     public:
00165     
00184     Connection(const Tensor_sym& delta_i, const Metric_flat& flat_met_i) ;      
00185     
00193     Connection(const Metric& met, const Metric_flat& flat_met_i) ;      
00194     
00195     Connection(const Connection& ) ;        
00196     
00197     protected:
00198 
00200     Connection(const Map&, const Base_vect& ) ;         
00201 
00202         public:
00203     virtual ~Connection() ;         
00204  
00205 
00206     // Memory management
00207     // -----------------
00208     protected:      
00209 
00211     void del_deriv() const ; 
00212     
00214     void set_der_0x0() const ; 
00215 
00216 
00217     // Mutators / assignment
00218     // ---------------------
00219     public:
00220 
00222     void operator=(const Connection&) ; 
00223     
00235     void update(const Tensor_sym& delta_i) ;        
00236     
00242     void update(const Metric& met) ;
00243     
00244 
00245     // Accessors
00246     // ---------
00247     public:
00249     const Map& get_mp() const {return *mp; } ;  
00250 
00251 
00267     const Tensor_sym& get_delta() const {return delta; } ; 
00268 
00269     // Computational methods
00270     // ---------------------
00271     
00272     public: 
00273 
00298     virtual Tensor* p_derive_cov(const Tensor& tens) const ; 
00299 
00322     virtual Tensor* p_divergence(const Tensor& tens) const ; 
00323 
00327     virtual const Tensor& ricci() const ; 
00328     
00329     private:
00335     void fait_delta(const Metric& ) ;  
00336 
00337 };
00338 
00339 
00340                 //-------------------------------//
00341                 //     class Connection_flat     // 
00342                 //-------------------------------//
00343 
00350 class Connection_flat : public Connection {
00351 
00352   // Constructors - Destructor
00353   // -------------------------
00354  protected:
00355   
00357   Connection_flat(const Map&, const Base_vect&) ; 
00358 
00359  public:
00360 
00361     Connection_flat(const Connection_flat & ) ; 
00362 
00363   virtual ~Connection_flat() ; 
00364 
00365 
00366   // Mutators / assignment
00367   // ---------------------
00368  public:
00369 
00371   void operator=(const Connection_flat&) ;  
00372   
00373 
00374   // Computational methods
00375   // ---------------------
00376   
00377  public: 
00378 
00403         virtual Tensor* p_derive_cov(const Tensor& tens) const = 0 ; 
00404 
00427         virtual Tensor* p_divergence(const Tensor& tens) const = 0 ; 
00428 
00432     virtual const Tensor& ricci() const ; 
00433     
00434 };
00435 
00436 
00437                 //-------------------------------//
00438                 //     class Connection_fspher   // 
00439                 //-------------------------------//
00440 
00448 class Connection_fspher : public Connection_flat {
00449 
00450   // Constructors - Destructor
00451   // -------------------------
00452   
00453  public:
00454 
00456     Connection_fspher(const Map&, const Base_vect_spher&) ; 
00457 
00458     Connection_fspher(const Connection_fspher& ) ;      
00459     
00460  public:
00461 
00462   virtual ~Connection_fspher() ; 
00463 
00464 
00465   // Mutators / assignment
00466   // ---------------------
00467  public:
00468 
00470   void operator=(const Connection_fspher&) ;    
00471   
00472 
00473   // Computational methods
00474   // ---------------------
00475   
00476  public: 
00501     virtual Tensor* p_derive_cov(const Tensor& tens) const ; 
00502 
00525     virtual Tensor* p_divergence(const Tensor& tens) const ; 
00526   
00527 };
00528 
00529 
00530 
00531                 //-------------------------------//
00532                 //     class Connection_fcart    // 
00533                 //-------------------------------//
00534 
00542 class Connection_fcart : public Connection_flat {
00543 
00544   // Constructors - Destructor
00545   // -------------------------
00546   
00547  public:
00548 
00550     Connection_fcart(const Map&, const Base_vect_cart&) ; 
00551 
00552     Connection_fcart(const Connection_fcart& ) ;        
00553     
00554  public:
00555 
00556   virtual ~Connection_fcart() ; 
00557 
00558 
00559   // Mutators / assignment
00560   // ---------------------
00561  public:
00562 
00564   void operator=(const Connection_fcart&) ; 
00565   
00566 
00567   // Computational methods
00568   // ---------------------
00569   
00570  public: 
00595     virtual Tensor* p_derive_cov(const Tensor& tens) const ; 
00596 
00619     virtual Tensor* p_divergence(const Tensor& tens) const ; 
00620 
00621   
00622 };
00623 
00624 
00625 
00626 
00627 #endif

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