diff.h

00001 /*
00002  *  Definition of Lorene class Diff.
00003  *
00004  */
00005 
00006 /*
00007  *   Copyright (c) 2005 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 __DIFF_H_ 
00027 #define __DIFF_H_ 
00028 
00029 /*
00030  * $Id: diff.h,v 1.3 2006/04/10 15:20:51 j_novak Exp $
00031  * $Log: diff.h,v $
00032  * Revision 1.3  2006/04/10 15:20:51  j_novak
00033  * Operators dsdx and sx can now be used in the nucleus.
00034  *
00035  * Revision 1.2  2005/01/11 15:16:58  j_novak
00036  * More Diff operators.
00037  *
00038  * Revision 1.1  2005/01/10 16:39:21  j_novak
00039  * New class for 1D mono-domain differential operators.
00040  *
00041  *
00042  *
00043  * $Header: /cvsroot/Lorene/C++/Include/diff.h,v 1.3 2006/04/10 15:20:51 j_novak Exp $
00044  *
00045  */
00046 
00047 #include "type_parite.h"
00048 #include "matrice.h"
00049 
00061 class Diff {
00062 
00063     // Data : 
00064     // -----
00065  public:
00067     static const int max_points = 50 ; 
00068 
00069  protected:
00070     int base ; 
00071     int npoints ; 
00072 
00073     // Constructors - Destructor
00074     // -------------------------
00075  protected:
00076     Diff(int base_r, int nr) ;  
00077     Diff(const Diff& ) ;        
00078 
00079     virtual ~Diff() ;           
00080  
00081 
00082     // Mutators / assignment
00083     // ---------------------
00084  protected:
00086     void operator=(const Diff&) ;   
00087     
00088     // Accessors
00089     // ---------
00090  public:
00092     int get_base() const {return base ;} ;
00093 
00095     int get_npoints() const { return npoints ;} ;
00096 
00098     operator Matrice() const { return get_matrice() ; }
00099     
00100     // Computational routines
00101     //-----------------------
00102  public:
00104     virtual const Matrice& get_matrice() const = 0 ;
00105 
00106     // Outputs
00107     // -------
00108  public:
00110     friend ostream& operator<<(ostream& , const Diff& ) ;   
00111     
00112  protected:
00114     virtual ostream& operator>>(ostream&) const = 0 ;
00115 
00116 };
00117 
00118 
00125 class Diff_dsdx : public Diff {
00126 
00127     // Constructors - Destructor
00128     // -------------------------
00129  public:
00133     Diff_dsdx(int base_r, int nr) ;  
00134 
00135     Diff_dsdx(const Diff_dsdx& ) ;   
00136 
00137     virtual ~Diff_dsdx() ;          
00138 
00139  private:
00140     void initialize() ;  
00141  
00142     // Mutators / assignment
00143     // ---------------------
00144  public:
00146     void operator=(const Diff_dsdx&) ;  
00147     
00148     // Computational routines
00149     //-----------------------
00150  public:
00152     virtual const Matrice& get_matrice() const ;
00153 
00154     // Outputs
00155     // -------
00156  protected:
00158     virtual ostream& operator>>(ostream&) const ;
00159 };
00160 
00161 
00168 class Diff_dsdx2 : public Diff {
00169 
00170     // Constructors - Destructor
00171     // -------------------------
00172  public:
00173     Diff_dsdx2(int base_r, int nr) ;     
00174     Diff_dsdx2(const Diff_dsdx2& ) ;     
00175 
00176     virtual ~Diff_dsdx2() ;         
00177 
00178  private:
00179     void initialize() ;  
00180  
00181     // Mutators / assignment
00182     // ---------------------
00183  public:
00185     void operator=(const Diff_dsdx2&) ; 
00186     
00187     // Computational routines
00188     //-----------------------
00189  public:
00191     virtual const Matrice& get_matrice() const ;
00192 
00193     // Outputs
00194     // -------
00195  protected:
00197     virtual ostream& operator>>(ostream&) const ;
00198 };
00199 
00206 class Diff_id : public Diff {
00207 
00208     // Constructors - Destructor
00209     // -------------------------
00210  public:
00211     Diff_id(int base_r, int nr) ;    
00212     Diff_id(const Diff_id& ) ;   
00213 
00214     virtual ~Diff_id() ;            
00215 
00216  private:
00217     void initialize() ;  
00218  
00219     // Mutators / assignment
00220     // ---------------------
00221  public:
00223     void operator=(const Diff_id&) ;    
00224     
00225     // Computational routines
00226     //-----------------------
00227  public:
00229     virtual const Matrice& get_matrice() const ;
00230 
00231     // Outputs
00232     // -------
00233  protected:
00235     virtual ostream& operator>>(ostream&) const ;
00236 };
00237 
00246 class Diff_mx : public Diff {
00247 
00248     // Constructors - Destructor
00249     // -------------------------
00250  public:
00251     Diff_mx(int base_r, int nr) ;    
00252     Diff_mx(const Diff_mx& ) ;   
00253 
00254     virtual ~Diff_mx() ;            
00255 
00256  private:
00257     void initialize() ;  
00258  
00259     // Mutators / assignment
00260     // ---------------------
00261  public:
00263     void operator=(const Diff_mx&) ;    
00264     
00265     // Computational routines
00266     //-----------------------
00267  public:
00269     virtual const Matrice& get_matrice() const ;
00270 
00271     // Outputs
00272     // -------
00273  protected:
00275     virtual ostream& operator>>(ostream&) const ;
00276 };
00277 
00285 class Diff_mx2 : public Diff {
00286 
00287     // Constructors - Destructor
00288     // -------------------------
00289  public:
00290     Diff_mx2(int base_r, int nr) ;   
00291     Diff_mx2(const Diff_mx2& ) ;     
00292 
00293     virtual ~Diff_mx2() ;           
00294 
00295  private:
00296     void initialize() ;  
00297  
00298     // Mutators / assignment
00299     // ---------------------
00300  public:
00302     void operator=(const Diff_mx2&) ;   
00303     
00304     // Computational routines
00305     //-----------------------
00306  public:
00308     virtual const Matrice& get_matrice() const ;
00309 
00310     // Outputs
00311     // -------
00312  protected:
00314     virtual ostream& operator>>(ostream&) const ;
00315 };
00316 
00325 class Diff_sx : public Diff {
00326 
00327     // Constructors - Destructor
00328     // -------------------------
00329  public:
00330     Diff_sx(int base_r, int nr) ;    
00331     Diff_sx(const Diff_sx& ) ;   
00332 
00333     virtual ~Diff_sx() ;            
00334 
00335  private:
00336     void initialize() ;  
00337  
00338     // Mutators / assignment
00339     // ---------------------
00340  public:
00342     void operator=(const Diff_sx&) ;    
00343     
00344     // Computational routines
00345     //-----------------------
00346  public:
00348     virtual const Matrice& get_matrice() const ;
00349 
00350     // Outputs
00351     // -------
00352  protected:
00354     virtual ostream& operator>>(ostream&) const ;
00355 };
00356 
00365 class Diff_sx2 : public Diff {
00366 
00367     // Constructors - Destructor
00368     // -------------------------
00369  public:
00370     Diff_sx2(int base_r, int nr) ;   
00371     Diff_sx2(const Diff_sx2& ) ;     
00372 
00373     virtual ~Diff_sx2() ;           
00374 
00375  private:
00376     void initialize() ;  
00377  
00378     // Mutators / assignment
00379     // ---------------------
00380  public:
00382     void operator=(const Diff_sx2&) ;   
00383     
00384     // Computational routines
00385     //-----------------------
00386  public:
00388     virtual const Matrice& get_matrice() const ;
00389 
00390     // Outputs
00391     // -------
00392  protected:
00394     virtual ostream& operator>>(ostream&) const ;
00395 };
00396 
00405 class Diff_xdsdx : public Diff {
00406 
00407     // Constructors - Destructor
00408     // -------------------------
00409  public:
00410     Diff_xdsdx(int base_r, int nr) ;     
00411     Diff_xdsdx(const Diff_xdsdx& ) ;     
00412 
00413     virtual ~Diff_xdsdx() ;         
00414 
00415  private:
00416     void initialize() ;  
00417  
00418     // Mutators / assignment
00419     // ---------------------
00420  public:
00422     void operator=(const Diff_xdsdx&) ; 
00423     
00424     // Computational routines
00425     //-----------------------
00426  public:
00428     virtual const Matrice& get_matrice() const ;
00429 
00430     // Outputs
00431     // -------
00432  protected:
00434     virtual ostream& operator>>(ostream&) const ;
00435 };
00436 
00446 class Diff_sxdsdx : public Diff {
00447 
00448     // Constructors - Destructor
00449     // -------------------------
00450  public:
00451     Diff_sxdsdx(int base_r, int nr) ;    
00452     Diff_sxdsdx(const Diff_sxdsdx& ) ;   
00453 
00454     virtual ~Diff_sxdsdx() ;            
00455 
00456  private:
00457     void initialize() ;  
00458  
00459     // Mutators / assignment
00460     // ---------------------
00461  public:
00463     void operator=(const Diff_sxdsdx&) ;    
00464     
00465     // Computational routines
00466     //-----------------------
00467  public:
00469     virtual const Matrice& get_matrice() const ;
00470 
00471     // Outputs
00472     // -------
00473  protected:
00475     virtual ostream& operator>>(ostream&) const ;
00476 };
00477 
00486 class Diff_x2dsdx2 : public Diff {
00487 
00488     // Constructors - Destructor
00489     // -------------------------
00490  public:
00491     Diff_x2dsdx2(int base_r, int nr) ;   
00492     Diff_x2dsdx2(const Diff_x2dsdx2& ) ;     
00493 
00494     virtual ~Diff_x2dsdx2() ;           
00495 
00496  private:
00497     void initialize() ;  
00498  
00499     // Mutators / assignment
00500     // ---------------------
00501  public:
00503     void operator=(const Diff_x2dsdx2&) ;   
00504     
00505     // Computational routines
00506     //-----------------------
00507  public:
00509     virtual const Matrice& get_matrice() const ;
00510 
00511     // Outputs
00512     // -------
00513  protected:
00515     virtual ostream& operator>>(ostream&) const ;
00516 };
00517 
00527 class Diff_xdsdx2 : public Diff {
00528 
00529     // Constructors - Destructor
00530     // -------------------------
00531  public:
00532     Diff_xdsdx2(int base_r, int nr) ;    
00533     Diff_xdsdx2(const Diff_xdsdx2& ) ;   
00534 
00535     virtual ~Diff_xdsdx2() ;            
00536 
00537  private:
00538     void initialize() ;  
00539  
00540     // Mutators / assignment
00541     // ---------------------
00542  public:
00544     void operator=(const Diff_xdsdx2&) ;    
00545     
00546     // Computational routines
00547     //-----------------------
00548  public:
00550     virtual const Matrice& get_matrice() const ;
00551 
00552     // Outputs
00553     // -------
00554  protected:
00556     virtual ostream& operator>>(ostream&) const ;
00557 };
00558 
00567 class Diff_x2dsdx : public Diff {
00568 
00569     // Constructors - Destructor
00570     // -------------------------
00571  public:
00572     Diff_x2dsdx(int base_r, int nr) ;    
00573     Diff_x2dsdx(const Diff_x2dsdx& ) ;   
00574 
00575     virtual ~Diff_x2dsdx() ;            
00576 
00577  private:
00578     void initialize() ;  
00579  
00580     // Mutators / assignment
00581     // ---------------------
00582  public:
00584     void operator=(const Diff_x2dsdx&) ;    
00585     
00586     // Computational routines
00587     //-----------------------
00588  public:
00590     virtual const Matrice& get_matrice() const ;
00591 
00592     // Outputs
00593     // -------
00594  protected:
00596     virtual ostream& operator>>(ostream&) const ;
00597 };
00598 
00607 class Diff_x3dsdx : public Diff {
00608 
00609     // Constructors - Destructor
00610     // -------------------------
00611  public:
00612     Diff_x3dsdx(int base_r, int nr) ;    
00613     Diff_x3dsdx(const Diff_x3dsdx& ) ;   
00614 
00615     virtual ~Diff_x3dsdx() ;            
00616 
00617  private:
00618     void initialize() ;  
00619  
00620     // Mutators / assignment
00621     // ---------------------
00622  public:
00624     void operator=(const Diff_x3dsdx&) ;    
00625     
00626     // Computational routines
00627     //-----------------------
00628  public:
00630     virtual const Matrice& get_matrice() const ;
00631 
00632     // Outputs
00633     // -------
00634  protected:
00636     virtual ostream& operator>>(ostream&) const ;
00637 };
00638 
00648 class Diff_x3dsdx2 : public Diff {
00649 
00650     // Constructors - Destructor
00651     // -------------------------
00652  public:
00653     Diff_x3dsdx2(int base_r, int nr) ;   
00654     Diff_x3dsdx2(const Diff_x3dsdx2& ) ;     
00655 
00656     virtual ~Diff_x3dsdx2() ;           
00657 
00658  private:
00659     void initialize() ;  
00660  
00661     // Mutators / assignment
00662     // ---------------------
00663  public:
00665     void operator=(const Diff_x3dsdx2&) ;   
00666     
00667     // Computational routines
00668     //-----------------------
00669  public:
00671     virtual const Matrice& get_matrice() const ;
00672 
00673     // Outputs
00674     // -------
00675  protected:
00677     virtual ostream& operator>>(ostream&) const ;
00678 };
00679 
00688 class Diff_x4dsdx2 : public Diff {
00689 
00690     // Constructors - Destructor
00691     // -------------------------
00692  public:
00693     Diff_x4dsdx2(int base_r, int nr) ;   
00694     Diff_x4dsdx2(const Diff_x4dsdx2& ) ;     
00695 
00696     virtual ~Diff_x4dsdx2() ;           
00697 
00698  private:
00699     void initialize() ;  
00700  
00701     // Mutators / assignment
00702     // ---------------------
00703  public:
00705     void operator=(const Diff_x4dsdx2&) ;   
00706     
00707     // Computational routines
00708     //-----------------------
00709  public:
00711     virtual const Matrice& get_matrice() const ;
00712 
00713     // Outputs
00714     // -------
00715  protected:
00717     virtual ostream& operator>>(ostream&) const ;
00718 };
00719 
00720 
00721 #endif

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