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::MixedULMLinearSolver< TSparseSpaceType, TDenseSpaceType, TPreconditionerType, TReordererType > Class Template Reference

This solver is designed for the solution of mixed U-LM problems (this solver in particular is optimized for dual LM, to avoid the resolution). More...

#include <mixedulm_linear_solver.h>

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

Public Types

Enums
enum class  BlockType {
  OTHER , MASTER , SLAVE_INACTIVE , SLAVE_ACTIVE ,
  LM_INACTIVE , LM_ACTIVE
}
 An enumeration of the different types of blocks used in the mixed Uzawa-LM linear solver. More...
 
- Public Types inherited from Kratos::IterativeSolver< TSparseSpaceType, TDenseSpaceType, Preconditioner< TSparseSpaceType, TDenseSpaceType >, Reorderer< TSparseSpaceType, TDenseSpaceType > >
typedef LinearSolver< TSparseSpaceType, TDenseSpaceType, Reorderer< TSparseSpaceType, TDenseSpaceType > > BaseType
 
typedef TSparseSpaceType::MatrixType SparseMatrixType
 
typedef TSparseSpaceType::VectorType VectorType
 
typedef TDenseSpaceType::MatrixType DenseMatrixType
 
typedef Preconditioner< TSparseSpaceType, TDenseSpaceType > PreconditionerType
 
typedef TSparseSpaceType::IndexType IndexType
 The index type definition to be consistent. More...
 
- Public Types inherited from Kratos::LinearSolver< TSparseSpaceType, TDenseSpaceType, Reorderer< TSparseSpaceType, TDenseSpaceType > >
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...
 

Public Member Functions

Life Cycle
 MixedULMLinearSolver (LinearSolverPointerType pSolverDispBlock, const double MaxTolerance, const std::size_t MaxIterationNumber)
 Default constructor. More...
 
 MixedULMLinearSolver (LinearSolverPointerType pSolverDispBlock, Parameters ThisParameters=Parameters(R"({})"))
 Second constructor, it uses a Kratos parameters as input instead of direct input. More...
 
 MixedULMLinearSolver (const MixedULMLinearSolver &rOther)
 Copy constructor. More...
 
 ~MixedULMLinearSolver () override
 Destructor. More...
 
Operators
MixedULMLinearSolveroperator= (const MixedULMLinearSolver &Other)
 Assignment operator. More...
 
Operations
void Initialize (SparseMatrixType &rA, VectorType &rX, VectorType &rB) override
 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) More...
 
void InitializeSolutionStep (SparseMatrixType &rA, VectorType &rX, VectorType &rB) override
 This function is designed to be called every time the coefficients change in the system that is, normally at the beginning of each solve. More...
 
void PerformSolutionStep (SparseMatrixType &rA, VectorType &rX, VectorType &rB) override
 This function actually performs the solution work, eventually taking advantage of what was done before in the. More...
 
void FinalizeSolutionStep (SparseMatrixType &rA, VectorType &rX, VectorType &rB) override
 This function is designed to be called at the end of the solve step. More...
 
void Clear () override
 This function is designed to clean up all internal data in the solver. More...
 
bool Solve (SparseMatrixType &rA, VectorType &rX, VectorType &rB) override
 Normal solve method. More...
 
bool Solve (SparseMatrixType &rA, DenseMatrixType &rX, DenseMatrixType &rB) override
 Multi solve method for solving a set of linear systems with same coefficient matrix. More...
 
bool AdditionalPhysicalDataIsNeeded () override
 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. More...
 
void ProvideAdditionalData (SparseMatrixType &rA, VectorType &rX, VectorType &rB, DofsArrayType &rDofSet, ModelPart &rModelPart) override
 Some solvers may require a minimum degree of knowledge of the structure of the matrix. More...
 
Access
DofsArrayTypeGetDisplacementDofs ()
 This method retrieves the displacement DoFs of the system ordered according to the resolution order. More...
 
const DofsArrayTypeGetDisplacementDofs () const
 This method retrieves the displacement DoFs of the system ordered according to the resolution order. 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...
 
- Public Member Functions inherited from Kratos::IterativeSolver< TSparseSpaceType, TDenseSpaceType, Preconditioner< TSparseSpaceType, TDenseSpaceType >, Reorderer< TSparseSpaceType, TDenseSpaceType > >
 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...
 
