46 #include "Ifpack_ConfigDefs.h"
47 #include "Ifpack_Preconditioner.h"
49 #ifdef HAVE_IFPACK_EPETRAEXT
50 #include "Ifpack_Condest.h"
52 #include "Epetra_CompObject.h"
53 #include "Epetra_MultiVector.h"
54 #include "Epetra_Vector.h"
55 #include "Epetra_CrsGraph.h"
56 #include "Epetra_CrsMatrix.h"
57 #include "Epetra_BlockMap.h"
58 #include "Epetra_Map.h"
59 #include "Epetra_Object.h"
60 #include "Epetra_Comm.h"
61 #include "Epetra_CrsMatrix.h"
62 #include "Epetra_Time.h"
63 #include "Teuchos_RefCountPtr.hpp"
64 #include "EpetraExt_Transpose_RowMatrix.h"
87 Ifpack_SORa(Epetra_RowMatrix* A);
104 return(IsInitialized_);
138 int SetUseTranspose(
bool UseTranspose_in) {UseTranspose_ = UseTranspose_in;
return(0);};
143 int Apply(
const Epetra_MultiVector& X,
144 Epetra_MultiVector& Y)
const
146 return(Multiply(
false,X,Y));
149 int Multiply(
bool Trans,
const Epetra_MultiVector& X,
150 Epetra_MultiVector& Y)
const{
return A_->Multiply(Trans,X,Y);}
166 int ApplyInverse(
const Epetra_MultiVector& X, Epetra_MultiVector& Y)
const;
169 double Condest(
const Ifpack_CondestType CT = Ifpack_Cheap,
170 const int MaxIters = 1550,
171 const double Tol = 1e-9,
172 Epetra_RowMatrix* Matrix_in = 0);
184 const char* Label()
const {
return(Label_);}
187 int SetLabel(
const char* Label_in)
189 strcpy(Label_,Label_in);
194 double NormInf()
const {
return(0.0);};
197 bool HasNormInf()
const {
return(
false);};
200 bool UseTranspose()
const {
return(UseTranspose_);};
203 const Epetra_Map & OperatorDomainMap()
const {
return(A_->OperatorDomainMap());};
206 const Epetra_Map & OperatorRangeMap()
const{
return(A_->OperatorRangeMap());};
209 const Epetra_Comm & Comm()
const{
return(A_->Comm());};
212 const Epetra_RowMatrix&
Matrix()
const
218 virtual double GetLambdaMax()
const{
return LambdaMax_;}
221 virtual double GetOmega()
const{
if(UseGlobalDamping_)
return 12.0/(11.0*LambdaMax_);
else return 1.0;}
224 virtual ostream&
Print(ostream& os)
const;
229 return(NumInitialize_);
241 return(NumApplyInverse_);
247 return(InitializeTime_);
253 return(ComputeTime_);
259 return(ApplyInverseTime_);
270 return(ComputeFlops_);
275 return(ApplyInverseFlops_);
284 Ifpack_SORa(
const Ifpack_SORa& RHS) :
289 Ifpack_SORa& operator=(
const Ifpack_SORa& RHS)
308 int Solve(
bool Trans,
const Epetra_MultiVector& X, Epetra_MultiVector& Y)
const;
312 int NumGlobalRows()
const {
return(A_->NumGlobalRows());};
315 int NumGlobalCols()
const {
return(A_->NumGlobalCols());};
318 int NumMyRows()
const {
return(A_->NumMyRows());};
321 int NumMyCols()
const {
return(A_->NumMyCols());};
324 int PowerMethod(
const int MaximumIterations,
double& lambda_max);
337 Teuchos::RefCountPtr<Epetra_CrsMatrix> Acrs_;
338 Teuchos::RefCountPtr<Epetra_RowMatrix> A_;
339 Teuchos::RefCountPtr<Epetra_CrsMatrix> W_;
340 Teuchos::RefCountPtr<Epetra_Vector> Wdiag_;
341 Teuchos::ParameterList List_;
367 bool HaveOAZBoundaries_;
369 bool UseInterprocDamping_;
371 bool UseGlobalDamping_;
376 mutable int NumApplyInverse_;
378 double InitializeTime_;
382 mutable double ApplyInverseTime_;
384 double ComputeFlops_;
386 mutable double ApplyInverseFlops_;
388 mutable Epetra_Time Time_;
virtual int NumInitialize() const =0
Returns the number of calls to Initialize().
virtual double ComputeTime() const =0
Returns the time spent in Compute().
virtual double ComputeFlops() const =0
Returns the number of flops in the computation phase.
virtual double ApplyInverseTime() const =0
Returns the time spent in ApplyInverse().
virtual double ApplyInverseFlops() const =0
Returns the number of flops in the application of the preconditioner.
virtual const Epetra_RowMatrix & Matrix() const =0
Returns a pointer to the matrix to be preconditioned.
virtual bool IsInitialized() const =0
Returns true if the preconditioner has been successfully initialized, false otherwise.
virtual int Initialize()=0
Computes all it is necessary to initialize the preconditioner.
virtual double InitializeTime() const =0
Returns the time spent in Initialize().
virtual ostream & Print(std::ostream &os) const =0
Prints basic information on iostream. This function is used by operator<<.
virtual int SetParameters(Teuchos::ParameterList &List)=0
Sets all parameters for the preconditioner.
virtual double Condest() const =0
Returns the computed condition number estimate, or -1.0 if not computed.
Ifpack_ScalingType enumerable type.
Ifpack_Preconditioner: basic class for preconditioning in Ifpack.
virtual int ApplyInverse(const Epetra_MultiVector &X, Epetra_MultiVector &Y) const =0
Applies the preconditioner to vector X, returns the result in Y.
virtual double InitializeFlops() const =0
Returns the number of flops in the initialization phase.
virtual int NumCompute() const =0
Returns the number of calls to Compute().
virtual bool IsComputed() const =0
Returns true if the preconditioner has been successfully computed, false otherwise.
virtual int Compute()=0
Computes all it is necessary to apply the preconditioner.
virtual int NumApplyInverse() const =0
Returns the number of calls to ApplyInverse().