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 #ifndef AMESOS_PARDISO_H
00030 #define AMESOS_PARDISO_H
00031
00032 #include "Amesos_ConfigDefs.h"
00033 #include "Amesos_BaseSolver.h"
00034 #include "Amesos_NoCopiable.h"
00035 #include "Amesos_Utils.h"
00036 #include "Amesos_Time.h"
00037 #include "Amesos_Status.h"
00038 #include "Amesos_Control.h"
00039 #include "Epetra_LinearProblem.h"
00040 #include "Epetra_Time.h"
00041 #include "Epetra_Map.h"
00042 #include "Epetra_Import.h"
00043 #include "Epetra_Comm.h"
00044 #include "Epetra_RowMatrix.h"
00045 #include "Epetra_CrsMatrix.h"
00046 #include "Teuchos_ParameterList.hpp"
00047 #include "Teuchos_RCP.hpp"
00048
00050
00057 class Amesos_Pardiso: public Amesos_BaseSolver,
00058 private Amesos_Time,
00059 private Amesos_NoCopiable,
00060 private Amesos_Utils,
00061 private Amesos_Control,
00062 private Amesos_Status {
00063
00064 public:
00065
00067
00068 Amesos_Pardiso(const Epetra_LinearProblem& LinearProblem );
00069
00071 ~Amesos_Pardiso();
00073
00075
00077 int SymbolicFactorization() ;
00078
00080 int NumericFactorization() ;
00081
00083 int Solve();
00085
00087
00089 const Epetra_LinearProblem* GetProblem() const { return(Problem_); };
00090
00092
00095 bool MatrixShapeOK() const;
00096
00098
00102 int SetUseTranspose(bool UseTranspose) {UseTranspose_ = UseTranspose; return(0);};
00103
00105 bool UseTranspose() const {return(UseTranspose_);};
00106
00108 const Epetra_Comm& Comm() const {return(GetProblem()->GetOperator()->Comm());};
00109
00111 int SetParameters( Teuchos::ParameterList &ParameterList);
00112
00114 int NumSymbolicFact() const { return( Amesos_Status::NumSymbolicFact_ ); }
00115
00117 int NumNumericFact() const { return( Amesos_Status::NumNumericFact_ ); }
00118
00120 int NumSolve() const { return( Amesos_Status::NumSolve_ ); }
00121
00123 void PrintTiming() const;
00124
00126 void PrintStatus() const;
00127
00129 void GetTiming( Teuchos::ParameterList &TimingParameterList ) const { Amesos_Time::GetTiming(TimingParameterList); }
00130
00132
00133 private:
00134
00135 int CheckError(const int error) const;
00136
00137 inline const Epetra_Map& Map() const
00138 {
00139 return(Matrix_->RowMatrixRowMap());
00140 }
00141
00142 inline const Epetra_RowMatrix& Matrix() const
00143 {
00144 return(*Matrix_);
00145 }
00146
00147 inline Epetra_Map& SerialMap()
00148 {
00149 return(*(SerialMap_.get()));
00150 }
00151
00152 inline Epetra_RowMatrix& SerialMatrix()
00153 {
00154 return(*(SerialMatrix_.get()));
00155 }
00156
00157 inline Epetra_CrsMatrix& SerialCrsMatrix()
00158 {
00159 return(*(SerialCrsMatrix_.get()));
00160 }
00161
00162 inline Epetra_Import& Importer()
00163 {
00164 return(*(Importer_.get()));
00165 }
00166
00167 int ConvertToSerial();
00168 int ConvertToPardiso();
00169 int PerformSymbolicFactorization();
00170 int PerformNumericFactorization();
00171
00172 Teuchos::RCP<Epetra_Map> SerialMap_;
00173 Teuchos::RCP<Epetra_CrsMatrix> SerialCrsMatrix_;
00174 Teuchos::RCP<Epetra_RowMatrix> SerialMatrix_;
00175 Teuchos::RCP<Epetra_Import> Importer_;
00176
00177 const Epetra_Map* Map_;
00178 const Epetra_RowMatrix* Matrix_;
00179
00181 bool UseTranspose_;
00183 const Epetra_LinearProblem* Problem_;
00184
00186 int MtxConvTime_, MtxRefactTime_, VecRefactTime_;
00187 int SymFactTime_, NumFactTime_, SolveTime_;
00188
00189
00190 std::vector<double> aa_;
00191 std::vector<int> ia_;
00192 std::vector<int> ja_;
00193
00194 bool pardiso_initialized_ ;
00195 int mtype_;
00196 void* pt_[64];
00197
00198 int iparm_[64];
00199 int maxfct_;
00200 int mnum_;
00201 int msglvl_;
00202 int nrhs_;
00203
00204 };
00205 #endif