IterativeSolveroperator= (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...
 
- Public Member Functions inherited from Kratos::LinearSolver< TSparseSpaceType, TDenseSpaceType, Reorderer< TSparseSpaceType, TDenseSpaceType > >
 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...
 
LinearSolveroperator= (const LinearSolver &Other)
 Assignment operator. More...
 
virtual void Solve (SparseMatrixType &K, SparseMatrixType &M, DenseVectorType &Eigenvalues, DenseMatrixType &Eigenvectors)
 
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...
 

Protected Member Functions

Protected Operations
void FillBlockMatrices (const bool NeedAllocation, SparseMatrixType &rA, VectorType &rX, VectorType &rB)
 T his function generates the subblocks of matrix A. More...
 
- Protected Member Functions inherited from Kratos::IterativeSolver< TSparseSpaceType, TDenseSpaceType, Preconditioner< TSparseSpaceType, TDenseSpaceType >, Reorderer< TSparseSpaceType, TDenseSpaceType > >
void PreconditionedMult (SparseMatrixType &rA, VectorType &rX, VectorType &rY)
 
void PreconditionedTransposeMult (SparseMatrixType &rA, VectorType &rX, VectorType &rY)
 

Type Definitions

using BaseType = IterativeSolver< TSparseSpaceType, TDenseSpaceType, TPreconditionerType, TReordererType >
 The base class corresponds to the an iterative solver. More...
 
using LinearSolverType = LinearSolver< TSparseSpaceType, TDenseSpaceType, TReordererType >
 The base class for the linear solver. More...
 
using LinearSolverPointerType = typename LinearSolverType::Pointer
 The pointer to a linear solver. More...
 
using SparseMatrixType = typename TSparseSpaceType::MatrixType
 The sparse matrix type. More...
 
using VectorType = typename TSparseSpaceType::VectorType
 The vector type. More...
 
using DenseMatrixType = typename TDenseSpaceType::MatrixType
 The dense matrix type. More...
 
using DenseVectorType = typename TDenseSpaceType::VectorType
 The dense vector type. More...
 
using DofType = typename ModelPart::DofType
 The definition of the dof type. More...
 
using DofsArrayType = typename ModelPart::DofsArrayType
 The array containing the dofs. More...
 
using ConditionsArrayType = typename ModelPart::ConditionsContainerType
 An array of conditions. More...
 
using NodesArrayType = typename ModelPart::NodesContainerType
 An array of nodes. More...
 
using SizeType = std::size_t
 The size type. More...
 
using IndexType = std::size_t
 The index type. More...
 
using IndexVectorType = DenseVector< IndexType >
 A vector of indexes. More...
 
using BlockTypeVectorType = DenseVector< BlockType >
 A vector of types. More...
 
static constexpr double ZeroTolerance = std::numeric_limits<double>::epsilon()
 The zero tolerance considerered. More...
 
 KRATOS_DEFINE_LOCAL_FLAG (BLOCKS_ARE_ALLOCATED)
 The flag that indicates if the blocks are allocated. More...
 
 KRATOS_DEFINE_LOCAL_FLAG (IS_INITIALIZED)
 The flag that indicates if the solution is initialized. More...
 
 KRATOS_CLASS_POINTER_DEFINITION (MixedULMLinearSolver)
 Pointer definition of MixedULMLinearSolver. More...
 

Additional Inherited Members

- Protected Attributes inherited from Kratos::IterativeSolver< TSparseSpaceType, TDenseSpaceType, Preconditioner< TSparseSpaceType, TDenseSpaceType >, Reorderer< TSparseSpaceType, TDenseSpaceType > >
double mResidualNorm
 
double mFirstResidualNorm
 
IndexType mIterationsNumber
 
double mBNorm
 

Detailed Description

template<class TSparseSpaceType, class TDenseSpaceType, class TPreconditionerType = Preconditioner<TSparseSpaceType, TDenseSpaceType>, class TReordererType = Reorderer<TSparseSpaceType, TDenseSpaceType>>
class Kratos::MixedULMLinearSolver< TSparseSpaceType, TDenseSpaceType, TPreconditionerType, TReordererType >

This solver is designed for the solution of mixed U-LM problems (this solver in particular is optimized for dual LM, to avoid the resolution).

It uses a block structure diving the matrix in UU LMLM ULM LMU blocks and uses "standard" linear solvers for the different blocks as well as a GMRES for the outer part

Author
Vicente Mataix Ferrandiz

Member Typedef Documentation

◆ BaseType

template<class TSparseSpaceType , class TDenseSpaceType , class TPreconditionerType = Preconditioner<TSparseSpaceType, TDenseSpaceType>, class TReordererType = Reorderer<TSparseSpaceType, TDenseSpaceType>>
using Kratos::MixedULMLinearSolver< TSparseSpaceType, TDenseSpaceType, TPreconditionerType, TReordererType >::BaseType = IterativeSolver<TSparseSpaceType, TDenseSpaceType, TPreconditionerType, TReordererType>

The base class corresponds to the an iterative solver.

◆ BlockTypeVectorType

template<class TSparseSpaceType , class TDenseSpaceType , class TPreconditionerType = Preconditioner<TSparseSpaceType, TDenseSpaceType>, class TReordererType = Reorderer<TSparseSpaceType, TDenseSpaceType>>
using Kratos::MixedULMLinearSolver< TSparseSpaceType, TDenseSpaceType, TPreconditionerType, TReordererType >::BlockTypeVectorType = DenseVector<BlockType>

A vector of types.

◆ ConditionsArrayType

template<class TSparseSpaceType , class TDenseSpaceType , class TPreconditionerType = Preconditioner<TSparseSpaceType, TDenseSpaceType>, class TReordererType = Reorderer<TSparseSpaceType, TDenseSpaceType>>
using Kratos::MixedULMLinearSolver< TSparseSpaceType, TDenseSpaceType, TPreconditionerType, TReordererType >::ConditionsArrayType = typename ModelPart::ConditionsContainerType

An array of conditions.

◆ DenseMatrixType

template<class TSparseSpaceType , class TDenseSpaceType , class TPreconditionerType = Preconditioner<TSparseSpaceType, TDenseSpaceType>, class TReordererType = Reorderer<TSparseSpaceType, TDenseSpaceType>>
using Kratos::MixedULMLinearSolver< TSparseSpaceType, TDenseSpaceType, TPreconditionerType, TReordererType >::DenseMatrixType = typename TDenseSpaceType::MatrixType

The dense matrix type.

◆ DenseVectorType

template<class TSparseSpaceType , class TDenseSpaceType , class TPreconditionerType = Preconditioner<TSparseSpaceType, TDenseSpaceType>, class TReordererType = Reorderer<TSparseSpaceType, TDenseSpaceType>>
using Kratos::MixedULMLinearSolver< TSparseSpaceType, TDenseSpaceType, TPreconditionerType, TReordererType >::DenseVectorType = typename TDenseSpaceType::VectorType

The dense vector type.

◆ DofsArrayType

template<class TSparseSpaceType , class TDenseSpaceType , class TPreconditionerType = Preconditioner<TSparseSpaceType, TDenseSpaceType>, class TReordererType = Reorderer<TSparseSpaceType, TDenseSpaceType>>
using Kratos::MixedULMLinearSolver< TSparseSpaceType, TDenseSpaceType, TPreconditionerType, TReordererType >::DofsArrayType = typename ModelPart::DofsArrayType

The array containing the dofs.

◆ DofType

template<class TSparseSpaceType , class TDenseSpaceType , class TPreconditionerType = Preconditioner<TSparseSpaceType, TDenseSpaceType>, class TReordererType = Reorderer<TSparseSpaceType, TDenseSpaceType>>
using Kratos::MixedULMLinearSolver< TSparseSpaceType, TDenseSpaceType, TPreconditionerType, TReordererType >::DofType = typename ModelPart::DofType

The definition of the dof type.

◆ IndexType

template<class TSparseSpaceType , class TDenseSpaceType , class TPreconditionerType = Preconditioner<TSparseSpaceType, TDenseSpaceType>, class TReordererType = Reorderer<TSparseSpaceType, TDenseSpaceType>>
using Kratos::MixedULMLinearSolver< TSparseSpaceType, TDenseSpaceType, TPreconditionerType, TReordererType >::IndexType = std::size_t

The index type.

◆ IndexVectorType

template<class TSparseSpaceType , class TDenseSpaceType , class TPreconditionerType = Preconditioner<TSparseSpaceType, TDenseSpaceType>, class TReordererType = Reorderer<TSparseSpaceType, TDenseSpaceType>>
using Kratos::MixedULMLinearSolver< TSparseSpaceType, TDenseSpaceType, TPreconditionerType, TReordererType >::IndexVectorType = DenseVector<IndexType>

A vector of indexes.

◆ LinearSolverPointerType

template<class TSparseSpaceType , class TDenseSpaceType , class TPreconditionerType = Preconditioner<TSparseSpaceType, TDenseSpaceType>, class TReordererType = Reorderer<TSparseSpaceType, TDenseSpaceType>>
using Kratos::MixedULMLinearSolver< TSparseSpaceType, TDenseSpaceType, TPreconditionerType, TReordererType >::LinearSolverPointerType = typename LinearSolverType::Pointer

The pointer to a linear solver.

◆ LinearSolverType

template<class TSparseSpaceType , class TDenseSpaceType , class TPreconditionerType = Preconditioner<TSparseSpaceType, TDenseSpaceType>, class TReordererType = Reorderer<TSparseSpaceType, TDenseSpaceType>>
using Kratos::MixedULMLinearSolver< TSparseSpaceType, TDenseSpaceType, TPreconditionerType, TReordererType >::LinearSolverType = LinearSolver<TSparseSpaceType, TDenseSpaceType, TReordererType>

The base class for the linear solver.

◆ NodesArrayType

template<class TSparseSpaceType , class TDenseSpaceType , class TPreconditionerType = Preconditioner<TSparseSpaceType, TDenseSpaceType>, class TReordererType = Reorderer<TSparseSpaceType, TDenseSpaceType>>
using Kratos::MixedULMLinearSolver< TSparseSpaceType, TDenseSpaceType, TPreconditionerType, TReordererType >::NodesArrayType = typename ModelPart::NodesContainerType

An array of nodes.

◆ SizeType

template<class TSparseSpaceType , class TDenseSpaceType , class TPreconditionerType = Preconditioner<TSparseSpaceType, TDenseSpaceType>, class TReordererType = Reorderer<TSparseSpaceType, TDenseSpaceType>>
using Kratos::MixedULMLinearSolver< TSparseSpaceType, TDenseSpaceType, TPreconditionerType, TReordererType >::SizeType = std::size_t

The size type.

◆ SparseMatrixType

template<class TSparseSpaceType , class TDenseSpaceType , class TPreconditionerType = Preconditioner<TSparseSpaceType, TDenseSpaceType>, class TReordererType = Reorderer<TSparseSpaceType, TDenseSpaceType>>
using Kratos::MixedULMLinearSolver< TSparseSpaceType, TDenseSpaceType, TPreconditionerType, TReordererType >::SparseMatrixType = typename TSparseSpaceType::MatrixType

The sparse matrix type.

◆ VectorType

template<class TSparseSpaceType , class TDenseSpaceType , class TPreconditionerType = Preconditioner<TSparseSpaceType, TDenseSpaceType>, class TReordererType = Reorderer<TSparseSpaceType, TDenseSpaceType>>
using Kratos::MixedULMLinearSolver< TSparseSpaceType, TDenseSpaceType, TPreconditionerType, TReordererType >::VectorType = typename TSparseSpaceType::VectorType

The vector type.

Member Enumeration Documentation

◆ BlockType

template<class TSparseSpaceType , class TDenseSpaceType , class TPreconditionerType = Preconditioner<TSparseSpaceType, TDenseSpaceType>, class TReordererType = Reorderer<TSparseSpaceType, TDenseSpaceType>>
enum Kratos::MixedULMLinearSolver::BlockType
strong

An enumeration of the different types of blocks used in the mixed Uzawa-LM linear solver.

Enumerator
OTHER 

A block of another type.

MASTER 

A master block.

SLAVE_INACTIVE 

An inactive slave block.

SLAVE_ACTIVE 

An active slave block.

LM_INACTIVE 

An inactive Lagrange multiplier block.

LM_ACTIVE 

An active Lagrange multiplier block.

Constructor & Destructor Documentation

◆ MixedULMLinearSolver() [1/3]

template<class TSparseSpaceType , class TDenseSpaceType , class TPreconditionerType = Preconditioner<TSparseSpaceType, TDenseSpaceType>, class TReordererType = Reorderer<TSparseSpaceType, TDenseSpaceType>>
Kratos::MixedULMLinearSolver< TSparseSpaceType, TDenseSpaceType, TPreconditionerType, TReordererType >::MixedULMLinearSolver ( LinearSolverPointerType  pSolverDispBlock,
const double  MaxTolerance,
const std::size_t  MaxIterationNumber 
)
inline

Default constructor.

Parameters
pSolverDispBlockThe linear solver used for the displacement block
MaxToleranceThe maximal tolrance considered
MaxIterationNumberThe maximal number of iterations

◆ MixedULMLinearSolver() [2/3]

template<class TSparseSpaceType , class TDenseSpaceType , class TPreconditionerType = Preconditioner<TSparseSpaceType, TDenseSpaceType>, class TReordererType = Reorderer<TSparseSpaceType, TDenseSpaceType>>
Kratos::MixedULMLinearSolver< TSparseSpaceType, TDenseSpaceType, TPreconditionerType, TReordererType >::MixedULMLinearSolver ( LinearSolverPointerType  pSolverDispBlock,
Parameters  ThisParameters = Parameters(R"({})") 
)
inline

Second constructor, it uses a Kratos parameters as input instead of direct input.

Parameters
pSolverDispBlockThe linear solver used for the displacement block
ThisParametersThe configuration parameters considered

◆ MixedULMLinearSolver() [3/3]

template<class TSparseSpaceType , class TDenseSpaceType , class TPreconditionerType = Preconditioner<TSparseSpaceType, TDenseSpaceType>, class TReordererType = Reorderer<TSparseSpaceType, TDenseSpaceType>>
Kratos::MixedULMLinearSolver< TSparseSpaceType, TDenseSpaceType, TPreconditionerType, TReordererType >::MixedULMLinearSolver ( const MixedULMLinearSolver< TSparseSpaceType, TDenseSpaceType, TPreconditionerType, TReordererType > &  rOther)
inline

Copy constructor.

◆ ~MixedULMLinearSolver()

template<class TSparseSpaceType , class TDenseSpaceType , class TPreconditionerType = Preconditioner<TSparseSpaceType, TDenseSpaceType>, class TReordererType = Reorderer<TSparseSpaceType, TDenseSpaceType>>
Kratos::MixedULMLinearSolver< TSparseSpaceType, TDenseSpaceType, TPreconditionerType, TReordererType >::~MixedULMLinearSolver ( )
inlineoverride

Destructor.

Member Function Documentation

◆ AdditionalPhysicalDataIsNeeded()

template<class TSparseSpaceType , class TDenseSpaceType , class TPreconditionerType = Preconditioner<TSparseSpaceType, TDenseSpaceType>, class TReordererType = Reorderer<TSparseSpaceType, TDenseSpaceType>>
bool Kratos::MixedULMLinearSolver< TSparseSpaceType, TDenseSpaceType, TPreconditionerType, TReordererType >::AdditionalPhysicalDataIsNeeded ( )
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 > >.

◆ Clear()

template<class TSparseSpaceType , class TDenseSpaceType , class TPreconditionerType = Preconditioner<TSparseSpaceType, TDenseSpaceType>, class TReordererType = Reorderer<TSparseSpaceType, TDenseSpaceType>>
void Kratos::MixedULMLinearSolver< TSparseSpaceType, TDenseSpaceType, TPreconditionerType, TReordererType >::Clear ( )
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

The modified displacement block

The modified active LM block (diagonal)

The modified inaactive LM block (diagonal)

The slave active-displacement block

The active slave-master block

The active slave-inactive slave block

The active slave-slave active block

The operator used for the master blocks

The operator used for the active slave block

The residual corresponding the active LM

The residual corresponding the inactive LM

The residual of the displacements

The solution of the active LM

The solution of the inactive LM

The solution of the displacement

Reimplemented from Kratos::LinearSolver< TSparseSpaceType, TDenseSpaceType, Reorderer< TSparseSpaceType, TDenseSpaceType > >.

◆ FillBlockMatrices()

template<class TSparseSpaceType , class TDenseSpaceType , class TPreconditionerType = Preconditioner<TSparseSpaceType, TDenseSpaceType>, class TReordererType = Reorderer<TSparseSpaceType, TDenseSpaceType>>
void Kratos::MixedULMLinearSolver< TSparseSpaceType, TDenseSpaceType, TPreconditionerType, TReordererType >::FillBlockMatrices ( const bool  NeedAllocation,
SparseMatrixType rA,
VectorType rX,
VectorType rB 
)
inlineprotected

T his function generates the subblocks of matrix A.

as A = ( KNN KNM KNSI KNSA 0 0 ) u ( KMN KMM KMSI KMSA -MI^T -MA^T ) u_master ( KSIN KSIM KSISI KSISA DII^T DIA^T ) u_slave_inactive ( KSAN KSAM KSASI KSASA DAI^T DAA^T ) u_slave_active ( 0 0 0 0 ALMI 0 ) LMInactive ( 0 KLMAM KLMASI KLMASA 0 KLMALMA ) LMActive We will call as A = ( KNN KNM KNSI KNSA 0 0 ) u ( KMN KMM KMSI KMSA KMLMI KMLMA ) u_master ( KSIN KSIM KSISI KSISA KSILMI KSILMA ) u_slave_inactive ( KSAN KSAM KSASI KSASA KSALMI KSALMA ) u_slave_active ( 0 0 0 0 KLMILMI 0 ) LMInactive ( 0 KLMAM KLMASI KLMASA 0 KLMALMA ) LMActive Subblocks are allocated or nor depending on the value of "NeedAllocation"

Parameters
rASystem matrix
rXSolution vector. it's also the initial guess for iterative linear solvers.
rBRight hand side vector.

The master-active LM block (this is the big block of M)

The active LM-active LM block

The active slave-active LM block (this is the big block of D, diagonal)

The inactive LM- inactive LM block (diagonal)

◆ FinalizeSolutionStep()

template<class TSparseSpaceType , class TDenseSpaceType , class TPreconditionerType = Preconditioner<TSparseSpaceType, TDenseSpaceType>, class TReordererType = Reorderer<TSparseSpaceType, TDenseSpaceType>>
void Kratos::MixedULMLinearSolver< TSparseSpaceType, TDenseSpaceType, TPreconditionerType, TReordererType >::FinalizeSolutionStep ( SparseMatrixType rA,
VectorType rX,
VectorType rB 
)
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

Parameters
rASystem matrix
rXSolution vector. it's also the initial guess for iterative linear solvers.
rBRight hand side vector.

Reimplemented from Kratos::LinearSolver< TSparseSpaceType, TDenseSpaceType, Reorderer< TSparseSpaceType, TDenseSpaceType > >.

◆ GetDisplacementDofs() [1/2]

template<class TSparseSpaceType , class TDenseSpaceType , class TPreconditionerType = Preconditioner<TSparseSpaceType, TDenseSpaceType>, class TReordererType = Reorderer<TSparseSpaceType, TDenseSpaceType>>
DofsArrayType& Kratos::MixedULMLinearSolver< TSparseSpaceType, TDenseSpaceType, TPreconditionerType, TReordererType >::GetDisplacementDofs ( )
inline

This method retrieves the displacement DoFs of the system ordered according to the resolution order.

Returns
The displacement DoFs of the system

◆ GetDisplacementDofs() [2/2]

template<class TSparseSpaceType , class TDenseSpaceType , class TPreconditionerType = Preconditioner<TSparseSpaceType, TDenseSpaceType>, class TReordererType = Reorderer<TSparseSpaceType, TDenseSpaceType>>
const DofsArrayType& Kratos::MixedULMLinearSolver< TSparseSpaceType, TDenseSpaceType, TPreconditionerType, TReordererType >::GetDisplacementDofs ( ) const
inline

This method retrieves the displacement DoFs of the system ordered according to the resolution order.

Returns
The displacement DoFs of the system

◆ Info()

template<class TSparseSpaceType , class TDenseSpaceType , class TPreconditionerType = Preconditioner<TSparseSpaceType, TDenseSpaceType>, class TReordererType = Reorderer<TSparseSpaceType, TDenseSpaceType>>
std::string Kratos::MixedULMLinearSolver< TSparseSpaceType, TDenseSpaceType, TPreconditionerType, TReordererType >::Info ( ) const
inlineoverridevirtual

◆ Initialize()

template<class TSparseSpaceType , class TDenseSpaceType , class TPreconditionerType = Preconditioner<TSparseSpaceType, TDenseSpaceType>, class TReordererType = Reorderer<TSparseSpaceType, TDenseSpaceType>>
void Kratos::MixedULMLinearSolver< TSparseSpaceType, TDenseSpaceType, TPreconditionerType, TReordererType >::Initialize ( SparseMatrixType rA,
VectorType rX,
VectorType rB 
)
inlineoverridevirtual

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
rASystem matrix
rXSolution vector. it's also the initial guess for iterative linear solvers.
rBRight hand side vector.

Reimplemented from Kratos::LinearSolver< TSparseSpaceType, TDenseSpaceType, Reorderer< TSparseSpaceType, TDenseSpaceType > >.

◆ InitializeSolutionStep()

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

Parameters
rASystem matrix
rXSolution vector. it's also the initial guess for iterative linear solvers.
rBRight hand side vector.

Reimplemented from Kratos::LinearSolver< TSparseSpaceType, TDenseSpaceType, Reorderer< TSparseSpaceType, TDenseSpaceType > >.

◆ KRATOS_CLASS_POINTER_DEFINITION()

template<class TSparseSpaceType , class TDenseSpaceType , class TPreconditionerType = Preconditioner<TSparseSpaceType, TDenseSpaceType>, class TReordererType = Reorderer<TSparseSpaceType, TDenseSpaceType>>
Kratos::MixedULMLinearSolver< TSparseSpaceType, TDenseSpaceType, TPreconditionerType, TReordererType >::KRATOS_CLASS_POINTER_DEFINITION ( MixedULMLinearSolver< TSparseSpaceType, TDenseSpaceType, TPreconditionerType, TReordererType >  )

Pointer definition of MixedULMLinearSolver.

◆ KRATOS_DEFINE_LOCAL_FLAG() [1/2]

template<class TSparseSpaceType , class TDenseSpaceType , class TPreconditionerType = Preconditioner<TSparseSpaceType, TDenseSpaceType>, class TReordererType = Reorderer<TSparseSpaceType, TDenseSpaceType>>
Kratos::MixedULMLinearSolver< TSparseSpaceType, TDenseSpaceType, TPreconditionerType, TReordererType >::KRATOS_DEFINE_LOCAL_FLAG ( BLOCKS_ARE_ALLOCATED  )

The flag that indicates if the blocks are allocated.

◆ KRATOS_DEFINE_LOCAL_FLAG() [2/2]

template<class TSparseSpaceType , class TDenseSpaceType , class TPreconditionerType = Preconditioner<TSparseSpaceType, TDenseSpaceType>, class TReordererType = Reorderer<TSparseSpaceType, TDenseSpaceType>>
Kratos::MixedULMLinearSolver< TSparseSpaceType, TDenseSpaceType, TPreconditionerType, TReordererType >::KRATOS_DEFINE_LOCAL_FLAG ( IS_INITIALIZED  )

The flag that indicates if the solution is initialized.

◆ operator=()

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

Assignment operator.

◆ PerformSolutionStep()

template<class TSparseSpaceType , class TDenseSpaceType , class TPreconditionerType = Preconditioner<TSparseSpaceType, TDenseSpaceType>, class TReordererType = Reorderer<TSparseSpaceType, TDenseSpaceType>>
void Kratos::MixedULMLinearSolver< TSparseSpaceType, TDenseSpaceType, TPreconditionerType, TReordererType >::PerformSolutionStep ( SparseMatrixType rA,
VectorType rX,
VectorType rB 
)
inlineoverridevirtual

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

Initialize and InitializeSolutionStep functions.

Parameters
rASystem matrix
rXSolution vector. it's also the initial guess for iterative linear solvers.
rBRight hand side vector.

Reimplemented from Kratos::LinearSolver< TSparseSpaceType, TDenseSpaceType, Reorderer< TSparseSpaceType, TDenseSpaceType > >.

◆ PrintData()

template<class TSparseSpaceType , class TDenseSpaceType , class TPreconditionerType = Preconditioner<TSparseSpaceType, TDenseSpaceType>, class TReordererType = Reorderer<TSparseSpaceType, TDenseSpaceType>>
void Kratos::MixedULMLinearSolver< TSparseSpaceType, TDenseSpaceType, TPreconditionerType, TReordererType >::PrintData ( std::ostream &  rOStream) const
inlineoverridevirtual

◆ PrintInfo()

template<class TSparseSpaceType , class TDenseSpaceType , class TPreconditionerType = Preconditioner<TSparseSpaceType, TDenseSpaceType>, class TReordererType = Reorderer<TSparseSpaceType, TDenseSpaceType>>
void Kratos::MixedULMLinearSolver< TSparseSpaceType, TDenseSpaceType, TPreconditionerType, TReordererType >::PrintInfo ( std::ostream &  rOStream) const
inlineoverridevirtual

◆ ProvideAdditionalData()

template<class TSparseSpaceType , class TDenseSpaceType , class TPreconditionerType = Preconditioner<TSparseSpaceType, TDenseSpaceType>, class TReordererType = Reorderer<TSparseSpaceType, TDenseSpaceType>>
void Kratos::MixedULMLinearSolver< TSparseSpaceType, TDenseSpaceType, TPreconditionerType, TReordererType >::ProvideAdditionalData ( SparseMatrixType rA,
VectorType rX,
VectorType rB,
DofsArrayType rDofSet,
ModelPart rModelPart 
)
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

Parameters
rASystem matrix
rXSolution vector. It's also the initial guess for iterative linear solvers.
rBRight hand side vector.
rDofSetReference to the container of the problem's degrees of freedom (stored by the BuilderAndSolver)
rModelPartReference to the ModelPart containing the contact problem.

Construct aux_lists as needed "other_counter[i]" i will contain the position in the global system of the i-th NON-LM node "lm_active_counter[i]" will contain the in the global system of the i-th NON-LM node mGlobalToLocalIndexing[i] will contain the position in the local blocks of the

Reimplemented from Kratos::LinearSolver< TSparseSpaceType, TDenseSpaceType, Reorderer< TSparseSpaceType, TDenseSpaceType > >.

◆ Solve() [1/2]

template<class TSparseSpaceType , class TDenseSpaceType , class TPreconditionerType = Preconditioner<TSparseSpaceType, TDenseSpaceType>, class TReordererType = Reorderer<TSparseSpaceType, TDenseSpaceType>>
bool Kratos::MixedULMLinearSolver< TSparseSpaceType, TDenseSpaceType, TPreconditionerType, TReordererType >::Solve ( SparseMatrixType rA,
DenseMatrixType rX,
DenseMatrixType rB 
)
inlineoverridevirtual

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
rASystem matrix
rXSolution vector. it's also the initial guess for iterative linear solvers.
rBRight hand side vector.

Reimplemented from Kratos::LinearSolver< TSparseSpaceType, TDenseSpaceType, Reorderer< TSparseSpaceType, TDenseSpaceType > >.

◆ Solve() [2/2]

template<class TSparseSpaceType , class TDenseSpaceType , class TPreconditionerType = Preconditioner<TSparseSpaceType, TDenseSpaceType>, class TReordererType = Reorderer<TSparseSpaceType, TDenseSpaceType>>
bool Kratos::MixedULMLinearSolver< TSparseSpaceType, TDenseSpaceType, TPreconditionerType, TReordererType >::Solve ( SparseMatrixType rA,
VectorType rX,
VectorType rB 
)
inlineoverridevirtual

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
rASystem matrix
rXSolution vector. it's also the initial guess for iterative linear solvers.
rBRight hand side vector.

Reimplemented from Kratos::LinearSolver< TSparseSpaceType, TDenseSpaceType, Reorderer< TSparseSpaceType, TDenseSpaceType > >.

Member Data Documentation

◆ ZeroTolerance

template<class TSparseSpaceType , class TDenseSpaceType , class TPreconditionerType = Preconditioner<TSparseSpaceType, TDenseSpaceType>, class TReordererType = Reorderer<TSparseSpaceType, TDenseSpaceType>>
constexpr double Kratos::MixedULMLinearSolver< TSparseSpaceType, TDenseSpaceType, TPreconditionerType, TReordererType >::ZeroTolerance = std::numeric_limits<double>::epsilon()
staticconstexpr

The zero tolerance considerered.


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