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
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043 #ifndef IFPACK_SPARSKIT_H
00044 #define IFPACK_SPARSKIT_H
00045
00046 #include "Ifpack_ConfigDefs.h"
00047 #ifdef HAVE_IFPACK_SPARSKIT
00048 #include "Ifpack_CondestType.h"
00049 #include "Ifpack_ScalingType.h"
00050 #include "Ifpack_Preconditioner.h"
00051 #include "Epetra_Vector.h"
00052 #include "Epetra_RowMatrix.h"
00053 class Epetra_Comm;
00054 class Epetra_Map;
00055 class Epetra_MultiVector;
00056 namespace Teuchos {
00057 class ParameterList;
00058 }
00059
00061
00062 class Ifpack_SPARSKIT: public Ifpack_Preconditioner {
00063
00064 public:
00066 Ifpack_SPARSKIT(Epetra_RowMatrix* A);
00067
00069 virtual ~Ifpack_SPARSKIT();
00070
00072
00073
00074
00075
00076
00077
00078
00079 int SetParameters(Teuchos::ParameterList& parameterlis);
00080
00081 int SetParameter(const string Name, const int Value)
00082 {
00083 IFPACK_CHK_ERR(-98);
00084 }
00085 int SetParameter(const string Name, const double Value)
00086 {
00087 IFPACK_CHK_ERR(-98);
00088 }
00089
00090 const Epetra_RowMatrix& Matrix() const
00091 {
00092 return(A_);
00093 }
00094
00095 Epetra_RowMatrix& Matrix()
00096 {
00097 return(A_);
00098 }
00099
00100 bool IsInitialized() const
00101 {
00102 return(IsInitialized_);
00103 }
00104
00106 int Initialize();
00107
00109 int Compute();
00110
00112 bool IsComputed() const
00113 {
00114 return(IsComputed_);
00115 }
00116
00117
00118
00120
00130 int ApplyInverse(const Epetra_MultiVector& X, Epetra_MultiVector& Y) const;
00131
00132 int Apply(const Epetra_MultiVector& X, Epetra_MultiVector& Y) const
00133 {
00134 IFPACK_CHK_ERR(-1);
00135 }
00136
00138
00146 double Condest(const Ifpack_CondestType CT = Ifpack_Cheap,
00147 const int MaxIters = 1550,
00148 const double Tol = 1e-9,
00149 Epetra_RowMatrix* Matrix = 0);
00150
00151 double Condest() const
00152 {
00153 return(Condest_);
00154 }
00155
00156
00157
00159
00161
00170 int SetUseTranspose(bool UseTranspose) {UseTranspose_ = UseTranspose; return(0);};
00171
00173 double NormInf() const {return(0.0);};
00174
00176 bool HasNormInf() const {return(false);};
00177
00179 bool UseTranspose() const {return(UseTranspose_);};
00180
00182 const Epetra_Map & OperatorDomainMap() const {return(A_.OperatorDomainMap());};
00183
00185 const Epetra_Map & OperatorRangeMap() const{return(A_.OperatorRangeMap());};
00186
00188 const Epetra_Comm & Comm() const{return(Comm_);};
00190
00191 const char* Label() const
00192 {
00193 return(Label_.c_str());
00194 }
00195
00196 int SetLabel(const char* Label)
00197 {
00198 Label_ = Label;
00199 return(0);
00200 }
00201
00203 virtual ostream& Print(std::ostream& os) const;
00204
00206 virtual int NumInitialize() const
00207 {
00208 return(NumInitialize_);
00209 }
00210
00212 virtual int NumCompute() const
00213 {
00214 return(NumCompute_);
00215 }
00216
00218 virtual int NumApplyInverse() const
00219 {
00220 return(NumApplyInverse_);
00221 }
00222
00224 virtual double InitializeTime() const
00225 {
00226 return(InitializeTime_);
00227 }
00228
00230 virtual double ComputeTime() const
00231 {
00232 return(ComputeTime_);
00233 }
00234
00236 virtual double ApplyInverseTime() const
00237 {
00238 return(ApplyInverseTime_);
00239 }
00240
00242 virtual double InitializeFlops() const
00243 {
00244 return(0.0);
00245 }
00246
00247 virtual double ComputeFlops() const
00248 {
00249 return(0.0);
00250 }
00251
00252 virtual double ApplyInverseFlops() const
00253 {
00254 return(0.0);
00255 }
00256
00257 private:
00258 Epetra_RowMatrix& A_;
00259 const Epetra_Comm& Comm_;
00260 bool UseTranspose_;
00261 int lfil_;
00262 double droptol_;
00263 double tol_;
00264 double permtol_;
00265 double alph_;
00266 int mbloc_;
00267 string Type_;
00268
00269
00270 std::vector<double> alu_;
00271 std::vector<int> jlu_;
00272 std::vector<int> ju_;
00273
00274 string Label_;
00275
00276 std::vector<int> iperm_;
00277
00278 double Condest_;
00279
00280 bool IsInitialized_;
00281 bool IsComputed_;
00282
00284 int NumInitialize_;
00286 int NumCompute_;
00288 mutable int NumApplyInverse_;
00289
00291 double InitializeTime_;
00293 double ComputeTime_;
00295 mutable double ApplyInverseTime_;
00296
00298 double ComputeFlops_;
00300 mutable double ApplyInverseFlops_;
00301
00302 };
00303
00304 #endif // HAVE_IFPACK_SPARSKIT
00305 #endif