grilles.h

00001 /*
00002  *  Definition of Lorene classes Grille3d
00003  *               Grille3d_*
00004  *               Mg3d
00005  *
00006  */
00007 
00008 /*
00009  *   Copyright (c) 1999-2000 Jean-Alain Marck
00010  *   Copyright (c) 1999-2001 Eric Gourgoulhon
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 __GRILLES_H_ 
00032 #define __GRILLES_H_ 
00033 
00034 /*
00035  * $Id: grilles.h,v 1.19 2012/01/17 10:10:15 j_penner Exp $
00036  * $Log: grilles.h,v $
00037  * Revision 1.19  2012/01/17 10:10:15  j_penner
00038  * added a constructor in which the nucleus and outer domain are both of type FIN
00039  *
00040  * Revision 1.18  2008/10/29 08:17:51  jl_cornou
00041  * Standard spectral bases for pseudo vectors added
00042  *
00043  * Revision 1.17  2008/02/18 13:53:37  j_novak
00044  * Removal of special indentation instructions.
00045  *
00046  * Revision 1.16  2007/12/11 15:28:05  jl_cornou
00047  * Jacobi(0,2) polynomials partially implemented
00048  *
00049  * Revision 1.15  2006/05/17 13:17:02  j_novak
00050  * New member g_angu_1dom, the one-domain angular grid associated with the
00051  * current grid.
00052  *
00053  * Revision 1.14  2005/10/25 08:56:34  p_grandclement
00054  * addition of std_spectral_base in the case of odd functions near the origin
00055  *
00056  * Revision 1.13  2005/10/07 08:47:20  j_novak
00057  * Addition of the pointer g_non_axi on a grid, with at least 5 points in the
00058  * theta direction and 4 in the phi one (for tensor rotations).
00059  *
00060  * Revision 1.12  2005/03/25 14:54:04  e_gourgoulhon
00061  * Corrected documentation.
00062  *
00063  * Revision 1.11  2004/07/06 13:36:27  j_novak
00064  * Added methods for desaliased product (operator |) only in r direction.
00065  *
00066  * Revision 1.10  2004/06/22 08:49:56  p_grandclement
00067  * Addition of everything needed for using the logarithmic mapping
00068  *
00069  * Revision 1.9  2004/03/22 13:12:41  j_novak
00070  * Modification of comments to use doxygen instead of doc++
00071  *
00072  * Revision 1.8  2003/06/20 14:16:57  f_limousin
00073  * Add the operator== to compare two Mg3d
00074  *
00075  * Revision 1.7  2003/06/18 08:45:26  j_novak
00076  * In class Mg3d: added the member get_radial, returning only a radial grid
00077  * For dAlembert solver: the way the coefficients of the operator are defined has been changed.
00078  *
00079  * Revision 1.6  2002/10/16 14:36:29  j_novak
00080  * Reorganization of #include instructions of standard C++, in order to
00081  * use experimental version 3 of gcc.
00082  *
00083  * Revision 1.5  2002/08/13 08:02:45  j_novak
00084  * Handling of spherical vector/tensor components added in the classes
00085  * Mg3d and Tenseur. Minor corrections for the class Metconf.
00086  *
00087  * Revision 1.4  2002/06/17 14:05:16  j_novak
00088  * friend functions are now also declared outside the class definition
00089  *
00090  * Revision 1.3  2001/12/12 09:23:46  e_gourgoulhon
00091  * Parameter compact added to the simplified constructor of class Mg3d
00092  *
00093  * Revision 1.2  2001/12/11 06:47:42  e_gourgoulhon
00094  * Simplified constructor for class Mg3d
00095  *
00096  * Revision 1.1.1.1  2001/11/20 15:19:27  e_gourgoulhon
00097  * LORENE
00098  *
00099  * Revision 2.10  2001/06/13  14:23:40  eric
00100  * Les fonctions Mg3d::del_deriv() et Mg3d::set_deriv_0x0() ne sont plus
00101  * virtuelles puisque Mg3d n'a aucune classe derivee.
00102  *
00103  * Revision 2.9  2001/05/26  13:24:49  eric
00104  * Ajout du membre g_twice (grille double pour le desaliasing)
00105  * Modif de la declaration de g_angu (pointeur mutable)
00106  *   g_twice et g_angu ne sont calcules que si necessaire (cad si
00107  *   on appelle la fonction get_twice() ou get_angu()).
00108  *
00109  * Revision 2.8  1999/11/16  14:15:57  eric
00110  * Ajout de la fonction Mg3d::get_angu().
00111  *
00112  * Revision 2.7  1999/10/12  14:54:11  eric
00113  * Ajout du membre Base_val std_base_scal() const.
00114  *
00115  * Revision 2.6  1999/10/01  10:35:42  eric
00116  * Amelioration des commentaires.
00117  *
00118  * Revision 2.5  1999/09/30  14:58:00  eric
00119  * Operator!= declare const/
00120  *
00121  * Revision 2.4  1999/09/30  14:11:43  eric
00122  * sauve et std_base_vect_cart declarees const.
00123  *
00124  * Revision 2.3  1999/09/30  12:52:38  eric
00125  * Depoussierage.
00126  * Documentation.
00127  *
00128  * Revision 2.2  1999/09/24  14:23:24  eric
00129  * Declaration de methodes const.
00130  *
00131  * Revision 2.1  1999/09/14  15:24:04  phil
00132  * ajout de std_base_vect_cart
00133  *
00134  * Revision 2.0  1999/02/15  10:41:51  hyc
00135  * *** empty log message ***
00136  *
00137  * Revision 2.1  1999/02/15  09:59:50  hyc
00138  * *** empty log message ***
00139  *
00140  * Revision 2.0  1998/12/01  14:28:00  hyc
00141  * Version 2
00142  *
00143  *
00144  * $Header: /cvsroot/Lorene/C++/Include/grilles.h,v 1.19 2012/01/17 10:10:15 j_penner Exp $
00145  *
00146  */
00147 
00148 // Classes utilisees
00149 
00150 // Fichiers includes
00151 #include <assert.h>
00152 #include <stdio.h>
00153 #include <stdlib.h>
00154 #include "headcpp.h"
00155 
00156 #include "type_parite.h"
00157 
00158 class Base_val ; 
00159 
00160                 //-------------//
00161                 // Mono-grille //
00162                 //-------------//
00163 
00164 // Classe de base
00183 class Grille3d {
00184     protected:
00185     const int nr ;  
00186     const int nt ;  
00187     const int np ;  
00188 
00189     int type_r ;    
00190     int type_t ;    
00191     int type_p ;    
00192     public:
00194     double* x ; 
00196     double* tet ;   
00198     double* phi ;   
00199 
00200     protected: 
00202     Grille3d(int n_r, int n_t, int n_p) ;
00203     
00204     private:
00208     Grille3d(const Grille3d& ) ;
00209     
00213     void operator=(const Grille3d& ) ;
00214         
00215     public:
00216     virtual ~Grille3d() ;       
00217 
00218     public:
00220         int get_nr() const {return nr ;} ;
00222         int get_nt() const {return nt ;} ;
00224         int get_np() const {return np ;} ;
00225 
00227         int get_type_r() const {return type_r ;} ; 
00229         int get_type_t() const {return type_t ;} ; 
00231         int get_type_p() const {return type_p ;} ; 
00232 
00233 };
00234 
00235 
00236             // -------------------- //
00237                     // Les classes derivees //
00238             // -------------------- //
00239 
00247 
00248 // Cas rare + sans symetrie
00249 // ------------------------
00257 class Grille3d_r : public Grille3d {
00258     public:
00259     Grille3d_r(int n_r, int n_t, int n_p) ; 
00260     ~Grille3d_r() ; 
00261 };
00262 
00263 // cas fin + sans symetrie
00264 // -----------------------
00273 class Grille3d_f : public Grille3d {
00274     public:
00275     Grille3d_f(int n_r, int n_t, int n_p) ; 
00276     ~Grille3d_f() ; 
00277 };
00278 
00279 // cas echantillonnage (fin) en 1/r + sans symetrie
00280 // ------------------------------------------------
00289 class Grille3d_i : public Grille3d {
00290     public:
00291     Grille3d_i(int n_r, int n_t, int n_p) ; 
00292     ~Grille3d_i() ; 
00293 };
00294 
00295 // Cas rare + symetrie equatoriale
00296 // -------------------------------
00306 class Grille3d_req : public Grille3d {
00307     public:
00308     Grille3d_req(int n_r, int n_t, int n_p) ; 
00309     ~Grille3d_req() ; 
00310 };
00311 
00312 // cas fin + symetrie equatoriale
00313 // ------------------------------
00323 class Grille3d_feq : public Grille3d {
00324     public:
00325     Grille3d_feq(int n_r, int n_t, int n_p) ; 
00326     ~Grille3d_feq() ; 
00327 };
00328 
00329 // cas echantillonnage (fin) en 1/r + symetrie equatoriale
00330 // -------------------------------------------------------
00340 class Grille3d_ieq : public Grille3d {
00341     public:
00342     Grille3d_ieq(int n_r, int n_t, int n_p) ; 
00343     ~Grille3d_ieq() ; 
00344 };
00345 
00346 // Cas rare supersymetrique
00347 // ------------------------
00357 class Grille3d_rs : public Grille3d {
00358     public:
00359     Grille3d_rs(int n_r, int n_t, int n_p) ; 
00360     ~Grille3d_rs() ; 
00361 };
00362 
00363 // cas fin supersymetrique
00364 // -----------------------
00374 class Grille3d_fs : public Grille3d {
00375     public:
00376     Grille3d_fs(int n_r, int n_t, int n_p) ; 
00377     ~Grille3d_fs() ; 
00378 };
00379 
00380 // cas echantillonnage (fin) en 1/r supersymetrique
00381 // --------------------------
00391 class Grille3d_is : public Grille3d {
00392     public:
00393     Grille3d_is(int n_r, int n_t, int n_p) ; 
00394     ~Grille3d_is() ; 
00395 };
00396 
00397 // Cas rare + 2 phi
00398 // ----------------
00407 class Grille3d_r2p : public Grille3d {
00408     public:
00409     Grille3d_r2p(int n_r, int n_t, int n_p) ; 
00410     ~Grille3d_r2p() ; 
00411 };
00412 
00413 // cas fin + 2 phi
00414 // ---------------
00423 class Grille3d_f2p : public Grille3d {
00424     public:
00425     Grille3d_f2p(int n_r, int n_t, int n_p) ; 
00426     ~Grille3d_f2p() ; 
00427 };
00428 
00429 // cas echantillonnage (fin) en 1/r + 2 phi
00430 // ----------------------------------------
00440 class Grille3d_i2p : public Grille3d {
00441     public:
00442     Grille3d_i2p(int n_r, int n_t, int n_p) ; 
00443     ~Grille3d_i2p() ; 
00444 };
00445 
00446 // cas fin de jacobi + sans symetrie
00447 // ---------------------------------
00457 class Grille3d_fj : public Grille3d {
00458     public:
00459     Grille3d_fj(int n_r, int n_t, int n_p) ; 
00460     ~Grille3d_fj() ; 
00461 };
00462 
00463 // cas fin de jacobi + symetrie equatoriale
00464 // ----------------------------------------
00475 class Grille3d_fjeq : public Grille3d {
00476     public:
00477     Grille3d_fjeq(int n_r, int n_t, int n_p) ; 
00478     ~Grille3d_fjeq() ; 
00479 };
00480 
00481 // cas fin de jacobi supersymetrique
00482 // ---------------------------------
00493 class Grille3d_fjs : public Grille3d {
00494     public:
00495     Grille3d_fjs(int n_r, int n_t, int n_p) ; 
00496     ~Grille3d_fjs() ; 
00497 };
00498 
00499 // cas fin de jacobi + 2 phi
00500 // -------------------------
00510 class Grille3d_fj2p : public Grille3d {
00511     public:
00512     Grille3d_fj2p(int n_r, int n_t, int n_p) ; 
00513     ~Grille3d_fj2p() ; 
00514 };
00515 
00517 
00518                 //---------------//
00519                 // Multi-grilles //
00520                 //---------------//
00521 
00539 class Mg3d {
00540 
00541     // Data  
00542     // ----
00543     protected:
00544     int nzone ; 
00545     
00546     int* nr ;   
00547     int* nt ;   
00548     int* np ;   
00549     
00553     int* type_r ;   
00555     int type_t ;
00557     int type_p ;    
00558     
00560     Grille3d** g ;  
00561 
00562     mutable Mg3d* g_angu ;  
00563 
00564     mutable Mg3d* g_angu_1dom ; 
00565     mutable Mg3d* g_radial ; 
00566     
00570     mutable Mg3d* g_twice ; 
00571 
00575     mutable Mg3d* g_plus_half ; 
00576 
00581     mutable Mg3d* g_non_axi ; 
00582 
00583     // Constructors - Destructor
00584     // -------------------------
00585     
00586     public:
00587 
00601     Mg3d(int nz, int nbr[], int typr[], int nbt[], int typt, int nbp[],
00602          int typp) ;
00603 
00639     Mg3d(int nz, int nbr, int nbt, int nbp, int typt, int typp, 
00640          bool compact) ;
00641 
00666     Mg3d(int nz, int nbr, int nbt, int nbp, int typt, int typp) ;
00667 
00668     Mg3d(FILE* ) ;   
00669     
00670    public:
00675     Mg3d(const Mg3d& ) ;
00676     
00677     public:
00678     
00679     ~Mg3d() ;   
00680         
00681     // Assignement
00682     // -----------
00683     private:
00688     void operator=(const Mg3d& ) ;
00689         
00690     // Extraction of information
00691     // -------------------------
00692     public:
00694     int get_nzone() const {      
00695         return nzone ;
00696     } ;
00698     int get_nr(int l) const { 
00699         assert(l>=0 && l<nzone) ;
00700         return nr[l] ;
00701     } ;
00703     int get_nt(int l) const { 
00704         assert(l>=0 && l<nzone) ;
00705         return nt[l] ;
00706     } ;
00708     int get_np(int l) const { 
00709         assert(l>=0 && l<nzone) ;
00710         return np[l] ;
00711     } ;
00712     
00722     int get_type_r(int l) const {
00723         assert(l>=0 && l<nzone) ;
00724         return type_r[l] ;
00725     } ;
00726 
00733     int get_type_t() const {    
00734         return type_t ;
00735     } ;
00736 
00743     int get_type_p() const {
00744         return type_p ;
00745     } ;
00746     
00748     const Grille3d* get_grille3d(int l) const { 
00749         assert(l>=0 && l<nzone) ;
00750         return g[l] ;
00751     } ;
00752 
00754     const Mg3d* get_angu() const ;
00755     
00759     const Mg3d* get_angu_1dom() const ;
00760     
00762     const Mg3d* get_radial() const ;
00763     
00767     const Mg3d* get_twice() const ;
00768 
00772     const Mg3d* plus_half() const ;
00773 
00778     const Mg3d* get_non_axi() const ;
00779 
00781     bool operator==(const Mg3d& ) const ;  
00782 
00783 
00784     
00785     // Outputs
00786     // -------
00787     public: 
00788     void sauve(FILE* ) const ; 
00789     
00790     friend ostream& operator<<(ostream& , const Mg3d & ) ;  
00791     
00792     // Management of derived quantities
00793     // --------------------------------
00794     protected:
00798     void del_deriv() const ; 
00799     
00803     void set_deriv_0x0() const ; 
00804 
00805 
00806     // Miscellaneous
00807     // -------------
00808     public:
00809     bool operator!=(const Mg3d & ) const ;  
00810 
00812     Base_val std_base_scal() const ;    
00813     
00815     Base_val std_base_scal_odd() const ;    
00816     
00820     Base_val** std_base_vect_cart() const ;
00821 
00825     Base_val** std_base_vect_spher() const ;
00826 
00830     Base_val** pseudo_base_vect_cart() const ;
00831 
00835     Base_val** pseudo_base_vect_spher() const ;
00836 
00837 };
00838 ostream& operator<<(ostream& , const Mg3d & ) ;
00839 
00840 #endif 

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