47#include "Epetra_MultiVector.h"
48#include "Epetra_Map.h"
49#include "Epetra_Comm.h"
51#include "Epetra_LinearProblem.h"
52#include "Epetra_RowMatrix.h"
53#include "Epetra_Time.h"
54#include "Teuchos_ParameterList.hpp"
63 IsInitialized_(
false),
71 ApplyInverseTime_(0.0),
73 ApplyInverseFlops_(0),
84 IsInitialized_(
false),
86 NumInitialize_(rhs.NumInitialize()),
87 NumCompute_(rhs.NumCompute()),
88 NumApplyInverse_(rhs.NumApplyInverse()),
89 InitializeTime_(rhs.InitializeTime()),
90 ComputeTime_(rhs.ComputeTime()),
91 ApplyInverseTime_(rhs.ApplyInverseTime()),
92 ComputeFlops_(rhs.ComputeFlops()),
93 ApplyInverseFlops_(rhs.ApplyInverseFlops()),
94 Condest_(rhs.Condest())
100 Teuchos::ParameterList RHSList(rhs.
List());
143 if (
Comm().NumProc() != 1) {
144 cout <<
"Class Ifpack_Amesos must be used for serial runs;" << endl;
145 cout <<
"for parallel runs you should declare objects as:" << endl;
146 cout <<
"Ifpack_AdditiveSchwarz<Ifpack_Amesos> APrec(Matrix)" << endl;
156 if (
Matrix_->NumGlobalRows64() == 0) {
166 if (
Time_ == Teuchos::null)
185 cerr <<
"IFPACK WARNING: In class Ifpack_Amesos:" << endl;
186 cerr <<
"IFPACK WARNING: Using LAPACK because other Amesos" << endl;
187 cerr <<
"IFPACK WARNING: solvers are not available. LAPACK" << endl;
188 cerr <<
"IFPACK WARNING: allocates memory to store the matrix as" << endl;
189 cerr <<
"IFPACK WARNING: dense, I hope you have enough memory..." << endl;
190 cerr <<
"IFPACK WARNING: (file " << __FILE__ <<
", line " << __LINE__
225 Time_->ResetStartTime();
274 Time_->ResetStartTime();
278 Teuchos::RefCountPtr<const Epetra_MultiVector> Xcopy;
282 Xcopy = Teuchos::rcp( &X,
false );
303 return((
char*)
Label_.c_str());
327 return(
Matrix_->OperatorDomainMap());
333 return(
Matrix_->OperatorRangeMap());
338 const int MaxIters,
const double Tol,
356 if (!
Comm().MyPID()) {
358 os <<
"================================================================================" << endl;
359 os <<
"Ifpack_Amesos: " <<
Label () << endl << endl;
360 os <<
"Condition number estimate = " <<
Condest() << endl;
361 os <<
"Global number of rows = " <<
Matrix_->NumGlobalRows64() << endl;
363 os <<
"Phase # calls Total Time (s) Total MFlops MFlops/s" << endl;
364 os <<
"----- ------- -------------- ------------ --------" << endl;
367 <<
" 0.0 0.0" << endl;
374 os <<
" " << std::setw(15) << 0.0 << endl;
381 os <<
" " << std::setw(15) << 0.0 << endl;
382 os <<
"================================================================================" << endl;
Ifpack_CondestType
Ifpack_CondestType: enum to define the type of condition number estimate.
double Ifpack_Condest(const Ifpack_Preconditioner &IFP, const Ifpack_CondestType CT, const int MaxIters, const double Tol, Epetra_RowMatrix *Matrix)
#define IFPACK_CHK_ERR(ifpack_err)
Amesos_BaseSolver * Create(const char *ClassType, const Epetra_LinearProblem &LinearProblem)
double ** Pointers() const
Ifpack_Amesos: a class to use Amesos' factorizations as preconditioners.
Teuchos::RefCountPtr< Amesos_BaseSolver > Solver_
Amesos solver, use to apply the inverse of the local matrix.
Teuchos::RefCountPtr< Epetra_Time > Time_
Time object.
double ComputeFlops_
Contains the number of flops for Compute().
int NumInitialize_
Contains the number of successful calls to Initialize().
double Condest_
Contains the estimated condition number.
virtual bool HasNormInf() const
Returns true if the this object can provide an approximate Inf-norm, false otherwise.
virtual int Apply(const Epetra_MultiVector &X, Epetra_MultiVector &Y) const
Applies the matrix to an Epetra_MultiVector.
Teuchos::ParameterList List_
Contains a copy of the input parameter list.
virtual bool UseTranspose() const
Returns the current UseTranspose setting.
virtual const Teuchos::ParameterList & List() const
double ComputeTime_
Contains the time for all successful calls to Compute().
double InitializeTime_
Contains the time for all successful calls to Initialize().
int NumCompute_
Contains the number of successful call to Compute().
virtual const char * Label() const
Returns a character string describing the operator.
virtual int Initialize()
Initializes the preconditioners.
virtual int Compute()
Computes the preconditioners.
std::string Label_
Contains the label of this object.
virtual int SetUseTranspose(bool UseTranspose_in)
If set true, transpose of this operator will be applied (not implemented).
virtual int ApplyInverse(const Epetra_MultiVector &X, Epetra_MultiVector &Y) const
Applies the preconditioner to X, returns the result in Y.
bool IsEmpty_
If true, the linear system on this processor is empty, thus the preconditioner is null operation.
virtual int SetParameters(Teuchos::ParameterList &List)
Sets all the parameters for the preconditioner.
virtual bool IsComputed() const
Returns true if the preconditioner has been successfully computed.
double ApplyInverseTime_
Contains the time for all successful calls to ApplyInverse().
Teuchos::RefCountPtr< Epetra_LinearProblem > Problem_
Linear problem required by Solver_.
virtual const Epetra_Map & OperatorRangeMap() const
Returns the Epetra_Map object associated with the range of this operator.
virtual double Condest() const
Returns the estimated condition number, never computes it.
bool IsInitialized_
If true, the preconditioner has been successfully initialized.
Ifpack_Amesos(Epetra_RowMatrix *Matrix)
Constructor.
virtual std::ostream & Print(std::ostream &os) const
Prints on ostream basic information about this object.
bool IsComputed_
If true, the preconditioner has been successfully computed.
double ApplyInverseFlops_
Contain sthe number of flops for ApplyInverse().
virtual const Epetra_Map & OperatorDomainMap() const
Returns the Epetra_Map object associated with the domain of this operator.
virtual double NormInf() const
Returns the infinity norm of the global matrix (not implemented)
bool UseTranspose_
If true, the preconditioner solves for the transpose of the matrix.
virtual const Epetra_Comm & Comm() const
Returns a pointer to the Epetra_Comm communicator associated with this operator.
Teuchos::RefCountPtr< const Epetra_RowMatrix > Matrix_
Pointers to the matrix to be preconditioned.
int NumApplyInverse_
Contains the number of successful call to ApplyInverse().
virtual bool IsInitialized() const
Returns true is the preconditioner has been successfully initialized.