46 #include "Ifpack_ConfigDefs.h" 47 #include "Ifpack_Preconditioner.h" 48 #include "Ifpack_Condest.h" 50 #include "Ifpack_IlukGraph.h" 51 #include "Epetra_CompObject.h" 52 #include "Epetra_MultiVector.h" 53 #include "Epetra_Vector.h" 54 #include "Epetra_CrsGraph.h" 55 #include "Epetra_CrsMatrix.h" 56 #include "Epetra_BlockMap.h" 57 #include "Epetra_Map.h" 58 #include "Epetra_Object.h" 59 #include "Epetra_Comm.h" 60 #include "Epetra_RowMatrix.h" 61 #include "Epetra_Time.h" 62 #include "Teuchos_RefCountPtr.hpp" 104 return(IsInitialized_);
132 int SetParameters(Teuchos::ParameterList& parameterlist);
144 int SetUseTranspose(
bool UseTranspose_in) {UseTranspose_ = UseTranspose_in;
return(0);};
149 int Apply(
const Epetra_MultiVector& X,
150 Epetra_MultiVector& Y)
const 152 return(Multiply(
false,X,Y));
155 int Multiply(
bool Trans,
const Epetra_MultiVector& X,
156 Epetra_MultiVector& Y)
const;
172 int ApplyInverse(
const Epetra_MultiVector& X, Epetra_MultiVector& Y)
const;
175 double Condest(
const Ifpack_CondestType CT = Ifpack_Cheap,
176 const int MaxIters = 1550,
177 const double Tol = 1e-9,
178 Epetra_RowMatrix* Matrix_in = 0);
190 const Epetra_CrsMatrix &
L()
const {
return(*L_);};
193 const Epetra_Vector &
D()
const {
return(*D_);};
196 const Epetra_CrsMatrix &
U()
const {
return(*U_);};
199 const char*
Label()
const {
return(Label_);}
204 strcpy(Label_,Label_in);
224 const Epetra_Comm &
Comm()
const{
return(Comm_);};
233 virtual ostream& Print(ostream& os)
const;
238 return(NumInitialize_);
250 return(NumApplyInverse_);
256 return(InitializeTime_);
262 return(ComputeTime_);
268 return(ApplyInverseTime_);
279 return(ComputeFlops_);
284 return(ApplyInverseFlops_);
318 int Solve(
bool Trans,
const Epetra_MultiVector& X, Epetra_MultiVector& Y)
const;
321 int InitAllValues(
const Epetra_RowMatrix & A,
int MaxNumEntries);
324 int LevelOfFill()
const {
return LevelOfFill_;}
327 double RelaxValue()
const {
return RelaxValue_;}
330 double AbsoluteThreshold()
const {
return Athresh_;}
333 double RelativeThreshold()
const {
return Rthresh_;}
336 int NumGlobalRows()
const {
return(Graph().NumGlobalRows());};
339 int NumGlobalCols()
const {
return(Graph().NumGlobalCols());};
342 int NumGlobalNonzeros()
const {
return(L().NumGlobalNonzeros()+U().NumGlobalNonzeros());};
345 virtual int NumGlobalBlockDiagonals()
const {
return(Graph().NumGlobalBlockDiagonals());};
348 int NumMyRows()
const {
return(Graph().NumMyRows());};
351 int NumMyCols()
const {
return(Graph().NumMyCols());};
354 int NumMyNonzeros()
const {
return(L().NumMyNonzeros()+U().NumMyNonzeros());};
357 virtual int NumMyBlockDiagonals()
const {
return(Graph().NumMyBlockDiagonals());};
360 virtual int NumMyDiagonals()
const {
return(NumMyDiagonals_);};
363 int IndexBase()
const {
return(Graph().IndexBase());};
369 Epetra_RowMatrix& Matrix()
378 Teuchos::RefCountPtr<Epetra_RowMatrix> A_;
379 Teuchos::RefCountPtr<Ifpack_IlukGraph> Graph_;
380 Teuchos::RefCountPtr<Epetra_CrsGraph> CrsGraph_;
381 Teuchos::RefCountPtr<Epetra_Map> IlukRowMap_;
382 Teuchos::RefCountPtr<Epetra_Map> IlukDomainMap_;
383 Teuchos::RefCountPtr<Epetra_Map> IlukRangeMap_;
384 const Epetra_Map * U_DomainMap_;
385 const Epetra_Map * L_RangeMap_;
386 const Epetra_Comm & Comm_;
388 Teuchos::RefCountPtr<Epetra_CrsMatrix> L_;
390 Teuchos::RefCountPtr<Epetra_CrsMatrix> U_;
391 Teuchos::RefCountPtr<Epetra_CrsGraph> L_Graph_;
392 Teuchos::RefCountPtr<Epetra_CrsGraph> U_Graph_;
394 Teuchos::RefCountPtr<Epetra_Vector> D_;
399 bool ValuesInitialized_;
422 mutable int NumApplyInverse_;
424 double InitializeTime_;
428 mutable double ApplyInverseTime_;
430 double ComputeFlops_;
432 mutable double ApplyInverseFlops_;
434 mutable Epetra_Time Time_;
virtual double InitializeFlops() const
Returns the number of flops in the initialization phase.
virtual int NumCompute() const
Returns the number of calls to Compute().
bool HasNormInf() const
Returns false because this class cannot compute an Inf-norm.
virtual double ComputeFlops() const
Returns the number of flops in the computation phase.
int SetUseTranspose(bool UseTranspose_in)
If set true, transpose of this operator will be applied.
const Epetra_Map & OperatorDomainMap() const
Returns the Epetra_Map object associated with the domain of this operator.
bool UseTranspose() const
Returns the current UseTranspose setting.
Ifpack_IlukGraph: A class for constructing level filled graphs for use with ILU(k) class precondition...
const Epetra_RowMatrix & Matrix() const
Returns a reference to the matrix to be preconditioned.
const Epetra_Comm & Comm() const
Returns the Epetra_BlockMap object associated with the range of this matrix operator.
const Epetra_Map & OperatorRangeMap() const
Returns the Epetra_Map object associated with the range of this operator.
Ifpack_ILU: A class for constructing and using an incomplete lower/upper (ILU) factorization of a giv...
const Epetra_CrsMatrix & U() const
Returns the address of the L factor associated with this factored matrix.
virtual double ComputeTime() const
Returns the time spent in Compute().
int SetLabel(const char *Label_in)
Sets label for this object.
bool IsComputed() const
If factor is completed, this query returns true, otherwise it returns false.
virtual double ApplyInverseTime() const
Returns the time spent in ApplyInverse().
Ifpack_ScalingType enumerable type.
Ifpack_Preconditioner: basic class for preconditioning in Ifpack.
const Epetra_CrsMatrix & L() const
Returns the address of the L factor associated with this factored matrix.
virtual double InitializeTime() const
Returns the time spent in Initialize().
virtual double ApplyInverseFlops() const
Returns the number of flops in the application of the preconditioner.
bool IsInitialized() const
Returns true if the preconditioner has been successfully initialized.
double Condest() const
Returns the computed estimated condition number, or -1.0 if not computed.
double NormInf() const
Returns 0.0 because this class cannot compute Inf-norm.
const char * Label() const
Returns a character string describing the operator.
virtual int NumApplyInverse() const
Returns the number of calls to ApplyInverse().
virtual int NumInitialize() const
Returns the number of calls to Initialize().
const Epetra_Vector & D() const
Returns the address of the D factor associated with this factored matrix.