base_val.h

00001 /*
00002  *  Definition of Lorene class Base_val
00003  *
00004  */
00005 
00006 /*
00007  *   Copyright (c) 1999-2000 Jean-Alain Marck
00008  *   Copyright (c) 1999-2001 Eric Gourgoulhon
00009  *   Copyright (c) 1999-2001 Philippe Grandclement
00010  *   Copyright (c) 2001 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 __BASE_VAL_H_ 
00032 #define __BASE_VAL_H_ 
00033 
00034 /*
00035  * $Id: base_val.h,v 1.19 2012/01/17 10:18:17 j_penner Exp $
00036  * $Log: base_val.h,v $
00037  * Revision 1.19  2012/01/17 10:18:17  j_penner
00038  * changed nzone from a private member to a protected member
00039  *
00040  * Revision 1.18  2009/10/23 12:55:46  j_novak
00041  * New base T_LEG_MI
00042  *
00043  * Revision 1.17  2009/10/08 16:19:32  j_novak
00044  * Addition of new bases T_COS and T_SIN.
00045  *
00046  * Revision 1.16  2008/12/03 15:21:20  j_novak
00047  * New method mult_cost.
00048  *
00049  * Revision 1.15  2007/12/11 15:28:05  jl_cornou
00050  * Jacobi(0,2) polynomials partially implemented
00051  *
00052  * Revision 1.14  2005/09/07 13:09:48  j_novak
00053  * New method for determining the highest multipole that can be described on a 3D
00054  * grid.
00055  *
00056  * Revision 1.13  2004/11/23 15:03:14  m_forot
00057  * Corrected error in comments.
00058  *
00059  * Revision 1.12  2004/11/04 15:39:45  e_gourgoulhon
00060  * Modif documentation: added description of bases without any symmetry
00061  *  in theta.
00062  *
00063  * Revision 1.11  2004/08/24 09:14:40  p_grandclement
00064  * Addition of some new operators, like Poisson in 2d... It now requieres the
00065  * GSL library to work.
00066  *
00067  * Also, the way a variable change is stored by a Param_elliptic is changed and
00068  * no longer uses Change_var but rather 2 Scalars. The codes using that feature
00069  * will requiere some modification. (It should concern only the ones about monopoles)
00070  *
00071  * Revision 1.10  2004/03/22 13:12:40  j_novak
00072  * Modification of comments to use doxygen instead of doc++
00073  *
00074  * Revision 1.9  2004/01/27 14:31:25  j_novak
00075  * New method Base_val::mult_sint()
00076  *
00077  * Revision 1.8  2004/01/27 14:13:58  j_novak
00078  * Added method Base_val::mult_x()
00079  *
00080  * Revision 1.7  2003/10/20 06:41:43  e_gourgoulhon
00081  * Corrected documentation.
00082  *
00083  * Revision 1.6  2003/10/19 19:42:50  e_gourgoulhon
00084  * -- member nzone now private
00085  * -- introduced new methods get_nzone() and get_b()
00086  * -- introduced new methods name_r, name_theta and name_phi.
00087  *
00088  * Revision 1.5  2003/09/16 08:53:05  j_novak
00089  * Addition of the T_LEG_II base (odd in theta, only for odd m) and the
00090  * transformation functions from and to T_SIN_P.
00091  *
00092  * Revision 1.4  2002/10/16 14:36:28  j_novak
00093  * Reorganization of #include instructions of standard C++, in order to
00094  * use experimental version 3 of gcc.
00095  *
00096  * Revision 1.3  2002/09/13 09:17:31  j_novak
00097  * Modif. commentaires
00098  *
00099  * Revision 1.2  2002/06/17 14:05:15  j_novak
00100  * friend functions are now also declared outside the class definition
00101  *
00102  * Revision 1.1.1.1  2001/11/20 15:19:27  e_gourgoulhon
00103  * LORENE
00104  *
00105  * Revision 2.20  2001/10/12  14:56:09  novak
00106  * Ajout des methodes dsdx(), dsdt(), etc...
00107  *
00108  * Revision 2.19  2001/05/29 16:08:45  eric
00109  * Modif commentaires (mise en conformite Doc++ 3.4.7).
00110  *
00111  * Revision 2.18  2000/09/28  10:19:50  eric
00112  * Modif commentaires (nouvelles bases T_LEG_IP et T_LEG_PI).
00113  *
00114  * Revision 2.17  2000/09/08  11:42:55  eric
00115  * *** empty log message ***
00116  *
00117  * Revision 2.16  2000/09/08  10:14:11  eric
00118  * *** empty log message ***
00119  *
00120  * Revision 2.15  2000/09/08  10:11:49  eric
00121  * *** empty log message ***
00122  *
00123  * Revision 2.14  2000/09/08  10:10:24  eric
00124  * *** empty log message ***
00125  *
00126  * Revision 2.13  2000/09/08  10:06:19  eric
00127  * Ajout des methodes set_base_r, etc... et get_base_r, etc...
00128  *
00129  * Revision 2.12  1999/12/29  10:49:12  eric
00130  * theta_functions et phi_functions declarees const.
00131  *
00132  * Revision 2.11  1999/12/29  10:36:58  eric
00133  * Modif commentaires.
00134  *
00135  * Revision 2.10  1999/12/28  12:57:44  eric
00136  * Introduction des methodes theta_functions et phi_functions.
00137  *
00138  * Revision 2.9  1999/11/19  14:53:11  phil
00139  * *** empty log message ***
00140  *
00141  * Revision 2.8  1999/11/18  13:48:35  phil
00142  * *** empty log message ***
00143  *
00144  * Revision 2.7  1999/11/18  12:51:12  phil
00145  * commentaire de operator*
00146  *
00147  * Revision 2.6  1999/10/26  13:23:12  phil
00148  * *** empty log message ***
00149  *
00150  * Revision 2.5  1999/10/26  13:18:06  phil
00151  * ajout de l'operator*
00152  *
00153  * Revision 2.4  1999/10/13  15:49:12  eric
00154  * *** empty log message ***
00155  *
00156  * Revision 2.3  1999/10/12  10:02:17  eric
00157  * Amelioration des commentaires: description de toutes les bases.
00158  *
00159  * Revision 2.2  1999/10/01  15:55:58  eric
00160  * Depoussierage.
00161  * Documentation
00162  *
00163  * Revision 2.1  1999/09/13  14:38:08  phil
00164  * ajout de l'operateur ==
00165  *
00166  * Revision 2.0  1999/02/22  15:17:47  hyc
00167  * *** empty log message ***
00168  *
00169  *
00170  * $Header: /cvsroot/Lorene/C++/Include/base_val.h,v 1.19 2012/01/17 10:18:17 j_penner Exp $
00171  *
00172  */
00173 
00174 #include <stdio.h>
00175 #include <assert.h>
00176 #include "headcpp.h"
00177 
00178 
00179 #include "type_parite.h"
00180 class Tbl ;
00181 class Mg3d ;
00182 
00302 class Base_val {
00303 
00304     // Data 
00305     // ----
00306     protected:
00307     int nzone ; 
00308 
00309     public: 
00311     int* b ;    
00312 
00313     // Constructors - Destructor
00314     // -------------------------
00315     public:
00316     explicit Base_val(int nb_of_domains) ;      
00317     Base_val(const Base_val& ) ;            
00318 
00320     explicit Base_val(FILE* ) ;        
00321 
00322     ~Base_val() ;               
00323 
00324 
00325     // Mutators / assignment
00326     // ---------------------
00327     public:
00328     void set_base_nondef() ;    
00329 
00339     void set_base_r(int l, int base_r) ; 
00340 
00349     void set_base_t(int base_t) ; 
00350 
00359     void set_base_p(int base_p) ; 
00360 
00361     void operator=(const Base_val& ) ;  
00362     
00363     // Accessors
00364     // ---------
00365     public:
00366     bool operator==(const Base_val& ) const ;  
00367 
00369     int get_b(int l) const {
00370         assert( (l>=0) && (l<nzone) ) ;
00371         return b[l] ; 
00372     }
00373 
00380     int get_base_r(int l) const {
00381         assert( (l>=0) && (l<nzone) ) ;
00382         return b[l] & MSQ_R ; 
00383     } ; 
00384 
00391     int get_base_t(int l) const {
00392         assert( (l>=0) && (l<nzone) ) ;
00393         return b[l] & MSQ_T ; 
00394     } ; 
00395 
00402     int get_base_p(int l) const {
00403         assert( (l>=0) && (l<nzone) ) ;
00404         return b[l] & MSQ_P ; 
00405     } ; 
00406 
00420     void name_r(int l, int k, int j, int i, char* basename) const ; 
00421 
00433     void name_theta(int l, int k, int j, char* basename) const ; 
00434 
00444     void name_phi(int l, int k, char* basename) const ; 
00445 
00446 
00469     const Tbl& theta_functions(int l, int nt) const ; 
00470     
00485     const Tbl& phi_functions(int l, int np) const ; 
00486 
00488     int get_nzone() const {return nzone; } ; 
00489     
00490      // Manipulation of basis
00491     // ----------------------
00492     public:
00497     void dsdx() ; 
00498  
00503     void sx() ;
00504 
00509     void mult_x() ;
00510 
00515     void dsdt() ;  
00516 
00521     void ssint() ;  
00522   
00527     void mult_sint() ;  
00528   
00533     void mult_cost() ;  
00534   
00539     void ylm() ;  
00540 
00544     void give_quant_numbers (int, int, int, 
00545                  int&, int&, int&) const ;
00546 
00554     int give_lmax(const Mg3d& mgrid, int lz) const ;
00555 
00556    // Outputs
00557     // -------
00558     public:     
00559     void sauve(FILE *) const ;      
00560     
00561     friend ostream& operator<<(ostream& , const Base_val& ) ; 
00562     friend Base_val operator*(const Base_val&, const Base_val&) ;
00563 };
00564 ostream& operator<<(ostream& , const Base_val& ) ;
00582 Base_val operator*(const Base_val&, const Base_val&) ;
00583 
00586 #endif

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