KratosMultiphysics
KRATOS Multiphysics (Kratos) is a framework for building parallel, multi-disciplinary simulation software, aiming at modularity, extensibility, and high performance. Kratos is written in C++, and counts with an extensive Python interface.
|
Preconditioner class. More...
#include <preconditioner.h>
Public Member Functions | |
Life Cycle | |
Preconditioner () | |
Default constructor. More... | |
Preconditioner (const Preconditioner &Other) | |
Copy constructor. More... | |
virtual | ~Preconditioner () |
Destructor. More... | |
Operators | |
Preconditioner & | operator= (const Preconditioner &Other) |
Assignment operator. More... | |
Operations | |
virtual void | Initialize (SparseMatrixType &rA, VectorType &rX, VectorType &rB) |
virtual void | Initialize (SparseMatrixType &rA, DenseMatrixType &rX, DenseMatrixType &rB) |
virtual void | InitializeSolutionStep (SparseMatrixType &rA, VectorType &rX, VectorType &rB) |
virtual void | FinalizeSolutionStep (SparseMatrixType &rA, VectorType &rX, VectorType &rB) |
virtual void | Clear () |
virtual bool | AdditionalPhysicalDataIsNeeded () |
virtual void | ProvideAdditionalData (SparseMatrixType &rA, VectorType &rX, VectorType &rB, typename ModelPart::DofsArrayType &rdof_set, ModelPart &r_model_part) |
virtual void | Mult (SparseMatrixType &rA, VectorType &rX, VectorType &rY) |
virtual void | TransposeMult (SparseMatrixType &rA, VectorType &rX, VectorType &rY) |
virtual VectorType & | ApplyLeft (VectorType &rX) |
virtual VectorType & | ApplyRight (VectorType &rX) |
virtual VectorType & | ApplyTransposeLeft (VectorType &rX) |
virtual VectorType & | ApplyTransposeRight (VectorType &rX) |
virtual VectorType & | ApplyInverseRight (VectorType &rX) |
virtual VectorType & | Finalize (VectorType &rX) |
Input and output | |
virtual std::string | Info () const |
Turn back information as a string. More... | |
virtual void | PrintInfo (std::ostream &rOStream) const |
Print information about this object. More... | |
virtual void | PrintData (std::ostream &rOStream) const |
Print object's data. More... | |
Type Definitions | |
typedef TSparseSpaceType::MatrixType | SparseMatrixType |
typedef TSparseSpaceType::VectorType | VectorType |
typedef TDenseSpaceType::MatrixType | DenseMatrixType |
KRATOS_CLASS_POINTER_DEFINITION (Preconditioner) | |
Pointer definition of Preconditioner. More... | |
Preconditioner class.
Base class for preconditioners for linesr system solvers which defining standard interface for all the preconditioners derived from it.
Considering a linear solver FooSolver with a method FooSolver::Solve. A typical code using this type of Preconditioners would be:
\begin{verbatim} FooSolver::Solve(A,b,x,preconditioner) { preconditioner.Initialize(A,x,b); ... ... while(...) // Start iteration. { preconditioner.ApplyLeft(x); mult(a,x) preconditioner.ApplyRight(x) } // End iteration
preconditioner.Finalize(A,x,b); } \end{verbatim}
typedef TDenseSpaceType::MatrixType Kratos::Preconditioner< TSparseSpaceType, TDenseSpaceType >::DenseMatrixType |
typedef TSparseSpaceType::MatrixType Kratos::Preconditioner< TSparseSpaceType, TDenseSpaceType >::SparseMatrixType |
typedef TSparseSpaceType::VectorType Kratos::Preconditioner< TSparseSpaceType, TDenseSpaceType >::VectorType |
|
inline |
Default constructor.
|
inline |
Copy constructor.
|
inlinevirtual |
Destructor.
|
inlinevirtual |
Some preconditioners may require a minimum degree of knowledge of the structure of the matrix. To make an example when solving a mixed u-p problem, it is important to identify the row associated to v and p. another example is the automatic prescription of rotation null-space for smoothed-aggregation preconditioners which require knowledge on the spatial position of the nodes associated to a given dof. This function tells if the solver requires such data
Reimplemented in Kratos::AdditiveSchwarzPreconditioner< TSparseSpaceType, TDenseSpaceType >.
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
Reimplemented in Kratos::DiagonalPreconditioner< TSparseSpaceType, TDenseSpaceType >.
|
inlinevirtual |
Preconditioner transpose solver. Solving tranpose preconditioner system M^T*x=y, where m^T means transpose.
rX | Unknows of preconditioner suystem |
Reimplemented in Kratos::ILUPreconditioner< TSparseSpaceType, TDenseSpaceType >, and Kratos::DiagonalPreconditioner< TSparseSpaceType, TDenseSpaceType >.
|
inlinevirtual |
Reimplemented in Kratos::DiagonalPreconditioner< TSparseSpaceType, TDenseSpaceType >.
|
inlinevirtual |
This function is designed to clean up all internal data in the solver. Clear is designed to leave the solver object as if newly created. After a clear a new Initialize is needed
|
inlinevirtual |
|
inlinevirtual |
This function is designed to be called at the end of the solve step. for example this is the place to remove any data that we do not want to save for later
rA. | System matrix |
rX. | Solution vector. it's also the initial guess for iterative linear solvers. |
rB. | Right hand side vector. |
|
inlinevirtual |
Turn back information as a string.
Reimplemented in Kratos::ILUPreconditioner< TSparseSpaceType, TDenseSpaceType >, Kratos::ILU0Preconditioner< TSparseSpaceType, TDenseSpaceType >, Kratos::DiagonalPreconditioner< TSparseSpaceType, TDenseSpaceType >, and Kratos::AdditiveSchwarzPreconditioner< TSparseSpaceType, TDenseSpaceType >.
|
inlinevirtual |
Reimplemented in Kratos::DiagonalPreconditioner< TSparseSpaceType, TDenseSpaceType >.
|
inlinevirtual |
Preconditioner Initialize Initialize preconditioner for linear system rA*rX=rB
rA | system matrix. |
rX | Unknows vector |
rB | Right side linear system of equations. |
Reimplemented in Kratos::ILU0Preconditioner< TSparseSpaceType, TDenseSpaceType >, and Kratos::DiagonalPreconditioner< TSparseSpaceType, TDenseSpaceType >.
|
inlinevirtual |
This function is designed to be called every time the coefficients change in the system that is, normally at the beginning of each solve. For example if we are implementing a direct solver, this is the place to do the factorization so that then the backward substitution can be performed effectively more than once
rA. | System matrix |
rX. | Solution vector. it's also the initial guess for iterative linear solvers. |
rB. | Right hand side vector. |
Kratos::Preconditioner< TSparseSpaceType, TDenseSpaceType >::KRATOS_CLASS_POINTER_DEFINITION | ( | Preconditioner< TSparseSpaceType, TDenseSpaceType > | ) |
Pointer definition of Preconditioner.
|
inlinevirtual |
|
inline |
Assignment operator.
|
inlinevirtual |
|
inlinevirtual |
Print information about this object.
Reimplemented in Kratos::ILUPreconditioner< TSparseSpaceType, TDenseSpaceType >, Kratos::ILU0Preconditioner< TSparseSpaceType, TDenseSpaceType >, Kratos::DiagonalPreconditioner< TSparseSpaceType, TDenseSpaceType >, and Kratos::AdditiveSchwarzPreconditioner< TSparseSpaceType, TDenseSpaceType >.
|
inlinevirtual |
Some preconditioners may require a minimum degree of knowledge of the structure of the matrix. To make an example when solving a mixed u-p problem, it is important to identify the row associated to v and p. another example is the automatic prescription of rotation null-space for smoothed-aggregation preconditioners which require knowledge on the spatial position of the nodes associated to a given dof. This function is the place to eventually provide such data
Reimplemented in Kratos::AdditiveSchwarzPreconditioner< TSparseSpaceType, TDenseSpaceType >.
|
inlinevirtual |