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
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066 #ifndef AMESOS_SUPERLU_H
00067 #define AMESOS_SUPERLU_H
00068
00069 #include "Amesos_ConfigDefs.h"
00070 #include "Amesos_BaseSolver.h"
00071 #include "Amesos_NoCopiable.h"
00072 #include "Amesos_Utils.h"
00073 #include "Amesos_Time.h"
00074 #include "Amesos_Status.h"
00075 #include "Amesos_Control.h"
00076 #include "Teuchos_RCP.hpp"
00077
00078 class SLUData;
00079 class Epetra_Comm;
00080 class Epetra_CrsMatrix;
00081 class Epetra_LinearProblem;
00082
00084
00092 class Amesos_Superlu: public Amesos_BaseSolver,
00093 private Amesos_Time,
00094 private Amesos_NoCopiable,
00095 private Amesos_Utils,
00096 private Amesos_Control,
00097 private Amesos_Status {
00098
00099 public:
00100
00102
00103
00110 Amesos_Superlu(const Epetra_LinearProblem& LinearProblem );
00111
00113 ~Amesos_Superlu();
00114
00116
00117
00118 int SymbolicFactorization();
00119
00120 int NumericFactorization();
00121
00122 int Solve();
00123
00125
00126
00127 const Epetra_LinearProblem *GetProblem() const { return(Problem_); };
00128
00129 bool MatrixShapeOK() const ;
00130
00131 int SetUseTranspose(bool UseTranspose) {
00132 UseTranspose_ = UseTranspose; return(0);
00133 }
00134
00135 bool UseTranspose() const {return(UseTranspose_);};
00136
00137 const Epetra_Comm& Comm() const {return(GetProblem()->GetOperator()->Comm());};
00138
00139 int SetParameters( Teuchos::ParameterList &ParameterList ) ;
00140
00142 int NumSymbolicFact() const { return( Amesos_Status::NumSymbolicFact_ ); }
00143
00145 int NumNumericFact() const { return( Amesos_Status::NumNumericFact_ ); }
00146
00148 int NumSolve() const { return( Amesos_Status::NumSolve_ ); }
00149
00151 void PrintTiming() const;
00152
00154 void PrintStatus() const;
00155
00157 void GetTiming( Teuchos::ParameterList &TimingParameterList ) const { Amesos_Time::GetTiming(TimingParameterList); }
00158
00159 private:
00160
00162
00163
00165
00166 const Epetra_Map& SerialMap() const
00167 {
00168 return(*(SerialMap_.get()));
00169 }
00170
00172
00173 const Epetra_Import& ImportToSerial() const
00174 {
00175 return(*(ImportToSerial_.get()));
00176 }
00177
00179 int Factor();
00181 int ReFactor();
00182
00184 int ConvertToSerial();
00185
00187
00188 int PerformNumericFactorization();
00189
00191
00193 SLUData* data_;
00194 std::vector<double> berr_;
00195 std::vector<double> ferr_;
00196 std::vector<int> perm_r_;
00197 std::vector<int> perm_c_;
00198 std::vector<int> etree_;
00199 std::vector<double> R_;
00200 std::vector<double> C_;
00201 char equed_;
00202
00203 double* DummyArray;
00204
00206 std::vector <int> Ap_;
00208 std::vector <int> Ai_;
00210 std::vector <double> Aval_;
00212 int NumGlobalRows_;
00214 int NumGlobalNonzeros_;
00216 bool UseTranspose_;
00218 bool FactorizationOK_;
00219 bool FactorizationDone_;
00220 bool ReuseSymbolic_;
00222 int iam_;
00224 int MtxConvTime_, MtxRedistTime_, VecRedistTime_;
00225 int NumFactTime_, SolveTime_, OverheadTime_;
00227 Teuchos::RCP<Epetra_Map> SerialMap_;
00229 Teuchos::RCP<Epetra_CrsMatrix> SerialCrsMatrixA_;
00231 Teuchos::RCP<Epetra_Import> ImportToSerial_;
00233 Epetra_RowMatrix* SerialMatrix_ ;
00235 const Epetra_LinearProblem* Problem_;
00237 Epetra_RowMatrix* RowMatrixA_;
00238
00239 };
00240 #endif