00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 #ifndef IFPACK_REORDERFILTER_H
00031 #define IFPACK_REORDERFILTER_H
00032
00033 #include "Ifpack_ConfigDefs.h"
00034 #include "Epetra_RowMatrix.h"
00035 #include "Teuchos_RefCountPtr.hpp"
00036
00037 class Epetra_Comm;
00038 class Epetra_Map;
00039 class Epetra_MultiVector;
00040 class Epetra_Import;
00041 class Epetra_BlockMap;
00042 class Ifpack_Reordering;
00043
00045
00068 class Ifpack_ReorderFilter : public virtual Epetra_RowMatrix {
00069
00070 public:
00071
00072 Ifpack_ReorderFilter(const Teuchos::RefCountPtr<Epetra_RowMatrix>& Matrix_in,
00073 const Teuchos::RefCountPtr<Ifpack_Reordering>& Reordering_in);
00074
00076 Ifpack_ReorderFilter(const Ifpack_ReorderFilter& RHS);
00077
00079 virtual ~Ifpack_ReorderFilter() {};
00080
00082 Ifpack_ReorderFilter& operator=(const Ifpack_ReorderFilter& RHS);
00083
00085 virtual inline int NumMyRowEntries(int MyRow, int & NumEntries) const
00086 {
00087 return(Matrix()->NumMyRowEntries(MyRow, NumEntries));
00088 }
00089
00091 virtual int MaxNumEntries() const
00092 {
00093 return(MaxNumEntries_);
00094 }
00095
00096
00097 virtual int ExtractMyRowCopy(int MyRow, int Length, int & NumEntries, double *Values, int * Indices) const;
00098
00100 virtual int ExtractDiagonalCopy(Epetra_Vector & Diagonal) const;
00101
00103 virtual int Multiply(bool TransA, const Epetra_MultiVector& X,
00104 Epetra_MultiVector& Y) const;
00105
00107 virtual int Solve(bool Upper, bool Trans, bool UnitDiagonal,
00108 const Epetra_MultiVector& X,
00109 Epetra_MultiVector& Y) const;
00110
00112 virtual int Apply(const Epetra_MultiVector& X,
00113 Epetra_MultiVector& Y) const;
00114
00116 virtual int ApplyInverse(const Epetra_MultiVector& X,
00117 Epetra_MultiVector& Y) const
00118 {
00119 return(-1);
00120 }
00121
00123 virtual int InvRowSums(Epetra_Vector& x) const
00124 {
00125 return(-1);
00126 }
00127
00129 virtual int LeftScale(const Epetra_Vector& x)
00130 {
00131 return(-1);
00132 }
00133
00135 virtual int InvColSums(Epetra_Vector& x) const
00136 {
00137 return(-1);
00138 }
00139
00141 virtual int RightScale(const Epetra_Vector& x)
00142 {
00143 return(-1);
00144 }
00145
00147 virtual bool Filled() const
00148 {
00149 return(Matrix()->Filled());
00150 }
00151
00153 virtual double NormInf() const
00154 {
00155 return(-1.0);
00156 }
00157
00159 virtual double NormOne() const
00160 {
00161 return(-1.0);
00162 }
00163
00165 virtual int NumGlobalNonzeros() const
00166 {
00167 return(Matrix()->NumGlobalNonzeros());
00168 }
00169
00171 virtual int NumGlobalRows() const
00172 {
00173 return(Matrix()->NumGlobalRows());
00174 }
00175
00177 virtual int NumGlobalCols() const
00178 {
00179 return(Matrix()->NumGlobalCols());
00180 }
00181
00183 virtual int NumGlobalDiagonals() const
00184 {
00185 return(Matrix()->NumGlobalDiagonals());
00186 }
00187
00189 virtual int NumMyNonzeros() const
00190 {
00191 return(Matrix()->NumMyNonzeros());
00192 }
00193
00195 virtual int NumMyRows() const
00196 {
00197 return(Matrix()->NumMyRows());
00198 }
00199
00201 virtual int NumMyCols() const
00202 {
00203 return(Matrix()->NumMyCols());
00204 }
00205
00207 virtual int NumMyDiagonals() const
00208 {
00209 return(Matrix()->NumMyDiagonals());
00210 }
00211
00213 virtual bool LowerTriangular() const
00214 {
00215 return(false);
00216 }
00217
00219 virtual bool UpperTriangular() const
00220 {
00221 return(false);
00222 }
00223
00225 virtual const Epetra_Map & RowMatrixRowMap() const
00226 {
00227 return(Matrix()->RowMatrixRowMap());
00228 }
00229
00231 virtual const Epetra_Map & RowMatrixColMap() const
00232 {
00233 return(Matrix()->RowMatrixColMap());
00234 }
00235
00237 virtual const Epetra_Import * RowMatrixImporter() const
00238 {
00239 return(Matrix()->RowMatrixImporter());
00240 }
00241
00243 int SetUseTranspose(bool UseTranspose_in)
00244 {
00245 return(Matrix()->SetUseTranspose(UseTranspose_in));
00246 }
00247
00249 bool UseTranspose() const
00250 {
00251 return(Matrix()->UseTranspose());
00252 }
00253
00255 bool HasNormInf() const
00256 {
00257 return(true);
00258 }
00259
00261 const Epetra_Comm & Comm() const
00262 {
00263 return(Matrix()->Comm());
00264 }
00265
00267 const Epetra_Map & OperatorDomainMap() const
00268 {
00269 return(Matrix()->OperatorDomainMap());
00270 }
00271
00273 const Epetra_Map & OperatorRangeMap() const
00274 {
00275 return(Matrix()->OperatorRangeMap());
00276 }
00277
00279 const Epetra_BlockMap& Map() const
00280 {
00281 return(Matrix()->Map());
00282 }
00283
00285 const char* Label() const{
00286 return(Label_);
00287 }
00288
00290 inline Teuchos::RefCountPtr<Epetra_RowMatrix> Matrix() const {
00291 return(A_);
00292 }
00293
00295 inline Teuchos::RefCountPtr<Ifpack_Reordering> Reordering() const {
00296 return(Reordering_);
00297 }
00298
00299 private:
00300
00302 Teuchos::RefCountPtr<Epetra_RowMatrix> A_;
00304 Teuchos::RefCountPtr<Ifpack_Reordering> Reordering_;
00305
00307 int NumMyRows_;
00309 int MaxNumEntries_;
00311 char Label_[80];
00312
00313 };
00314
00315
00316 #endif