15 #if !defined(KRATOS_POROMECHANICS_NEWTON_RAPHSON_NONLOCAL_STRATEGY)
16 #define KRATOS_POROMECHANICS_NEWTON_RAPHSON_NONLOCAL_STRATEGY
30 template<
class TSparseSpace,
class TDenseSpace,
class TLinearSolver>
64 typename TSchemeType::Pointer pScheme,
65 typename TConvergenceCriteriaType::Pointer pNewConvergenceCriteria,
66 typename TBuilderAndSolverType::Pointer pNewBuilderAndSolver,
68 int MaxIterations = 30,
69 bool CalculateReactions =
false,
70 bool ReformDofSetAtEachStep =
false,
73 pNewConvergenceCriteria, pNewBuilderAndSolver, rParameters, MaxIterations, CalculateReactions, ReformDofSetAtEachStep,
MoveMeshFlag)
152 unsigned int iteration_number = 1;
154 bool is_converged =
false;
159 TSparseSpace::SetToZero(mA);
160 TSparseSpace::SetToZero(
mb);
161 TSparseSpace::SetToZero(mDx);
172 if (is_converged ==
true)
177 TSparseSpace::SetToZero(
mb);
193 TSparseSpace::SetToZero(mA);
194 TSparseSpace::SetToZero(
mb);
195 TSparseSpace::SetToZero(mDx);
210 if (is_converged ==
true)
214 TSparseSpace::SetToZero(
mb);
295 TSparseSpace::SetToZero(mA);
296 TSparseSpace::SetToZero(
mb);
297 TSparseSpace::SetToZero(mDx);
308 unsigned int iteration_number = 0;
309 bool is_converged =
false;
310 double dofs_ratio = 1000.0;
311 double ReferenceDofsNorm;
319 iteration_number += 1;
325 TSparseSpace::SetToZero(mA);
326 TSparseSpace::SetToZero(
mb);
327 TSparseSpace::SetToZero(mDx);
341 dofs_ratio = NormDx/ReferenceDofsNorm;
342 KRATOS_INFO(
"Newton Raphson Nonlocal Strategy") <<
"TEST ITERATION: " << iteration_number << std::endl;
343 KRATOS_INFO(
"Newton Raphson Nonlocal Strategy") <<
" Dofs Ratio = " << dofs_ratio << std::endl;
345 if(dofs_ratio <= 1.0e-3)
This is the base class to define the different convergence criterion considered.
Definition: convergence_criteria.h:58
Implicit solving strategy base class This is the base class from which we will derive all the implici...
Definition: implicit_solving_strategy.h:61
BaseType::TSystemVectorType TSystemVectorType
Definition: implicit_solving_strategy.h:72
Scheme< TSparseSpace, TDenseSpace > TSchemeType
Definition: implicit_solving_strategy.h:82
BuilderAndSolver< TSparseSpace, TDenseSpace, TLinearSolver > TBuilderAndSolverType
Definition: implicit_solving_strategy.h:84
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
Definition: nonlocal_damage_2D_utilities.hpp:26
Definition: nonlocal_damage_3D_utilities.hpp:26
Definition: nonlocal_damage_utilities.hpp:36
virtual void SearchGaussPointsNeighbours(Parameters *pParameters, ModelPart &rModelPart)
Definition: nonlocal_damage_utilities.hpp:82
void CalculateNonlocalEquivalentStrain(Parameters *pParameters, const ProcessInfo &CurrentProcessInfo)
Definition: nonlocal_damage_utilities.hpp:89
This class provides to Kratos a data structure for I/O based on the standard of JSON.
Definition: kratos_parameters.h:59
bool GetBool() const
This method returns the boolean contained in the current Parameter.
Definition: kratos_parameters.cpp:675
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
Definition: poromechanics_newton_raphson_nonlocal_strategy.hpp:33
PoromechanicsNewtonRaphsonNonlocalStrategy(ModelPart &model_part, typename TSchemeType::Pointer pScheme, typename TConvergenceCriteriaType::Pointer pNewConvergenceCriteria, typename TBuilderAndSolverType::Pointer pNewBuilderAndSolver, Parameters &rParameters, int MaxIterations=30, bool CalculateReactions=false, bool ReformDofSetAtEachStep=false, bool MoveMeshFlag=false)
Constructor.
Definition: poromechanics_newton_raphson_nonlocal_strategy.hpp:62
BaseType::TSystemMatrixType TSystemMatrixType
Definition: poromechanics_newton_raphson_nonlocal_strategy.hpp:46
PoromechanicsNewtonRaphsonStrategy< TSparseSpace, TDenseSpace, TLinearSolver > MotherType
Definition: poromechanics_newton_raphson_nonlocal_strategy.hpp:41
bool mSearchNeighboursAtEachStep
Definition: poromechanics_newton_raphson_nonlocal_strategy.hpp:278
BaseType::DofsArrayType DofsArrayType
Definition: poromechanics_newton_raphson_nonlocal_strategy.hpp:45
ResidualBasedNewtonRaphsonStrategy< TSparseSpace, TDenseSpace, TLinearSolver > GrandMotherType
Definition: poromechanics_newton_raphson_nonlocal_strategy.hpp:40
void Clear() override
Clears the internal storage.
Definition: poromechanics_newton_raphson_nonlocal_strategy.hpp:256
unsigned int mMaxIterationNumber
Definition: residualbased_newton_raphson_strategy.h:1261
BaseType::TSchemeType TSchemeType
Definition: poromechanics_newton_raphson_nonlocal_strategy.hpp:44
TSystemVectorPointerType mpb
The increment in the solution.
Definition: residualbased_newton_raphson_strategy.h:1237
bool CheckConvergence() override
Name of the nodal variable associated to every SubModelPart.
Definition: poromechanics_newton_raphson_nonlocal_strategy.hpp:282
BaseType::TBuilderAndSolverType TBuilderAndSolverType
Definition: poromechanics_newton_raphson_nonlocal_strategy.hpp:43
TSystemMatrixPointerType mpA
The RHS vector of the system of equations.
Definition: residualbased_newton_raphson_strategy.h:1238
bool mCalculateReactionsFlag
Flag telling if it is needed or not to compute the reactions.
Definition: residualbased_newton_raphson_strategy.h:1253
Parameters * mpParameters
Member Variables.
Definition: poromechanics_newton_raphson_strategy.hpp:165
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
TSchemeType::Pointer mpScheme
Definition: residualbased_newton_raphson_strategy.h:1232
ConvergenceCriteria< TSparseSpace, TDenseSpace > TConvergenceCriteriaType
Definition: poromechanics_newton_raphson_nonlocal_strategy.hpp:42
bool SolveSolutionStep() override
Solves the current step. This function returns true if a solution has been found, false otherwise.
Definition: poromechanics_newton_raphson_nonlocal_strategy.hpp:141
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
void FinalizeSolutionStep() override
Performs all the required operations that should be done (for each step) after solving the solution s...
Definition: poromechanics_newton_raphson_nonlocal_strategy.hpp:239
void Initialize() override
Initialization of member variables and prior operations.
Definition: poromechanics_newton_raphson_nonlocal_strategy.hpp:86
bool mNonlocalDamageIsInitialized
Definition: poromechanics_newton_raphson_nonlocal_strategy.hpp:277
NonlocalDamageUtilities * mpNonlocalDamageUtility
Member Variables.
Definition: poromechanics_newton_raphson_nonlocal_strategy.hpp:276
~PoromechanicsNewtonRaphsonNonlocalStrategy() override
Destructor.
Definition: poromechanics_newton_raphson_nonlocal_strategy.hpp:82
void InitializeSolutionStep() override
Performs all the required operations that should be done (for each step) before solving the solution ...
Definition: poromechanics_newton_raphson_nonlocal_strategy.hpp:115
BaseType::TSystemVectorType TSystemVectorType
Definition: poromechanics_newton_raphson_nonlocal_strategy.hpp:47
ImplicitSolvingStrategy< TSparseSpace, TDenseSpace, TLinearSolver > BaseType
Definition: poromechanics_newton_raphson_nonlocal_strategy.hpp:39
KRATOS_CLASS_POINTER_DEFINITION(PoromechanicsNewtonRaphsonNonlocalStrategy)
Definition: poromechanics_newton_raphson_strategy.hpp:35
Parameters * mpParameters
Member Variables.
Definition: poromechanics_newton_raphson_strategy.hpp:165
void Initialize() override
Initialization of member variables and prior operations.
Definition: poromechanics_newton_raphson_strategy.hpp:115
double CalculateReferenceDofsNorm(DofsArrayType &rDofSet)
Definition: poromechanics_newton_raphson_strategy.hpp:240
This is the base Newton Raphson strategy.
Definition: residualbased_newton_raphson_strategy.h:66
unsigned int mMaxIterationNumber
Definition: residualbased_newton_raphson_strategy.h:1261
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
TSchemeType::Pointer mpScheme
Definition: residualbased_newton_raphson_strategy.h:1232
void InitializeSolutionStep() override
Performs all the required operations that should be done (for each step) before solving the solution ...
Definition: residualbased_newton_raphson_strategy.h:781
void Clear() override
Clears the internal storage.
Definition: residualbased_newton_raphson_strategy.h:707
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
void FinalizeSolutionStep() override
Performs all the required operations that should be done (for each step) after solving the solution s...
Definition: residualbased_newton_raphson_strategy.h:848
ModelPart & GetModelPart()
Operations to get the pointer to the model.
Definition: solving_strategy.h:350
TSparseSpace::MatrixType TSystemMatrixType
Definition: solving_strategy.h:71
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
virtual void MoveMesh()
This function is designed to move the mesh.
Definition: solving_strategy.h:330
#define KRATOS_CATCH(MoreInfo)
Definition: define.h:110
#define KRATOS_TRY
Definition: define.h:109
#define KRATOS_INFO(label)
Definition: logger.h:250
double TwoNorm(SparseSpaceType &dummy, SparseSpaceType::VectorType &x)
Definition: add_strategies_to_python.cpp:164
ProcessInfo & GetProcessInfo(ModelPart &rModelPart)
Definition: add_model_part_to_python.cpp:54
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
model_part
Definition: face_heat.py:14
double precision function mb(a)
Definition: TensorModule.f:849