![]() |
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.
|
This solvers rescales in order to improve the conditioning of the system. More...
#include <scaling_solver.h>
Public Member Functions | |
Life Cycle | |
ScalingSolver () | |
Default constructor. More... | |
ScalingSolver (typename BaseType::Pointer pLinearSolver, const bool SymmetricScaling=true) | |
Constructor without parameters. More... | |
ScalingSolver (Parameters ThisParameters) | |
Constructor with parameters. More... | |
ScalingSolver (const ScalingSolver &Other) | |
Copy constructor. More... | |
~ScalingSolver () override | |
Destructor. More... | |
Operators | |
ScalingSolver & | operator= (const ScalingSolver &Other) |
Assignment operator. More... | |
Operations | |
bool | AdditionalPhysicalDataIsNeeded () override |
void | ProvideAdditionalData (SparseMatrixType &rA, VectorType &rX, VectorType &rB, typename ModelPart::DofsArrayType &rdof_set, ModelPart &r_model_part) override |
void | InitializeSolutionStep (SparseMatrixType &rA, VectorType &rX, VectorType &rB) override |
void | FinalizeSolutionStep (SparseMatrixType &rA, VectorType &rX, VectorType &rB) override |
void | Clear () override |
bool | Solve (SparseMatrixType &rA, VectorType &rX, VectorType &rB) override |
Access | |
IndexType | GetIterationsNumber () override |
Input and output | |
std::string | Info () const override |
Turn back information as a string. More... | |
void | PrintInfo (std::ostream &rOStream) const override |
Print information about this object. More... | |
void | PrintData (std::ostream &rOStream) const override |
Print object's data. More... | |
![]() | |
LinearSolver () | |
Default constructor. More... | |
LinearSolver (Reorderer< TSparseSpaceType, TDenseSpaceType > NewReorderer) | |
Constructor with specific reorderer. More... | |
LinearSolver (const LinearSolver &Other) | |
Copy constructor. More... | |
virtual | ~LinearSolver () |
Destructor. More... | |
LinearSolver & | operator= (const LinearSolver &Other) |
Assignment operator. More... | |
virtual void | Initialize (SparseMatrixType &rA, VectorType &rX, VectorType &rB) |
virtual void | PerformSolutionStep (SparseMatrixType &rA, VectorType &rX, VectorType &rB) |
virtual bool | Solve (SparseMatrixType &rA, DenseMatrixType &rX, DenseMatrixType &rB) |
virtual void | Solve (SparseMatrixType &K, SparseMatrixType &M, DenseVectorType &Eigenvalues, DenseMatrixType &Eigenvectors) |
virtual TReordererType::Pointer | GetReorderer () |
virtual void | SetReorderer (typename TReordererType::Pointer pNewReorderer) |
virtual void | SetTolerance (double NewTolerance) |
This method allows to set the tolerance in the linear solver. More... | |
virtual double | GetTolerance () |
This method allows to get the tolerance in the linear solver. More... | |
virtual bool | IsConsistent (SparseMatrixType &rA, VectorType &rX, VectorType &rB) |
This method checks if the dimensions of the system of equations are consistent. More... | |
virtual bool | IsConsistent (SparseMatrixType &rA, DenseMatrixType &rX, DenseMatrixType &rB) |
This method checks if the dimensions of the system of equations are consistent (dense matrix for RHS and unknowns version) More... | |
virtual bool | IsNotConsistent (SparseMatrixType &rA, VectorType &rX, VectorType &rB) |
This method checks if the dimensions of the system of equations are not consistent. More... | |
virtual bool | IsNotConsistent (SparseMatrixType &rA, DenseMatrixType &rX, DenseMatrixType &rB) |
This method checks if the dimensions of the system of equations are not consistent. More... | |
KRATOS_CLASS_POINTER_DEFINITION (LinearSolver) | |
Pointer definition of LinearSolver. More... | |
Type Definitions | |
typedef LinearSolver< TSparseSpaceType, TDenseSpaceType, TReordererType > | BaseType |
Definition of the base type. More... | |
typedef TSparseSpaceType::MatrixType | SparseMatrixType |
The definition of the spaces (sparse matrix) More... | |
typedef TSparseSpaceType::VectorType | VectorType |
The definition of the spaces (vector) More... | |
typedef TDenseSpaceType::MatrixType | DenseMatrixType |
The definition of the spaces (dense matrix) More... | |
typedef LinearSolverFactory< TSparseSpaceType, TDenseSpaceType > | LinearSolverFactoryType |
The definition of the linear solver factory type. More... | |
typedef TSparseSpaceType::IndexType | IndexType |
The index type definition to be consistent. More... | |
KRATOS_CLASS_POINTER_DEFINITION (ScalingSolver) | |
Pointer definition of ScalingSolver. More... | |
Additional Inherited Members | |
![]() | |
typedef TSparseSpaceType::MatrixType | SparseMatrixType |
typedef TSparseSpaceType::MatrixPointerType | SparseMatrixPointerType |
typedef TSparseSpaceType::VectorType | VectorType |
typedef TSparseSpaceType::VectorPointerType | VectorPointerType |
typedef TDenseSpaceType::MatrixType | DenseMatrixType |
typedef TDenseSpaceType::VectorType | DenseVectorType |
typedef std::size_t | SizeType |
typedef TSparseSpaceType::IndexType | IndexType |
The index type definition to be consistent. More... | |
This solvers rescales in order to improve the conditioning of the system.
Rescales the matrix, and uses a given linear solver
TSparseSpaceType | The sparse space definition |
TDenseSpaceType | The dense space definition |
TReordererType | The reorder considered |
typedef LinearSolver<TSparseSpaceType, TDenseSpaceType, TReordererType> Kratos::ScalingSolver< TSparseSpaceType, TDenseSpaceType, TReordererType >::BaseType |
Definition of the base type.
typedef TDenseSpaceType::MatrixType Kratos::ScalingSolver< TSparseSpaceType, TDenseSpaceType, TReordererType >::DenseMatrixType |
The definition of the spaces (dense matrix)
typedef TSparseSpaceType::IndexType Kratos::ScalingSolver< TSparseSpaceType, TDenseSpaceType, TReordererType >::IndexType |
The index type definition to be consistent.
typedef LinearSolverFactory<TSparseSpaceType,TDenseSpaceType> Kratos::ScalingSolver< TSparseSpaceType, TDenseSpaceType, TReordererType >::LinearSolverFactoryType |
The definition of the linear solver factory type.
typedef TSparseSpaceType::MatrixType Kratos::ScalingSolver< TSparseSpaceType, TDenseSpaceType, TReordererType >::SparseMatrixType |
The definition of the spaces (sparse matrix)
typedef TSparseSpaceType::VectorType Kratos::ScalingSolver< TSparseSpaceType, TDenseSpaceType, TReordererType >::VectorType |
The definition of the spaces (vector)
|
inline |
Default constructor.
|
inline |
Constructor without parameters.
pLinearSolver | The linear solver to be scaled |
SymmetricScaling | If the scaling is symmetric (true by default) |
|
inline |
Constructor with parameters.
ThisParameters | The configuration parameters of the linear solver |
|
inline |
Copy constructor.
|
inlineoverride |
Destructor.
|
inlineoverridevirtual |
Some solvers 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 solvers 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 from Kratos::LinearSolver< TSparseSpaceType, TDenseSpaceType, Reorderer< TSparseSpaceType, TDenseSpaceType > >.
|
inlineoverridevirtual |
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
Reimplemented from Kratos::LinearSolver< TSparseSpaceType, TDenseSpaceType, Reorderer< TSparseSpaceType, TDenseSpaceType > >.
|
inlineoverridevirtual |
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. |
Reimplemented from Kratos::LinearSolver< TSparseSpaceType, TDenseSpaceType, Reorderer< TSparseSpaceType, TDenseSpaceType > >.
|
inlineoverridevirtual |
|
inlineoverridevirtual |
Turn back information as a string.
Reimplemented from Kratos::LinearSolver< TSparseSpaceType, TDenseSpaceType, Reorderer< TSparseSpaceType, TDenseSpaceType > >.
|
inlineoverridevirtual |
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. |
Reimplemented from Kratos::LinearSolver< TSparseSpaceType, TDenseSpaceType, Reorderer< TSparseSpaceType, TDenseSpaceType > >.
Kratos::ScalingSolver< TSparseSpaceType, TDenseSpaceType, TReordererType >::KRATOS_CLASS_POINTER_DEFINITION | ( | ScalingSolver< TSparseSpaceType, TDenseSpaceType, TReordererType > | ) |
Pointer definition of ScalingSolver.
|
inline |
Assignment operator.
|
inlineoverridevirtual |
Print object's data.
Reimplemented from Kratos::LinearSolver< TSparseSpaceType, TDenseSpaceType, Reorderer< TSparseSpaceType, TDenseSpaceType > >.
|
inlineoverridevirtual |
Print information about this object.
Reimplemented from Kratos::LinearSolver< TSparseSpaceType, TDenseSpaceType, Reorderer< TSparseSpaceType, TDenseSpaceType > >.
|
inlineoverridevirtual |
Some solvers 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 solvers 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 from Kratos::LinearSolver< TSparseSpaceType, TDenseSpaceType, Reorderer< TSparseSpaceType, TDenseSpaceType > >.
|
inlineoverridevirtual |
Normal solve method. Solves the linear system Ax=b and puts the result on SystemVector& rX. rX is also th initial guess for iterative methods.
rA. | System matrix |
rX. | Solution vector. it's also the initial guess for iterative linear solvers. |
rB. | Right hand side vector. |
Reimplemented from Kratos::LinearSolver< TSparseSpaceType, TDenseSpaceType, Reorderer< TSparseSpaceType, TDenseSpaceType > >.