grid.h

00001 /*
00002  * Declaration of class Grid and derived classes
00003  */
00004 
00005 /*
00006  *   Copyright (c) 2005 Eric Gourgoulhon
00007  *
00008  *   This file is part of LORENE.
00009  *
00010  *   LORENE is free software; you can redistribute it and/or modify
00011  *   it under the terms of the GNU General Public License as published by
00012  *   the Free Software Foundation; either version 2 of the License, or
00013  *   (at your option) any later version.
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 /*
00027  * $Id: grid.h,v 1.1 2005/11/14 01:56:58 e_gourgoulhon Exp $
00028  * $Log: grid.h,v $
00029  * Revision 1.1  2005/11/14 01:56:58  e_gourgoulhon
00030  * First version
00031  *
00032  *
00033  * $Header: /cvsroot/Lorene/School05/Monday/grid.h,v 1.1 2005/11/14 01:56:58 e_gourgoulhon Exp $
00034  *
00035  */
00036 
00037 
00038 #ifndef __GRID_H_ 
00039 #define __GRID_H_ 
00040 
00041             //----------------------------------//
00042             //          class Grid              //
00043             //----------------------------------//
00044 
00048 class Grid {
00049 
00050     // Data : 
00051     // -----
00052     protected:
00053         const int nn ; 
00054         double* xx ;  
00055 
00056     // Constructors - Destructor
00057     // -------------------------
00058     public:
00063     Grid(int nb_nodes, double* xi) ;
00064         
00065     Grid(const Grid& ) ;        
00066         
00067     protected:
00071         Grid(int nb_nodes) ;
00072          
00073     public:
00074     virtual ~Grid() ;           
00075  
00076     // Mutators / assignment
00077     // ---------------------
00078     public:
00080     void operator=(const Grid&) ;   
00081     
00082     // Accessors
00083     // ---------
00084     public:
00085         int n() const ; 
00086 
00087         double operator()(int i) const ; 
00088 
00123         void plot(int color = 1, int nfig = 0, double ymin = -1., 
00124                   double ymax = 1., const char* title = 0x0, 
00125                   const char* label_y = 0x0, const char* device = 0x0) const ;
00126                         
00127     // Computation
00128     // -----------
00129     public: 
00140         double lagrange(int i, double x) const ; 
00141          
00151         double nodal_polynomial(double x) const ; 
00152           
00160         double interpole(double (*f)(double), double x) const ;  
00161         
00163         double lebesgue_constant() const ; 
00164     
00165 };
00166 
00168 ostream& operator<<(ostream& , const Grid& ) ;  
00169 
00170 
00171             //----------------------------------//
00172             //          class Grid_uniform      //
00173             //----------------------------------//
00174 
00175 
00176 
00180 class Grid_uniform : public Grid {
00181 
00182     // Constructors - Destructor
00183     // -------------------------
00184     public:
00188     Grid_uniform(int nb_nodes) ;
00189         
00190     Grid_uniform(const Grid_uniform& ) ;        
00191         
00192     virtual ~Grid_uniform() ;           
00193  
00194     // Mutators / assignment
00195     // ---------------------
00196     public:
00198     void operator=(const Grid_uniform&) ;   
00199     
00200                        
00201 };
00202 
00204 ostream& operator<<(ostream& , const Grid_uniform& ) ;  
00205 
00206 
00207             //----------------------------------//
00208             //    class Grid_Legendre_Gauss    //
00209             //----------------------------------//
00210 
00211 
00215 class Grid_Legendre_Gauss : public Grid {
00216 
00217     // Constructors - Destructor
00218     // -------------------------
00219     public:
00223         Grid_Legendre_Gauss(int nb_nodes) ;
00224         
00225         Grid_Legendre_Gauss(const Grid_Legendre_Gauss& ) ;  
00226         
00227         virtual ~Grid_Legendre_Gauss() ;            
00228  
00229     // Mutators / assignment
00230     // ---------------------
00231     public:
00233         void operator=(const Grid_Legendre_Gauss&) ;    
00234     
00235                        
00236 };
00237 
00239 ostream& operator<<(ostream& , const Grid_Legendre_Gauss& ) ;   
00240 
00241 
00242             //----------------------------------//
00243             //     class Grid_Legendre_GL      //
00244             //----------------------------------//
00245 
00246 
00250 class Grid_Legendre_GL : public Grid {
00251 
00252     // Constructors - Destructor
00253     // -------------------------
00254     public:
00258         Grid_Legendre_GL(int nb_nodes) ;
00259         
00260         Grid_Legendre_GL(const Grid_Legendre_GL& ) ;    
00261         
00262         virtual ~Grid_Legendre_GL() ;           
00263  
00264     // Mutators / assignment
00265     // ---------------------
00266     public:
00268         void operator=(const Grid_Legendre_GL&) ;   
00269     
00270                        
00271 };
00272 
00274 ostream& operator<<(ostream& , const Grid_Legendre_GL& ) ;  
00275 
00276 
00277 
00278             //----------------------------------//
00279             //    class Grid_Chebyshev_Gauss    //
00280             //----------------------------------//
00281 
00282 
00286 class Grid_Chebyshev_Gauss : public Grid {
00287 
00288     // Constructors - Destructor
00289     // -------------------------
00290     public:
00294         Grid_Chebyshev_Gauss(int nb_nodes) ;
00295         
00296         Grid_Chebyshev_Gauss(const Grid_Chebyshev_Gauss& ) ;    
00297         
00298         virtual ~Grid_Chebyshev_Gauss() ;           
00299  
00300     // Mutators / assignment
00301     // ---------------------
00302     public:
00304         void operator=(const Grid_Chebyshev_Gauss&) ;   
00305     
00306                        
00307 };
00308 
00310 ostream& operator<<(ostream& , const Grid_Chebyshev_Gauss& ) ;  
00311 
00312 
00313             //----------------------------------//
00314             //     class Grid_Chebyshev_GL      //
00315             //----------------------------------//
00316 
00317 
00321 class Grid_Chebyshev_GL : public Grid {
00322 
00323     // Constructors - Destructor
00324     // -------------------------
00325     public:
00329         Grid_Chebyshev_GL(int nb_nodes) ;
00330         
00331         Grid_Chebyshev_GL(const Grid_Chebyshev_GL& ) ;  
00332         
00333         virtual ~Grid_Chebyshev_GL() ;          
00334  
00335     // Mutators / assignment
00336     // ---------------------
00337     public:
00339         void operator=(const Grid_Chebyshev_GL&) ;  
00340     
00341                        
00342 };
00343 
00345 ostream& operator<<(ostream& , const Grid_Chebyshev_GL& ) ; 
00346 
00347 #endif

Generated on Tue Dec 6 14:48:44 2011 for POLYNOM by  doxygen 1.4.6