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.
List of all members
Kratos::LinearSolver< TSparseSpaceType, TDenseSpaceType, TReordererType > Class Template Reference

Base class for all the linear solvers in Kratos. More...

#include <linear_solver.h>

Inheritance diagram for Kratos::LinearSolver< TSparseSpaceType, TDenseSpaceType, TReordererType >:
Collaboration diagram for Kratos::LinearSolver< TSparseSpaceType, TDenseSpaceType, TReordererType >:

Public Member Functions

Life Cycle
 LinearSolver ()
 Default constructor. More...
 
 LinearSolver (TReordererType NewReorderer)
 Constructor with specific reorderer. More...
 
 LinearSolver (const LinearSolver &Other)
 Copy constructor. More...
 
virtual ~LinearSolver ()
 Destructor. More...
 
Operators
LinearSolveroperator= (const LinearSolver &Other)
 Assignment operator. More...
 
Operations
virtual void Initialize (SparseMatrixType &rA, VectorType &rX, VectorType &rB)
 
virtual void InitializeSolutionStep (SparseMatrixType &rA, VectorType &rX, VectorType &rB)
 
virtual void PerformSolutionStep (SparseMatrixType &rA, VectorType &rX, VectorType &rB)
 
virtual void FinalizeSolutionStep (SparseMatrixType &rA, VectorType &rX, VectorType &rB)
 
virtual void Clear ()
 
