15 #if !defined(KRATOS_POROMECHANICS_RAMM_ARC_LENGTH_STRATEGY)
16 #define KRATOS_POROMECHANICS_RAMM_ARC_LENGTH_STRATEGY
27 template<
class TSparseSpace,
class TDenseSpace,
class TLinearSolver>
65 typename TSchemeType::Pointer pScheme,
66 typename TConvergenceCriteriaType::Pointer pNewConvergenceCriteria,
67 typename TBuilderAndSolverType::Pointer pNewBuilderAndSolver,
69 int MaxIterations = 30,
70 bool CalculateReactions =
false,
71 bool ReformDofSetAtEachStep =
false,
74 pNewConvergenceCriteria, pNewBuilderAndSolver, rParameters, MaxIterations, CalculateReactions, ReformDofSetAtEachStep,
MoveMeshFlag)
115 TSparseSpace::SetToZero(mA);
116 TSparseSpace::SetToZero(mDx);
117 TSparseSpace::SetToZero(
mb);
126 TSystemVectorType& mf = *
mpf;
127 TSparseSpace::SetToZero(mf);
140 KRATOS_INFO(
"Ramm's Arc Length Strategy") <<
"Strategy Initialized" << std::endl;
170 KRATOS_INFO(
"Ramm's Arc Length Strategy") <<
"INITIAL ARC-LENGTH RADIUS: " <<
mRadius_0 << std::endl;
187 unsigned int iteration_number = 1;
189 bool is_converged =
false;
193 TSparseSpace::SetToZero(mA);
194 TSparseSpace::SetToZero(
mb);
195 TSparseSpace::SetToZero(mDxf);
206 noalias(mDxPred) = DLambda*mDxf;
208 this->
Update(rDofSet, mA, mDxPred,
mb);
214 if (is_converged ==
true)
219 TSparseSpace::SetToZero(
mb);
234 TSparseSpace::SetToZero(mA);
235 TSparseSpace::SetToZero(
mb);
236 TSparseSpace::SetToZero(mDxf);
243 TSparseSpace::SetToZero(mA);
244 TSparseSpace::SetToZero(
mb);
245 TSparseSpace::SetToZero(mDxb);
251 noalias(mDx) = mDxb + DLambda*mDxf;
260 is_converged =
false;
278 if (is_converged ==
true)
282 TSparseSpace::SetToZero(
mb);
341 std::cout <<
"************ NO CONVERGENCE: restoring equilibrium path ************" << std::endl;
383 TSystemVectorType& mf = *
mpf;
444 TSystemVectorPointerType
mpf;
567 double& rvalue = itNode->FastGetSolutionStepValue(var);
587 double& rvaluex = itNode->FastGetSolutionStepValue(varx);
589 double& rvaluey = itNode->FastGetSolutionStepValue(vary);
591 double& rvaluez = itNode->FastGetSolutionStepValue(varz);
598 KRATOS_THROW_ERROR( std::logic_error,
"One variable of the applied loads has a non supported type. Variable: ", VariableName )
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
BaseType::TSystemVectorPointerType TSystemVectorPointerType
Definition: implicit_solving_strategy.h:76
BuilderAndSolver< TSparseSpace, TDenseSpace, TLinearSolver > TBuilderAndSolverType
Definition: implicit_solving_strategy.h:84
BaseType::TSystemMatrixType TSystemMatrixType
Definition: implicit_solving_strategy.h:70
KratosComponents class encapsulates a lookup table for a family of classes in a generic way.
Definition: kratos_components.h:49
static const TComponentType & Get(const std::string &rName)
Retrieves a component with the specified name.
Definition: kratos_components.h:114
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
ProcessInfo & GetProcessInfo()
Definition: model_part.h:1746
MeshType::NodeIterator NodeIterator
Definition: model_part.h:134
NodesContainerType & Nodes(IndexType ThisIndex=0)
Definition: model_part.h:507
static void PartitionedIterators(TVector &rVector, typename TVector::iterator &rBegin, typename TVector::iterator &rEnd)
Generate a partition for an std::vector-like array, providing iterators to the begin and end position...
Definition: openmp_utils.h:179
This class provides to Kratos a data structure for I/O based on the standard of JSON.
Definition: kratos_parameters.h:59
double GetDouble() const
This method returns the double contained in the current Parameter.
Definition: kratos_parameters.cpp:657
int GetInt() const
This method returns the integer contained in the current Parameter.
Definition: kratos_parameters.cpp:666
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_strategy.hpp:35
std::vector< ModelPart * > mSubModelPartList
Definition: poromechanics_newton_raphson_strategy.hpp:166
void Initialize() override
Initialization of member variables and prior operations.
Definition: poromechanics_newton_raphson_strategy.hpp:115
std::vector< std::string > mVariableNames
List of every SubModelPart associated to an external load.
Definition: poromechanics_newton_raphson_strategy.hpp:167
virtual bool CheckConvergence()
Name of the nodal variable associated to every SubModelPart.
Definition: poromechanics_newton_raphson_strategy.hpp:171
double CalculateReferenceDofsNorm(DofsArrayType &rDofSet)
Definition: poromechanics_newton_raphson_strategy.hpp:240
Definition: poromechanics_ramm_arc_length_strategy.hpp:30
~PoromechanicsRammArcLengthStrategy() override
Destructor.
Definition: poromechanics_ramm_arc_length_strategy.hpp:86
double mDLambdaStep
Norm of the solution vector in equilibrium.
Definition: poromechanics_ramm_arc_length_strategy.hpp:458
double mMaxRadiusFactor
Definition: poromechanics_ramm_arc_length_strategy.hpp:454
TSystemVectorPointerType mpDxPred
Delta x of A*Dxb=b.
Definition: poromechanics_ramm_arc_length_strategy.hpp:447
double mNormxEquilibrium
Loading factor.
Definition: poromechanics_ramm_arc_length_strategy.hpp:457
ImplicitSolvingStrategy< TSparseSpace, TDenseSpace, TLinearSolver > BaseType
Definition: poromechanics_ramm_arc_length_strategy.hpp:36
PoromechanicsNewtonRaphsonStrategy< TSparseSpace, TDenseSpace, TLinearSolver > MotherType
Definition: poromechanics_ramm_arc_length_strategy.hpp:38
BaseType::TSystemVectorType TSystemVectorType
Definition: poromechanics_ramm_arc_length_strategy.hpp:45
void BuildWithDirichlet(TSystemMatrixType &mA, TSystemVectorType &mDx, TSystemVectorType &mb)
Definition: poromechanics_ramm_arc_length_strategy.hpp:494
bool SolveSolutionStep() override
Solves the current step. This function returns true if a solution has been found, false otherwise.
Definition: poromechanics_ramm_arc_length_strategy.hpp:166
bool IsConverged() override
This should be considered as a "post solution" convergence check which is useful for coupled analysis...
Definition: poromechanics_ramm_arc_length_strategy.hpp:402
void Clear() override
Clears the internal storage.
Definition: poromechanics_ramm_arc_length_strategy.hpp:373
BaseType::TSystemMatrixType TSystemMatrixType
Definition: poromechanics_ramm_arc_length_strategy.hpp:44
unsigned int mMaxIterationNumber
Definition: residualbased_newton_raphson_strategy.h:1261
PoromechanicsRammArcLengthStrategy(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_ramm_arc_length_strategy.hpp:63
void ClearStep()
Definition: poromechanics_ramm_arc_length_strategy.hpp:521
virtual void UpdateLoads()
Definition: poromechanics_ramm_arc_length_strategy.hpp:426
TSystemVectorPointerType mpb
The increment in the solution.
Definition: residualbased_newton_raphson_strategy.h:1237
TSystemVectorPointerType mpf
Member Variables.
Definition: poromechanics_ramm_arc_length_strategy.hpp:444
ConvergenceCriteria< TSparseSpace, TDenseSpace > TConvergenceCriteriaType
Definition: poromechanics_ramm_arc_length_strategy.hpp:39
double mLambda_old
Definition: poromechanics_ramm_arc_length_strategy.hpp:456
void InitializeSolutionStep() override
Performs all the required operations that should be done (for each step) before solving the solution ...
Definition: poromechanics_ramm_arc_length_strategy.hpp:149
TSystemVectorPointerType mpDxf
Vector of reference external forces.
Definition: poromechanics_ramm_arc_length_strategy.hpp:445
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
TSystemVectorPointerType mpDxStep
Delta x of prediction phase.
Definition: poromechanics_ramm_arc_length_strategy.hpp:448
virtual void Update(DofsArrayType &rDofSet, TSystemMatrixType &mA, TSystemVectorType &mDx, TSystemVectorType &mb)
Definition: poromechanics_ramm_arc_length_strategy.hpp:506
TSystemVectorPointerType mpDx
The pointer to the convergence criteria employed.
Definition: residualbased_newton_raphson_strategy.h:1236
void UpdateExternalLoads()
Definition: poromechanics_ramm_arc_length_strategy.hpp:547
TBuilderAndSolverType::Pointer mpBuilderAndSolver
The pointer to the time scheme employed.
Definition: residualbased_newton_raphson_strategy.h:1233
BaseType::TSystemVectorPointerType TSystemVectorPointerType
Definition: poromechanics_ramm_arc_length_strategy.hpp:46
TSystemVectorPointerType mpDxb
Delta x of A*Dxf=f.
Definition: poromechanics_ramm_arc_length_strategy.hpp:446
double mRadius_0
Definition: poromechanics_ramm_arc_length_strategy.hpp:455
TSchemeType::Pointer mpScheme
Definition: residualbased_newton_raphson_strategy.h:1232
bool mInitializeArcLengthWasPerformed
This is used to calculate the radius of the next step.
Definition: poromechanics_ramm_arc_length_strategy.hpp:452
KRATOS_CLASS_POINTER_DEFINITION(PoromechanicsRammArcLengthStrategy)
void InitializeSystemVector(TSystemVectorPointerType &pv)
Delta lambda of the current step.
Definition: poromechanics_ramm_arc_length_strategy.hpp:462
void Initialize() override
Initialization of member variables and prior operations.
Definition: poromechanics_ramm_arc_length_strategy.hpp:90
double mRadius
Used to limit the radius of the arc length strategy.
Definition: poromechanics_ramm_arc_length_strategy.hpp:455
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
TSparseSpace SparseSpaceType
Definition: poromechanics_ramm_arc_length_strategy.hpp:42
void FinalizeSolutionStep() override
Performs all the required operations that should be done (for each step) after solving the solution s...
Definition: poromechanics_ramm_arc_length_strategy.hpp:314
BaseType::DofsArrayType DofsArrayType
Definition: poromechanics_ramm_arc_length_strategy.hpp:43
BaseType::TBuilderAndSolverType TBuilderAndSolverType
Definition: poromechanics_ramm_arc_length_strategy.hpp:40
double mLambda
Radius of the arc length strategy.
Definition: poromechanics_ramm_arc_length_strategy.hpp:456
double mMinRadiusFactor
Definition: poromechanics_ramm_arc_length_strategy.hpp:454
void SaveInitializeSystemVector(TSystemVectorPointerType &pv)
Definition: poromechanics_ramm_arc_length_strategy.hpp:478
ResidualBasedNewtonRaphsonStrategy< TSparseSpace, TDenseSpace, TLinearSolver > GrandMotherType
Definition: poromechanics_ramm_arc_length_strategy.hpp:37
bool mReformDofSetAtEachStep
The LHS matrix of the system of equations.
Definition: residualbased_newton_raphson_strategy.h:1247
BaseType::TSchemeType TSchemeType
Definition: poromechanics_ramm_arc_length_strategy.hpp:41
unsigned int mDesiredIterations
Delta x of the current step.
Definition: poromechanics_ramm_arc_length_strategy.hpp:450
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 Predict() override
Operation to predict the solution ... if it is not called a trivial predictor is used in which the va...
Definition: residualbased_newton_raphson_strategy.h:625
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
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
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
static void Resize(MatrixType &rA, SizeType m, SizeType n)
Definition: ublas_space.h:558
static void Clear(MatrixPointerType &pA)
Definition: ublas_space.h:578
#define KRATOS_THROW_ERROR(ExceptionType, ErrorMessage, MoreInfo)
Definition: define.h:77
#define KRATOS_CATCH(MoreInfo)
Definition: define.h:110
#define KRATOS_TRY
Definition: define.h:109
#define KRATOS_INFO(label)
Definition: logger.h:250
bool Has(const std::string &ModelerName)
Checks if the modeler is registered.
Definition: modeler_factory.cpp:24
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
double Dot(SparseSpaceType &dummy, SparseSpaceType::VectorType &rX, SparseSpaceType::VectorType &rY)
Definition: add_strategies_to_python.cpp:85
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
T & noalias(T &TheMatrix)
Definition: amatrix_interface.h:484
model_part
Definition: face_heat.py:14
v
Definition: generate_convection_diffusion_explicit_element.py:114
integer i
Definition: TensorModule.f:17
double precision function mb(a)
Definition: TensorModule.f:849