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
00039 #ifndef AMESOS_TAUCS_H
00040 #define AMESOS_TAUCS_H
00041
00042 #include "Amesos_ConfigDefs.h"
00043 #include "Amesos_BaseSolver.h"
00044 #include "Amesos_NoCopiable.h"
00045 #include "Amesos_Utils.h"
00046 #include "Amesos_Time.h"
00047 #include "Amesos_Status.h"
00048 #include "Amesos_Control.h"
00049 #include "Epetra_LinearProblem.h"
00050 #include "Epetra_Map.h"
00051 #include "Epetra_Import.h"
00052 #include "Epetra_Comm.h"
00053 #include "Epetra_RowMatrix.h"
00054 #include "Epetra_CrsMatrix.h"
00055 #include "Teuchos_ParameterList.hpp"
00056 #include "Teuchos_RCP.hpp"
00057 extern "C" {
00058
00059 }
00060
00069 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00070 class Amesos_Taucs_Pimpl ;
00071 #endif
00072
00073 class Amesos_Taucs: public Amesos_BaseSolver,
00074 private Amesos_Time,
00075 private Amesos_NoCopiable,
00076 private Amesos_Utils,
00077 private Amesos_Control,
00078 private Amesos_Status {
00079
00080 public:
00081
00083
00085 Amesos_Taucs(const Epetra_LinearProblem& LinearProblem );
00086
00088 ~Amesos_Taucs(void);
00089
00091
00092
00093 int SymbolicFactorization() ;
00094
00095 int NumericFactorization() ;
00096
00097 int Solve();
00098
00100
00101
00102 const Epetra_LinearProblem* GetProblem() const { return(Problem_); };
00103
00105
00106
00107 bool MatrixShapeOK() const;
00108
00110
00112 int SetUseTranspose(bool UseTranspose) {UseTranspose_ = UseTranspose; return(0);};
00113
00114 bool UseTranspose() const {return(UseTranspose_);};
00115
00116 const Epetra_Comm& Comm() const {return(GetProblem()->GetOperator()->Comm());};
00117
00118 int SetParameters( Teuchos::ParameterList &ParameterList);
00119
00121 int NumSymbolicFact() const { return( Amesos_Status::NumSymbolicFact_ ); }
00122
00124 int NumNumericFact() const { return( Amesos_Status::NumNumericFact_ ); }
00125
00127 int NumSolve() const { return( Amesos_Status::NumSolve_ ); }
00128
00130 void PrintTiming() const;
00131
00133 void PrintStatus() const;
00134
00136 void GetTiming( Teuchos::ParameterList &TimingParameterList ) const { Amesos_Time::GetTiming(TimingParameterList); }
00137
00138 private:
00139
00141
00142
00144 inline const Epetra_Map& Map() const
00145 {
00146 return(Matrix_->RowMatrixRowMap());
00147 }
00148
00150 inline const Epetra_RowMatrix& Matrix() const
00151 {
00152 return(*Matrix_);
00153 }
00154
00156 inline Epetra_Map& SerialMap()
00157 {
00158 return(*(SerialMap_.get()));
00159 }
00160
00162 inline Epetra_RowMatrix& SerialMatrix()
00163 {
00164 return(*(SerialMatrix_.get()));
00165 }
00166
00168 inline Epetra_CrsMatrix& SerialCrsMatrix()
00169 {
00170 return(*(SerialCrsMatrix_.get()));
00171 }
00172
00174 inline Epetra_Import& Importer()
00175 {
00176 return(*(Importer_.get()));
00177 }
00178
00180 int ConvertToSerial();
00181
00183 int ConvertToTaucs();
00184
00186 int PerformSymbolicFactorization();
00187
00189 int PerformNumericFactorization();
00190
00191
00192
00194 bool UseTranspose_;
00195
00196 Teuchos::RCP<Epetra_Map> SerialMap_;
00197 Teuchos::RCP<Epetra_CrsMatrix> SerialCrsMatrix_;
00198 Teuchos::RCP<Epetra_RowMatrix> SerialMatrix_;
00199 Teuchos::RCP<Epetra_Import> Importer_;
00200
00201 const Epetra_Map* Map_;
00202 const Epetra_RowMatrix* Matrix_;
00203
00205 const Epetra_LinearProblem* Problem_;
00206
00208 int MtxConvTime_, MtxRedistTime_, VecRedistTime_;
00209 int SymFactTime_, NumFactTime_, SolveTime_;
00210
00211
00212
00213
00214
00215 Teuchos::RCP<Amesos_Taucs_Pimpl> PrivateTaucsData_;
00216
00217
00218 };
00219
00220 #endif