Ifpack_OverlappingRowMatrix.h

Go to the documentation of this file.
00001 #ifndef IFPACK_OVERLAPPINGROWMATRIX_H
00002 #define IFPACK_OVERLAPPINGROWMATRIX_H
00003 
00004 #include "Ifpack_ConfigDefs.h"
00005 #include "Epetra_RowMatrix.h"
00006 class Epetra_Map;
00007 class Epetra_BlockMap;
00008 class Epetra_CrsMatrix;
00009 class Epetra_Comm;
00010 class Epetra_Import;
00011 #include "Epetra_CombineMode.h"
00012 
00013 class Ifpack_OverlappingRowMatrix : public virtual Epetra_RowMatrix {
00014 
00015 public:
00016 
00018   Ifpack_OverlappingRowMatrix(const Epetra_RowMatrix* Matrix,
00019                               int OverlapLevel);
00020 
00021   ~Ifpack_OverlappingRowMatrix();
00023 
00025 
00027 
00035   virtual int NumMyRowEntries(int MyRow, int & NumEntries) const;
00036 
00038   virtual int MaxNumEntries() const
00039   {
00040     return(MaxNumEntries_);
00041   }
00042 
00044 
00058   virtual int ExtractMyRowCopy(int MyRow, int Length, int & NumEntries, double *Values, int * Indices) const;
00059 
00061 
00067   virtual int ExtractDiagonalCopy(Epetra_Vector & Diagonal) const;
00069 
00071 
00073 
00083   virtual int Multiply(bool TransA, const Epetra_MultiVector& X, Epetra_MultiVector& Y) const;
00084 
00086   virtual int Solve(bool Upper, bool Trans, bool UnitDiagonal, const Epetra_MultiVector& X, 
00087         Epetra_MultiVector& Y) const
00088   {
00089     IFPACK_RETURN(-1); // not implemented 
00090   }
00091 
00092   virtual int Apply(const Epetra_MultiVector& X,
00093         Epetra_MultiVector& Y) const;
00094 
00095   virtual int ApplyInverse(const Epetra_MultiVector& X,
00096          Epetra_MultiVector& Y) const;
00098   virtual int InvRowSums(Epetra_Vector& x) const
00099   {
00100     IFPACK_RETURN(-1); // not implemented
00101   }
00102 
00104   virtual int LeftScale(const Epetra_Vector& x)
00105   {
00106     IFPACK_RETURN(-1); // not implemented
00107   }
00108 
00110   virtual int InvColSums(Epetra_Vector& x) const
00111   {
00112     IFPACK_RETURN(-1); // not implemented
00113   }
00114 
00115 
00117   virtual int RightScale(const Epetra_Vector& x) 
00118   {
00119     IFPACK_RETURN(-1); // not implemented
00120   }
00121 
00123 
00125 
00127   virtual bool Filled() const
00128   {
00129     return(true);
00130   }
00131 
00133   /* Returns the quantity \f$ \| A \|_\infty\f$ such that
00134      \f[\| A \|_\infty = \max_{1\lei\len} \sum_{i=1}^m |a_{ij}| \f].
00135      */ 
00136   virtual double NormInf() const
00137   {
00138     return(A().NormInf());
00139   }
00140 
00142   /* Returns the quantity \f$ \| A \|_1\f$ such that
00143      \f[\| A \|_1= \max_{1\lej\len} \sum_{j=1}^n |a_{ij}| \f].
00144      */ 
00145   virtual double NormOne() const
00146   {
00147     IFPACK_RETURN(A().NormOne());
00148   }
00149 
00151   virtual int NumGlobalNonzeros() const
00152   {
00153     return(NumGlobalNonzeros_);
00154   }
00155 
00157   virtual int NumGlobalRows() const
00158   {
00159     return(A().NumGlobalRows());
00160   }
00161 
00163   virtual int NumGlobalCols() const
00164   {
00165     return(A().NumGlobalCols());
00166   }
00167 
00169   virtual int NumGlobalDiagonals() const
00170   {
00171     return(A().NumGlobalDiagonals());
00172   }
00173 
00175   virtual int NumMyNonzeros() const
00176   {
00177     return(NumMyNonzeros_);
00178   }
00179 
00181   virtual int NumMyRows() const
00182   {
00183     return(NumMyRows_);
00184   }
00185 
00187   virtual int NumMyCols() const
00188   {
00189     return(NumMyCols_);
00190   }
00191 
00193   virtual int NumMyDiagonals() const
00194   {
00195     return(NumMyDiagonals_);
00196   }
00197 
00199   virtual bool LowerTriangular() const
00200   {
00201     return(A().LowerTriangular());
00202   }
00203 
00205   virtual bool UpperTriangular() const
00206   {
00207     return(A().UpperTriangular());
00208   }
00209 
00211   virtual const Epetra_Map & RowMatrixRowMap() const
00212   {
00213     return(*Map_);
00214   }
00215 
00217   virtual const Epetra_Map & RowMatrixColMap() const
00218   {
00219     return(*Map_);
00220   }
00221 
00223   virtual const Epetra_Import * RowMatrixImporter() const
00224   {
00225     return(Importer_);
00226   }
00228 
00229   // following functions are required to derive Epetra_RowMatrix objects.
00230 
00232   int SetOwnership(bool ownership)
00233   {
00234     IFPACK_RETURN(-1);
00235   }
00236 
00238   int SetUseTranspose(bool UseTranspose)
00239   {
00240     UseTranspose_ = UseTranspose;
00241     return(0);
00242   }
00243 
00245   bool UseTranspose() const 
00246   {
00247     return(UseTranspose_);
00248   }
00249 
00251   bool HasNormInf() const
00252   {
00253     return(A().HasNormInf());
00254   }
00255 
00257   const Epetra_Comm & Comm() const
00258   {
00259     return(A().Comm());
00260   }
00261 
00263   const Epetra_Map & OperatorDomainMap() const 
00264   {
00265     return(*Map_);
00266   }
00267 
00269   const Epetra_Map & OperatorRangeMap() const 
00270   {
00271     return(*Map_);
00272   }
00274 
00275 const Epetra_BlockMap& Map() const;
00276 
00277 const char* Label() const{
00278   return(Label_.c_str());
00279 };
00280 
00281 int OverlapLevel() const
00282 {
00283   return(OverlapLevel_);
00284 }
00285 
00286 int ImportMultiVector(const Epetra_MultiVector& X,
00287                       Epetra_MultiVector& OvX,
00288                       Epetra_CombineMode CM = Insert);
00289 
00290 int ExportMultiVector(const Epetra_MultiVector& OvX,
00291                       Epetra_MultiVector& X,
00292                       Epetra_CombineMode CM = Add);
00293 private:
00294 
00295   inline const Epetra_RowMatrix& A() const 
00296   {
00297     return(*Matrix_);
00298   }
00299 
00300   inline Epetra_RowMatrix& B() const;
00301 
00302   int NumMyRows_;
00303   int NumMyCols_;
00304   int NumMyDiagonals_;
00305   int NumMyNonzeros_;
00306 
00307   int NumGlobalNonzeros_;
00308   int MaxNumEntries_;
00309 
00310   int NumMyRowsA_;
00311   int NumMyRowsB_;
00312 
00313   bool UseTranspose_;
00314 
00315   const Epetra_Map* Map_;
00316   const Epetra_Import* Importer_;
00317 
00318   const Epetra_RowMatrix* Matrix_;
00319   Epetra_CrsMatrix* ExtMatrix_;
00320   Epetra_Map* ExtMap_;
00321   Epetra_Import* ExtImporter_;
00322 
00323   int OverlapLevel_;
00324   string Label_;
00325 
00326 }; // class Ifpack_OverlappingRowMatrix
00327 
00328 #endif // IFPACK_OVERLAPPINGROWMATRIX_H

Generated on Thu Sep 18 12:37:22 2008 for Ifpack Package Browser (Single Doxygen Collection) by doxygen 1.3.9.1