matrixinterface.h

Go to the documentation of this file.
00001 #ifndef __matrixinterface_h
00002 #define __matrixinterface_h
00003 
00004 #include  "entrymatrix.h"
00005 #include  "compvector.h"
00006 #include  "sparsestructureinterface.h"
00007 #include  "stencilinterface.h"
00008 #include  <string>
00009 
00010 /*-------------------------------------------------------------*/
00011 
00012 namespace Gascoigne
00013 {
00014   class MatrixInterface
00015   {
00016     private:
00017 
00018     protected:
00019 
00020     public:
00021       MatrixInterface() { }
00022       virtual ~MatrixInterface() { }
00023 
00024       virtual std::string GetName() const=0;
00025   
00026       virtual const StencilInterface* GetStencil() const=0;
00027       virtual void ReInit(const SparseStructureInterface* S)=0;
00028       virtual void AddMassWithDifferentStencil(const MatrixInterface* M, const TimePattern& TP, double s=1.) {
00029         std::cerr << "\"MatrixInterface::AddMassWithDifferentStencil\" not written!" << std::endl;
00030         abort();
00031       }
00032       virtual void zero()=0;
00033       virtual void transpose()=0;
00034 
00035       virtual std::ostream& Write(std::ostream& os) const=0;
00036 
00037       //
00039       //
00040       typedef IntVector::const_iterator niiterator;
00041 
00042       virtual void entry(nvector<int>::const_iterator start1, nvector<int>::const_iterator stop1,
00043                  nvector<int>::const_iterator start2, nvector<int>::const_iterator stop2,
00044                  const EntryMatrix& M, double s=1.) { assert(0);}
00045       virtual void entry(niiterator start, niiterator stop, const EntryMatrix& M, double s=1.)=0;
00046       virtual void entrydual(niiterator start, niiterator stop, const EntryMatrix& M, double s=1.) {
00047         std::cerr << "\"MatrixInterface::entrydual\" not written!" << std::endl;
00048         abort();
00049       }
00050 
00051       //
00053       //
00054       virtual void entry_diag(int i, const nmatrix<double>& M)=0;
00055       
00056       //
00058       //
00059       virtual void dirichlet (int i, const std::vector<int>& cv) {
00060         std::cerr << "\"MatrixInterface::dirichlet\" not written!" << std::endl;
00061         abort();
00062       }
00063       virtual void dirichlet_only_row(int i, const std::vector<int>& indices) {
00064         std::cerr << "\"MatrixInterface::dirichlet_only_row\" not written!" << std::endl;
00065         abort();
00066       }
00067 
00068       virtual void vmult(GlobalVector& y, const GlobalVector& x, double s=1.) const {
00069         std::cerr << "\"MatrixInterface::vmult\" not written!" << std::endl;
00070         abort();
00071       }
00072       virtual void vmult_transpose(GlobalVector& y, const GlobalVector& x, double s=1.) const {
00073         std::cerr << "\"MatrixInterface::vmult_tranpose\" not written!" << std::endl;
00074         abort();
00075       }
00076       virtual void vmult_time(GlobalVector& y, const GlobalVector& x, const TimePattern& TP, double s=1.) const {
00077         std::cerr << "\"MatrixInterface::vmult_time\" not written!" << std::endl;
00078         abort();
00079       }
00080 
00081                 /*-----------------------------------------------*/
00082       
00083       virtual void FillInterfaceList(const nvector<int>& elements,nvector<int>& start, nvector<float>& values) const
00084         { std::cerr << "\"MatrixInterface::FillInterfaceList\" not written!" << std::endl; assert(0); }
00085       virtual void FurbishInterface (double d, const nvector<int>&   elements, const nvector<int>&   start, const nvector<float>& values)
00086         { std::cerr << "\"MatrixInterface::FurbishInterface\" not written!" << std::endl; assert(0); }
00087       
00088       virtual void Jacobi           (GlobalVector& x) const
00089         { std::cerr << "\"MatrixInterface::Jacobi\" not written!" << std::endl; assert(0); }
00090       
00091                 /*-----------------------------------------------*/
00092  };
00093 }
00094 
00095 /*-------------------------------------------------------------*/
00096 
00097 #endif

Generated on Thu Sep 14 10:34:36 2006 for Gascoigne by  doxygen 1.4.7