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.
|
MPI version of the ResidualCriteria. More...
#include <trilinos_residual_criteria.h>
Public Member Functions | |
Life Cycle | |
TrilinosResidualCriteria () | |
Default constructor. More... | |
TrilinosResidualCriteria (Kratos::Parameters ThisParameters) | |
Default constructor. (with parameters) More... | |
TrilinosResidualCriteria (TDataType NewRatioTolerance, TDataType AlwaysConvergedNorm) | |
Constructor 2 arguments. More... | |
TrilinosResidualCriteria (const TrilinosResidualCriteria &rOther) | |
Copy constructor. More... | |
~TrilinosResidualCriteria () override | |
Destructor. More... | |
Operators | |
TrilinosResidualCriteria & | operator= (TrilinosResidualCriteria const &rOther)=delete |
Deleted 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... | |
Public Member Functions inherited from Kratos::ResidualCriteria< TSparseSpace, TDenseSpace > | |
ResidualCriteria () | |
Default constructor. More... | |
ResidualCriteria (Kratos::Parameters ThisParameters) | |
Default constructor. (with parameters) More... | |
ResidualCriteria (TDataType NewRatioTolerance, TDataType AlwaysConvergedNorm) | |
Constructor 2 arguments. More... | |
ResidualCriteria (ResidualCriteria const &rOther) | |
Copy constructor. More... | |
~ResidualCriteria () override | |
Destructor. More... | |
ResidualCriteria & | operator= (ResidualCriteria const &rOther)=delete |
Deleted assignment operator. More... | |
KRATOS_CLASS_POINTER_DEFINITION (ResidualCriteria) | |
Pointer definition of ResidualCriteria. More... | |
bool | PostCriteria (ModelPart &rModelPart, DofsArrayType &rDofSet, const TSystemMatrixType &rA, const TSystemVectorType &rDx, const TSystemVectorType &rb) override |
Criterion that need to be called after getting the solution. More... | |
void | FinalizeSolutionStep (ModelPart &rModelPart, DofsArrayType &rDofSet, const TSystemMatrixType &rA, const TSystemVectorType &rDx, const TSystemVectorType &rb) override |
This function finalizes the solution step. More... | |
Public Member Functions inherited from Kratos::ConvergenceCriteria< TSparseSpace, TDenseSpace > | |
ConvergenceCriteria () | |
ConvergenceCriteria (Kratos::Parameters ThisParameters) | |
Constructor with Parameters. More... | |
ConvergenceCriteria (ConvergenceCriteria const &rOther) | |
virtual | ~ConvergenceCriteria () |
KRATOS_CLASS_POINTER_DEFINITION (ConvergenceCriteria) | |
Pointer definition of ConvergenceCriteria. More... | |
virtual std::vector< TSystemVectorType > & | GetRHS_Element_Components () |
Get component wise element components. More... | |
virtual std::vector< Variable< LocalSystemVectorType > > & | GetRHS_Element_Variables () |
Get component wise element variables. More... | |
virtual std::vector< TSystemVectorType > & | GetRHS_Condition_Components () |
Get component wise condition components. More... | |
virtual std::vector< Variable< LocalSystemVectorType > > & | GetRHS_Condition_Variables () |
Get component wise condition variables. More... | |
virtual void | SetEchoLevel (int Level) |
It sets the level of echo for the solving strategy. More... | |
int | GetEchoLevel () |
This returns the level of echo for the solving strategy. More... | |
void | SetActualizeRHSFlag (bool ActualizeRHSIsNeeded) |
This method sets the flag mActualizeRHSIsNeeded. More... | |
bool | GetActualizeRHSflag () |
This method gets the flag mActualizeRHSIsNeeded. More... | |
virtual bool | PreCriteria (ModelPart &rModelPart, DofsArrayType &rDofSet, const TSystemMatrixType &rA, const TSystemVectorType &rDx, const TSystemVectorType &rb) |
Criterias that need to be called before getting the solution. More... | |
virtual void | Initialize (ModelPart &rModelPart) |
This function initialize the convergence criteria. More... | |
virtual bool | IsInitialized () |
This function returns if the convergence criteria is initialized. More... | |
virtual void | InitializeNonLinearIteration (ModelPart &rModelPart, DofsArrayType &rDofSet, const TSystemMatrixType &rA, const TSystemVectorType &rDx, const TSystemVectorType &rb) |
This function initializes the non-linear iteration. More... | |
virtual void | FinalizeNonLinearIteration (ModelPart &rModelPart, DofsArrayType &rDofSet, const TSystemMatrixType &rA, const TSystemVectorType &rDx, const TSystemVectorType &rb) |
This function finalizes the non-linear iteration. More... | |
virtual int | Check (ModelPart &rModelPart) |
This function is designed to be called once to perform all the checks needed on the input provided. Checks can be "expensive" as the function is designed to catch user's errors. More... | |
Protected Member Functions | |
Protected Operations | |
void | ComputeActiveDofs (ModelPart &rModelPart, const ModelPart::DofsArrayType &rDofSet) override |
This method computes the active dofs. More... | |
Protected Member Functions inherited from Kratos::ResidualCriteria< TSparseSpace, TDenseSpace > | |
bool | IsActiveAndLocalDof (const DofType &rDof, const int Rank) |
Check if a Degree of Freedom (Dof) is active. More... | |
bool | IsFreeAndLocalDof (const DofType &rDof, const int Rank) |
Check if a Degree of Freedom (Dof) is free. More... | |
virtual void | CalculateResidualNorm (ModelPart &rModelPart, TDataType &rResidualSolutionNorm, SizeType &rDofNum, DofsArrayType &rDofSet, const TSystemVectorType &rb) |
This method computes the norm of the residual. More... | |
void | AssignSettings (const Parameters ThisParameters) override |
This method assigns settings to member variables. More... | |
Protected Member Functions inherited from Kratos::ConvergenceCriteria< TSparseSpace, TDenseSpace > | |
virtual Parameters | ValidateAndAssignParameters (Parameters ThisParameters, const Parameters DefaultParameters) const |
This method validate and assign default parameters. More... | |
Type Definitions | |
using | BaseConvergenceCriteriaType = ConvergenceCriteria< TSparseSpace, TDenseSpace > |
The definition of the base ConvergenceCriteria. More... | |
using | BaseType = ResidualCriteria< TSparseSpace, TDenseSpace > |
The definition of the base ResidualCriteria. More... | |
using | ClassType = TrilinosResidualCriteria< TSparseSpace, TDenseSpace > |
The definition of the current class. More... | |
using | TDataType = typename BaseType::TDataType |
The data type. More... | |
using | DofsArrayType = typename BaseType::DofsArrayType |
The dofs array type. More... | |
using | DofType = typename Node::DofType |
The definition of the DoF data type. More... | |
using | TSystemMatrixType = typename BaseType::TSystemMatrixType |
The sparse matrix type. More... | |
using | TSystemVectorType = typename BaseType::TSystemVectorType |
The dense vector type. More... | |
using | IndexType = std::size_t |
Definition of the IndexType. More... | |
KRATOS_CLASS_POINTER_DEFINITION (TrilinosResidualCriteria) | |
Pointer definition of TrilinosResidualCriteria. More... | |
Operations | |
BaseConvergenceCriteriaType::Pointer | Create (Parameters ThisParameters) const override |
Create method. More... | |
void | InitializeSolutionStep (ModelPart &rModelPart, DofsArrayType &rDofSet, const TSystemMatrixType &rA, const TSystemVectorType &rDx, const TSystemVectorType &rb) override |
This function initializes the solution step. More... | |
Parameters | GetDefaultParameters () const override |
This method provides the defaults parameters to avoid conflicts between the different constructors. More... | |
static std::string | Name () |
Returns the name of the class as used in the settings (snake_case format) More... | |
Additional Inherited Members | |
Public Types inherited from Kratos::ResidualCriteria< TSparseSpace, TDenseSpace > | |
using | BaseType = ConvergenceCriteria< TSparseSpace, TDenseSpace > |
The definition of the base ConvergenceCriteria. More... | |
using | ClassType = ResidualCriteria< TSparseSpace, TDenseSpace > |
The definition of the current class. More... | |
using | TDataType = typename BaseType::TDataType |
The data type. More... | |
using | DofsArrayType = typename BaseType::DofsArrayType |
The dofs array type. More... | |
using | DofType = typename Node::DofType |
The definition of the DoF data type. More... | |
using | TSystemMatrixType = typename BaseType::TSystemMatrixType |
The sparse matrix type. More... | |
using | TSystemVectorType = typename BaseType::TSystemVectorType |
The dense vector type. More... | |
using | IndexType = std::size_t |
Definition of the IndexType. More... | |
using | SizeType = std::size_t |
Definition of the size type. More... | |
Public Types inherited from Kratos::ConvergenceCriteria< TSparseSpace, TDenseSpace > | |
typedef ConvergenceCriteria< TSparseSpace, TDenseSpace > | ClassType |
The definition of the current class. More... | |
typedef TSparseSpace::DataType | TDataType |
Data type definition. More... | |
typedef TSparseSpace::MatrixType | TSystemMatrixType |
Matrix type definition. More... | |
typedef TSparseSpace::VectorType | TSystemVectorType |
Vector type definition. More... | |
typedef TDenseSpace::MatrixType | LocalSystemMatrixType |
Local system matrix type definition. More... | |
typedef TDenseSpace::VectorType | LocalSystemVectorType |
Local system vector type definition. More... | |
typedef ModelPart::DofsArrayType | DofsArrayType |
DoF array type definition. More... | |
Static Public Member Functions inherited from Kratos::ResidualCriteria< TSparseSpace, TDenseSpace > | |
static std::string | Name () |
Returns the name of the class as used in the settings (snake_case format) More... | |
Static Public Member Functions inherited from Kratos::ConvergenceCriteria< TSparseSpace, TDenseSpace > | |
static std::string | Name () |
Returns the name of the class as used in the settings (snake_case format) More... | |
Protected Attributes inherited from Kratos::ResidualCriteria< TSparseSpace, TDenseSpace > | |
TDataType | mRatioTolerance {} |
TDataType | mInitialResidualNorm {} |
The ratio threshold for the norm of the residual. More... | |
TDataType | mCurrentResidualNorm {} |
The reference norm of the residual. More... | |
TDataType | mAlwaysConvergedNorm {} |
The current norm of the residual. More... | |
TDataType | mReferenceDispNorm {} |
The absolute value threshold for the norm of the residual. More... | |
std::vector< int > | mActiveDofs |
The norm at the beginning of the iterations. More... | |
IndexType | mInitialDoFId = std::numeric_limits<IndexType>::max() |
This vector contains the dofs that are active. More... | |
Protected Attributes inherited from Kratos::ConvergenceCriteria< TSparseSpace, TDenseSpace > | |
bool | mActualizeRHSIsNeeded = false |
bool | mConvergenceCriteriaIsInitialized = false |
This "flag" is set in order to know if it is necessary to actualize the RHS. More... | |
int | mEchoLevel |
This "flag" is set in order to know if it is convergence criteria is initialized. More... | |
MPI version of the ResidualCriteria.
Implements a convergence criteria based on the norm of the (free rows of) the RHS vector.
using Kratos::TrilinosResidualCriteria< TSparseSpace, TDenseSpace >::BaseConvergenceCriteriaType = ConvergenceCriteria< TSparseSpace, TDenseSpace > |
The definition of the base ConvergenceCriteria.
using Kratos::TrilinosResidualCriteria< TSparseSpace, TDenseSpace >::BaseType = ResidualCriteria< TSparseSpace, TDenseSpace > |
The definition of the base ResidualCriteria.
using Kratos::TrilinosResidualCriteria< TSparseSpace, TDenseSpace >::ClassType = TrilinosResidualCriteria< TSparseSpace, TDenseSpace > |
The definition of the current class.
using Kratos::TrilinosResidualCriteria< TSparseSpace, TDenseSpace >::DofsArrayType = typename BaseType::DofsArrayType |
The dofs array type.
using Kratos::TrilinosResidualCriteria< TSparseSpace, TDenseSpace >::DofType = typename Node::DofType |
The definition of the DoF data type.
using Kratos::TrilinosResidualCriteria< TSparseSpace, TDenseSpace >::IndexType = std::size_t |
Definition of the IndexType.
using Kratos::TrilinosResidualCriteria< TSparseSpace, TDenseSpace >::TDataType = typename BaseType::TDataType |
The data type.
using Kratos::TrilinosResidualCriteria< TSparseSpace, TDenseSpace >::TSystemMatrixType = typename BaseType::TSystemMatrixType |
The sparse matrix type.
using Kratos::TrilinosResidualCriteria< TSparseSpace, TDenseSpace >::TSystemVectorType = typename BaseType::TSystemVectorType |
The dense vector type.
|
inlineexplicit |
Default constructor.
|
inlineexplicit |
Default constructor. (with parameters)
ThisParameters | The configuration parameters |
|
inlineexplicit |
Constructor 2 arguments.
NewRatioTolerance | The ratio tolerance for the convergence. |
AlwaysConvergedNorm | The absolute tolerance for the convergence. |
|
inlineexplicit |
Copy constructor.
rOther | The criteria to be copied |
|
inlineoverride |
Destructor.
|
inlineoverrideprotectedvirtual |
This method computes the active dofs.
rModelPart | Reference to the ModelPart containing the problem |
rDofSet | The whole set of dofs |
Reimplemented from Kratos::ResidualCriteria< TSparseSpace, TDenseSpace >.
|
inlineoverridevirtual |
Create method.
ThisParameters | The configuration parameters |
Reimplemented from Kratos::ResidualCriteria< TSparseSpace, TDenseSpace >.
|
inlineoverridevirtual |
This method provides the defaults parameters to avoid conflicts between the different constructors.
Reimplemented from Kratos::ResidualCriteria< TSparseSpace, TDenseSpace >.
|
inlineoverridevirtual |
Turn back information as a string.
Reimplemented from Kratos::ResidualCriteria< TSparseSpace, TDenseSpace >.
|
inlineoverridevirtual |
This function initializes the solution step.
rModelPart | Reference to the ModelPart containing the problem. |
rDofSet | Reference to the container of the problem's degrees of freedom (stored by the BuilderAndSolver) |
rA | System matrix (unused) |
rDx | Vector of results (variations on nodal variables) |
rb | RHS vector (residual + reactions) |
Reimplemented from Kratos::ResidualCriteria< TSparseSpace, TDenseSpace >.
Kratos::TrilinosResidualCriteria< TSparseSpace, TDenseSpace >::KRATOS_CLASS_POINTER_DEFINITION | ( | TrilinosResidualCriteria< TSparseSpace, TDenseSpace > | ) |
Pointer definition of TrilinosResidualCriteria.
|
inlinestatic |
Returns the name of the class as used in the settings (snake_case format)
|
delete |
Deleted assignment operator.
|
inlineoverridevirtual |
Print object's data.
Reimplemented from Kratos::ResidualCriteria< TSparseSpace, TDenseSpace >.
|
inlineoverridevirtual |
Print information about this object.
Reimplemented from Kratos::ResidualCriteria< TSparseSpace, TDenseSpace >.