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_SPARSKIT_H
00031 #define IFPACK_SPARSKIT_H
00032
00033 #include "Ifpack_ConfigDefs.h"
00034 #if defined(HAVE_IFPACK_TEUCHOS) && defined(HAVE_IFPACK_SPARSKIT)
00035 #include "Ifpack_CondestType.h"
00036 #include "Ifpack_ScalingType.h"
00037 #include "Ifpack_Preconditioner.h"
00038 #include "Epetra_Vector.h"
00039 #include "Epetra_RowMatrix.h"
00040 class Epetra_Comm;
00041 class Epetra_Map;
00042 class Epetra_MultiVector;
00043 namespace Teuchos {
00044 class ParameterList;
00045 }
00046
00048
00049 class Ifpack_SPARSKIT: public Ifpack_Preconditioner {
00050
00051 public:
00053 Ifpack_SPARSKIT(Epetra_RowMatrix* A);
00054
00056 virtual ~Ifpack_SPARSKIT();
00057
00058 #ifdef HAVE_IFPACK_TEUCHOS
00059
00060
00061
00062
00063
00064
00065
00066
00067 int SetParameters(Teuchos::ParameterList& parameterlis);
00068 #endif
00069
00070 int SetParameter(const string Name, const int Value)
00071 {
00072 IFPACK_CHK_ERR(-98);
00073 }
00074 int SetParameter(const string Name, const double Value)
00075 {
00076 IFPACK_CHK_ERR(-98);
00077 }
00078
00079 const Epetra_RowMatrix& Matrix() const
00080 {
00081 return(A_);
00082 }
00083
00084 Epetra_RowMatrix& Matrix()
00085 {
00086 return(A_);
00087 }
00088
00089 bool IsInitialized() const
00090 {
00091 return(IsInitialized_);
00092 }
00093
00095 int Initialize();
00096
00098 int Compute();
00099
00101 bool IsComputed() const
00102 {
00103 return(IsComputed_);
00104 }
00105
00106
00107
00109
00119 int ApplyInverse(const Epetra_MultiVector& X, Epetra_MultiVector& Y) const;
00120
00121 int Apply(const Epetra_MultiVector& X, Epetra_MultiVector& Y) const
00122 {
00123 IFPACK_CHK_ERR(-1);
00124 }
00125
00127
00135 double Condest(const Ifpack_CondestType CT = Ifpack_Cheap,
00136 const int MaxIters = 1550,
00137 const double Tol = 1e-9,
00138 Epetra_RowMatrix* Matrix = 0);
00139
00140 double Condest() const
00141 {
00142 return(Condest_);
00143 }
00144
00145
00146
00148
00150
00159 int SetUseTranspose(bool UseTranspose) {UseTranspose_ = UseTranspose; return(0);};
00160
00162 double NormInf() const {return(0.0);};
00163
00165 bool HasNormInf() const {return(false);};
00166
00168 bool UseTranspose() const {return(UseTranspose_);};
00169
00171 const Epetra_Map & OperatorDomainMap() const {return(A_.OperatorDomainMap());};
00172
00174 const Epetra_Map & OperatorRangeMap() const{return(A_.OperatorRangeMap());};
00175
00177 const Epetra_Comm & Comm() const{return(Comm_);};
00179
00180 const char* Label() const
00181 {
00182 return(Label_.c_str());
00183 }
00184
00185 int SetLabel(const char* Label)
00186 {
00187 Label_ = Label;
00188 return(0);
00189 }
00190
00192 virtual ostream& Print(std::ostream& os) const;
00193
00195 virtual int NumInitialize() const
00196 {
00197 return(NumInitialize_);
00198 }
00199
00201 virtual int NumCompute() const
00202 {
00203 return(NumCompute_);
00204 }
00205
00207 virtual int NumApplyInverse() const
00208 {
00209 return(NumApplyInverse_);
00210 }
00211
00213 virtual double InitializeTime() const
00214 {
00215 return(InitializeTime_);
00216 }
00217
00219 virtual double ComputeTime() const
00220 {
00221 return(ComputeTime_);
00222 }
00223
00225 virtual double ApplyInverseTime() const
00226 {
00227 return(ApplyInverseTime_);
00228 }
00229
00231 virtual double InitializeFlops() const
00232 {
00233 return(0.0);
00234 }
00235
00236 virtual double ComputeFlops() const
00237 {
00238 return(0.0);
00239 }
00240
00241 virtual double ApplyInverseFlops() const
00242 {
00243 return(0.0);
00244 }
00245
00246 private:
00247 Epetra_RowMatrix& A_;
00248 const Epetra_Comm& Comm_;
00249 bool UseTranspose_;
00250 int lfil_;
00251 double droptol_;
00252 double tol_;
00253 double permtol_;
00254 double alph_;
00255 int mbloc_;
00256 string Type_;
00257
00258
00259 vector<double> alu_;
00260 vector<int> jlu_;
00261 vector<int> ju_;
00262
00263 string Label_;
00264
00265 vector<int> iperm_;
00266
00267 double Condest_;
00268
00269 bool IsInitialized_;
00270 bool IsComputed_;
00271
00273 int NumInitialize_;
00275 int NumCompute_;
00277 mutable int NumApplyInverse_;
00278
00280 double InitializeTime_;
00282 double ComputeTime_;
00284 mutable double ApplyInverseTime_;
00285
00287 double ComputeFlops_;
00289 mutable double ApplyInverseFlops_;
00290
00291 };
00292
00293 #endif // HAVE_IFPACK_TEUCHOS && HAVE_IFPACK_SPARSKIT
00294 #endif