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 #ifdef 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
00059
00060
00061
00062
00063
00064
00065
00066 int SetParameters(Teuchos::ParameterList& parameterlis);
00067
00068 int SetParameter(const string Name, const int Value)
00069 {
00070 IFPACK_CHK_ERR(-98);
00071 }
00072 int SetParameter(const string Name, const double Value)
00073 {
00074 IFPACK_CHK_ERR(-98);
00075 }
00076
00077 const Epetra_RowMatrix& Matrix() const
00078 {
00079 return(A_);
00080 }
00081
00082 Epetra_RowMatrix& Matrix()
00083 {
00084 return(A_);
00085 }
00086
00087 bool IsInitialized() const
00088 {
00089 return(IsInitialized_);
00090 }
00091
00093 int Initialize();
00094
00096 int Compute();
00097
00099 bool IsComputed() const
00100 {
00101 return(IsComputed_);
00102 }
00103
00104
00105
00107
00117 int ApplyInverse(const Epetra_MultiVector& X, Epetra_MultiVector& Y) const;
00118
00119 int Apply(const Epetra_MultiVector& X, Epetra_MultiVector& Y) const
00120 {
00121 IFPACK_CHK_ERR(-1);
00122 }
00123
00125
00133 double Condest(const Ifpack_CondestType CT = Ifpack_Cheap,
00134 const int MaxIters = 1550,
00135 const double Tol = 1e-9,
00136 Epetra_RowMatrix* Matrix = 0);
00137
00138 double Condest() const
00139 {
00140 return(Condest_);
00141 }
00142
00143
00144
00146
00148
00157 int SetUseTranspose(bool UseTranspose) {UseTranspose_ = UseTranspose; return(0);};
00158
00160 double NormInf() const {return(0.0);};
00161
00163 bool HasNormInf() const {return(false);};
00164
00166 bool UseTranspose() const {return(UseTranspose_);};
00167
00169 const Epetra_Map & OperatorDomainMap() const {return(A_.OperatorDomainMap());};
00170
00172 const Epetra_Map & OperatorRangeMap() const{return(A_.OperatorRangeMap());};
00173
00175 const Epetra_Comm & Comm() const{return(Comm_);};
00177
00178 const char* Label() const
00179 {
00180 return(Label_.c_str());
00181 }
00182
00183 int SetLabel(const char* Label)
00184 {
00185 Label_ = Label;
00186 return(0);
00187 }
00188
00190 virtual ostream& Print(std::ostream& os) const;
00191
00193 virtual int NumInitialize() const
00194 {
00195 return(NumInitialize_);
00196 }
00197
00199 virtual int NumCompute() const
00200 {
00201 return(NumCompute_);
00202 }
00203
00205 virtual int NumApplyInverse() const
00206 {
00207 return(NumApplyInverse_);
00208 }
00209
00211 virtual double InitializeTime() const
00212 {
00213 return(InitializeTime_);
00214 }
00215
00217 virtual double ComputeTime() const
00218 {
00219 return(ComputeTime_);
00220 }
00221
00223 virtual double ApplyInverseTime() const
00224 {
00225 return(ApplyInverseTime_);
00226 }
00227
00229 virtual double InitializeFlops() const
00230 {
00231 return(0.0);
00232 }
00233
00234 virtual double ComputeFlops() const
00235 {
00236 return(0.0);
00237 }
00238
00239 virtual double ApplyInverseFlops() const
00240 {
00241 return(0.0);
00242 }
00243
00244 private:
00245 Epetra_RowMatrix& A_;
00246 const Epetra_Comm& Comm_;
00247 bool UseTranspose_;
00248 int lfil_;
00249 double droptol_;
00250 double tol_;
00251 double permtol_;
00252 double alph_;
00253 int mbloc_;
00254 string Type_;
00255
00256
00257 std::vector<double> alu_;
00258 std::vector<int> jlu_;
00259 std::vector<int> ju_;
00260
00261 string Label_;
00262
00263 std::vector<int> iperm_;
00264
00265 double Condest_;
00266
00267 bool IsInitialized_;
00268 bool IsComputed_;
00269
00271 int NumInitialize_;
00273 int NumCompute_;
00275 mutable int NumApplyInverse_;
00276
00278 double InitializeTime_;
00280 double ComputeTime_;
00282 mutable double ApplyInverseTime_;
00283
00285 double ComputeFlops_;
00287 mutable double ApplyInverseFlops_;
00288
00289 };
00290
00291 #endif // HAVE_IFPACK_SPARSKIT
00292 #endif