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.
poromechanics_ramm_arc_length_strategy.hpp
Go to the documentation of this file.
1 
2 // | / |
3 // ' / __| _` | __| _ \ __|
4 // . \ | ( | | ( |\__ `
5 // _|\_\_| \__,_|\__|\___/ ____/
6 // Multi-Physics
7 //
8 // License: BSD License
9 // Kratos default license: kratos/license.txt
10 //
11 // Main authors: Ignasi de Pouplana
12 //
13 
14 
15 #if !defined(KRATOS_POROMECHANICS_RAMM_ARC_LENGTH_STRATEGY)
16 #define KRATOS_POROMECHANICS_RAMM_ARC_LENGTH_STRATEGY
17 
18 // Project includes
20 
21 // Application includes
23 
24 namespace Kratos
25 {
26 
27 template<class TSparseSpace,class TDenseSpace,class TLinearSolver>
28 
29 class PoromechanicsRammArcLengthStrategy : public PoromechanicsNewtonRaphsonStrategy<TSparseSpace, TDenseSpace, TLinearSolver>
30 {
31 
32 public:
33 
35 
42  typedef TSparseSpace SparseSpaceType;
50  using GrandMotherType::mpA; //Tangent matrix
51  using GrandMotherType::mpb; //Residual vector of iteration i
52  using GrandMotherType::mpDx; //Delta x of iteration i
59 
60 //----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
61 
65  typename TSchemeType::Pointer pScheme,
66  typename TConvergenceCriteriaType::Pointer pNewConvergenceCriteria,
67  typename TBuilderAndSolverType::Pointer pNewBuilderAndSolver,
68  Parameters& rParameters,
69  int MaxIterations = 30,
70  bool CalculateReactions = false,
71  bool ReformDofSetAtEachStep = false,
72  bool MoveMeshFlag = false
73  ) : PoromechanicsNewtonRaphsonStrategy<TSparseSpace, TDenseSpace, TLinearSolver>(model_part, pScheme,
74  pNewConvergenceCriteria, pNewBuilderAndSolver, rParameters, MaxIterations, CalculateReactions, ReformDofSetAtEachStep, MoveMeshFlag)
75  {
76  mDesiredIterations = rParameters["desired_iterations"].GetInt();
77  mMaxRadiusFactor = rParameters["max_radius_factor"].GetDouble();
78  mMinRadiusFactor = rParameters["min_radius_factor"].GetDouble();
79 
81  }
82 
83  //------------------------------------------------------------------------------------
84 
87 
88 //----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
89 
90  void Initialize() override
91  {
93 
94  if (mInitializeWasPerformed == false)
95  {
97 
99  {
100  //set up the system
101  if (mpBuilderAndSolver->GetDofSetIsInitializedFlag() == false)
102  {
103  //setting up the list of the DOFs to be solved
105 
106  //shaping correctly the system
108  }
109 
110  // Compute initial radius (mRadius_0)
111  mpBuilderAndSolver->ResizeAndInitializeVectors(mpScheme, mpA, mpDx, mpb, BaseType::GetModelPart());
112  TSystemMatrixType& mA = *mpA;
113  TSystemVectorType& mDx = *mpDx;
115  TSparseSpace::SetToZero(mA);
116  TSparseSpace::SetToZero(mDx);
117  TSparseSpace::SetToZero(mb);
118 
119  mpBuilderAndSolver->BuildAndSolve(mpScheme, BaseType::GetModelPart(), mA, mDx, mb);
120 
122  mRadius = mRadius_0;
123 
124  // Compute vector of reference external force (mf)
126  TSystemVectorType& mf = *mpf;
127  TSparseSpace::SetToZero(mf);
128 
130 
131  //Initialize the loading factor Lambda
132  mLambda = 0.0;
133  mLambda_old = 1.0;
134 
135  // Initialize Norm of solution
136  mNormxEquilibrium = 0.0;
137 
139 
140  KRATOS_INFO("Ramm's Arc Length Strategy") << "Strategy Initialized" << std::endl;
141  }
142  }
143 
144  KRATOS_CATCH( "" )
145  }
146 
147 //----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
148 
149  void InitializeSolutionStep() override
150  {
151  KRATOS_TRY
152 
154 
160 
161  KRATOS_CATCH( "" )
162  }
163 
164 //----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
165 
166  bool SolveSolutionStep() override
167  {
168  // ********** Prediction phase **********
169 
170  KRATOS_INFO("Ramm's Arc Length Strategy") << "INITIAL ARC-LENGTH RADIUS: " << mRadius_0 << std::endl;
171 
172  KRATOS_INFO("Ramm's Arc Length Strategy") << "ARC-LENGTH RADIUS: " << mRadius/mRadius_0 << " X initial radius" << std::endl;
173 
174  // Initialize variables
175  DofsArrayType& rDofSet = mpBuilderAndSolver->GetDofSet();
176  TSystemMatrixType& mA = *mpA;
177  TSystemVectorType& mDx = *mpDx;
179  TSystemVectorType& mf = *mpf;
180  TSystemVectorType& mDxb = *mpDxb;
181  TSystemVectorType& mDxf = *mpDxf;
182  TSystemVectorType& mDxPred = *mpDxPred;
183  TSystemVectorType& mDxStep = *mpDxStep;
184 
185  //initializing the parameters of the iteration loop
186  double NormDx;
187  unsigned int iteration_number = 1;
188  BaseType::GetModelPart().GetProcessInfo()[NL_ITERATION_NUMBER] = iteration_number;
189  bool is_converged = false;
190  mpScheme->InitializeNonLinIteration(BaseType::GetModelPart(), mA, mDx, mb);
191  is_converged = mpConvergenceCriteria->PreCriteria(BaseType::GetModelPart(), rDofSet, mA, mDx, mb);
192 
193  TSparseSpace::SetToZero(mA);
194  TSparseSpace::SetToZero(mb);
195  TSparseSpace::SetToZero(mDxf);
196 
197  // Note: This is not so efficient, but I want to solve mA*mDxf=mf without losing mf
198  this->BuildWithDirichlet(mA, mDxf, mb);
199  noalias(mb) = mf;
200  mpBuilderAndSolver->SystemSolve(mA, mDxf, mb);
201 
202  //update results
203  double DLambda = mRadius/TSparseSpace::TwoNorm(mDxf);
204  mDLambdaStep = DLambda;
205  mLambda += DLambda;
206  noalias(mDxPred) = DLambda*mDxf;
207  noalias(mDxStep) = mDxPred;
208  this->Update(rDofSet, mA, mDxPred, mb);
209 
210  //move the mesh if needed
212 
213  // ********** Correction phase (iteration cicle) **********
214  if (is_converged == true)
215  {
216  mpConvergenceCriteria->InitializeSolutionStep(BaseType::GetModelPart(), rDofSet, mA, mDxf, mb);
217  if (mpConvergenceCriteria->GetActualizeRHSflag() == true)
218  {
219  TSparseSpace::SetToZero(mb);
221  }
222  is_converged = mpConvergenceCriteria->PostCriteria(BaseType::GetModelPart(), rDofSet, mA, mDxf, mb);
223  }
224 
225  while (is_converged == false && iteration_number++ < mMaxIterationNumber)
226  {
227  //setting the number of iteration
228  BaseType::GetModelPart().GetProcessInfo()[NL_ITERATION_NUMBER] = iteration_number;
229 
230  mpScheme->InitializeNonLinIteration(BaseType::GetModelPart(), mA, mDx, mb);
231 
232  is_converged = mpConvergenceCriteria->PreCriteria(BaseType::GetModelPart(), rDofSet, mA, mDx, mb);
233 
234  TSparseSpace::SetToZero(mA);
235  TSparseSpace::SetToZero(mb);
236  TSparseSpace::SetToZero(mDxf);
237 
238  // Note: This is not so efficient, but I want to solve mA*mDxf=mf without losing mf
239  this->BuildWithDirichlet(mA, mDxf, mb);
240  noalias(mb) = mf;
241  mpBuilderAndSolver->SystemSolve(mA, mDxf, mb);
242 
243  TSparseSpace::SetToZero(mA);
244  TSparseSpace::SetToZero(mb);
245  TSparseSpace::SetToZero(mDxb);
246 
247  mpBuilderAndSolver->BuildAndSolve(mpScheme, BaseType::GetModelPart(), mA, mDxb, mb);
248 
249  DLambda = -TSparseSpace::Dot(mDxPred, mDxb)/TSparseSpace::Dot(mDxPred, mDxf);
250 
251  noalias(mDx) = mDxb + DLambda*mDxf;
252 
253  //Check solution before update
254  if( mNormxEquilibrium > 1.0e-10 )
255  {
256  NormDx = TSparseSpace::TwoNorm(mDx);
257 
258  if( (NormDx/mNormxEquilibrium) > 1.0e3 || (std::abs(DLambda)/std::abs(mLambda-mDLambdaStep)) > 1.0e3 )
259  {
260  is_converged = false;
261  break;
262  }
263  }
264 
265  //update results
266  mDLambdaStep += DLambda;
267  mLambda += DLambda;
268  noalias(mDxStep) += mDx;
269  this->Update(rDofSet, mA, mDx, mb);
270 
271  //move the mesh if needed
273 
274  mpScheme->FinalizeNonLinIteration(BaseType::GetModelPart(), mA, mDx, mb);
275 
276  // *** Check Convergence ***
277 
278  if (is_converged == true)
279  {
280  if (mpConvergenceCriteria->GetActualizeRHSflag() == true)
281  {
282  TSparseSpace::SetToZero(mb);
284  }
285  is_converged = mpConvergenceCriteria->PostCriteria(BaseType::GetModelPart(), rDofSet, mA, mDx, mb);
286  }
287 
288  }//While
289 
290  // Check iteration_number
291  if (iteration_number >= mMaxIterationNumber)
292  {
293  is_converged = true;
294  //plots a warning if the maximum number of iterations is exceeded
295  if(BaseType::GetModelPart().GetCommunicator().MyPID() == 0)
296  {
297  this->MaxIterationsExceeded();
298  }
299  }
300 
301  //calculate reactions if required
302  if (mCalculateReactionsFlag == true)
303  {
304  mpBuilderAndSolver->CalculateReactions(mpScheme, BaseType::GetModelPart(), mA, mDx, mb);
305  }
306 
307  BaseType::GetModelPart().GetProcessInfo()[IS_CONVERGED] = is_converged;
308 
309  return is_converged;
310  }
311 
312 //----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
313 
314  void FinalizeSolutionStep() override
315  {
316  KRATOS_TRY
317 
318  unsigned int iteration_number = BaseType::GetModelPart().GetProcessInfo()[NL_ITERATION_NUMBER];
319 
320  // Update the radius
321  mRadius = mRadius*sqrt(double(mDesiredIterations)/double(iteration_number));
322 
323  DofsArrayType& rDofSet = mpBuilderAndSolver->GetDofSet();
324  TSystemMatrixType& mA = *mpA;
325  TSystemVectorType& mDx = *mpDx;
327 
328  if (BaseType::GetModelPart().GetProcessInfo()[IS_CONVERGED] == true)
329  {
330  // Modify the radius to advance faster when convergence is achieved
335 
336  // Update Norm of x
338  }
339  else
340  {
341  std::cout << "************ NO CONVERGENCE: restoring equilibrium path ************" << std::endl;
342 
343  TSystemVectorType& mDxStep = *mpDxStep;
344 
345  //update results
347  noalias(mDx) = -mDxStep;
348  this->Update(rDofSet, mA, mDx, mb);
349 
350  //move the mesh if needed
352  }
353 
354  BaseType::GetModelPart().GetProcessInfo()[ARC_LENGTH_LAMBDA] = mLambda;
355  BaseType::GetModelPart().GetProcessInfo()[ARC_LENGTH_RADIUS_FACTOR] = mRadius/mRadius_0;
356 
357  mpScheme->FinalizeSolutionStep(BaseType::GetModelPart(), mA, mDx, mb);
358  mpBuilderAndSolver->FinalizeSolutionStep(BaseType::GetModelPart(), mA, mDx, mb);
359 
360  //Cleaning memory after the solution
361  mpScheme->Clean();
362 
363  if (mReformDofSetAtEachStep == true) //deallocate the systemvectors
364  {
365  this->ClearStep();
366  }
367 
368  KRATOS_CATCH("")
369  }
370 
371 //----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
372 
373  void Clear() override
374  {
375  KRATOS_TRY
376 
382 
383  TSystemVectorType& mf = *mpf;
384  TSystemVectorType& mDxf = *mpDxf;
385  TSystemVectorType& mDxb = *mpDxb;
386  TSystemVectorType& mDxPred = *mpDxPred;
387  TSystemVectorType& mDxStep = *mpDxStep;
388 
390  SparseSpaceType::Resize(mDxf, 0);
391  SparseSpaceType::Resize(mDxb, 0);
392  SparseSpaceType::Resize(mDxPred, 0);
393  SparseSpaceType::Resize(mDxStep, 0);
394 
396 
397  KRATOS_CATCH( "" )
398  }
399 
400 //----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
401 
402  bool IsConverged() override
403  {
404  KRATOS_TRY
405 
406  bool IsConverged = true;
407 
408  // Note: Initialize() needs to be called beforehand
409 
410  this->InitializeSolutionStep();
411 
412  this->Predict();
413 
414  // Solve the problem with constant load
415  IsConverged = this->CheckConvergence();
416 
417  this->FinalizeSolutionStep();
418 
419  return IsConverged;
420 
421  KRATOS_CATCH("")
422  }
423 
424 //----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
425 
426  virtual void UpdateLoads()
427  {
428  KRATOS_TRY
429 
430  mLambda = BaseType::GetModelPart().GetProcessInfo()[ARC_LENGTH_LAMBDA];
431  mRadius = (BaseType::GetModelPart().GetProcessInfo()[ARC_LENGTH_RADIUS_FACTOR])*mRadius_0;
432 
433  // Update External Loads
434  this->UpdateExternalLoads();
435 
436  KRATOS_CATCH("")
437  }
438 
439 //----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
440 
441 protected:
442 
444  TSystemVectorPointerType mpf;
449 
450  unsigned int mDesiredIterations;
451 
453 
455  double mRadius, mRadius_0;
458  double mDLambdaStep;
459 
460 //----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
461 
463  {
464  if (pv == NULL)
465  {
467  pv.swap(pNewv);
468  }
469 
470  TSystemVectorType& v = *pv;
471 
472  if (v.size() != mpBuilderAndSolver->GetEquationSystemSize())
473  v.resize(mpBuilderAndSolver->GetEquationSystemSize(), false);
474  }
475 
476 //----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
477 
479  {
480  if (pv == NULL)
481  {
483  pv.swap(pNewv);
484  }
485 
486  TSystemVectorType& v = *pv;
487 
488  if (v.size() != mpBuilderAndSolver->GetEquationSystemSize())
489  v.resize(mpBuilderAndSolver->GetEquationSystemSize(), true);
490  }
491 
492 //----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
493 
495  {
496  KRATOS_TRY
497 
499  mpBuilderAndSolver->ApplyDirichletConditions(mpScheme, BaseType::GetModelPart(), mA, mDx, mb);
500 
501  KRATOS_CATCH( "" )
502  }
503 
504 //----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
505 
507  {
508  KRATOS_TRY
509 
510  // Update scheme
511  mpScheme->Update(BaseType::GetModelPart(), rDofSet, mA, mDx, mb);
512 
513  // Update External Loads
514  this->UpdateExternalLoads();
515 
516  KRATOS_CATCH( "" )
517  }
518 
519 //----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
520 
521  void ClearStep()
522  {
523  KRATOS_TRY
524 
525  SparseSpaceType::Clear(mpDxf);
529 
530  TSystemVectorType& mDxf = *mpDxf;
531  TSystemVectorType& mDxb = *mpDxb;
532  TSystemVectorType& mDxPred = *mpDxPred;
533  TSystemVectorType& mDxStep = *mpDxStep;
534 
535  SparseSpaceType::Resize(mDxf, 0);
536  SparseSpaceType::Resize(mDxb, 0);
537  SparseSpaceType::Resize(mDxPred, 0);
538  SparseSpaceType::Resize(mDxStep, 0);
539 
541 
542  KRATOS_CATCH("");
543  }
544 
545 //----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
546 
548  {
549  // Update External Loads
550  for(unsigned int i = 0; i < mVariableNames.size(); i++)
551  {
552  ModelPart& rSubModelPart = *(mSubModelPartList[i]);
553  const std::string& VariableName = mVariableNames[i];
554 
555  if( KratosComponents< Variable<double> >::Has( VariableName ) )
556  {
557  const Variable<double>& var = KratosComponents< Variable<double> >::Get( VariableName );
558 
559  #pragma omp parallel
560  {
561  ModelPart::NodeIterator NodesBegin;
562  ModelPart::NodeIterator NodesEnd;
563  OpenMPUtils::PartitionedIterators(rSubModelPart.Nodes(),NodesBegin,NodesEnd);
564 
565  for (ModelPart::NodeIterator itNode = NodesBegin; itNode != NodesEnd; ++itNode)
566  {
567  double& rvalue = itNode->FastGetSolutionStepValue(var);
568  rvalue *= (mLambda/mLambda_old);
569  }
570  }
571  }
572  else if( KratosComponents< Variable<array_1d<double,3> > >::Has(VariableName) )
573  {
574  typedef Variable<double> component_type;
575  const component_type& varx = KratosComponents< component_type >::Get(VariableName+std::string("_X"));
576  const component_type& vary = KratosComponents< component_type >::Get(VariableName+std::string("_Y"));
577  const component_type& varz = KratosComponents< component_type >::Get(VariableName+std::string("_Z"));
578 
579  #pragma omp parallel
580  {
581  ModelPart::NodeIterator NodesBegin;
582  ModelPart::NodeIterator NodesEnd;
583  OpenMPUtils::PartitionedIterators(rSubModelPart.Nodes(),NodesBegin,NodesEnd);
584 
585  for (ModelPart::NodeIterator itNode = NodesBegin; itNode != NodesEnd; ++itNode)
586  {
587  double& rvaluex = itNode->FastGetSolutionStepValue(varx);
588  rvaluex *= (mLambda/mLambda_old);
589  double& rvaluey = itNode->FastGetSolutionStepValue(vary);
590  rvaluey *= (mLambda/mLambda_old);
591  double& rvaluez = itNode->FastGetSolutionStepValue(varz);
592  rvaluez *= (mLambda/mLambda_old);
593  }
594  }
595  }
596  else
597  {
598  KRATOS_THROW_ERROR( std::logic_error, "One variable of the applied loads has a non supported type. Variable: ", VariableName )
599  }
600  }
601 
602  // Save the applied Lambda factor
604  }
605 
606 }; // Class PoromechanicsRammArcLengthStrategy
607 
608 } // namespace Kratos
609 
610 #endif // KRATOS_POROMECHANICS_RAMM_ARC_LENGTH_STRATEGY defined
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