LifeV
|
Provide the ApplyInverse
method for a Epetra_CrsMatrix object.
More...
#include <ApproximatedInvertibleRowMatrix.hpp>
Public Member Functions | |
ApproximatedInvertibleRowMatrix () | |
virtual | ~ApproximatedInvertibleRowMatrix () |
int | Compute () |
std::shared_ptr< RowMatrixPreconditioner > & | Preconditioner () |
Public Member Functions inherited from LinearOperatorAlgebra | |
virtual | ~LinearOperatorAlgebra () |
Destructor. More... | |
int | apply (const VectorEpetra &X, VectorEpetra &Y) const |
Returns the result of a LinearOperator applied to a VectorEpetra X in Y. More... | |
int | applyInverse (const VectorEpetra &X, VectorEpetra &Y) |
Returns the result of a LinearOperator inverse applied to an VectorEpetra X in Y. More... | |
Private Attributes | |
bool | usePreconditionerAsApproximatedInverse |
rowMatrixPtr_Type | M_rowMatrix |
std::shared_ptr< RowMatrixPreconditioner > | M_prec |
std::shared_ptr< InvertibleOperator > | M_linSolver |
pList_Type | M_pList |
Public Typedef | |
typedef Epetra_CrsMatrix | rowMatrix_Type |
typedef std::shared_ptr< rowMatrix_Type > | rowMatrixPtr_Type |
typedef Teuchos::ParameterList | pList_Type |
Attribute set methods | |
void | SetRowMatrix (const rowMatrixPtr_Type &rowMatrix) |
void | SetParameterList (const pList_Type pList) |
virtual int | SetUseTranspose (bool UseTranspose) |
not fully supported! More... | |
Mathematical functions | |
virtual int | Apply (const vector_Type &X, vector_Type &Y) const |
Returns the result of a raw_operator applied to a raw_vector X in Y. More... | |
virtual int | ApplyInverse (const vector_Type &X, vector_Type &Y) const |
Returns the result of a raw_operator inverse applied to an raw_vector X in Y. More... | |
virtual double | NormInf () const |
Returns the infinity norm of the global matrix. More... | |
Attribute access functions | |
virtual const char * | Label () const |
Returns a character string describing the operator. More... | |
virtual bool | UseTranspose () const |
Returns the current UseTranspose setting. More... | |
virtual bool | HasNormInf () const |
Returns true if the this object can provide an approximate Inf-norm, false otherwise. More... | |
virtual const comm_Type & | Comm () const |
Returns a pointer to the Epetra_Comm communicator associated with this operator. More... | |
virtual const map_Type & | OperatorDomainMap () const |
Returns the raw_map object associated with the domain of this operator. More... | |
virtual const map_Type & | OperatorRangeMap () const |
Returns the raw_map object associated with the range of this operator. More... | |
Additional Inherited Members | |
Public Types inherited from LinearOperatorAlgebra | |
typedef Epetra_Comm | comm_Type |
typedef std::shared_ptr< comm_Type > | commPtr_Type |
typedef Epetra_Map | map_Type |
typedef std::shared_ptr< map_Type > | mapPtr_Type |
typedef std::shared_ptr< const map_Type > | constMapPtr_Type |
typedef Epetra_Operator | operator_Type |
typedef std::shared_ptr< operator_Type > | operatorPtr_Type |
typedef Epetra_MultiVector | vector_Type |
typedef std::shared_ptr< vector_Type > | vectorPtr_Type |
Provide the ApplyInverse
method for a Epetra_CrsMatrix object.
ApproximatedInvertibleRowMatrix is derived by the LinearOperator class, and it can be used to approximate the inverse of a Epetra_CsrMatrix, either by using the Krylov methods in Belos or AztecOO or the preconditioning techniques in ML or Ifpack. Internally ApproximatedInvertibleRowMatrix contains pointers to a Epetra_CsrMatrix, to an InvertibleOperator object (that provides the interface to AztecOO or Belos), and RowMatrixPreconditioner (the provides the interface to Ifpack or ML).
The parameters to set up the Krylov methods or the preconditioner are given by using a Teuchos Parameter List. Below how the parameter list would look like:
* <ParameterList name="ApproximatedInvertibleRowMatrix"> * <Parameter name="use preconditioner as approximated inverse" type="bool" value="false"/> * <Parameter name="preconditioner type" type="string" value="ML"/> <!-- Ifpack, ML, TwoLevel--> * <ParameterList name="solver"> * <Parameter name="Linear Solver Type" type="string" value="Belos"/> * <ParameterList name="AztecOO"> * <Parameter name="conv" type="string" value="r0"/> * <Parameter name="max_iter" type="int" value="1500"/> * <Parameter name="output" type="string" value="warnings"/> * <Parameter name="scaling" type="string" value="none"/> * <Parameter name="solver" type="string" value="cg"/> * <Parameter name="tol" type="double" value="1e-03"/> * </ParameterList> * <ParameterList name="Belos"> * <Parameter name="Solver Type" type="string" value="RCG"/> * <Parameter name="Preconditioner Side" type="string" value="Left"/> * <ParameterList name="options"> * <Parameter name="Maximum Iterations" type="int" value="50"/> * <Parameter name="Num Blocks" type="int" value="50"/> * <Parameter name="Num Recycled Blocks" type="int" value="10"/> * <Parameter name="Convergence Tolerance" type="double" value="1e-03"/> * <Parameter name="Output Frequency" type="int" value="1"/> * <Parameter name="Verbosity" type="int" value="0"/> * </ParameterList> * </ParameterList> * </ParameterList> * <ParameterList name="preconditioner"> * <ParameterList name="ML"> * <ParameterList name="options"> * <Parameter name="default values" type="string" value="SA"/> * </ParameterList> * </ParameterList> * </ParameterList> * </ParameterList> *
Definition at line 87 of file ApproximatedInvertibleRowMatrix.hpp.
typedef Epetra_CrsMatrix rowMatrix_Type |
Definition at line 93 of file ApproximatedInvertibleRowMatrix.hpp.
typedef std::shared_ptr<rowMatrix_Type> rowMatrixPtr_Type |
Definition at line 94 of file ApproximatedInvertibleRowMatrix.hpp.
typedef Teuchos::ParameterList pList_Type |
Definition at line 95 of file ApproximatedInvertibleRowMatrix.hpp.
Definition at line 16 of file ApproximatedInvertibleRowMatrix.cpp.
|
virtual |
Definition at line 21 of file ApproximatedInvertibleRowMatrix.cpp.
void SetRowMatrix | ( | const rowMatrixPtr_Type & | rowMatrix | ) |
Definition at line 24 of file ApproximatedInvertibleRowMatrix.cpp.
void SetParameterList | ( | const pList_Type | pList | ) |
Definition at line 34 of file ApproximatedInvertibleRowMatrix.cpp.
|
virtual |
not fully supported!
Implements LinearOperatorAlgebra.
Definition at line 49 of file ApproximatedInvertibleRowMatrix.cpp.
int Compute | ( | ) |
Definition at line 54 of file ApproximatedInvertibleRowMatrix.cpp.
|
inline |
Definition at line 113 of file ApproximatedInvertibleRowMatrix.hpp.
|
virtual |
Returns the result of a raw_operator applied to a raw_vector X in Y.
In | X - A raw_vector of dimension NumVectors to multiply with matrix. |
Out | Y -A raw_vector of dimension NumVectors containing result. |
Implements LinearOperatorAlgebra.
Definition at line 77 of file ApproximatedInvertibleRowMatrix.cpp.
|
inlinevirtual |
Returns the result of a raw_operator inverse applied to an raw_vector X in Y.
In | X - A raw_vector of dimension NumVectors to solve for. |
Out | Y -A raw_vector of dimension NumVectors containing result. |
Implements LinearOperatorAlgebra.
Definition at line 82 of file ApproximatedInvertibleRowMatrix.cpp.
|
virtual |
Returns the infinity norm of the global matrix.
Implements LinearOperatorAlgebra.
Definition at line 93 of file ApproximatedInvertibleRowMatrix.cpp.
|
virtual |
Returns a character string describing the operator.
Implements LinearOperatorAlgebra.
Definition at line 98 of file ApproximatedInvertibleRowMatrix.cpp.
|
virtual |
Returns the current UseTranspose setting.
Implements LinearOperatorAlgebra.
Definition at line 103 of file ApproximatedInvertibleRowMatrix.cpp.
|
virtual |
Returns true if the this object can provide an approximate Inf-norm, false otherwise.
Implements LinearOperatorAlgebra.
Definition at line 108 of file ApproximatedInvertibleRowMatrix.cpp.
|
virtual |
Returns a pointer to the Epetra_Comm communicator associated with this operator.
Implements LinearOperatorAlgebra.
Definition at line 113 of file ApproximatedInvertibleRowMatrix.cpp.
|
virtual |
Returns the raw_map object associated with the domain of this operator.
Implements LinearOperatorAlgebra.
Definition at line 118 of file ApproximatedInvertibleRowMatrix.cpp.
|
virtual |
Returns the raw_map object associated with the range of this operator.
Implements LinearOperatorAlgebra.
Definition at line 123 of file ApproximatedInvertibleRowMatrix.cpp.
|
private |
Definition at line 152 of file ApproximatedInvertibleRowMatrix.hpp.
|
private |
Definition at line 153 of file ApproximatedInvertibleRowMatrix.hpp.
|
private |
Definition at line 154 of file ApproximatedInvertibleRowMatrix.hpp.
|
private |
Definition at line 155 of file ApproximatedInvertibleRowMatrix.hpp.
|
private |
Definition at line 156 of file ApproximatedInvertibleRowMatrix.hpp.