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_MultiVector.h"
00041 #include "Epetra_Vector.h"
00042
00043 #include "Teuchos_RefCountPtr.hpp"
00044
00045 class Epetra_Comm;
00046 class Epetra_Map;
00047
00048 namespace Teuchos {
00049 class ParameterList;
00050 }
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
00190
00191
00192
00193
00194
00195
00196
00197 int SetParameters(const Teuchos::ParameterList& parameterlist,
00198 bool cerr_warning_if_unused=false);
00199
00201
00207 int InitValues(const Epetra_CrsMatrix &A);
00208
00210 bool ValuesInitialized() const {return(ValuesInitialized_);};
00211
00213
00221 int Factor();
00222
00224 bool Factored() const {return(Factored_);};
00225
00226
00227
00228
00229
00231
00241 int Solve(bool Trans, const Epetra_MultiVector& X, Epetra_MultiVector& Y) const;
00242
00244
00254 int Multiply(bool Trans, const Epetra_MultiVector& X, Epetra_MultiVector& Y) const;
00255
00257
00265 int Condest(bool Trans, double & ConditionNumberEstimate) const;
00266
00267
00269 double GetAbsoluteThreshold() {return Athresh_;}
00270
00272 double GetRelativeThreshold() {return Rthresh_;}
00273
00275 Epetra_CombineMode GetOverlapMode() {return OverlapMode_;}
00276
00278 int NumGlobalNonzeros() const {return(U().NumGlobalNonzeros()+D().GlobalLength());};
00279
00281 int NumMyNonzeros() const {return(U().NumMyNonzeros()+D().MyLength());};
00283 const Epetra_Vector & D() const {return(*D_);};
00284
00286 const Epetra_CrsMatrix & U() const {return(*U_);};
00287
00289
00291 const char * Label() const {return(Epetra_Object::Label());};
00292
00294
00303 int SetUseTranspose(bool UseTranspose_in) {UseTranspose_ = UseTranspose_in; return(0);};
00304
00306
00317 int Apply(const Epetra_MultiVector& X, Epetra_MultiVector& Y) const {
00318 return(Multiply(Ifpack_CrsIct::UseTranspose(), X, Y));};
00319
00321
00334 int ApplyInverse(const Epetra_MultiVector& X, Epetra_MultiVector& Y) const {
00335 return(Solve(Ifpack_CrsIct::UseTranspose(), X, Y));};
00336
00338 double NormInf() const {return(0.0);};
00339
00341 bool HasNormInf() const {return(false);};
00342
00344 bool UseTranspose() const {return(UseTranspose_);};
00345
00347 const Epetra_Map & OperatorDomainMap() const {return(A_.DomainMap());};
00348
00350 const Epetra_Map & OperatorRangeMap() const{return(A_.RangeMap());};
00351
00353 const Epetra_Comm & Comm() const{return(Comm_);};
00355
00356 protected:
00357 void SetFactored(bool Flag) {Factored_ = Flag;};
00358 void SetValuesInitialized(bool Flag) {ValuesInitialized_ = Flag;};
00359 bool Allocated() const {return(Allocated_);};
00360 int SetAllocated(bool Flag) {Allocated_ = Flag; return(0);};
00361
00362 private:
00363
00364
00365 int Allocate();
00366
00367 const Epetra_CrsMatrix &A_;
00368 const Epetra_Comm & Comm_;
00369 Teuchos::RefCountPtr<Epetra_CrsMatrix> U_;
00370 Teuchos::RefCountPtr<Epetra_Vector> D_;
00371 bool UseTranspose_;
00372
00373
00374 bool Allocated_;
00375 bool ValuesInitialized_;
00376 bool Factored_;
00377 mutable double Condest_;
00378 double Athresh_;
00379 double Rthresh_;
00380 double Droptol_;
00381 int Lfil_;
00382
00383 mutable Teuchos::RefCountPtr<Epetra_MultiVector> OverlapX_;
00384 mutable Teuchos::RefCountPtr<Epetra_MultiVector> OverlapY_;
00385 int LevelOverlap_;
00386 Epetra_CombineMode OverlapMode_;
00387
00388 void * Aict_;
00389 void * Lict_;
00390 double * Ldiag_;
00391
00392 };
00393
00395 ostream& operator << (ostream& os, const Ifpack_CrsIct& A);
00396
00397 #endif