virtual bool Solve (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 bool AdditionalPhysicalDataIsNeeded ()
 
virtual void ProvideAdditionalData (SparseMatrixType &rA, VectorType &rX, VectorType &rB, typename ModelPart::DofsArrayType &rDoFSet, ModelPart &rModelPart)
 
Access
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 IndexType GetIterationsNumber ()
 
Inquiry
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...
 
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::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...
 
 KRATOS_CLASS_POINTER_DEFINITION (LinearSolver)
 Pointer definition of LinearSolver. More...
 

Detailed Description

template<class TSparseSpaceType, class TDenseSpaceType, class TReordererType = Reorderer<TSparseSpaceType, TDenseSpaceType>>
class Kratos::LinearSolver< TSparseSpaceType, TDenseSpaceType, TReordererType >

Base class for all the linear solvers in Kratos.

This class define the general interface for the linear solvers in Kratos. There is three template parameter:

Member Typedef Documentation

◆ DenseMatrixType

template<class TSparseSpaceType , class TDenseSpaceType , class TReordererType = Reorderer<TSparseSpaceType, TDenseSpaceType>>
typedef TDenseSpaceType::MatrixType Kratos::LinearSolver< TSparseSpaceType, TDenseSpaceType, TReordererType >::DenseMatrixType

◆ DenseVectorType

template<class TSparseSpaceType , class TDenseSpaceType , class TReordererType = Reorderer<TSparseSpaceType, TDenseSpaceType>>
typedef TDenseSpaceType::VectorType Kratos::LinearSolver< TSparseSpaceType, TDenseSpaceType, TReordererType >::DenseVectorType

◆ IndexType

template<class TSparseSpaceType , class TDenseSpaceType , class TReordererType = Reorderer<TSparseSpaceType, TDenseSpaceType>>
typedef TSparseSpaceType::IndexType Kratos::LinearSolver< TSparseSpaceType, TDenseSpaceType, TReordererType >::IndexType

The index type definition to be consistent.

◆ SizeType

template<class TSparseSpaceType , class TDenseSpaceType , class TReordererType = Reorderer<TSparseSpaceType, TDenseSpaceType>>
typedef std::size_t Kratos::LinearSolver< TSparseSpaceType, TDenseSpaceType, TReordererType >::SizeType

◆ SparseMatrixPointerType

template<class TSparseSpaceType , class TDenseSpaceType , class TReordererType = Reorderer<TSparseSpaceType, TDenseSpaceType>>
typedef TSparseSpaceType::MatrixPointerType Kratos::LinearSolver< TSparseSpaceType, TDenseSpaceType, TReordererType >::SparseMatrixPointerType

◆ SparseMatrixType

template<class TSparseSpaceType , class TDenseSpaceType , class TReordererType = Reorderer<TSparseSpaceType, TDenseSpaceType>>
typedef TSparseSpaceType::MatrixType Kratos::LinearSolver< TSparseSpaceType, TDenseSpaceType, TReordererType >::SparseMatrixType

◆ VectorPointerType

template<class TSparseSpaceType , class TDenseSpaceType , class TReordererType = Reorderer<TSparseSpaceType, TDenseSpaceType>>
typedef TSparseSpaceType::VectorPointerType Kratos::LinearSolver< TSparseSpaceType, TDenseSpaceType, TReordererType >::VectorPointerType

◆ VectorType

template<class TSparseSpaceType , class TDenseSpaceType , class TReordererType = Reorderer<TSparseSpaceType, TDenseSpaceType>>
typedef TSparseSpaceType::VectorType Kratos::LinearSolver< TSparseSpaceType, TDenseSpaceType, TReordererType >::VectorType

Constructor & Destructor Documentation

◆ LinearSolver() [1/3]

template<class TSparseSpaceType , class TDenseSpaceType , class TReordererType = Reorderer<TSparseSpaceType, TDenseSpaceType>>
Kratos::LinearSolver< TSparseSpaceType, TDenseSpaceType, TReordererType >::LinearSolver ( )
inline

Default constructor.

◆ LinearSolver() [2/3]

template<class TSparseSpaceType , class TDenseSpaceType , class TReordererType = Reorderer<TSparseSpaceType, TDenseSpaceType>>
Kratos::LinearSolver< TSparseSpaceType, TDenseSpaceType, TReordererType >::LinearSolver ( TReordererType  NewReorderer)
inline

Constructor with specific reorderer.

◆ LinearSolver() [3/3]

template<class TSparseSpaceType , class TDenseSpaceType , class TReordererType = Reorderer<TSparseSpaceType, TDenseSpaceType>>
Kratos::LinearSolver< TSparseSpaceType, TDenseSpaceType, TReordererType >::LinearSolver ( const LinearSolver< TSparseSpaceType, TDenseSpaceType, TReordererType > &  Other)
inline

Copy constructor.

◆ ~LinearSolver()

template<class TSparseSpaceType , class TDenseSpaceType , class TReordererType = Reorderer<TSparseSpaceType, TDenseSpaceType>>
virtual Kratos::LinearSolver< TSparseSpaceType, TDenseSpaceType, TReordererType >::~LinearSolver ( )
inlinevirtual

Destructor.

Member Function Documentation

◆ AdditionalPhysicalDataIsNeeded()

template<class TSparseSpaceType , class TDenseSpaceType , class TReordererType = Reorderer<TSparseSpaceType, TDenseSpaceType>>
virtual bool Kratos::LinearSolver< TSparseSpaceType, TDenseSpaceType, TReordererType >::AdditionalPhysicalDataIsNeeded ( )
inlinevirtual

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 in Kratos::ScalingSolver< TSparseSpaceType, TDenseSpaceType, TReordererType >, Kratos::MonotonicityPreservingSolver< TSparseSpaceType, TDenseSpaceType, TReordererType >, Kratos::IterativeSolver< TSparseSpaceType, TDenseSpaceType, TPreconditionerType, TReordererType >, Kratos::IterativeSolver< UblasSpace< double, CompressedMatrix, Vector >, UblasSpace< double, Matrix, Vector >, Preconditioner< UblasSpace< double, CompressedMatrix, Vector >, UblasSpace< double, Matrix, Vector > >, Reorderer< UblasSpace< double, CompressedMatrix, Vector >, UblasSpace< double, Matrix, Vector > > >, Kratos::IterativeSolver< TSparseSpaceType, TDenseSpaceType, Preconditioner< TSparseSpaceType, TDenseSpaceType >, Reorderer< TSparseSpaceType, TDenseSpaceType > >, Kratos::AMGCLSolver< TSparseSpaceType, TDenseSpaceType, TReordererType >, Kratos::AMGCLSolver< TSparseSpaceType, TDenseSpaceType, Reorderer< TSparseSpaceType, TDenseSpaceType > >, Kratos::AMGCL_NS_Solver< TSparseSpaceType, TDenseSpaceType, TReordererType >, Kratos::TrilinosMonotonicityPreservingSolver< TSparseSpaceType, TDenseSpaceType, TReordererType >, Kratos::MultiLevelSolver< TSparseSpaceType, TDenseSpaceType, TReordererType >, Kratos::AmgclMPISchurComplementSolver< TSparseSpaceType, TDenseSpaceType, TReordererType >, and Kratos::MixedULMLinearSolver< TSparseSpaceType, TDenseSpaceType, TPreconditionerType, TReordererType >.

◆ Clear()

template<class TSparseSpaceType , class TDenseSpaceType , class TReordererType = Reorderer<TSparseSpaceType, TDenseSpaceType>>
virtual void Kratos::LinearSolver< TSparseSpaceType, TDenseSpaceType, TReordererType >::Clear ( )
inlinevirtual

◆ FinalizeSolutionStep()

template<class TSparseSpaceType , class TDenseSpaceType , class TReordererType = Reorderer<TSparseSpaceType, TDenseSpaceType>>
virtual void Kratos::LinearSolver< TSparseSpaceType, TDenseSpaceType, TReordererType >::FinalizeSolutionStep ( SparseMatrixType rA,
VectorType rX,
VectorType rB 
)
inlinevirtual

◆ GetIterationsNumber()

template<class TSparseSpaceType , class TDenseSpaceType , class TReordererType = Reorderer<TSparseSpaceType, TDenseSpaceType>>
virtual IndexType Kratos::LinearSolver< TSparseSpaceType, TDenseSpaceType, TReordererType >::GetIterationsNumber ( )
inlinevirtual

◆ GetReorderer()

template<class TSparseSpaceType , class TDenseSpaceType , class TReordererType = Reorderer<TSparseSpaceType, TDenseSpaceType>>
virtual TReordererType::Pointer Kratos::LinearSolver< TSparseSpaceType, TDenseSpaceType, TReordererType >::GetReorderer ( )
inlinevirtual

◆ GetTolerance()

template<class TSparseSpaceType , class TDenseSpaceType , class TReordererType = Reorderer<TSparseSpaceType, TDenseSpaceType>>
virtual double Kratos::LinearSolver< TSparseSpaceType, TDenseSpaceType, TReordererType >::GetTolerance ( )
inlinevirtual

◆ Info()

template<class TSparseSpaceType , class TDenseSpaceType , class TReordererType = Reorderer<TSparseSpaceType, TDenseSpaceType>>
virtual std::string Kratos::LinearSolver< TSparseSpaceType, TDenseSpaceType, TReordererType >::Info ( ) const
inlinevirtual

Turn back information as a string.

Reimplemented in Kratos::TFQMRSolver< TSparseSpaceType, TDenseSpaceType, TPreconditionerType, TReordererType >, Kratos::ScalingSolver< TSparseSpaceType, TDenseSpaceType, TReordererType >, Kratos::RayleighQuotientIterationEigenvalueSolver< TSparseSpaceType, TDenseSpaceType, TLinearSolverType, TPreconditionerType, TReordererType >, Kratos::PowerIterationHighestEigenvalueSolver< TSparseSpaceType, TDenseSpaceType, TLinearSolverType, TPreconditionerType, TReordererType >, Kratos::PowerIterationEigenvalueSolver< TSparseSpaceType, TDenseSpaceType, TLinearSolverType, TPreconditionerType, TReordererType >, Kratos::MonotonicityPreservingSolver< TSparseSpaceType, TDenseSpaceType, TReordererType >, Kratos::IterativeSolver< TSparseSpaceType, TDenseSpaceType, TPreconditionerType, TReordererType >, Kratos::IterativeSolver< UblasSpace< double, CompressedMatrix, Vector >, UblasSpace< double, Matrix, Vector >, Preconditioner< UblasSpace< double, CompressedMatrix, Vector >, UblasSpace< double, Matrix, Vector > >, Reorderer< UblasSpace< double, CompressedMatrix, Vector >, UblasSpace< double, Matrix, Vector > > >, Kratos::IterativeSolver< TSparseSpaceType, TDenseSpaceType, Preconditioner< TSparseSpaceType, TDenseSpaceType >, Reorderer< TSparseSpaceType, TDenseSpaceType > >, Kratos::DeflatedCGSolver< TSparseSpaceType, TDenseSpaceType, TPreconditionerType, TReordererType >, Kratos::CGSolver< TSparseSpaceType, TDenseSpaceType, TPreconditionerType, TReordererType >, Kratos::BICGSTABSolver< TSparseSpaceType, TDenseSpaceType, TPreconditionerType, TReordererType >, Kratos::TrilinosMonotonicityPreservingSolver< TSparseSpaceType, TDenseSpaceType, TReordererType >, and Kratos::MixedULMLinearSolver< TSparseSpaceType, TDenseSpaceType, TPreconditionerType, TReordererType >.

◆ Initialize()

template<class TSparseSpaceType , class TDenseSpaceType , class TReordererType = Reorderer<TSparseSpaceType, TDenseSpaceType>>
virtual void Kratos::LinearSolver< TSparseSpaceType, TDenseSpaceType, TReordererType >::Initialize ( SparseMatrixType rA,
VectorType rX,
VectorType rB 
)
inlinevirtual

This function is designed to be called as few times as possible. It creates the data structures that only depend on the connectivity of the matrix (and not on its coefficients) so that the memory can be allocated once and expensive operations can be done only when strictly needed

Parameters
rA.System matrix
rX.Solution vector. it's also the initial guess for iterative linear solvers.
rB.Right hand side vector.

Reimplemented in Kratos::MixedULMLinearSolver< TSparseSpaceType, TDenseSpaceType, TPreconditionerType, TReordererType >.

◆ InitializeSolutionStep()

template<class TSparseSpaceType , class TDenseSpaceType , class TReordererType = Reorderer<TSparseSpaceType, TDenseSpaceType>>
virtual void Kratos::LinearSolver< TSparseSpaceType, TDenseSpaceType, TReordererType >::InitializeSolutionStep ( SparseMatrixType rA,
VectorType rX,
VectorType rB 
)
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

Parameters
rA.System matrix
rX.Solution vector. it's also the initial guess for iterative linear solvers.
rB.Right hand side vector.

Reimplemented in Kratos::SkylineLUCustomScalarSolver< TSparseSpaceType, TDenseSpaceType, TReordererType >, Kratos::ScalingSolver< TSparseSpaceType, TDenseSpaceType, TReordererType >, Kratos::MonotonicityPreservingSolver< TSparseSpaceType, TDenseSpaceType, TReordererType >, Kratos::IterativeSolver< TSparseSpaceType, TDenseSpaceType, TPreconditionerType, TReordererType >, Kratos::IterativeSolver< UblasSpace< double, CompressedMatrix, Vector >, UblasSpace< double, Matrix, Vector >, Preconditioner< UblasSpace< double, CompressedMatrix, Vector >, UblasSpace< double, Matrix, Vector > >, Reorderer< UblasSpace< double, CompressedMatrix, Vector >, UblasSpace< double, Matrix, Vector > > >, Kratos::IterativeSolver< TSparseSpaceType, TDenseSpaceType, Preconditioner< TSparseSpaceType, TDenseSpaceType >, Reorderer< TSparseSpaceType, TDenseSpaceType > >, Kratos::TrilinosMonotonicityPreservingSolver< TSparseSpaceType, TDenseSpaceType, TReordererType >, Kratos::EigenDirectSolver< TSolverType, TSparseSpaceType, TDenseSpaceType, TReordererType >, Kratos::MixedULMLinearSolver< TSparseSpaceType, TDenseSpaceType, TPreconditionerType, TReordererType >, and Kratos::EigenDenseDirectSolver< TSolverType, TSparseSpaceType, TDenseSpaceType, TReordererType >.

◆ IsConsistent() [1/2]

template<class TSparseSpaceType , class TDenseSpaceType , class TReordererType = Reorderer<TSparseSpaceType, TDenseSpaceType>>
virtual bool Kratos::LinearSolver< TSparseSpaceType, TDenseSpaceType, TReordererType >::IsConsistent ( SparseMatrixType rA,
DenseMatrixType rX,
DenseMatrixType rB 
)
inlinevirtual

This method checks if the dimensions of the system of equations are consistent (dense matrix for RHS and unknowns version)

Parameters
rAThe LHS of the system of equations
rXThe matrix containing the unkowns
rBThe matrix containing the RHSs of the system of equations
Returns
True if consistent, false otherwise

◆ IsConsistent() [2/2]

template<class TSparseSpaceType , class TDenseSpaceType , class TReordererType = Reorderer<TSparseSpaceType, TDenseSpaceType>>
virtual bool Kratos::LinearSolver< TSparseSpaceType, TDenseSpaceType, TReordererType >::IsConsistent ( SparseMatrixType rA,
VectorType rX,
VectorType rB 
)
inlinevirtual

This method checks if the dimensions of the system of equations are consistent.

Parameters
rAThe LHS of the system of equations
rXThe vector containing the unkowns
rBThe RHS of the system of equations
Returns
True if consistent, false otherwise

◆ IsNotConsistent() [1/2]

template<class TSparseSpaceType , class TDenseSpaceType , class TReordererType = Reorderer<TSparseSpaceType, TDenseSpaceType>>
virtual bool Kratos::LinearSolver< TSparseSpaceType, TDenseSpaceType, TReordererType >::IsNotConsistent ( SparseMatrixType rA,
DenseMatrixType rX,
DenseMatrixType rB 
)
inlinevirtual

This method checks if the dimensions of the system of equations are not consistent.

Parameters
rAThe LHS of the system of equations
rXThe matrix containing the unkowns
rBThe matrix containing the RHSs of the system of equations
Returns
False if consistent, true otherwise

◆ IsNotConsistent() [2/2]

template<class TSparseSpaceType , class TDenseSpaceType , class TReordererType = Reorderer<TSparseSpaceType, TDenseSpaceType>>
virtual bool Kratos::LinearSolver< TSparseSpaceType, TDenseSpaceType, TReordererType >::IsNotConsistent ( SparseMatrixType rA,
VectorType rX,
VectorType rB 
)
inlinevirtual

This method checks if the dimensions of the system of equations are not consistent.

Parameters
rAThe LHS of the system of equations
rXThe vector containing the unkowns
rBThe RHS of the system of equations
Returns
False if consistent, true otherwise

◆ KRATOS_CLASS_POINTER_DEFINITION()

template<class TSparseSpaceType , class TDenseSpaceType , class TReordererType = Reorderer<TSparseSpaceType, TDenseSpaceType>>
Kratos::LinearSolver< TSparseSpaceType, TDenseSpaceType, TReordererType >::KRATOS_CLASS_POINTER_DEFINITION ( LinearSolver< TSparseSpaceType, TDenseSpaceType, TReordererType >  )

Pointer definition of LinearSolver.

◆ operator=()

template<class TSparseSpaceType , class TDenseSpaceType , class TReordererType = Reorderer<TSparseSpaceType, TDenseSpaceType>>
LinearSolver& Kratos::LinearSolver< TSparseSpaceType, TDenseSpaceType, TReordererType >::operator= ( const LinearSolver< TSparseSpaceType, TDenseSpaceType, TReordererType > &  Other)
inline

Assignment operator.

◆ PerformSolutionStep()

template<class TSparseSpaceType , class TDenseSpaceType , class TReordererType = Reorderer<TSparseSpaceType, TDenseSpaceType>>
virtual void Kratos::LinearSolver< TSparseSpaceType, TDenseSpaceType, TReordererType >::PerformSolutionStep ( SparseMatrixType rA,
VectorType rX,
VectorType rB 
)
inlinevirtual

This function actually performs the solution work, eventually taking advantage of what was done before in the Initialize and InitializeSolutionStep functions.

Parameters
rA.System matrix
rX.Solution vector. it's also the initial guess for iterative linear solvers.
rB.Right hand side vector.

Reimplemented in Kratos::SkylineLUCustomScalarSolver< TSparseSpaceType, TDenseSpaceType, TReordererType >, Kratos::EigenDirectSolver< TSolverType, TSparseSpaceType, TDenseSpaceType, TReordererType >, Kratos::MixedULMLinearSolver< TSparseSpaceType, TDenseSpaceType, TPreconditionerType, TReordererType >, and Kratos::EigenDenseDirectSolver< TSolverType, TSparseSpaceType, TDenseSpaceType, TReordererType >.

◆ PrintData()

template<class TSparseSpaceType , class TDenseSpaceType , class TReordererType = Reorderer<TSparseSpaceType, TDenseSpaceType>>
virtual void Kratos::LinearSolver< TSparseSpaceType, TDenseSpaceType, TReordererType >::PrintData ( std::ostream &  rOStream) const
inlinevirtual

Print object's data.

Reimplemented in Kratos::SkylineLUFactorizationSolver< TSparseSpaceType, TDenseSpaceType, TReordererType >, Kratos::ScalingSolver< TSparseSpaceType, TDenseSpaceType, TReordererType >, Kratos::RayleighQuotientIterationEigenvalueSolver< TSparseSpaceType, TDenseSpaceType, TLinearSolverType, TPreconditionerType, TReordererType >, Kratos::PowerIterationHighestEigenvalueSolver< TSparseSpaceType, TDenseSpaceType, TLinearSolverType, TPreconditionerType, TReordererType >, Kratos::PowerIterationEigenvalueSolver< TSparseSpaceType, TDenseSpaceType, TLinearSolverType, TPreconditionerType, TReordererType >, Kratos::MonotonicityPreservingSolver< TSparseSpaceType, TDenseSpaceType, TReordererType >, Kratos::IterativeSolver< TSparseSpaceType, TDenseSpaceType, TPreconditionerType, TReordererType >, Kratos::IterativeSolver< UblasSpace< double, CompressedMatrix, Vector >, UblasSpace< double, Matrix, Vector >, Preconditioner< UblasSpace< double, CompressedMatrix, Vector >, UblasSpace< double, Matrix, Vector > >, Reorderer< UblasSpace< double, CompressedMatrix, Vector >, UblasSpace< double, Matrix, Vector > > >, Kratos::IterativeSolver< TSparseSpaceType, TDenseSpaceType, Preconditioner< TSparseSpaceType, TDenseSpaceType >, Reorderer< TSparseSpaceType, TDenseSpaceType > >, Kratos::DirectSolver< TSparseSpaceType, TDenseSpaceType, TReordererType >, Kratos::DirectSolver< typename SpaceType< typename TSolverType::Scalar >::Global, typename SpaceType< typename TSolverType::Scalar >::Local, Reorderer< typename SpaceType< typename TSolverType::Scalar >::Global, typename SpaceType< typename TSolverType::Scalar >::Local > >, Kratos::DirectSolver< typename SpaceType< typename TSolverType::Scalar >::Local, typename SpaceType< typename TSolverType::Scalar >::Local, Reorderer< typename SpaceType< typename TSolverType::Scalar >::Local, typename SpaceType< typename TSolverType::Scalar >::Local > >, Kratos::DirectSolver< TSparseSpaceType, TDenseSpaceType, Reorderer< TSparseSpaceType, TDenseSpaceType > >, Kratos::DeflatedCGSolver< TSparseSpaceType, TDenseSpaceType, TPreconditionerType, TReordererType >, Kratos::CGSolver< TSparseSpaceType, TDenseSpaceType, TPreconditionerType, TReordererType >, Kratos::AMGCLSolver< TSparseSpaceType, TDenseSpaceType, TReordererType >, Kratos::AMGCLSolver< TSparseSpaceType, TDenseSpaceType, Reorderer< TSparseSpaceType, TDenseSpaceType > >, Kratos::AMGCL_NS_Solver< TSparseSpaceType, TDenseSpaceType, TReordererType >, Kratos::TrilinosMonotonicityPreservingSolver< TSparseSpaceType, TDenseSpaceType, TReordererType >, Kratos::SpectraSymGEigsShiftSolver< TSparseSpaceType, TDenseSpaceType, TPreconditionerType, TReordererType >, Kratos::FEASTEigensystemSolver< TSymmetric, TScalarIn, TScalarOut, TSparseSpaceTypeIn, TDenseSpaceTypeIn, TSparseSpaceTypeOut, TDenseSpaceTypeOut >, Kratos::EigensystemSolver< TSparseSpaceType, TDenseSpaceType, TPreconditionerType, TReordererType >, Kratos::EigenDirectSolver< TSolverType, TSparseSpaceType, TDenseSpaceType, TReordererType >, Kratos::EigenDenseDirectSolver< TSolverType, TSparseSpaceType, TDenseSpaceType, TReordererType >, Kratos::MixedULMLinearSolver< TSparseSpaceType, TDenseSpaceType, TPreconditionerType, TReordererType >, Kratos::TFQMRSolver< TSparseSpaceType, TDenseSpaceType, TPreconditionerType, TReordererType >, and Kratos::BICGSTABSolver< TSparseSpaceType, TDenseSpaceType, TPreconditionerType, TReordererType >.

◆ PrintInfo()

template<class TSparseSpaceType , class TDenseSpaceType , class TReordererType = Reorderer<TSparseSpaceType, TDenseSpaceType>>
virtual void Kratos::LinearSolver< TSparseSpaceType, TDenseSpaceType, TReordererType >::PrintInfo ( std::ostream &  rOStream) const
inlinevirtual

Print information about this object.

Reimplemented in Kratos::SkylineLUFactorizationSolver< TSparseSpaceType, TDenseSpaceType, TReordererType >, Kratos::SkylineLUCustomScalarSolver< TSparseSpaceType, TDenseSpaceType, TReordererType >, Kratos::ScalingSolver< TSparseSpaceType, TDenseSpaceType, TReordererType >, Kratos::RayleighQuotientIterationEigenvalueSolver< TSparseSpaceType, TDenseSpaceType, TLinearSolverType, TPreconditionerType, TReordererType >, Kratos::PowerIterationHighestEigenvalueSolver< TSparseSpaceType, TDenseSpaceType, TLinearSolverType, TPreconditionerType, TReordererType >, Kratos::PowerIterationEigenvalueSolver< TSparseSpaceType, TDenseSpaceType, TLinearSolverType, TPreconditionerType, TReordererType >, Kratos::MonotonicityPreservingSolver< TSparseSpaceType, TDenseSpaceType, TReordererType >, Kratos::IterativeSolver< TSparseSpaceType, TDenseSpaceType, TPreconditionerType, TReordererType >, Kratos::IterativeSolver< UblasSpace< double, CompressedMatrix, Vector >, UblasSpace< double, Matrix, Vector >, Preconditioner< UblasSpace< double, CompressedMatrix, Vector >, UblasSpace< double, Matrix, Vector > >, Reorderer< UblasSpace< double, CompressedMatrix, Vector >, UblasSpace< double, Matrix, Vector > > >, Kratos::IterativeSolver< TSparseSpaceType, TDenseSpaceType, Preconditioner< TSparseSpaceType, TDenseSpaceType >, Reorderer< TSparseSpaceType, TDenseSpaceType > >, Kratos::DirectSolver< TSparseSpaceType, TDenseSpaceType, TReordererType >, Kratos::DirectSolver< typename SpaceType< typename TSolverType::Scalar >::Global, typename SpaceType< typename TSolverType::Scalar >::Local, Reorderer< typename SpaceType< typename TSolverType::Scalar >::Global, typename SpaceType< typename TSolverType::Scalar >::Local > >, Kratos::DirectSolver< typename SpaceType< typename TSolverType::Scalar >::Local, typename SpaceType< typename TSolverType::Scalar >::Local, Reorderer< typename SpaceType< typename TSolverType::Scalar >::Local, typename SpaceType< typename TSolverType::Scalar >::Local > >, Kratos::DirectSolver< TSparseSpaceType, TDenseSpaceType, Reorderer< TSparseSpaceType, TDenseSpaceType > >, Kratos::DeflatedCGSolver< TSparseSpaceType, TDenseSpaceType, TPreconditionerType, TReordererType >, Kratos::CGSolver< TSparseSpaceType, TDenseSpaceType, TPreconditionerType, TReordererType >, Kratos::AMGCLSolver< TSparseSpaceType, TDenseSpaceType, TReordererType >, Kratos::AMGCLSolver< TSparseSpaceType, TDenseSpaceType, Reorderer< TSparseSpaceType, TDenseSpaceType > >, Kratos::AMGCL_NS_Solver< TSparseSpaceType, TDenseSpaceType, TReordererType >, Kratos::TrilinosMonotonicityPreservingSolver< TSparseSpaceType, TDenseSpaceType, TReordererType >, Kratos::MultiLevelSolver< TSparseSpaceType, TDenseSpaceType, TReordererType >, Kratos::AztecSolver< TSparseSpaceType, TDenseSpaceType, TReordererType >, Kratos::AmgclMPISolver< TSparseSpaceType, TDenseSpaceType, TReordererType >, Kratos::AmgclMPISchurComplementSolver< TSparseSpaceType, TDenseSpaceType, TReordererType >, Kratos::AmesosSolver< TSparseSpaceType, TDenseSpaceType, TReordererType >, Kratos::Amesos2Solver< TSparseSpaceType, TDenseSpaceType, TReordererType >, Kratos::SpectraSymGEigsShiftSolver< TSparseSpaceType, TDenseSpaceType, TPreconditionerType, TReordererType >, Kratos::FEASTEigensystemSolver< TSymmetric, TScalarIn, TScalarOut, TSparseSpaceTypeIn, TDenseSpaceTypeIn, TSparseSpaceTypeOut, TDenseSpaceTypeOut >, Kratos::EigensystemSolver< TSparseSpaceType, TDenseSpaceType, TPreconditionerType, TReordererType >, Kratos::EigenDirectSolver< TSolverType, TSparseSpaceType, TDenseSpaceType, TReordererType >, Kratos::DenseEigenvalueSolver< TScalar, TSparseSpaceType, TDenseSpaceType >, Kratos::EigenDenseDirectSolver< TSolverType, TSparseSpaceType, TDenseSpaceType, TReordererType >, Kratos::MixedULMLinearSolver< TSparseSpaceType, TDenseSpaceType, TPreconditionerType, TReordererType >, Kratos::TFQMRSolver< TSparseSpaceType, TDenseSpaceType, TPreconditionerType, TReordererType >, and Kratos::BICGSTABSolver< TSparseSpaceType, TDenseSpaceType, TPreconditionerType, TReordererType >.

◆ ProvideAdditionalData()

template<class TSparseSpaceType , class TDenseSpaceType , class TReordererType = Reorderer<TSparseSpaceType, TDenseSpaceType>>
virtual void Kratos::LinearSolver< TSparseSpaceType, TDenseSpaceType, TReordererType >::ProvideAdditionalData ( SparseMatrixType rA,
VectorType rX,
VectorType rB,
typename ModelPart::DofsArrayType rDoFSet,
ModelPart rModelPart 
)
inlinevirtual

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 in Kratos::AMGCL_NS_Solver< TSparseSpaceType, TDenseSpaceType, TReordererType >, Kratos::AmgclMPISchurComplementSolver< TSparseSpaceType, TDenseSpaceType, TReordererType >, Kratos::ScalingSolver< TSparseSpaceType, TDenseSpaceType, TReordererType >, Kratos::MonotonicityPreservingSolver< TSparseSpaceType, TDenseSpaceType, TReordererType >, Kratos::IterativeSolver< TSparseSpaceType, TDenseSpaceType, TPreconditionerType, TReordererType >, Kratos::IterativeSolver< UblasSpace< double, CompressedMatrix, Vector >, UblasSpace< double, Matrix, Vector >, Preconditioner< UblasSpace< double, CompressedMatrix, Vector >, UblasSpace< double, Matrix, Vector > >, Reorderer< UblasSpace< double, CompressedMatrix, Vector >, UblasSpace< double, Matrix, Vector > > >, Kratos::IterativeSolver< TSparseSpaceType, TDenseSpaceType, Preconditioner< TSparseSpaceType, TDenseSpaceType >, Reorderer< TSparseSpaceType, TDenseSpaceType > >, Kratos::TrilinosMonotonicityPreservingSolver< TSparseSpaceType, TDenseSpaceType, TReordererType >, Kratos::MultiLevelSolver< TSparseSpaceType, TDenseSpaceType, TReordererType >, Kratos::AMGCLSolver< TSparseSpaceType, TDenseSpaceType, TReordererType >, Kratos::AMGCLSolver< TSparseSpaceType, TDenseSpaceType, Reorderer< TSparseSpaceType, TDenseSpaceType > >, and Kratos::MixedULMLinearSolver< TSparseSpaceType, TDenseSpaceType, TPreconditionerType, TReordererType >.

◆ SetReorderer()

template<class TSparseSpaceType , class TDenseSpaceType , class TReordererType = Reorderer<TSparseSpaceType, TDenseSpaceType>>
virtual void Kratos::LinearSolver< TSparseSpaceType, TDenseSpaceType, TReordererType >::SetReorderer ( typename TReordererType::Pointer  pNewReorderer)
inlinevirtual

◆ SetTolerance()

template<class TSparseSpaceType , class TDenseSpaceType , class TReordererType = Reorderer<TSparseSpaceType, TDenseSpaceType>>
virtual void Kratos::LinearSolver< TSparseSpaceType, TDenseSpaceType, TReordererType >::SetTolerance ( double  NewTolerance)
inlinevirtual

◆ Solve() [1/3]

template<class TSparseSpaceType , class TDenseSpaceType , class TReordererType = Reorderer<TSparseSpaceType, TDenseSpaceType>>
virtual void Kratos::LinearSolver< TSparseSpaceType, TDenseSpaceType, TReordererType >::Solve ( SparseMatrixType K,
SparseMatrixType M,
DenseVectorType Eigenvalues,
DenseMatrixType Eigenvectors 
)
inlinevirtual

◆ Solve() [2/3]

template<class TSparseSpaceType , class TDenseSpaceType , class TReordererType = Reorderer<TSparseSpaceType, TDenseSpaceType>>
virtual bool Kratos::LinearSolver< TSparseSpaceType, TDenseSpaceType, TReordererType >::Solve ( SparseMatrixType rA,
DenseMatrixType rX,
DenseMatrixType rB 
)
inlinevirtual

Multi solve method for solving a set of linear systems with same coefficient matrix. Solves the linear system Ax=b and puts the result on SystemVector& rX. rVectorx is also th initial guess for iterative methods.

Parameters
rA.System matrix
rX.Solution vector. it's also the initial guess for iterative linear solvers.
rB.Right hand side vector.

Reimplemented in Kratos::TFQMRSolver< TSparseSpaceType, TDenseSpaceType, TPreconditionerType, TReordererType >, Kratos::SkylineLUFactorizationSolver< TSparseSpaceType, TDenseSpaceType, TReordererType >, Kratos::DeflatedCGSolver< TSparseSpaceType, TDenseSpaceType, TPreconditionerType, TReordererType >, Kratos::CGSolver< TSparseSpaceType, TDenseSpaceType, TPreconditionerType, TReordererType >, Kratos::BICGSTABSolver< TSparseSpaceType, TDenseSpaceType, TPreconditionerType, TReordererType >, Kratos::AMGCLSolver< TSparseSpaceType, TDenseSpaceType, TReordererType >, Kratos::AMGCLSolver< TSparseSpaceType, TDenseSpaceType, Reorderer< TSparseSpaceType, TDenseSpaceType > >, Kratos::AMGCL_NS_Solver< TSparseSpaceType, TDenseSpaceType, TReordererType >, Kratos::MultiLevelSolver< TSparseSpaceType, TDenseSpaceType, TReordererType >, Kratos::AztecSolver< TSparseSpaceType, TDenseSpaceType, TReordererType >, Kratos::AmgclMPISchurComplementSolver< TSparseSpaceType, TDenseSpaceType, TReordererType >, Kratos::AmesosSolver< TSparseSpaceType, TDenseSpaceType, TReordererType >, Kratos::Amesos2Solver< TSparseSpaceType, TDenseSpaceType, TReordererType >, Kratos::EigenDirectSolver< TSolverType, TSparseSpaceType, TDenseSpaceType, TReordererType >, and Kratos::MixedULMLinearSolver< TSparseSpaceType, TDenseSpaceType, TPreconditionerType, TReordererType >.

◆ Solve() [3/3]

template<class TSparseSpaceType , class TDenseSpaceType , class TReordererType = Reorderer<TSparseSpaceType, TDenseSpaceType>>
virtual bool Kratos::LinearSolver< TSparseSpaceType, TDenseSpaceType, TReordererType >::Solve ( SparseMatrixType rA,
VectorType rX,
VectorType rB 
)
inlinevirtual

Normal solve method. Solves the linear system Ax=b and puts the result on SystemVector& rX. rVectorx is also th initial guess for iterative methods.

Parameters
rA.System matrix
rX.Solution vector. it's also the initial guess for iterative linear solvers.
rB.Right hand side vector.

Reimplemented in Kratos::TFQMRSolver< TSparseSpaceType, TDenseSpaceType, TPreconditionerType, TReordererType >, Kratos::SkylineLUFactorizationSolver< TSparseSpaceType, TDenseSpaceType, TReordererType >, Kratos::SkylineLUCustomScalarSolver< TSparseSpaceType, TDenseSpaceType, TReordererType >, Kratos::ScalingSolver< TSparseSpaceType, TDenseSpaceType, TReordererType >, Kratos::MonotonicityPreservingSolver< TSparseSpaceType, TDenseSpaceType, TReordererType >, Kratos::CGSolver< TSparseSpaceType, TDenseSpaceType, TPreconditionerType, TReordererType >, Kratos::BICGSTABSolver< TSparseSpaceType, TDenseSpaceType, TPreconditionerType, TReordererType >, Kratos::AMGCLSolver< TSparseSpaceType, TDenseSpaceType, TReordererType >, Kratos::AMGCLSolver< TSparseSpaceType, TDenseSpaceType, Reorderer< TSparseSpaceType, TDenseSpaceType > >, Kratos::AMGCL_NS_Solver< TSparseSpaceType, TDenseSpaceType, TReordererType >, Kratos::TrilinosMonotonicityPreservingSolver< TSparseSpaceType, TDenseSpaceType, TReordererType >, Kratos::MultiLevelSolver< TSparseSpaceType, TDenseSpaceType, TReordererType >, Kratos::AztecSolver< TSparseSpaceType, TDenseSpaceType, TReordererType >, Kratos::AmgclMPISchurComplementSolver< TSparseSpaceType, TDenseSpaceType, TReordererType >, Kratos::AmesosSolver< TSparseSpaceType, TDenseSpaceType, TReordererType >, Kratos::Amesos2Solver< TSparseSpaceType, TDenseSpaceType, TReordererType >, Kratos::EigenDirectSolver< TSolverType, TSparseSpaceType, TDenseSpaceType, TReordererType >, Kratos::MixedULMLinearSolver< TSparseSpaceType, TDenseSpaceType, TPreconditionerType, TReordererType >, Kratos::DeflatedCGSolver< TSparseSpaceType, TDenseSpaceType, TPreconditionerType, TReordererType >, and Kratos::EigenDenseDirectSolver< TSolverType, TSparseSpaceType, TDenseSpaceType, TReordererType >.


The documentation for this class was generated from the following file: