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 very simple strategy to solve linearly the problem. More...
#include <residualbased_linear_strategy.h>
Public Member Functions | |
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::ImplicitSolvingStrategy< TSparseSpace, TDenseSpace, TLinearSolver > | |
ImplicitSolvingStrategy () | |
Default constructor. More... | |
ImplicitSolvingStrategy (ModelPart &rModelPart, Parameters ThisParameters) | |
Default constructor. (with parameters) More... | |
ImplicitSolvingStrategy (ModelPart &rModelPart, bool MoveMeshFlag=false) | |
Default constructor. More... | |
virtual | ~ImplicitSolvingStrategy () |
void | SetRebuildLevel (int Level) override |
This sets the build level. More... | |
int | GetRebuildLevel () const override |
This returns the build level. More... | |
void | SetStiffnessMatrixIsBuilt (const bool StiffnessMatrixIsBuilt) |
This method sets the flag mStiffnessMatrixIsBuilt. More... | |
bool | GetStiffnessMatrixIsBuilt () const |
This method gets the flag mStiffnessMatrixIsBuilt. More... | |
KRATOS_CLASS_POINTER_DEFINITION (ImplicitSolvingStrategy) | |
Public Member Functions inherited from Kratos::SolvingStrategy< TSparseSpace, TDenseSpace > | |
SolvingStrategy () | |
Default constructor. More... | |
SolvingStrategy (ModelPart &rModelPart, Parameters ThisParameters) | |
Default constructor. (with parameters) More... | |
SolvingStrategy (ModelPart &rModelPart, bool MoveMeshFlag=false) | |
Default constructor. More... | |
virtual | ~SolvingStrategy () |
KRATOS_CLASS_POINTER_DEFINITION (SolvingStrategy) | |
virtual bool | IsConverged () |
This should be considered as a "post solution" convergence check which is useful for coupled analysis. More... | |
int | GetEchoLevel () |
This returns the level of echo for the solving strategy. More... | |
void | SetMoveMeshFlag (bool Flag) |
This function sets the flag that says if the mesh is moved. More... | |
bool | MoveMeshFlag () |
This function returns the flag that says if the mesh is moved. More... | |
bool | GetMoveMeshFlag () |
This function returns the flag that says if the mesh is moved. More... | |
virtual void | MoveMesh () |
This function is designed to move the mesh. More... | |
ModelPart & | GetModelPart () |
Operations to get the pointer to the model. More... | |
const ModelPart & | GetModelPart () const |
Operations to get the pointer to the model. More... | |
Protected Member Functions | |
Protected Operations | |
void | AssignSettings (const Parameters ThisParameters) override |
This method assigns settings to member variables. More... | |
Protected Operations | |
Protected Member Functions inherited from Kratos::SolvingStrategy< TSparseSpace, TDenseSpace > | |
virtual Parameters | ValidateAndAssignParameters (Parameters ThisParameters, const Parameters DefaultParameters) const |
This method validate and assign default parameters. More... | |
Type Definitions */ | |
typedef SolvingStrategy< TSparseSpace, TDenseSpace > | SolvingStrategyType |
typedef ImplicitSolvingStrategy< TSparseSpace, TDenseSpace, TLinearSolver > | BaseType |
typedef ResidualBasedLinearStrategy< TSparseSpace, TDenseSpace, TLinearSolver > | ClassType |
typedef BaseType::TDataType | TDataType |
typedef TSparseSpace | SparseSpaceType |
typedef BaseType::TSchemeType | TSchemeType |
typedef BaseType::TBuilderAndSolverType | TBuilderAndSolverType |
typedef BaseType::DofsArrayType | DofsArrayType |
typedef BaseType::TSystemMatrixType | TSystemMatrixType |
typedef BaseType::TSystemVectorType | TSystemVectorType |
typedef BaseType::LocalSystemVectorType | LocalSystemVectorType |
typedef BaseType::LocalSystemMatrixType | LocalSystemMatrixType |
typedef BaseType::TSystemMatrixPointerType | TSystemMatrixPointerType |
typedef BaseType::TSystemVectorPointerType | TSystemVectorPointerType |
KRATOS_CLASS_POINTER_DEFINITION (ResidualBasedLinearStrategy) | |
Life Cycle | |
ResidualBasedLinearStrategy () | |
Default constructor. More... | |
ResidualBasedLinearStrategy (ModelPart &rModelPart, Parameters ThisParameters) | |
Default constructor. (with parameters) More... | |
ResidualBasedLinearStrategy (ModelPart &rModelPart, typename TSchemeType::Pointer pScheme, typename TLinearSolver::Pointer pNewLinearSolver, bool CalculateReactionFlag=false, bool ReformDofSetAtEachStep=false, bool CalculateNormDxFlag=false, bool MoveMeshFlag=false) | |
Default constructor. More... | |
ResidualBasedLinearStrategy (ModelPart &rModelPart, typename TSchemeType::Pointer pScheme, typename TBuilderAndSolverType::Pointer pNewBuilderAndSolver, bool CalculateReactionFlag=false, bool ReformDofSetAtEachStep=false, bool CalculateNormDxFlag=false, bool MoveMeshFlag=false) | |
Constructor specifying the builder and solver. More... | |
~ResidualBasedLinearStrategy () override | |
Destructor. More... | |
void | SetScheme (typename TSchemeType::Pointer pScheme) |
Set method for the time scheme. More... | |
TSchemeType::Pointer | GetScheme () |
Get method for the time scheme. More... | |
void | SetBuilderAndSolver (typename TBuilderAndSolverType::Pointer pNewBuilderAndSolver) |
Set method for the builder and solver. More... | |
TBuilderAndSolverType::Pointer | GetBuilderAndSolver () |
Get method for the builder and solver. More... | |
void | SetCalculateReactionsFlag (bool CalculateReactionsFlag) |
This method sets the flag mCalculateReactionsFlag. More... | |
bool | GetCalculateReactionsFlag () |
This method returns the flag mCalculateReactionsFlag. More... | |
void | SetReformDofSetAtEachStepFlag (bool Flag) |
This method sets the flag mReformDofSetAtEachStep. More... | |
bool | GetReformDofSetAtEachStepFlag () |
This method returns the flag mReformDofSetAtEachStep. More... | |
void | SetEchoLevel (int Level) override |
It sets the level of echo for the solving strategy. More... | |
SolvingStrategyType::Pointer | Create (ModelPart &rModelPart, Parameters ThisParameters) const override |
Create method. More... | |
void | Predict () override |
Operation to predict the solution ... if it is not called a trivial predictor is used in which the values of the solution step of interest are assumed equal to the old values. More... | |
void | Initialize () override |
Initialization of member variables and prior operations. More... | |
double | Solve () override |
The problem of interest is solved. More... | |
void | Clear () override |
Clears the internal storage. More... | |
void | CalculateOutputData () override |
This operations should be called before printing the results when non trivial results (e.g. stresses) need to be calculated given the solution of the step. More... | |
void | InitializeSolutionStep () override |
Performs all the required operations that should be done (for each step) before solving the solution step. More... | |
void | FinalizeSolutionStep () override |
Performs all the required operations that should be done (for each step) after solving the solution step. More... | |
bool | SolveSolutionStep () override |
Solves the current step. This function returns true if a solution has been found, false otherwise. More... | |
TSystemMatrixType & | GetSystemMatrix () override |
This method returns the LHS matrix. More... | |
TSystemVectorType & | GetSystemVector () override |
This method returns the RHS vector. More... | |
TSystemVectorType & | GetSolutionVector () override |
This method returns the solution vector. More... | |
double | GetResidualNorm () override |
This method returns the residual norm. More... | |
int | Check () override |
Function to perform expensive checks. 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... | |
This is a very simple strategy to solve linearly the problem.
As a linear strategy the check on the convergence is not done and just one non linear iteration will be performed
typedef ImplicitSolvingStrategy<TSparseSpace, TDenseSpace, TLinearSolver> Kratos::ResidualBasedLinearStrategy< TSparseSpace, TDenseSpace, TLinearSolver >::BaseType |
typedef ResidualBasedLinearStrategy<TSparseSpace,TDenseSpace,TLinearSolver> Kratos::ResidualBasedLinearStrategy< TSparseSpace, TDenseSpace, TLinearSolver >::ClassType |
typedef BaseType::DofsArrayType Kratos::ResidualBasedLinearStrategy< TSparseSpace, TDenseSpace, TLinearSolver >::DofsArrayType |
typedef BaseType::LocalSystemMatrixType Kratos::ResidualBasedLinearStrategy< TSparseSpace, TDenseSpace, TLinearSolver >::LocalSystemMatrixType |
typedef BaseType::LocalSystemVectorType Kratos::ResidualBasedLinearStrategy< TSparseSpace, TDenseSpace, TLinearSolver >::LocalSystemVectorType |
typedef SolvingStrategy<TSparseSpace, TDenseSpace> Kratos::ResidualBasedLinearStrategy< TSparseSpace, TDenseSpace, TLinearSolver >::SolvingStrategyType |
typedef TSparseSpace Kratos::ResidualBasedLinearStrategy< TSparseSpace, TDenseSpace, TLinearSolver >::SparseSpaceType |
typedef BaseType::TBuilderAndSolverType Kratos::ResidualBasedLinearStrategy< TSparseSpace, TDenseSpace, TLinearSolver >::TBuilderAndSolverType |
typedef BaseType::TDataType Kratos::ResidualBasedLinearStrategy< TSparseSpace, TDenseSpace, TLinearSolver >::TDataType |
typedef BaseType::TSchemeType Kratos::ResidualBasedLinearStrategy< TSparseSpace, TDenseSpace, TLinearSolver >::TSchemeType |
typedef BaseType::TSystemMatrixPointerType Kratos::ResidualBasedLinearStrategy< TSparseSpace, TDenseSpace, TLinearSolver >::TSystemMatrixPointerType |
typedef BaseType::TSystemMatrixType Kratos::ResidualBasedLinearStrategy< TSparseSpace, TDenseSpace, TLinearSolver >::TSystemMatrixType |
typedef BaseType::TSystemVectorPointerType Kratos::ResidualBasedLinearStrategy< TSparseSpace, TDenseSpace, TLinearSolver >::TSystemVectorPointerType |
typedef BaseType::TSystemVectorType Kratos::ResidualBasedLinearStrategy< TSparseSpace, TDenseSpace, TLinearSolver >::TSystemVectorType |
|
inlineexplicit |
Default constructor.
|
inlineexplicit |
Default constructor. (with parameters)
rModelPart | The model part of the problem |
ThisParameters | The configuration parameters |
|
inlineexplicit |
Default constructor.
rModelPart | The model part of the problem |
pScheme | The integration scheme |
pNewLinearSolver | The linear solver employed |
CalculateReactionFlag | The flag for the reaction calculation |
ReformDofSetAtEachStep | The flag that allows to compute the modification of the DOF |
CalculateNormDxFlag | The flag sets if the norm of Dx is computed |
MoveMeshFlag | The flag that allows to move the mesh |
|
inlineexplicit |
Constructor specifying the builder and solver.
rModelPart | The model part of the problem |
pScheme | The integration scheme |
pNewLinearSolver | The linear solver employed |
pNewBuilderAndSolver | The builder and solver employed |
CalculateReactionFlag | The flag for the reaction calculation |
ReformDofSetAtEachStep | The flag that allows to compute the modification of the DOF |
CalculateNormDxFlag | The flag sets if the norm of Dx is computed |
MoveMeshFlag | The flag that allows to move the mesh |
|
inlineoverride |
Destructor.
In trilinos third party library, the linear solver's preconditioner should be freed before the system matrix. We control the deallocation order with Clear().
|
inlineoverrideprotectedvirtual |
This method assigns settings to member variables.
ThisParameters | Parameters that are assigned to the member variables |
Reimplemented from Kratos::ImplicitSolvingStrategy< TSparseSpace, TDenseSpace, TLinearSolver >.
|
inlineoverridevirtual |
This operations should be called before printing the results when non trivial results (e.g. stresses) need to be calculated given the solution of the step.
This operations should be called only when needed, before printing as it can involve a non negligible cost
Reimplemented from Kratos::SolvingStrategy< TSparseSpace, TDenseSpace >.
|
inlineoverridevirtual |
Function to perform expensive checks.
It is designed to be called ONCE to verify that the input is correct.
Reimplemented from Kratos::SolvingStrategy< TSparseSpace, TDenseSpace >.
|
inlineoverridevirtual |
Clears the internal storage.
Reimplemented from Kratos::SolvingStrategy< TSparseSpace, TDenseSpace >.
|
inlineoverridevirtual |
Create method.
OPERATIONS ACCESSIBLE FROM THE INPUT:
rModelPart | The model part of the problem |
ThisParameters | The configuration parameters |
Reimplemented from Kratos::ImplicitSolvingStrategy< TSparseSpace, TDenseSpace, TLinearSolver >.
|
inlineoverridevirtual |
Performs all the required operations that should be done (for each step) after solving the solution step.
A member variable should be used as a flag to make sure this function is called only once per step.
Reimplemented from Kratos::SolvingStrategy< TSparseSpace, TDenseSpace >.
|
inline |
Get method for the builder and solver.
|
inline |
This method returns the flag mCalculateReactionsFlag.
|
inlineoverridevirtual |
This method provides the defaults parameters to avoid conflicts between the different constructors.
Reimplemented from Kratos::ImplicitSolvingStrategy< TSparseSpace, TDenseSpace, TLinearSolver >.
|
inline |
This method returns the flag mReformDofSetAtEachStep.
|
inlineoverridevirtual |
This method returns the residual norm.
Reimplemented from Kratos::SolvingStrategy< TSparseSpace, TDenseSpace >.
|
inline |
Get method for the time scheme.
|
inlineoverridevirtual |
This method returns the solution vector.
Reimplemented from Kratos::SolvingStrategy< TSparseSpace, TDenseSpace >.
|
inlineoverridevirtual |
This method returns the LHS matrix.
Reimplemented from Kratos::SolvingStrategy< TSparseSpace, TDenseSpace >.
|
inlineoverridevirtual |
This method returns the RHS vector.
Reimplemented from Kratos::SolvingStrategy< TSparseSpace, TDenseSpace >.
|
inlineoverridevirtual |
Turn back information as a string.
Reimplemented from Kratos::ImplicitSolvingStrategy< TSparseSpace, TDenseSpace, TLinearSolver >.
|
inlineoverridevirtual |
Initialization of member variables and prior operations.
Reimplemented from Kratos::SolvingStrategy< TSparseSpace, TDenseSpace >.
|
inlineoverridevirtual |
Performs all the required operations that should be done (for each step) before solving the solution step.
A member variable should be used as a flag to make sure this function is called only once per step.
Reimplemented from Kratos::SolvingStrategy< TSparseSpace, TDenseSpace >.
Kratos::ResidualBasedLinearStrategy< TSparseSpace, TDenseSpace, TLinearSolver >::KRATOS_CLASS_POINTER_DEFINITION | ( | ResidualBasedLinearStrategy< TSparseSpace, TDenseSpace, TLinearSolver > | ) |
Counted pointer of ClassName
|
inlinestatic |
Returns the name of the class as used in the settings (snake_case format)
|
inlineoverridevirtual |
Operation to predict the solution ... if it is not called a trivial predictor is used in which the values of the solution step of interest are assumed equal to the old values.
Reimplemented from Kratos::SolvingStrategy< TSparseSpace, TDenseSpace >.
|
inlineoverridevirtual |
Print object's data.
Reimplemented from Kratos::SolvingStrategy< TSparseSpace, TDenseSpace >.
|
inlineoverridevirtual |
Print information about this object.
Reimplemented from Kratos::SolvingStrategy< TSparseSpace, TDenseSpace >.
|
inline |
Set method for the builder and solver.
pNewBuilderAndSolver | The pointer to the builder and solver considered |
|
inline |
This method sets the flag mCalculateReactionsFlag.
CalculateReactionsFlag | The flag that tells if the reactions are computed |
|
inlineoverridevirtual |
It sets the level of echo for the solving strategy.
Level | The level to set |
The different levels of echo are:
Reimplemented from Kratos::SolvingStrategy< TSparseSpace, TDenseSpace >.
|
inline |
This method sets the flag mReformDofSetAtEachStep.
Flag | The flag that tells if each time step the system is rebuilt |
|
inline |
Set method for the time scheme.
pScheme | The pointer to the time scheme considered |
|
inlineoverridevirtual |
The problem of interest is solved.
a double containing norm(Dx) is returned if CalculateNormDxFlag == true, else 0 is returned
Reimplemented from Kratos::SolvingStrategy< TSparseSpace, TDenseSpace >.
|
inlineoverridevirtual |
Solves the current step. This function returns true if a solution has been found, false otherwise.
Reimplemented from Kratos::SolvingStrategy< TSparseSpace, TDenseSpace >.