13 #if !defined(KRATOS_HEXAHEDRA_NEWTON_RAPHSON_STRATEGY)
14 #define KRATOS_HEXAHEDRA_NEWTON_RAPHSON_STRATEGY
63 template <
class TSparseSpace,
109 typename TSchemeType::Pointer pScheme,
110 typename TLinearSolver::Pointer pNewLinearSolver,
111 typename TConvergenceCriteriaType::Pointer pNewConvergenceCriteria,
112 int MaxIterations = 30,
113 bool CalculateReactions =
false,
114 bool ReformDofSetAtEachStep =
false,
135 BaseType::mpLinearSolver = pNewLinearSolver;
142 BaseType::mSolutionStepIsInitialized =
false;
179 typename TSchemeType::Pointer pScheme,
180 typename TLinearSolver::Pointer pNewLinearSolver,
181 typename TConvergenceCriteriaType::Pointer pNewConvergenceCriteria,
182 typename TBuilderAndSolverType::Pointer pNewBuilderAndSolver,
183 int MaxIterations = 30,
184 bool CalculateReactions =
false,
185 bool ReformDofSetAtEachStep =
false,
206 BaseType::mpLinearSolver = pNewLinearSolver;
212 BaseType::mSolutionStepIsInitialized =
false;
258 unsigned int iteration_number = 1;
260 bool is_converged =
false;
261 bool residual_is_updated =
false;
268 "list_of_variables": ["STRESS_VECTOR","STRAIN_VECTOR"]
271 extrapolation_process.Execute();
277 TSparseSpace::SetToZero(rA);
278 TSparseSpace::SetToZero(rDx);
279 TSparseSpace::SetToZero(rb);
282 TSparseSpace::SetToZero(rDx);
283 TSparseSpace::SetToZero(rb);
295 if (is_converged ==
true) {
300 TSparseSpace::SetToZero(rb);
312 extrapolation_process.Execute();
319 TSparseSpace::SetToZero(rA);
320 TSparseSpace::SetToZero(rDx);
321 TSparseSpace::SetToZero(rb);
324 TSparseSpace::SetToZero(rDx);
325 TSparseSpace::SetToZero(rb);
329 TSparseSpace::SetToZero(rDx);
330 TSparseSpace::SetToZero(rb);
334 KRATOS_WARNING(
"NO DOFS") <<
"ATTENTION: no free DOFs!! " << std::endl;
345 residual_is_updated =
false;
347 if (is_converged ==
true) {
349 TSparseSpace::SetToZero(rb);
352 residual_is_updated =
true;
This is the base class to define the different convergence criterion considered.
Definition: convergence_criteria.h:58
This is the base Newton Raphson strategy.
Definition: hexahedra_newton_raphson_strategy.h:69
BaseType::TSystemVectorType TSystemVectorType
Definition: hexahedra_newton_raphson_strategy.h:85
BaseType::LocalSystemVectorType LocalSystemVectorType
Definition: hexahedra_newton_raphson_strategy.h:86
BaseType::TSchemeType TSchemeType
Definition: hexahedra_newton_raphson_strategy.h:82
bool SolveSolutionStep() override
Solves the current step. This function returns true if a solution has been found, false otherwise.
Definition: hexahedra_newton_raphson_strategy.h:247
KRATOS_CLASS_POINTER_DEFINITION(HexahedraNewtonRaphsonStrategy)
ConvergenceCriteria< TSparseSpace, TDenseSpace > TConvergenceCriteriaType
Definition: hexahedra_newton_raphson_strategy.h:73
BaseType::TSystemVectorPointerType TSystemVectorPointerType
Definition: hexahedra_newton_raphson_strategy.h:89
BaseType::TSystemMatrixType TSystemMatrixType
Definition: hexahedra_newton_raphson_strategy.h:84
BaseType::DofsArrayType DofsArrayType
Definition: hexahedra_newton_raphson_strategy.h:83
HexahedraNewtonRaphsonStrategy(const HexahedraNewtonRaphsonStrategy &Other)
Definition: hexahedra_newton_raphson_strategy.h:442
BaseType::TSystemMatrixPointerType TSystemMatrixPointerType
Definition: hexahedra_newton_raphson_strategy.h:88
BaseType::LocalSystemMatrixType LocalSystemMatrixType
Definition: hexahedra_newton_raphson_strategy.h:87
TSparseSpace SparseSpaceType
Definition: hexahedra_newton_raphson_strategy.h:81
BaseType::TBuilderAndSolverType TBuilderAndSolverType
Definition: hexahedra_newton_raphson_strategy.h:79
HexahedraNewtonRaphsonStrategy(ModelPart &rModelPart, typename TSchemeType::Pointer pScheme, typename TLinearSolver::Pointer pNewLinearSolver, typename TConvergenceCriteriaType::Pointer pNewConvergenceCriteria, typename TBuilderAndSolverType::Pointer pNewBuilderAndSolver, int MaxIterations=30, bool CalculateReactions=false, bool ReformDofSetAtEachStep=false, bool MoveMeshFlag=false)
Definition: hexahedra_newton_raphson_strategy.h:177
ResidualBasedNewtonRaphsonStrategy< TSparseSpace, TDenseSpace, TLinearSolver > BaseType
Definition: hexahedra_newton_raphson_strategy.h:78
~HexahedraNewtonRaphsonStrategy() override
Destructor.
Definition: hexahedra_newton_raphson_strategy.h:239
BaseType::TDataType TDataType
Definition: hexahedra_newton_raphson_strategy.h:80
HexahedraNewtonRaphsonStrategy(ModelPart &rModelPart, typename TSchemeType::Pointer pScheme, typename TLinearSolver::Pointer pNewLinearSolver, typename TConvergenceCriteriaType::Pointer pNewConvergenceCriteria, int MaxIterations=30, bool CalculateReactions=false, bool ReformDofSetAtEachStep=false, bool MoveMeshFlag=false)
Definition: hexahedra_newton_raphson_strategy.h:107
BaseType::TSystemVectorType TSystemVectorType
Definition: implicit_solving_strategy.h:72
void SetRebuildLevel(int Level) override
This sets the build level.
Definition: implicit_solving_strategy.h:207
int mRebuildLevel
Definition: implicit_solving_strategy.h:263
bool mStiffnessMatrixIsBuilt
The current rebuild level.
Definition: implicit_solving_strategy.h:264
BaseType::TSystemMatrixType TSystemMatrixType
Definition: implicit_solving_strategy.h:70
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
ProcessInfo & GetProcessInfo()
Definition: model_part.h:1746
This class provides to Kratos a data structure for I/O based on the standard of JSON.
Definition: kratos_parameters.h:59
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
Current class provides an implementation for standard builder and solving operations.
Definition: residualbased_block_builder_and_solver.h:82
This is the base Newton Raphson strategy.
Definition: residualbased_newton_raphson_strategy.h:66
void SetMaxIterationNumber(unsigned int MaxIterationNumber)
This method sets the flag mMaxIterationNumber.
Definition: residualbased_newton_raphson_strategy.h:575
TBuilderAndSolverType::Pointer GetBuilderAndSolver()
Get method for the builder and solver.
Definition: residualbased_newton_raphson_strategy.h:493
virtual void UpdateDatabase(TSystemMatrixType &rA, TSystemVectorType &rDx, TSystemVectorType &rb, const bool MoveMesh)
Here the database is updated.
Definition: residualbased_newton_raphson_strategy.h:1278
bool mKeepSystemConstantDuringIterations
Flag to set as initialized the strategy.
Definition: residualbased_newton_raphson_strategy.h:1265
unsigned int mMaxIterationNumber
Definition: residualbased_newton_raphson_strategy.h:1261
TSchemeType::Pointer GetScheme()
Get method for the time scheme.
Definition: residualbased_newton_raphson_strategy.h:475
TSystemVectorPointerType mpb
The increment in the solution.
Definition: residualbased_newton_raphson_strategy.h:1237
TSystemMatrixPointerType mpA
The RHS vector of the system of equations.
Definition: residualbased_newton_raphson_strategy.h:1238
virtual void MaxIterationsExceeded()
This method prints information after reach the max number of iterations.
Definition: residualbased_newton_raphson_strategy.h:1340
bool mCalculateReactionsFlag
Flag telling if it is needed or not to compute the reactions.
Definition: residualbased_newton_raphson_strategy.h:1253
TSystemVectorPointerType mpDx
The pointer to the convergence criteria employed.
Definition: residualbased_newton_raphson_strategy.h:1236
TBuilderAndSolverType::Pointer mpBuilderAndSolver
The pointer to the time scheme employed.
Definition: residualbased_newton_raphson_strategy.h:1233
BaseType::TSchemeType TSchemeType
Definition: residualbased_newton_raphson_strategy.h:87
TSchemeType::Pointer mpScheme
Definition: residualbased_newton_raphson_strategy.h:1232
BaseType::TBuilderAndSolverType TBuilderAndSolverType
Definition: residualbased_newton_raphson_strategy.h:81
void SetEchoLevel(int Level) override
It sets the level of echo for the solving strategy.
Definition: residualbased_newton_raphson_strategy.h:599
bool GetKeepSystemConstantDuringIterations()
Get method for the flag mKeepSystemConstantDuringIterations.
Definition: residualbased_newton_raphson_strategy.h:1158
void Clear() override
Clears the internal storage.
Definition: residualbased_newton_raphson_strategy.h:707
virtual void EchoInfo(const unsigned int IterationNumber)
This method returns the components of the system of equations depending of the echo level.
Definition: residualbased_newton_raphson_strategy.h:1298
TConvergenceCriteriaType::Pointer mpConvergenceCriteria
The pointer to the builder and solver employed.
Definition: residualbased_newton_raphson_strategy.h:1234
bool mInitializeWasPerformed
The maximum number of iterations, 30 by default.
Definition: residualbased_newton_raphson_strategy.h:1263
bool mReformDofSetAtEachStep
The LHS matrix of the system of equations.
Definition: residualbased_newton_raphson_strategy.h:1247
TSparseSpace::VectorPointerType TSystemVectorPointerType
Definition: solving_strategy.h:77
TDenseSpace::MatrixType LocalSystemMatrixType
Definition: solving_strategy.h:79
TSparseSpace::DataType TDataType
Definition: solving_strategy.h:69
ModelPart & GetModelPart()
Operations to get the pointer to the model.
Definition: solving_strategy.h:350
TSparseSpace::MatrixType TSystemMatrixType
Definition: solving_strategy.h:71
TSparseSpace::MatrixPointerType TSystemMatrixPointerType
Definition: solving_strategy.h:75
bool MoveMeshFlag()
This function returns the flag that says if the mesh is moved.
Definition: solving_strategy.h:290
TSparseSpace::VectorType TSystemVectorType
Definition: solving_strategy.h:73
TDenseSpace::VectorType LocalSystemVectorType
Definition: solving_strategy.h:81
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_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