![]() |
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 is a eigen solver based on the Rayleigh quotient iteration algorithm. More...
#include <rayleigh_quotient_iteration_eigenvalue_solver.h>
Public Member Functions | |
Life Cycle | |
RayleighQuotientIterationEigenvalueSolver () | |
Default constructor. More... | |
RayleighQuotientIterationEigenvalueSolver (double NewMaxTolerance, unsigned int NewMaxIterationsNumber, unsigned int NewRequiredEigenvalueNumber, typename TLinearSolverType::Pointer pLinearSolver, double ShiftingConvergence=0.25) | |
The "manual" settings constructor. More... | |
RayleighQuotientIterationEigenvalueSolver (Parameters ThisParameters, typename TLinearSolverType::Pointer pLinearSolver) | |
The parameters constructor. More... | |
RayleighQuotientIterationEigenvalueSolver (const RayleighQuotientIterationEigenvalueSolver &Other) | |
Copy constructor. More... | |
virtual | ~RayleighQuotientIterationEigenvalueSolver () |
Destructor. More... | |
Operators | |
RayleighQuotientIterationEigenvalueSolver & | operator= (const RayleighQuotientIterationEigenvalueSolver &Other) |
Assignment operator. More... | |
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... | |
![]() | |
IterativeSolver () | |
Default constructor. More... | |
IterativeSolver (double NewTolerance) | |
IterativeSolver (double NewTolerance, unsigned int NewMaxIterationsNumber) | |
IterativeSolver (double NewTolerance, unsigned int NewMaxIterationsNumber, typename TPreconditionerType::Pointer pNewPreconditioner) | |
IterativeSolver (Parameters settings, typename TPreconditionerType::Pointer pNewPreconditioner=Kratos::make_shared< Preconditioner< TSparseSpaceType, TDenseSpaceType > >()) | |
IterativeSolver (const IterativeSolver &Other) | |
Copy constructor. More... | |
~IterativeSolver () override | |
Destructor. More... | |
IterativeSolver & | operator= (const IterativeSolver &Other) |
Assignment operator. More... | |
void | InitializeSolutionStep (SparseMatrixType &rA, VectorType &rX, VectorType &rB) override |
void | FinalizeSolutionStep (SparseMatrixType &rA, VectorType &rX, VectorType &rB) override |
void | Clear () override |
bool | AdditionalPhysicalDataIsNeeded () override |
void | ProvideAdditionalData (SparseMatrixType &rA, VectorType &rX, VectorType &rB, typename ModelPart::DofsArrayType &rdof_set, ModelPart &r_model_part) override |
virtual TPreconditionerType::Pointer | GetPreconditioner (void) |
virtual const TPreconditionerType::Pointer | GetPreconditioner (void) const |
virtual void | SetPreconditioner (typename TPreconditionerType::Pointer pNewPreconditioner) |
virtual void | SetMaxIterationsNumber (unsigned int NewMaxIterationsNumber) |
virtual IndexType | GetMaxIterationsNumber () |
virtual void | SetIterationsNumber (unsigned int NewIterationNumber) |
IndexType | GetIterationsNumber () override |
void | SetTolerance (double NewTolerance) override |
This method allows to set the tolerance in the linear solver. More... | |
double | GetTolerance () override |
This method allows to get the tolerance in the linear solver. More... | |
virtual void | SetResidualNorm (double NewResidualNorm) |
virtual double | GetResidualNorm () |
virtual bool | IterationNeeded () |
virtual bool | IsConverged () |
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... | |
KRATOS_CLASS_POINTER_DEFINITION (IterativeSolver) | |
Pointer definition of IterativeSolver. 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, VectorType &rX, VectorType &rB) |
virtual bool | Solve (SparseMatrixType &rA, DenseMatrixType &rX, DenseMatrixType &rB) |
virtual TReordererType::Pointer | GetReorderer () |
virtual void | SetReorderer (typename TReordererType::Pointer pNewReorderer) |
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 IterativeSolver< TSparseSpaceType, TDenseSpaceType, TPreconditionerType, TReordererType > | BaseType |
The base class definition. More... | |
typedef TSparseSpaceType::MatrixType | SparseMatrixType |
The sparse matrix defintion. More... | |
typedef TSparseSpaceType::VectorType | VectorType |
The vector definition ("sparse") More... | |
typedef TDenseSpaceType::MatrixType | DenseMatrixType |
The dense matrix definition. More... | |
typedef TDenseSpaceType::VectorType | DenseVectorType |
The "dense" vector definition. More... | |
typedef std::size_t | SizeType |
The size type definiton. More... | |
typedef std::size_t | IndexType |
The index type definition. More... | |
KRATOS_CLASS_POINTER_DEFINITION (RayleighQuotientIterationEigenvalueSolver) | |
Pointer definition of RayleighQuotientIterationEigenvalueSolver. More... | |
Operations | |
SizeType | SturmSequenceCheck (SparseMatrixType &ShiftedK) |
This method performs a Sturm Sequence Check. More... | |
void | Solve (SparseMatrixType &K, SparseMatrixType &M, DenseVectorType &Eigenvalues, DenseMatrixType &Eigenvectors) override |
The Rayleigh quotient iteration method. More... | |
static void | InitializeSystem (VectorType &rR, const SparseMatrixType &rM) |
This method initializes the system. More... | |
This is a eigen solver based on the Rayleigh quotient iteration algorithm.
Rayleigh quotient iteration is an iterative method, that is, it delivers a sequence of approximate solutions that converges to a true solution in the limit (this is true for all algorithms that compute eigenvalues: since eigenvalues can be irrational numbers, there can be no general method for computing them in a finite number of steps). Very rapid convergence is guaranteed and no more than a few iterations are needed in practice to obtain a reasonable approximation. The Rayleigh quotient iteration algorithm converges cubically for Hermitian or symmetric matrices, given an initial vector that is sufficiently close to an eigenvector of the matrix that is being analyzed.
typedef IterativeSolver<TSparseSpaceType, TDenseSpaceType, TPreconditionerType, TReordererType> Kratos::RayleighQuotientIterationEigenvalueSolver< TSparseSpaceType, TDenseSpaceType, TLinearSolverType, TPreconditionerType, TReordererType >::BaseType |
The base class definition.
typedef TDenseSpaceType::MatrixType Kratos::RayleighQuotientIterationEigenvalueSolver< TSparseSpaceType, TDenseSpaceType, TLinearSolverType, TPreconditionerType, TReordererType >::DenseMatrixType |
The dense matrix definition.
typedef TDenseSpaceType::VectorType Kratos::RayleighQuotientIterationEigenvalueSolver< TSparseSpaceType, TDenseSpaceType, TLinearSolverType, TPreconditionerType, TReordererType >::DenseVectorType |
The "dense" vector definition.
typedef std::size_t Kratos::RayleighQuotientIterationEigenvalueSolver< TSparseSpaceType, TDenseSpaceType, TLinearSolverType, TPreconditionerType, TReordererType >::IndexType |
The index type definition.
typedef std::size_t Kratos::RayleighQuotientIterationEigenvalueSolver< TSparseSpaceType, TDenseSpaceType, TLinearSolverType, TPreconditionerType, TReordererType >::SizeType |
The size type definiton.
typedef TSparseSpaceType::MatrixType Kratos::RayleighQuotientIterationEigenvalueSolver< TSparseSpaceType, TDenseSpaceType, TLinearSolverType, TPreconditionerType, TReordererType >::SparseMatrixType |
The sparse matrix defintion.
typedef TSparseSpaceType::VectorType Kratos::RayleighQuotientIterationEigenvalueSolver< TSparseSpaceType, TDenseSpaceType, TLinearSolverType, TPreconditionerType, TReordererType >::VectorType |
The vector definition ("sparse")
|
inline |
Default constructor.
|
inline |
The "manual" settings constructor.
NewMaxTolerance | The tolerance considered |
NewMaxIterationsNumber | The maximum number of iterations considered |
NewRequiredEigenvalueNumber | The number of eigen values to compute |
ShiftingConvergence | The convergence parameter of shifting |
|
inline |
The parameters constructor.
ThisParameters | The input parameters |
pLinearSolver | The linear solver considered |
|
inline |
Copy constructor.
|
inlinevirtual |
Destructor.
|
inlineoverridevirtual |
Turn back information as a string.
Reimplemented from Kratos::LinearSolver< TSparseSpaceType, TDenseSpaceType, Reorderer< TSparseSpaceType, TDenseSpaceType > >.
|
inlinestatic |
This method initializes the system.
It computes the vector R, which contains the components of the diagonal of the M matrix
rR | The vector containing the normalized components of the diagonal |
rM | The "mass" matrix |
Kratos::RayleighQuotientIterationEigenvalueSolver< TSparseSpaceType, TDenseSpaceType, TLinearSolverType, TPreconditionerType, TReordererType >::KRATOS_CLASS_POINTER_DEFINITION | ( | RayleighQuotientIterationEigenvalueSolver< TSparseSpaceType, TDenseSpaceType, TLinearSolverType, TPreconditionerType, TReordererType > | ) |
Pointer definition of RayleighQuotientIterationEigenvalueSolver.
|
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 |
The Rayleigh quotient iteration method.
K | The stiffness matrix |
M | The mass matrix |
Eigenvalues | The vector containing the eigen values |
Eigenvectors | The matrix containing the eigen vectors |
Reimplemented from Kratos::LinearSolver< TSparseSpaceType, TDenseSpaceType, Reorderer< TSparseSpaceType, TDenseSpaceType > >.
|
inline |
This method performs a Sturm Sequence Check.
ShiftedK | The modified K matrix after apply the M matrix |