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_CRSICT_H_
00031 #define _IFPACK_CRSICT_H_
00032
00033 #include "Ifpack_ScalingType.h"
00034 #include "Ifpack_IlukGraph.h"
00035 #include "Epetra_CombineMode.h"
00036 #include "Epetra_CompObject.h"
00037 #include "Epetra_Operator.h"
00038 #include "Epetra_CrsMatrix.h"
00039 #include "Epetra_Object.h"
00040 #include "Epetra_Vector.h"
00041 class Epetra_Comm;
00042 class Epetra_Map;
00043 class Epetra_CrsMatrix;
00044 class Epetra_MultiVector;
00045
00046 #ifdef HAVE_IFPACK_TEUCHOS
00047 namespace Teuchos {
00048 class ParameterList;
00049 }
00050 #endif
00051
00053
00157 class Ifpack_CrsIct: public Epetra_Object, public Epetra_CompObject, public virtual Epetra_Operator {
00158
00159
00160
00161 friend ostream& operator << (ostream& os, const Ifpack_CrsIct& A);
00162
00163 public:
00165
00172 Ifpack_CrsIct(const Epetra_CrsMatrix &A, double Droptol = 1.0E-4, int Lfil = 20);
00173
00175 Ifpack_CrsIct(const Ifpack_CrsIct & IctOperator);
00176
00178 virtual ~Ifpack_CrsIct();
00179
00181 void SetAbsoluteThreshold( double Athresh) {Athresh_ = Athresh; return;}
00182
00184 void SetRelativeThreshold( double Rthresh) {Rthresh_ = Rthresh; return;}
00185
00187 void SetOverlapMode( Epetra_CombineMode OverlapMode) {OverlapMode_ = OverlapMode; return;}
00188
00189 #ifdef HAVE_IFPACK_TEUCHOS
00190
00191
00192
00193
00194
00195
00196
00197
00198 int SetParameters(const Teuchos::ParameterList& parameterlist,
00199 bool cerr_warning_if_unused=false);
00200 #endif
00201
00203
00209 int InitValues(const Epetra_CrsMatrix &A);
00210
00212 bool ValuesInitialized() const {return(ValuesInitialized_);};
00213
00215
00223 int Factor();
00224
00226 bool Factored() const {return(Factored_);};
00227
00228
00229
00230
00231
00233
00243 int Solve(bool Trans, const Epetra_MultiVector& X, Epetra_MultiVector& Y) const;
00244
00246
00256 int Multiply(bool Trans, const Epetra_MultiVector& X, Epetra_MultiVector& Y) const;
00257
00259
00267 int Condest(bool Trans, double & ConditionNumberEstimate) const;
00268
00269
00271 double GetAbsoluteThreshold() {return Athresh_;}
00272
00274 double GetRelativeThreshold() {return Rthresh_;}
00275
00277 Epetra_CombineMode GetOverlapMode() {return OverlapMode_;}
00278
00280 int NumGlobalNonzeros() const {return(U().NumGlobalNonzeros()+D().GlobalLength());};
00281
00283 int NumMyNonzeros() const {return(U().NumMyNonzeros()+D().MyLength());};
00285 const Epetra_Vector & D() const {return(*D_);};
00286
00288 const Epetra_CrsMatrix & U() const {return(*U_);};
00289
00291
00293 const char * Label() const {return(Epetra_Object::Label());};
00294
00296
00305 int SetUseTranspose(bool UseTranspose) {UseTranspose_ = UseTranspose; return(0);};
00306
00308
00319 int Apply(const Epetra_MultiVector& X, Epetra_MultiVector& Y) const {
00320 return(Multiply(Ifpack_CrsIct::UseTranspose(), X, Y));};
00321
00323
00336 int ApplyInverse(const Epetra_MultiVector& X, Epetra_MultiVector& Y) const {
00337 return(Solve(Ifpack_CrsIct::UseTranspose(), X, Y));};
00338
00340 double NormInf() const {return(0.0);};
00341
00343 bool HasNormInf() const {return(false);};
00344
00346 bool UseTranspose() const {return(UseTranspose_);};
00347
00349 const Epetra_Map & OperatorDomainMap() const {return(A_.DomainMap());};
00350
00352 const Epetra_Map & OperatorRangeMap() const{return(A_.RangeMap());};
00353
00355 const Epetra_Comm & Comm() const{return(Comm_);};
00357
00358 protected:
00359 protected:
00360 void SetFactored(bool Flag) {Factored_ = Flag;};
00361 void SetValuesInitialized(bool Flag) {ValuesInitialized_ = Flag;};
00362 bool Allocated() const {return(Allocated_);};
00363 int SetAllocated(bool Flag) {Allocated_ = Flag; return(0);};
00364
00365 private:
00366
00367
00368 int Allocate();
00369
00370 const Epetra_CrsMatrix &A_;
00371 const Epetra_Comm & Comm_;
00372 Epetra_CrsMatrix * U_;
00373 Epetra_Vector * D_;
00374 bool UseTranspose_;
00375
00376
00377 bool Allocated_;
00378 bool ValuesInitialized_;
00379 bool Factored_;
00380 mutable double Condest_;
00381 double Athresh_;
00382 double Rthresh_;
00383 double Droptol_;
00384 int Lfil_;
00385
00386 mutable Epetra_MultiVector * OverlapX_;
00387 mutable Epetra_MultiVector * OverlapY_;
00388 int LevelOverlap_;
00389 Epetra_CombineMode OverlapMode_;
00390
00391 void * Aict_;
00392 void * Lict_;
00393 double * Ldiag_;
00394
00395 };
00396
00398 ostream& operator << (ostream& os, const Ifpack_CrsIct& A);
00399
00400 #endif