10 #if !defined(KRATOS_LINEAR_STRATEGY_H_INCLUDED)
11 #define KRATOS_LINEAR_STRATEGY_H_INCLUDED
50 template <
class TSparseSpace,
98 typename SchemeType::Pointer pScheme,
99 typename BuilderAndSolverType::Pointer pBuilderAndSolver,
101 :
SolutionStrategy<TSparseSpace, TDenseSpace, TLinearSolver>(rModelPart, rOptions)
138 typename SchemeType::Pointer pScheme,
139 typename LinearSolverType::Pointer pLinearSolver,
171 if(this->
IsNot(LocalFlagType::INITIALIZED))
178 if(this->
mOptions.
Is(LocalFlagType::REFORM_DOFS)){
212 if(this->
mOptions.
Is(LocalFlagType::COMPUTE_REACTIONS))
245 KRATOS_WARNING(
"DOFS") <<
"solution has zero size, no free DOFs" << std::endl;
251 if(this->
mOptions.
IsNot(LocalFlagType::CONSTANT_SYSTEM_MATRIX)){
253 TSparseSpace::SetToZero((*
mpA));
254 TSparseSpace::SetToZero((*
mpDx));
255 TSparseSpace::SetToZero((*
mpb));
261 TSparseSpace::SetToZero((*
mpDx));
262 TSparseSpace::SetToZero((*
mpb));
450 if(
mpScheme->IsNot(LocalFlagType::INITIALIZED) )
456 this->
Set(LocalFlagType::INITIALIZED,
true);
501 KRATOS_INFO(
" Reform Dofs ") <<
" Flag = " <<this->
mOptions.
Is(LocalFlagType::REFORM_DOFS) << std::endl;
514 mpBuilderAndSolver->SetUpSystem();
Solution Buider and Solver based on block matrix.
Definition: block_builder_and_solver.hpp:58
void Set(const Flags ThisFlag)
Definition: flags.cpp:33
bool Is(Flags const &rOther) const
Definition: flags.h:274
bool IsNot(Flags const &rOther) const
Definition: flags.h:291
This is the base linear strategy jacobi / gauss-seidel linear strategies.
Definition: linear_strategy.hpp:55
BaseType::DofsArrayType DofsArrayType
Definition: linear_strategy.hpp:75
bool SolveIteration() override
Solves the current iteration. This function returns true if a solution has been found,...
Definition: linear_strategy.hpp:239
SolutionStrategy< TSparseSpace, TDenseSpace, TLinearSolver > BaseType
Definition: linear_strategy.hpp:63
SchemeType::Pointer mpScheme
Definition: linear_strategy.hpp:427
void GetDirectSystemMatrix(SystemMatrixType &A)
This method directly sets the input as the LHS.
Definition: linear_strategy.hpp:403
BaseType::SystemVectorPointerType SystemVectorPointerType
Definition: linear_strategy.hpp:83
SystemVectorPointerType mpDx
The pointer to the builder and solver employed.
Definition: linear_strategy.hpp:430
~LinearStrategy() override
Destructor.
Definition: linear_strategy.hpp:149
BaseType::SystemMatrixType SystemMatrixType
Definition: linear_strategy.hpp:77
KRATOS_CLASS_POINTER_DEFINITION(LinearStrategy)
BaseType::SchemeType SchemeType
Definition: linear_strategy.hpp:69
void SetEchoLevel(const int Level) override
This sets the level of echo for the solving strategy.
Definition: linear_strategy.hpp:344
void Update() override
Here the database is updated.
Definition: linear_strategy.hpp:483
void SetSystemDofs()
Performs all the required operations to reform dofs.
Definition: linear_strategy.hpp:496
TLinearSolver LinearSolverType
Definition: linear_strategy.hpp:71
void FinalizeSolutionStep() override
Performs all the required operations that should be done (for each step) after solving the solution s...
Definition: linear_strategy.hpp:205
LinearStrategy(ModelPart &rModelPart, typename SchemeType::Pointer pScheme, typename BuilderAndSolverType::Pointer pBuilderAndSolver, Flags &rOptions)
Definition: linear_strategy.hpp:97
BaseType::BuilderAndSolverType BuilderAndSolverType
Definition: linear_strategy.hpp:67
SchemeType::Pointer GetScheme()
Get method for the time scheme.
Definition: linear_strategy.hpp:364
LinearStrategy(ModelPart &rModelPart, typename SchemeType::Pointer pScheme, typename LinearSolverType::Pointer pLinearSolver, Flags &rOptions)
Definition: linear_strategy.hpp:137
SystemMatrixType & GetSystemMatrix()
This method returns the LHS matrix.
Definition: linear_strategy.hpp:392
void Predict() override
Operation to predict the solution ... if it is not called a trivial predictor is used in which the va...
Definition: linear_strategy.hpp:466
BaseType::SystemMatrixPointerType SystemMatrixPointerType
Definition: linear_strategy.hpp:81
TSparseSpace SparseSpaceType
Definition: linear_strategy.hpp:73
void Initialize() override
Initialization of member variables and prior operations.
Definition: linear_strategy.hpp:445
void Clear() override
Clears the internal storage.
Definition: linear_strategy.hpp:285
BuilderAndSolverType::Pointer mpBuilderAndSolver
The pointer to the time scheme employed.
Definition: linear_strategy.hpp:428
int Check() override
Function to perform expensive checks.
Definition: linear_strategy.hpp:310
BaseType::SystemVectorType SystemVectorType
Definition: linear_strategy.hpp:79
bool SolveSolutionStep() override
Solves the current step. This function returns true if a solution has been found, false otherwise.
Definition: linear_strategy.hpp:226
void SetBuilderAndSolver(typename BuilderAndSolverType::Pointer pBuilderAndSolver)
Set method for the builder and solver.
Definition: linear_strategy.hpp:373
SystemVectorPointerType mpb
The incremement in the solution.
Definition: linear_strategy.hpp:431
void SetScheme(typename SchemeType::Pointer pScheme)
Set method for the time scheme.
Definition: linear_strategy.hpp:355
SystemMatrixPointerType mpA
The RHS vector of the system of equations.
Definition: linear_strategy.hpp:432
void InitializeSolutionStep() override
Performs all the required operations that should be done (for each step) before solving the solution ...
Definition: linear_strategy.hpp:166
BuilderAndSolverType::Pointer GetBuilderAndSolver()
Get method for the builder and solver.
Definition: linear_strategy.hpp:382
BaseType::LocalFlagType LocalFlagType
Definition: linear_strategy.hpp:65
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
A sorted associative container similar to an STL set, but uses a vector to store pointers to its data...
Definition: pointer_vector_set.h:72
Solution Buider and Solver base class.
Definition: solution_builder_and_solver.hpp:63
Solution scheme base class.
Definition: solution_scheme.hpp:54
Solution strategy base class.
Definition: solution_strategy.hpp:52
TSparseSpace::VectorPointerType SystemVectorPointerType
Definition: solution_strategy.hpp:63
ModelPart & GetModelPart()
Operations to get the pointer to the model.
Definition: solution_strategy.hpp:243
Flags mOptions
Definition: solution_strategy.hpp:267
TSparseSpace::MatrixPointerType SystemMatrixPointerType
Definition: solution_strategy.hpp:62
TSparseSpace::MatrixType SystemMatrixType
Definition: solution_strategy.hpp:60
virtual int Check()
Function to perform expensive checks.
Definition: solution_strategy.hpp:154
TSparseSpace::VectorType SystemVectorType
Definition: solution_strategy.hpp:61
virtual void SetEchoLevel(const int Level)
This sets the level of echo for the solution strategy.
Definition: solution_strategy.hpp:190
int mEchoLevel
Definition: solution_strategy.hpp:270
Solver local flags class definition.
Definition: solution_local_flags.hpp:48
static void Clear(MatrixPointerType &pA)
Definition: ublas_space.h:578
static IndexType Size(VectorType const &rV)
return size of vector rV
Definition: ublas_space.h:190
#define KRATOS_CATCH(MoreInfo)
Definition: define.h:110
#define KRATOS_TRY
Definition: define.h:109
#define KRATOS_INFO(label)
Definition: logger.h:250
#define KRATOS_WARNING(label)
Definition: logger.h:265
TSpaceType::VectorPointerType CreateEmptyVectorPointer(TSpaceType &dummy)
Definition: add_strategies_to_python.cpp:187
TSpaceType::MatrixPointerType CreateEmptyMatrixPointer(TSpaceType &dummy)
Definition: add_strategies_to_python.cpp:181
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
shared_ptr< C > make_shared(Args &&...args)
Definition: smart_pointers.h:40
A
Definition: sensitivityMatrix.py:70