tenseur.h

00001 /*
00002  *  Definition of Lorene classes Tenseur
00003  *               Tenseur_sym
00004  *
00005  */
00006 
00007 /*
00008  *   Copyright (c) 1999-2001 Philippe Grandclement
00009  *   Copyright (c) 2000-2001 Eric Gourgoulhon
00010  *   Copyright (c) 2002 Jerome Novak
00011  *
00012  *   This file is part of LORENE.
00013  *
00014  *   LORENE is free software; you can redistribute it and/or modify
00015  *   it under the terms of the GNU General Public License as published by
00016  *   the Free Software Foundation; either version 2 of the License, or
00017  *   (at your option) any later version.
00018  *
00019  *   LORENE is distributed in the hope that it will be useful,
00020  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
00021  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00022  *   GNU General Public License for more details.
00023  *
00024  *   You should have received a copy of the GNU General Public License
00025  *   along with LORENE; if not, write to the Free Software
00026  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00027  *
00028  */
00029 
00030 
00031 #ifndef __TENSEUR_H_
00032 #define __TENSEUR_H_
00033 
00034 
00035 /*
00036  * $Id: tenseur.h,v 1.17 2010/02/02 13:34:12 e_gourgoulhon Exp $
00037  * $Log: tenseur.h,v $
00038  * Revision 1.17  2010/02/02 13:34:12  e_gourgoulhon
00039  * Marked DEPRECATED (in the documentation).
00040  *
00041  * Revision 1.16  2005/08/30 08:35:10  p_grandclement
00042  * Addition of the Tau version of the vectorial Poisson equation for the Tensors
00043  *
00044  * Revision 1.15  2004/12/29 16:24:03  k_taniguchi
00045  * Addition of the method for vectorial Poisson equations with a multipole
00046  * falloff condition at the outer boundary.
00047  *
00048  * Revision 1.14  2004/12/22 18:25:12  k_taniguchi
00049  * Change an argument of poisson_vect_falloff
00050  *
00051  * Revision 1.13  2004/11/30 20:43:32  k_taniguchi
00052  * Addition of the method for vectorial Poisson equations with falloff
00053  * condition at the outer boundary.
00054  *
00055  * Revision 1.12  2004/03/22 13:12:43  j_novak
00056  * Modification of comments to use doxygen instead of doc++
00057  *
00058  * Revision 1.11  2003/11/06 12:17:31  r_prix
00059  * fixed mini-bug in documentation: without explicit argument in function-prototype,
00060  * doc++ seemed to merge docu of Tensor::operator=(Cmp&) and operator=(Tenseur&)
00061  *
00062  * Revision 1.10  2003/06/20 14:23:38  f_limousin
00063  * Add the functions compare().
00064  *
00065  * Revision 1.9  2002/10/16 14:36:29  j_novak
00066  * Reorganization of #include instructions of standard C++, in order to
00067  * use experimental version 3 of gcc.
00068  *
00069  * Revision 1.8  2002/09/19 14:12:37  e_gourgoulhon
00070  * Modif documentation for LaTeX compliance.
00071  *
00072  * Revision 1.7  2002/09/10 13:44:17  j_novak
00073  * The method "manipule" of one indice has been removed for Tenseur_sym objects
00074  * (the result cannot be a Tenseur_sym).
00075  * The method "sans_trace" now computes the traceless part of a Tenseur (or
00076  * Tenseur_sym) of valence 2.
00077  *
00078  * Revision 1.6  2002/09/06 14:49:25  j_novak
00079  * Added method lie_derive for Tenseur and Tenseur_sym.
00080  * Corrected various errors for derive_cov and arithmetic.
00081  *
00082  * Revision 1.5  2002/08/14 13:46:14  j_novak
00083  * Derived quantities of a Tenseur can now depend on several Metrique's
00084  *
00085  * Revision 1.4  2002/08/08 15:10:44  j_novak
00086  * The flag "plat" has been added to the class Metrique to show flat metrics.
00087  *
00088  * Revision 1.3  2002/08/07 16:14:11  j_novak
00089  * class Tenseur can now also handle tensor densities, this should be transparent to older codes
00090  *
00091  * Revision 1.2  2002/06/17 14:05:17  j_novak
00092  * friend functions are now also declared outside the class definition
00093  *
00094  * Revision 1.1.1.1  2001/11/20 15:19:27  e_gourgoulhon
00095  * LORENE
00096  *
00097  * Revision 2.46  2001/08/27  10:03:56  eric
00098  * Ajout de l'operator% (produit tensoriel avec desaliasing)
00099  *
00100  * Revision 2.45  2001/06/19  15:38:00  eric
00101  * Modif commentaires: mise en conformite Doc++ 3.4.8.
00102  *
00103  * Revision 2.44  2001/06/18  13:56:07  novak
00104  * Ajout de la fonction abs()
00105  *
00106  * Revision 2.43  2001/05/29 16:10:43  eric
00107  * Modif commentaires (mise en conformite Doc++ 3.4.7).
00108  *
00109  * Revision 2.42  2001/05/26  15:48:17  eric
00110  * *** empty log message ***
00111  *
00112  * Revision 2.41  2001/05/26  15:42:54  eric
00113  * Ajout de la fonction flat_scalar_prod_desal (desaliasage)
00114  *
00115  * Revision 2.40  2000/10/19  10:37:51  phil
00116  * *** empty log message ***
00117  *
00118  * Revision 2.39  2000/10/19  09:47:15  phil
00119  * *** empty log message ***
00120  *
00121  * Revision 2.38  2000/10/19  09:41:48  phil
00122  * ajout de inverse_poisson_vect
00123  *
00124  * Revision 2.37  2000/10/06  12:37:09  keisuke
00125  * Add a vectorial Poisson equation Tenseur::poisson_vect_regu.
00126  *
00127  * Revision 2.36  2000/09/27  08:52:34  eric
00128  * Modif commentaires.
00129  *
00130  * Revision 2.35  2000/09/13  12:21:36  eric
00131  * Modif commentaires.
00132  *
00133  * Revision 2.34  2000/09/13  12:11:26  eric
00134  * Ajout de la fonction allocate_all().
00135  *
00136  * Revision 2.33  2000/05/22  14:39:11  phil
00137  * ajout de inc_dzpuis et dec_dzpuis
00138  *
00139  * Revision 2.32  2000/04/03  15:18:54  phil
00140  * suppression de poisson_vect_dirichlet
00141  *
00142  * Revision 2.31  2000/03/31  13:29:43  phil
00143  * poisson_vect_neumann devient poisson_vect_dirichlet
00144  *
00145  * Revision 2.30  2000/03/30  16:10:46  phil
00146  * *** empty log message ***
00147  *
00148  * Revision 2.29  2000/02/18  10:45:05  eric
00149  * Modif commentaires.
00150  *
00151  * Revision 2.28  2000/02/11  19:11:55  phil
00152  * commentaires
00153  *
00154  * Revision 2.27  2000/02/10  16:26:48  eric
00155  * Modif commentaires.
00156  *
00157  * Revision 2.26  2000/02/10  16:10:49  eric
00158  * Ajout de la fonction change_triad.
00159  *
00160  * Revision 2.25  2000/02/09  19:29:25  eric
00161  * MODIF IMPORTANTE: la triade de decomposition est desormais passee en
00162  * argument des constructeurs.
00163  *
00164  * Revision 2.24  2000/02/09  09:53:56  phil
00165  * ajout de poisson_vect_oohara
00166  * ,
00167  *
00168  * Revision 2.23  2000/02/08  19:04:25  eric
00169  * Les fonctions arithmetiques ne sont plus amies.
00170  * Ajout de nouvelles fonctions arithmetiques.
00171  *
00172  * Revision 2.22  2000/02/01  15:40:19  eric
00173  * Ajout de la fonction sqrt
00174  *
00175  * Revision 2.21  2000/02/01  14:13:56  eric
00176  * Modif commentaires.
00177  * Ajout de la fonction amie flat_scalar_prod.
00178  *
00179  * Revision 2.20  2000/01/21  12:48:55  phil
00180  * changement prototypage de Tenseur::poisson_vect
00181  *
00182  * Revision 2.19  2000/01/20  16:02:20  eric
00183  * Ajout des operator=(double ) et operator=(int ).
00184  *
00185  * Revision 2.18  2000/01/20  14:52:08  phil
00186  * *** empty log message ***
00187  *
00188  * Revision 2.17  2000/01/20  14:50:56  phil
00189  * *** empty log message ***
00190  *
00191  * Revision 2.16  2000/01/20  14:39:31  phil
00192  * *** empty log message ***
00193  *
00194  * Revision 2.15  2000/01/20  13:10:56  phil
00195  * Ajout de Tenseur::poisson_vect (double)
00196  *
00197  * Revision 2.14  2000/01/20  11:20:17  phil
00198  * changement prototypage
00199  *
00200  * Revision 2.13  2000/01/20  10:31:30  phil
00201  * ajout de xksk
00202  *
00203  * Revision 2.12  2000/01/14  14:17:47  eric
00204  * Modif commentaires.
00205  *
00206  * Revision 2.11  2000/01/14  14:04:07  eric
00207  * Ajout de la fonction annule.
00208  * classe Tenseur: constructeurs pour les classes derivees et fonctions
00209  *  de gestion memoire (del_t(), ...) declarees protected et non plus
00210  *  private.
00211  *
00212  * Revision 2.10  2000/01/13  14:15:30  eric
00213  * Modif commentaires.
00214  *
00215  * Revision 2.9  2000/01/13  14:10:18  eric
00216  * Ajout du constructeur par copie d'un Cmp (pour un scalaire)
00217  * ainsi que l'affectation a un Cmp.
00218  *
00219  * Revision 2.8  2000/01/13  13:45:56  eric
00220  * Ajout du membre p_gradient_spher et des fonctions fait_gradient_spher(),
00221  *  gradient_spher() pour le calcul du gradient d'un scalaire en
00222  *  coordonnees spheriques sur la triade spherique associee.
00223  *
00224  * Revision 2.7  2000/01/12  13:17:49  eric
00225  * Les operator::(...) renvoie desormais une reference const sur le c[...]
00226  * correspondant et non plus un Cmp copie de c[...].
00227  * (ceci grace a Map::cmp_zero()).
00228  *
00229  * Revision 2.6  2000/01/11  11:13:16  eric
00230  * Changement de nom pour la base vectorielle : base --> triad
00231  *
00232  * Revision 2.5  2000/01/10  17:22:26  eric
00233  *  Modif des #include
00234  *
00235  * Revision 2.4  2000/01/10  15:14:58  eric
00236  * Ajout du membre base (base vectorielle sur laquelle sont definies
00237  *   les composantes).
00238  *
00239  * Revision 2.3  1999/12/09  12:39:39  phil
00240  * changement prototypage des derivees
00241  *
00242  * Revision 2.2  1999/12/07  15:24:17  phil
00243  * ajout include
00244  *
00245  * Revision 2.1  1999/12/03  09:37:11  phil
00246  * *** empty log message ***
00247  *
00248  * Revision 2.0  1999/12/02  17:15:32  phil
00249  * *** empty log message ***
00250  *
00251  * Revision 1.1  1999/12/02  17:13:29  phil
00252  * Initial revision
00253  *
00254  *
00255  * $Header: /cvsroot/Lorene/C++/Include/tenseur.h,v 1.17 2010/02/02 13:34:12 e_gourgoulhon Exp $
00256  *
00257  */
00258 
00259 #define COV -1
00260 #define CON +1
00261 
00262 #define N_MET_MAX 5
00263 
00264 // Headers Lorene 
00265 #include "cmp.h"
00266 #include "itbl.h"
00267 #include "base_vect.h"
00268 
00269 class Metrique ;
00270 class Tenseur_sym ;
00271 
00272             //---------------------------------//
00273             //  class Tenseur          //
00274             //---------------------------------//
00275             
00276 
00294 class Tenseur { 
00295 
00296     // Data : 
00297     // -----
00298     protected:
00299     const Map* const mp ;   
00300     int valence ;       
00301     
00305     const Base_vect* triad ; 
00306 
00311     Itbl type_indice ;  
00312     
00313     int n_comp ;    
00314     int etat ;  
00315     Cmp** c ;   
00316     double poids ; 
00317 
00318     const Metrique* metric ;      
00319     
00320     // Derived data : 
00321     // ------------
00322     protected:
00330     const Metrique** met_depend ;
00331     
00336     mutable Tenseur* p_gradient ;
00337     
00343     mutable Tenseur* p_gradient_spher ;
00344     
00351     Tenseur** p_derive_cov ;
00352 
00358     Tenseur** p_derive_con ;
00359 
00365     Tenseur** p_carre_scal ;
00366    
00367     // Constructors - Destructor :
00368     // -------------------------
00369     protected:
00371     bool verif() const ; 
00372         
00378     void new_der_met() ;
00379     
00380     public:
00381     explicit Tenseur (const Map& map, const Metrique* met = 0x0, 
00382              double weight = 0) ; 
00383 
00385     explicit Tenseur (const Cmp& cmp, const Metrique* met = 0x0, 
00386              double weight = 0) ; 
00387 
00405     Tenseur (const Map& map, int val, const Itbl& tipe, 
00406          const Base_vect& triad_i, const Metrique* met = 0x0, 
00407              double weight = 0) ;
00408 
00427     Tenseur (const Map& map, int val, const Itbl& tipe, 
00428          const Base_vect* triad_i, const Metrique* met = 0x0, 
00429              double weight = 0) ;
00430 
00443     Tenseur (const Map& map, int val, int tipe, const 
00444          Base_vect& triad_i, const Metrique* met = 0x0, 
00445              double weight = 0) ;
00446 
00447     Tenseur (const Tenseur&) ;  
00448 
00450     explicit Tenseur (const Tenseur_sym&) ;
00451     
00464     Tenseur (const Map& map, const Base_vect& triad_i, FILE* fich, 
00465          const Metrique* met = 0x0) ;
00466 
00476     Tenseur (const Map& map, FILE* fich, const Metrique* met = 0x0) ;
00477 
00478     
00479     protected:
00499     Tenseur (const Map& map, int val, const Itbl& tipe, int n_comp,
00500          const Base_vect& triad_i, const Metrique* met = 0x0, 
00501              double weight = 0) ;
00502 
00517     Tenseur (const Map&, int val, int tipe, int n_comp, 
00518          const Base_vect& triad_i, const Metrique* met = 0x0, 
00519              double weight = 0) ;
00520 
00521 
00522     public: 
00523 
00524     virtual ~Tenseur() ;    
00525     
00526     // Memory management
00527     // -----------------
00528     protected:
00529     void del_t() ;  
00530 
00535     void del_derive_met(int i) const ;
00536 
00540     void del_derive() const ;
00541     
00547     void set_der_met_0x0(int i) const ;
00548 
00553     void set_der_0x0() const ;
00554 
00555     // Mutators / assignment
00556     // ---------------------
00557     public:
00562     void set_etat_nondef() ;
00563     
00568     void set_etat_zero() ;
00569 
00574     void set_etat_qcq() ;
00575     
00585     void allocate_all() ; 
00586 
00590     void change_triad(const Base_vect& new_triad) ; 
00591     
00598     void set_triad(const Base_vect& new_triad) ; 
00599     void set_poids(double weight) ; 
00600 
00601     void set_metric(const Metrique& met) ;
00602     
00604     virtual void operator=(const Tenseur& tens) ; 
00605     
00607     void operator=(const Cmp& field) ; 
00608     
00610     void operator=(double ) ;   
00611 
00613     void operator=(int ) ;  
00614 
00616     Cmp& set () ;  
00617     Cmp& set (int) ; 
00618     Cmp& set (int, int) ; 
00619     Cmp& set (int, int, int) ; 
00620     Cmp& set (const Itbl&) ; 
00621         
00627     void annule(int l) ; 
00628 
00640     void annule(int l_min, int l_max) ; 
00641 
00647     void set_std_base() ; 
00648     
00649     void dec_dzpuis() ; 
00650     void inc_dzpuis() ; 
00651     void dec2_dzpuis() ;    
00652     void inc2_dzpuis() ;    
00653     void mult_r_zec() ; 
00654     
00659     Tenseur inverse_poisson_vect (double lambda) const ;
00660     
00661     // Accessors
00662     // ---------
00663     public:
00674     virtual int donne_place (const Itbl& idx) const ;
00675 
00689     virtual Itbl donne_indices (int place) const ;
00690     
00692     const Map* get_mp() const {return mp ;} ; 
00693 
00697     const Base_vect* get_triad() const {return triad;} ; 
00698     
00700     int get_etat() const {return etat ;} ;
00701  
00703     int get_valence() const {return valence ; } ;
00704 
00706     int get_n_comp() const {return n_comp ;} ; 
00707     
00719     int get_type_indice (int i) const {return type_indice(i) ;};
00720 
00728     Itbl get_type_indice () const {return type_indice ; } ;
00729 
00731     double get_poids() const {return poids ; } ; 
00732 
00738     const Metrique* get_metric() const {return metric ; } ; 
00739     
00740     const Cmp& operator()() const ; 
00741     const Cmp& operator()(int) const ; 
00742     const Cmp& operator()(int, int) const ; 
00743     const Cmp& operator()(int, int, int) const ; 
00744     const Cmp& operator()(const Itbl&) const ; 
00745     
00746     // Outputs
00747     // -------
00748     public:
00749     void sauve(FILE *) const ;      
00750     friend ostream& operator<<(ostream& , const Tenseur & ) ;
00751     
00752     // Computation of derived members
00753     // ------------------------------
00754     protected:
00759     virtual void fait_gradient () const ;
00760 
00766     void fait_gradient_spher () const ;
00767 
00773     virtual void fait_derive_cov (const Metrique& met, int i) const ;
00774 
00780     virtual void fait_derive_con (const Metrique&, int i) const ;
00781 
00787     void fait_carre_scal (const Metrique&, int i) const ;
00788     
00798     void set_dependance (const Metrique& met) const ;
00799 
00805     int get_place_met(const Metrique& metre) const ;
00806     
00807     // Differential operators
00808     // ----------------------
00809     public:
00811     const Tenseur& gradient() const ; 
00812     
00816     const Tenseur& gradient_spher() const ; 
00817     
00822     const Tenseur& derive_cov (const Metrique& met) const ;
00823 
00828     const Tenseur& derive_con (const Metrique&) const ; 
00829 
00834     const Tenseur& carre_scal (const Metrique&) const ;
00835     
00836     // Resolution d'EDP :
00862     void poisson_vect(double lambda, Param& par, Tenseur& shift, Tenseur& vect
00863             , Tenseur& scal) const ;
00864     
00865     /*
00866     * Same as poisson_vect with a Tau method
00867     **/
00868     void poisson_vect_tau(double lambda, Param& par, Tenseur& shift, Tenseur& vect
00869             , Tenseur& scal) const ;
00870             
00871     void poisson_vect_falloff(double lambda, Param& par, Tenseur& shift, 
00872                   Tenseur& vect, Tenseur& scal, int* k_falloff) const ;
00873 
00874     void poisson_vect_ylm(double lambda, Param& para, Tenseur& shift,
00875               Tenseur& vecteur, Tenseur& scalaire, int nylm,
00876               double* intvec) const ;
00877 
00905     Tenseur poisson_vect(double lambda, Tenseur& vect , Tenseur& scal ) const ;
00906     
00907     /*
00908     * Same as poisson_vect with a Tau method
00909     **/
00910     Tenseur poisson_vect_tau(double lambda, Tenseur& vect , Tenseur& scal ) const ;
00911             
00912     Tenseur poisson_vect_falloff(double lambda, Tenseur& vect , 
00913                  Tenseur& scal, int* k_falloff ) const ;
00914 
00915     Tenseur poisson_vect_ylm(double lambda, Tenseur& vecteur, 
00916                  Tenseur& scalaire, int nylm, double* intvec) const ;
00917 
00943     void poisson_vect_oohara(double lambda, Param& par, Tenseur& shift, 
00944                     Tenseur& scal) const ;
00945        
00946     /*
00947     * Same as poisson_vect_oohara with a Tau method
00948     **/
00949     void poisson_vect_oohara_tau(double lambda, Param& par, Tenseur& shift, 
00950                     Tenseur& scal) const ;
00951             
00980     Tenseur poisson_vect_oohara(double lambda, Tenseur& scal) const ;
00981    /*
00982     * Same as poisson_vect_oohara with a Tau method
00983     **/
00984     Tenseur poisson_vect_oohara_tau(double lambda, Tenseur& scal) const ;
00985             
01014     void poisson_vect_regu(int k_div, int nzet, double unsgam1,
01015                            double lambda, Param& par, Tenseur& shift,
01016                            Tenseur& vect, Tenseur& scal) const ;
01017    
01018     
01020 
01021     void compare( const Tenseur& tens, const char* name ) ;
01022     void compare( FILE* fich, const char* name_i ) ;
01023     
01024 
01025 
01026     // Friend classes 
01027     // ---------------
01028     friend class Tenseur_sym ;
01029     friend class Metrique ;
01030     
01031     // Mathematical operators
01032     // ----------------------
01033     
01034     friend Tenseur operator* (const Tenseur&, const Tenseur&) ; 
01035     friend Tenseur operator% (const Tenseur&, const Tenseur&) ; 
01036     friend Tenseur contract(const Tenseur&, int id1, int id2) ;
01037     friend Tenseur contract(const Tenseur&, int id1, const Tenseur&, 
01038                 int id2) ;
01039     friend Tenseur contract_desal(const Tenseur&, int id1, const Tenseur&, 
01040                 int id2) ;
01041     friend Tenseur flat_scalar_prod(const Tenseur& t1, const Tenseur& t2) ;
01042     friend Tenseur flat_scalar_prod_desal(const Tenseur& t1, 
01043                       const Tenseur& t2) ;
01044     friend Tenseur manipule(const Tenseur&, const Metrique&, int idx) ;
01045     friend Tenseur manipule(const Tenseur&, const Metrique&) ;
01046     friend Tenseur skxk (const Tenseur&) ;
01047     friend Tenseur lie_derive(const Tenseur& , const Tenseur& , 
01048                   const Metrique* ) ;
01049 
01050 };
01051 
01052 
01059 
01060 Tenseur operator*(const Tenseur&, const Tenseur&) ; 
01061 
01063 Tenseur operator%(const Tenseur&, const Tenseur&) ; 
01064 
01087 Tenseur contract(const Tenseur&, int id1, int id2) ;
01088 
01111 Tenseur contract(const Tenseur&, int id1, const Tenseur&, int id2) ;
01112 
01119 Tenseur flat_scalar_prod(const Tenseur& t1, const Tenseur& t2) ;
01120     
01124 Tenseur flat_scalar_prod_desal(const Tenseur& t1, const Tenseur& t2) ;
01125     
01130 Tenseur manipule(const Tenseur&, const Metrique&, int idx) ;
01131 
01136 Tenseur manipule(const Tenseur&, const Metrique&) ;
01137     
01145 Tenseur skxk (const Tenseur&) ;
01146 
01153 Tenseur lie_derive (const Tenseur& t, const Tenseur& x, const Metrique* = 0x0);
01154 
01163 Tenseur sans_trace(const Tenseur& tens, const Metrique& metre) ;
01164 
01165 
01174 Tenseur operator+(const Tenseur& ) ;            
01175 Tenseur operator-(const Tenseur& ) ;            
01176 Tenseur operator+(const Tenseur&, const Tenseur &) ;    
01177 
01179 Tenseur operator+(const Tenseur&, double ) ;        
01180 
01182 Tenseur operator+(double, const Tenseur& ) ;        
01183 
01185 Tenseur operator+(const Tenseur&, int ) ;       
01186 
01188 Tenseur operator+(int, const Tenseur& ) ;       
01189 
01190 Tenseur operator-(const Tenseur &, const Tenseur &) ;   
01191 
01193 Tenseur operator-(const Tenseur&, double ) ;        
01194 
01196 Tenseur operator-(double, const Tenseur& ) ;        
01197 
01199 Tenseur operator-(const Tenseur&, int ) ;       
01200 
01202 Tenseur operator-(int, const Tenseur& ) ;       
01203 
01205 Tenseur operator*(const Tenseur&, double ) ;        
01206 
01208 Tenseur operator*(double, const Tenseur& ) ;        
01209 
01211 Tenseur operator*(const Tenseur&, int ) ;       
01212 
01214 Tenseur operator*(int, const Tenseur& ) ;       
01215 
01217 Tenseur operator/(const Tenseur& a, const Tenseur& b) ; 
01218 
01219 Tenseur operator/(const Tenseur&, double ) ;    
01220 
01222 Tenseur operator/(double, const Tenseur &) ;        
01223 
01224 Tenseur operator/(const Tenseur&, int ) ;       
01225 
01227 Tenseur operator/(int, const Tenseur &) ;       
01228 
01229 Tenseur exp(const Tenseur& ) ;      
01230 Tenseur log(const Tenseur& ) ;      
01231 Tenseur sqrt(const Tenseur& ) ;     
01232 Tenseur abs(const Tenseur& ) ;      
01233 Tenseur pow(const Tenseur&, int ) ; 
01234 Tenseur pow(const Tenseur&, double ) ;  
01235 
01242             //---------------------------------//
01243             //  class Tenseur_sym      //
01244             //---------------------------------//
01245             
01253 class Tenseur_sym : public Tenseur {
01254 
01255     // Constructors - Destructor :
01256     // -------------------------
01257     
01258     public:
01273     Tenseur_sym (const Map& map, int val, const Itbl& tipe, 
01274              const Base_vect& triad_i, const Metrique* met = 0x0,
01275              double weight = 0) ;
01276 
01286     Tenseur_sym (const Map& map, int val, int tipe, 
01287              const Base_vect& triad_i, const Metrique* met = 0x0,
01288              double weight = 0) ;
01289 
01290     Tenseur_sym (const Tenseur_sym&) ; 
01291 
01295     explicit Tenseur_sym (const Tenseur&) ;
01296     
01307     Tenseur_sym (const Map& map, const Base_vect& triad_i, FILE* fich,
01308              const Metrique* met = 0x0) ;
01309 
01310     virtual ~Tenseur_sym() ;    
01311     
01312     // Mutators / assignment
01313     // ---------------------
01314     public:
01320     virtual void operator= (const Tenseur&) ;
01321     
01322 
01323     // Accessors
01324     // ---------
01325     public:
01336     virtual int donne_place (const Itbl& idx) const ;
01337 
01349     virtual Itbl donne_indices (int place) const ;
01350         
01351     // Computation of derived members
01352     // ------------------------------
01353     protected:
01358     virtual void fait_gradient () const ;
01359 
01365     virtual void fait_derive_cov (const Metrique& met, int i) const ;
01366 
01372     virtual void fait_derive_con (const Metrique&, int i) const ;
01373     
01374     // Mathematical operators
01375     // ----------------------
01376     friend Tenseur_sym operator* (const Tenseur&, const Tenseur_sym&) ; 
01377     friend Tenseur_sym manipule(const Tenseur_sym&, const Metrique&) ;
01378     friend Tenseur lie_derive (const Tenseur& , const Tenseur& , 
01379                 const Metrique* );
01380  
01381 } ;
01388 
01389 Tenseur_sym operator* (const Tenseur&, const Tenseur_sym&) ; 
01390 
01395 Tenseur_sym manipule(const Tenseur_sym&, const Metrique&) ;
01396 
01404 Tenseur_sym lie_derive (const Tenseur_sym& t, const Tenseur& x, 
01405                 const Metrique* = 0x0);
01406 
01415 Tenseur_sym sans_trace(const Tenseur_sym& tens, const Metrique& metre) ;
01416 
01427 Tenseur_sym operator+(const Tenseur_sym& ) ;    
01428 Tenseur_sym operator-(const Tenseur_sym& ) ;    
01429 
01431 Tenseur_sym operator+(const Tenseur_sym&, const Tenseur_sym &) ;    
01432 
01434 Tenseur_sym operator-(const Tenseur_sym &, const Tenseur_sym &) ;   
01435 
01437 Tenseur_sym operator*(const Tenseur_sym&, double ) ;        
01438 
01440 Tenseur_sym operator*(double, const Tenseur_sym& ) ;        
01441 
01443 Tenseur_sym operator*(const Tenseur_sym&, int ) ;       
01444 
01446 Tenseur_sym operator*(int, const Tenseur_sym& ) ;       
01447 
01449 Tenseur_sym operator/(const Tenseur_sym& a, const Tenseur& b) ; 
01450 
01451 Tenseur_sym operator/(const Tenseur_sym&, double ) ;  
01452 
01453 Tenseur_sym operator/(const Tenseur_sym&, int ) ;     
01454 
01461 #endif

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