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_ICT_H
00031 #define IFPACK_ICT_H
00032
00033 #include "Ifpack_ConfigDefs.h"
00034 #include "Ifpack_CondestType.h"
00035 #include "Ifpack_ScalingType.h"
00036 #include "Ifpack_Preconditioner.h"
00037 #include "Epetra_Vector.h"
00038 #include "Epetra_CrsMatrix.h"
00039 #include "Epetra_Time.h"
00040 #include "Teuchos_RefCountPtr.hpp"
00041
00042 class Epetra_RowMatrix;
00043 class Epetra_SerialComm;
00044 class Epetra_Comm;
00045 class Epetra_Map;
00046 class Epetra_MultiVector;
00047
00048 namespace Teuchos {
00049 class ParameterList;
00050 }
00051
00053
00070 class Ifpack_ICT: public Ifpack_Preconditioner {
00071
00072 public:
00074
00081 Ifpack_ICT(const Epetra_RowMatrix* A);
00082
00084 virtual ~Ifpack_ICT();
00085
00087
00088
00089
00090
00091
00092
00093
00094 int SetParameters(Teuchos::ParameterList& parameterlis);
00095
00097 const Epetra_RowMatrix& Matrix() const
00098 {
00099 return(A_);
00100 }
00101
00103 bool IsInitialized() const
00104 {
00105 return(IsInitialized_);
00106 }
00107
00109
00115 int Initialize();
00116
00118
00126 int Compute();
00127
00129 bool IsComputed() const {return(IsComputed_);};
00130
00131
00132
00134
00144 int ApplyInverse(const Epetra_MultiVector& X, Epetra_MultiVector& Y) const;
00145
00146 int Apply(const Epetra_MultiVector& X, Epetra_MultiVector& Y) const;
00147
00149
00157 double Condest(const Ifpack_CondestType CT = Ifpack_Cheap,
00158 const int MaxIters = 1550,
00159 const double Tol = 1e-9,
00160 Epetra_RowMatrix* Matrix_in = 0);
00161
00162 double Condest() const
00163 {
00164 return(Condest_);
00165 }
00166
00167
00168
00170 int NumGlobalNonzeros() const {return(H().NumGlobalNonzeros());};
00171
00173 int NumMyNonzeros() const {return(H().NumMyNonzeros());};
00174
00176 const Epetra_CrsMatrix& H() const {return(*H_);};
00177
00179
00181
00190 int SetUseTranspose(bool UseTranspose_in) {UseTranspose_ = UseTranspose_in; return(0);};
00191
00193 double NormInf() const {return(0.0);};
00194
00196 bool HasNormInf() const {return(false);};
00197
00199 bool UseTranspose() const {return(UseTranspose_);};
00200
00202 const Epetra_Map& OperatorDomainMap() const {return(A_.OperatorDomainMap());};
00203
00205 const Epetra_Map& OperatorRangeMap() const{return(A_.OperatorRangeMap());};
00206
00208 const Epetra_Comm& Comm() const{return(Comm_);};
00210
00211 const char* Label() const
00212 {
00213 return(Label_.c_str());
00214 }
00215
00216 int SetLabel(const char* Label_in)
00217 {
00218 Label_ = Label_in;
00219 return(0);
00220 }
00221
00223 virtual ostream& Print(std::ostream& os) const;
00224
00226 virtual int NumInitialize() const
00227 {
00228 return(NumInitialize_);
00229 }
00230
00232 virtual int NumCompute() const
00233 {
00234 return(NumCompute_);
00235 }
00236
00238 virtual int NumApplyInverse() const
00239 {
00240 return(NumApplyInverse_);
00241 }
00242
00244 virtual double InitializeTime() const
00245 {
00246 return(InitializeTime_);
00247 }
00248
00250 virtual double ComputeTime() const
00251 {
00252 return(ComputeTime_);
00253 }
00254
00256 virtual double ApplyInverseTime() const
00257 {
00258 return(ApplyInverseTime_);
00259 }
00260
00262 virtual double InitializeFlops() const
00263 {
00264 return(0.0);
00265 }
00266
00268 virtual double ComputeFlops() const
00269 {
00270 return(ComputeFlops_);
00271 }
00272
00274 virtual double ApplyInverseFlops() const
00275 {
00276 return(ApplyInverseFlops_);
00277 }
00278
00280
00283 inline double LevelOfFill() const
00284 {
00285 return(LevelOfFill_);
00286 }
00287
00289 inline double AbsoluteThreshold() const
00290 {
00291 return(Athresh_);
00292 }
00293
00295 inline double RelativeThreshold() const
00296 {
00297 return(Rthresh_);
00298 }
00299
00301 inline double RelaxValue() const
00302 {
00303 return(Relax_);
00304 }
00305
00307 inline double DropTolerance() const
00308 {
00309 return(DropTolerance_);
00310 }
00311
00312 private:
00313
00315 Ifpack_ICT(const Ifpack_ICT& rhs) :
00316 A_(rhs.Matrix()),
00317 Comm_(Comm()),
00318 Time_(Comm())
00319 {}
00320
00322 Ifpack_ICT& operator=(const Ifpack_ICT& rhs)
00323 {
00324 return(*this);
00325 }
00326
00328 void Destroy();
00329
00331 const Epetra_RowMatrix& A_;
00333 const Epetra_Comm& Comm_;
00335 Teuchos::RefCountPtr<Epetra_CrsMatrix> H_;
00337 double Condest_;
00339 double Athresh_;
00341 double Rthresh_;
00343 double LevelOfFill_;
00345 double DropTolerance_;
00347 double Relax_;
00349 string Label_;
00351 bool IsInitialized_;
00353 bool IsComputed_;
00355 bool UseTranspose_;
00357 int NumMyRows_;
00359 int NumInitialize_;
00361 int NumCompute_;
00363 mutable int NumApplyInverse_;
00365 double InitializeTime_;
00367 double ComputeTime_;
00369 mutable double ApplyInverseTime_;
00371 double ComputeFlops_;
00373 mutable double ApplyInverseFlops_;
00375 mutable Epetra_Time Time_;
00377 int GlobalNonzeros_;
00378 Teuchos::RefCountPtr<Epetra_SerialComm> SerialComm_;
00379 Teuchos::RefCountPtr<Epetra_Map> SerialMap_;
00380 };
00381
00382 #endif