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.
geo_mechanics_ramm_arc_length_strategy.hpp
Go to the documentation of this file.
1 // KRATOS___
2 // // ) )
3 // // ___ ___
4 // // ____ //___) ) // ) )
5 // // / / // // / /
6 // ((____/ / ((____ ((___/ / MECHANICS
7 //
8 // License: geo_mechanics_application/license.txt
9 //
10 // Main authors: Ignasi de Pouplana,
11 // Vahid Galavi
12 //
13 
14 #pragma once
15 
16 // Project includes
18 
19 // Application includes
21 
22 namespace Kratos
23 {
24 
25 template <class TSparseSpace, class TDenseSpace, class TLinearSolver>
27  : public GeoMechanicsNewtonRaphsonStrategy<TSparseSpace, TDenseSpace, TLinearSolver>
28 {
29 public:
31 
38  using SparseSpaceType = TSparseSpace;
46  using GrandMotherType::mpA; // Tangent matrix
47  using GrandMotherType::mpb; // Residual vector of iteration i
50  using GrandMotherType::mpDx; // Delta x of iteration i
55 
57  typename TSchemeType::Pointer pScheme,
58  typename TLinearSolver::Pointer pNewLinearSolver,
59  typename TConvergenceCriteriaType::Pointer pNewConvergenceCriteria,
60  typename TBuilderAndSolverType::Pointer pNewBuilderAndSolver,
61  Parameters& rParameters,
62  int MaxIterations = 30,
63  bool CalculateReactions = false,
64  bool ReformDofSetAtEachStep = false,
65  bool MoveMeshFlag = false)
66  : GeoMechanicsNewtonRaphsonStrategy<TSparseSpace, TDenseSpace, TLinearSolver>(
67  model_part,
68  pScheme,
69  pNewLinearSolver,
70  pNewConvergenceCriteria,
71  pNewBuilderAndSolver,
72  rParameters,
73  MaxIterations,
74  CalculateReactions,
75  ReformDofSetAtEachStep,
77  {
78  mDesiredIterations = rParameters["desired_iterations"].GetInt();
79  mMaxRadiusFactor = rParameters["max_radius_factor"].GetDouble();
80  mMinRadiusFactor = rParameters["min_radius_factor"].GetDouble();
81  }
82 
83  void Initialize() override
84  {
86 
89 
91  // set up the system
92  if (mpBuilderAndSolver->GetDofSetIsInitializedFlag() == false) {
93  // setting up the list of the DOFs to be solved
95 
96  // shaping correctly the system
98  }
99 
100  // Compute initial radius (mRadius_0)
101  mpBuilderAndSolver->ResizeAndInitializeVectors(mpScheme, mpA, mpDx, mpb,
103  TSystemMatrixType& mA = *mpA;
104  TSystemVectorType& mDx = *mpDx;
106  TSparseSpace::SetToZero(mA);
107  TSparseSpace::SetToZero(mDx);
108  TSparseSpace::SetToZero(mb);
109 
110  mpBuilderAndSolver->BuildAndSolve(mpScheme, BaseType::GetModelPart(), mA, mDx, mb);
111 
113  mRadius = mRadius_0;
114 
115  // Compute vector of reference external force (mf)
117  TSystemVectorType& mf = *mpf;
118  TSparseSpace::SetToZero(mf);
119 
121 
122  // Initialize the loading factor Lambda
123  mLambda = 0.0;
124  mLambda_old = 1.0;
125 
126  // Initialize Norm of solution
127  mNormxEquilibrium = 0.0;
128 
130 
131  KRATOS_INFO("Ramm's Arc Length Strategy") << "Strategy Initialized" << std::endl;
132  }
133  }
134 
135  KRATOS_CATCH("")
136  }
137 
138  void InitializeSolutionStep() override
139  {
140  KRATOS_TRY
141 
143 
149 
150  KRATOS_CATCH("")
151  }
152 
153  bool SolveSolutionStep() override
154  {
155  // ********** Prediction phase **********
156  KRATOS_INFO("Ramm's Arc Length Strategy")
157  << "ARC-LENGTH RADIUS: " << mRadius / mRadius_0 << " X initial radius" << std::endl;
158 
159  // Initialize variables
160  DofsArrayType& rDofSet = mpBuilderAndSolver->GetDofSet();
161  TSystemMatrixType& mA = *mpA;
162  TSystemVectorType& mDx = *mpDx;
164  TSystemVectorType& mf = *mpf;
165  TSystemVectorType& mDxb = *mpDxb;
166  TSystemVectorType& mDxf = *mpDxf;
167  TSystemVectorType& mDxPred = *mpDxPred;
168  TSystemVectorType& mDxStep = *mpDxStep;
169 
170  // initializing the parameters of the iteration loop
171  double NormDx;
172  unsigned int iteration_number = 1;
173  BaseType::GetModelPart().GetProcessInfo()[NL_ITERATION_NUMBER] = iteration_number;
174  mpScheme->InitializeNonLinIteration(BaseType::GetModelPart(), mA, mDx, mb);
175  bool is_converged =
176  mpConvergenceCriteria->PreCriteria(BaseType::GetModelPart(), rDofSet, mA, mDx, mb);
177 
178  TSparseSpace::SetToZero(mA);
179  TSparseSpace::SetToZero(mb);
180  TSparseSpace::SetToZero(mDxf);
181 
182  // Note: This is not so efficient, but I want to solve mA*mDxf=mf without losing mf
183  this->BuildWithDirichlet(mA, mDxf, mb);
184  noalias(mb) = mf;
185  mpBuilderAndSolver->SystemSolve(mA, mDxf, mb);
186 
187  // update results
188  double DLambda = mRadius / TSparseSpace::TwoNorm(mDxf);
189  mDLambdaStep = DLambda;
190  mLambda += DLambda;
191  noalias(mDxPred) = DLambda * mDxf;
192  noalias(mDxStep) = mDxPred;
193  this->Update(rDofSet, mA, mDxPred, mb);
194 
195  // move the mesh if needed
197 
198  // ********** Correction phase (iteration cycle) **********
199  if (is_converged) {
200  mpConvergenceCriteria->InitializeSolutionStep(BaseType::GetModelPart(), rDofSet, mA, mDxf, mb);
201  if (mpConvergenceCriteria->GetActualizeRHSflag()) {
202  TSparseSpace::SetToZero(mb);
204  }
205  is_converged =
206  mpConvergenceCriteria->PostCriteria(BaseType::GetModelPart(), rDofSet, mA, mDxf, mb);
207  }
208 
209  while (!is_converged && iteration_number++ < mMaxIterationNumber) {
210  // setting the number of iteration
211  BaseType::GetModelPart().GetProcessInfo()[NL_ITERATION_NUMBER] = iteration_number;
212 
213  mpScheme->InitializeNonLinIteration(BaseType::GetModelPart(), mA, mDx, mb);
214 
215  is_converged = mpConvergenceCriteria->PreCriteria(BaseType::GetModelPart(), rDofSet, mA, mDx, mb);
216 
217  TSparseSpace::SetToZero(mA);
218  TSparseSpace::SetToZero(mb);
219  TSparseSpace::SetToZero(mDxf);
220 
221  // Note: This is not so efficient, but I want to solve mA*mDxf=mf without losing mf
222  this->BuildWithDirichlet(mA, mDxf, mb);
223  noalias(mb) = mf;
224  mpBuilderAndSolver->SystemSolve(mA, mDxf, mb);
225 
226  TSparseSpace::SetToZero(mA);
227  TSparseSpace::SetToZero(mb);
228  TSparseSpace::SetToZero(mDxb);
229 
230  mpBuilderAndSolver->BuildAndSolve(mpScheme, BaseType::GetModelPart(), mA, mDxb, mb);
231 
232  DLambda = -TSparseSpace::Dot(mDxPred, mDxb) / TSparseSpace::Dot(mDxPred, mDxf);
233 
234  noalias(mDx) = mDxb + DLambda * mDxf;
235 
236  // Check solution before update
237  if (mNormxEquilibrium > 1.0e-10) {
238  NormDx = TSparseSpace::TwoNorm(mDx);
239 
240  if ((NormDx / mNormxEquilibrium) > 1.0e3 ||
241  (std::abs(DLambda) / std::abs(mLambda - mDLambdaStep)) > 1.0e3) {
242  is_converged = false;
243  break;
244  }
245  }
246 
247  // update results
248  mDLambdaStep += DLambda;
249  mLambda += DLambda;
250  noalias(mDxStep) += mDx;
251  this->Update(rDofSet, mA, mDx, mb);
252 
253  // move the mesh if needed
255 
256  mpScheme->FinalizeNonLinIteration(BaseType::GetModelPart(), mA, mDx, mb);
257 
258  // *** Check Convergence ***
259  if (is_converged) {
260  if (mpConvergenceCriteria->GetActualizeRHSflag()) {
261  TSparseSpace::SetToZero(mb);
263  }
264  is_converged =
265  mpConvergenceCriteria->PostCriteria(BaseType::GetModelPart(), rDofSet, mA, mDx, mb);
266  }
267 
268  } // While
269 
270  // Check iteration_number
271  if (iteration_number >= mMaxIterationNumber) {
272  is_converged = true;
273  // plots a warning if the maximum number of iterations is exceeded
274  if (BaseType::GetModelPart().GetCommunicator().MyPID() == 0) {
275  this->MaxIterationsExceeded();
276  }
277  }
278 
279  // calculate reactions if required
281  mpBuilderAndSolver->CalculateReactions(mpScheme, BaseType::GetModelPart(), mA, mDx, mb);
282  }
283 
284  BaseType::GetModelPart().GetProcessInfo()[IS_CONVERGED] = is_converged;
285 
286  return is_converged;
287  }
288 
289  void FinalizeSolutionStep() override
290  {
291  KRATOS_TRY
292 
293  unsigned int iteration_number = BaseType::GetModelPart().GetProcessInfo()[NL_ITERATION_NUMBER];
294 
295  // Update the radius
296  mRadius = mRadius * sqrt(double(mDesiredIterations) / double(iteration_number));
297 
298  DofsArrayType& rDofSet = mpBuilderAndSolver->GetDofSet();
299  TSystemMatrixType& mA = *mpA;
300  TSystemVectorType& mDx = *mpDx;
302 
303  if (BaseType::GetModelPart().GetProcessInfo()[IS_CONVERGED]) {
304  // Modify the radius to advance faster when convergence is achieved
307 
308  // Update Norm of x
310  } else {
311  std::cout << "************ NO CONVERGENCE: restoring equilibrium path ************" << std::endl;
312 
313  TSystemVectorType& mDxStep = *mpDxStep;
314 
315  // update results
317  noalias(mDx) = -mDxStep;
318  this->Update(rDofSet, mA, mDx, mb);
319 
320  // move the mesh if needed
322  }
323 
324  BaseType::GetModelPart().GetProcessInfo()[ARC_LENGTH_LAMBDA] = mLambda;
325  BaseType::GetModelPart().GetProcessInfo()[ARC_LENGTH_RADIUS_FACTOR] = mRadius / mRadius_0;
326 
327  mpScheme->FinalizeSolutionStep(BaseType::GetModelPart(), mA, mDx, mb);
328  mpBuilderAndSolver->FinalizeSolutionStep(BaseType::GetModelPart(), mA, mDx, mb);
329 
330  // Cleaning memory after the solution
331  mpScheme->Clean();
332 
333  if (mReformDofSetAtEachStep) // deallocate the systemvectors
334  {
335  this->ClearStep();
336  }
337 
338  KRATOS_CATCH("")
339  }
340 
341  void Clear() override
342  {
343  KRATOS_TRY
344 
350 
351  TSystemVectorType& mf = *mpf;
352  TSystemVectorType& mDxf = *mpDxf;
353  TSystemVectorType& mDxb = *mpDxb;
354  TSystemVectorType& mDxPred = *mpDxPred;
355  TSystemVectorType& mDxStep = *mpDxStep;
356 
358  SparseSpaceType::Resize(mDxf, 0);
359  SparseSpaceType::Resize(mDxb, 0);
360  SparseSpaceType::Resize(mDxPred, 0);
361  SparseSpaceType::Resize(mDxStep, 0);
362 
364 
365  KRATOS_CATCH("")
366  }
367 
368  //----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
369  // bool IsConverged() override
370  // {
371  // KRATOS_TRY
372  // KRATOS_INFO("Arc-Length:IsConverged()") << std::endl;
373 
374  // bool IsConverged = true;
375 
376  // // Note: Initialize() needs to be called beforehand
377 
378  // this->InitializeSolutionStep();
379 
380  // this->Predict();
381 
382  // // Solve the problem with constant load
383  // IsConverged = this->CheckConvergence();
384 
385  // this->FinalizeSolutionStep();
386 
387  // return IsConverged;
388 
389  // KRATOS_CATCH("")
390  // }
391 
392  virtual void UpdateLoads()
393  {
394  KRATOS_TRY
395 
396  mLambda = BaseType::GetModelPart().GetProcessInfo()[ARC_LENGTH_LAMBDA];
397  mRadius = (BaseType::GetModelPart().GetProcessInfo()[ARC_LENGTH_RADIUS_FACTOR]) * mRadius_0;
398 
399  // Update External Loads
400  this->UpdateExternalLoads();
401 
402  KRATOS_CATCH("")
403  }
404 
405 protected:
412 
413  unsigned int mDesiredIterations;
414 
416 
419  double mRadius, mRadius_0;
422  double mDLambdaStep;
423 
424  int Check() override
425  {
426  KRATOS_TRY
427 
428  return MotherType::Check();
429 
430  KRATOS_CATCH("")
431  }
432 
434  {
435  if (pv == nullptr) {
437  pv.swap(pNewv);
438  }
439 
440  TSystemVectorType& v = *pv;
441 
442  if (v.size() != mpBuilderAndSolver->GetEquationSystemSize())
443  v.resize(mpBuilderAndSolver->GetEquationSystemSize(), false);
444  }
445 
447  {
448  if (pv == nullptr) {
450  pv.swap(pNewv);
451  }
452 
453  TSystemVectorType& v = *pv;
454 
455  if (v.size() != mpBuilderAndSolver->GetEquationSystemSize())
456  v.resize(mpBuilderAndSolver->GetEquationSystemSize(), true);
457  }
458 
460  {
461  KRATOS_TRY
462 
464  mpBuilderAndSolver->ApplyDirichletConditions(mpScheme, BaseType::GetModelPart(), mA, mDx, mb);
465 
466  KRATOS_CATCH("")
467  }
468 
470  {
471  KRATOS_TRY
472 
473  // Update scheme
474  mpScheme->Update(BaseType::GetModelPart(), rDofSet, mA, mDx, mb);
475 
476  // Update External Loads
477  this->UpdateExternalLoads();
478 
479  KRATOS_CATCH("")
480  }
481 
482  void ClearStep()
483  {
484  KRATOS_TRY
485 
486  SparseSpaceType::Clear(mpDxf);
490 
491  TSystemVectorType& mDxf = *mpDxf;
492  TSystemVectorType& mDxb = *mpDxb;
493  TSystemVectorType& mDxPred = *mpDxPred;
494  TSystemVectorType& mDxStep = *mpDxStep;
495 
496  SparseSpaceType::Resize(mDxf, 0);
497  SparseSpaceType::Resize(mDxb, 0);
498  SparseSpaceType::Resize(mDxPred, 0);
499  SparseSpaceType::Resize(mDxStep, 0);
500 
502 
503  KRATOS_CATCH("")
504  }
505 
507  {
508  // Update External Loads
509  for (unsigned int i = 0; i < mVariableNames.size(); i++) {
510  ModelPart& rSubModelPart = *(mSubModelPartList[i]);
511  const std::string& VariableName = mVariableNames[i];
512 
513  if (KratosComponents<Variable<double>>::Has(VariableName)) {
514  const Variable<double>& var = KratosComponents<Variable<double>>::Get(VariableName);
515 
516 #pragma omp parallel
517  {
518  ModelPart::NodeIterator NodesBegin;
519  ModelPart::NodeIterator NodesEnd;
520  OpenMPUtils::PartitionedIterators(rSubModelPart.Nodes(), NodesBegin, NodesEnd);
521 
522  for (ModelPart::NodeIterator itNode = NodesBegin; itNode != NodesEnd; ++itNode) {
523  double& rvalue = itNode->FastGetSolutionStepValue(var);
524  rvalue *= (mLambda / mLambda_old);
525  }
526  }
527  } else if (KratosComponents<Variable<array_1d<double, 3>>>::Has(VariableName)) {
528  typedef Variable<double> component_type;
529  const component_type& varx =
530  KratosComponents<component_type>::Get(VariableName + std::string("_X"));
531  const component_type& vary =
532  KratosComponents<component_type>::Get(VariableName + std::string("_Y"));
533  const component_type& varz =
534  KratosComponents<component_type>::Get(VariableName + std::string("_Z"));
535 
536 #pragma omp parallel
537  {
538  ModelPart::NodeIterator NodesBegin;
539  ModelPart::NodeIterator NodesEnd;
540  OpenMPUtils::PartitionedIterators(rSubModelPart.Nodes(), NodesBegin, NodesEnd);
541 
542  for (ModelPart::NodeIterator itNode = NodesBegin; itNode != NodesEnd; ++itNode) {
543  double& rvaluex = itNode->FastGetSolutionStepValue(varx);
544  rvaluex *= mLambda / mLambda_old;
545  double& rvaluey = itNode->FastGetSolutionStepValue(vary);
546  rvaluey *= mLambda / mLambda_old;
547  double& rvaluez = itNode->FastGetSolutionStepValue(varz);
548  rvaluez *= mLambda / mLambda_old;
549  }
550  }
551  } else {
553  << "One variable of the applied loads has a non supported type. Variable: " << VariableName
554  << std::endl;
555  }
556  }
557 
558  // Save the applied Lambda factor
560  }
561 }; // Class GeoMechanicsRammArcLengthStrategy
562 
563 } // namespace Kratos
Current class provides an implementation for the base builder and solving operations.
Definition: builder_and_solver.h:64
This is the base class to define the different convergence criterion considered.
Definition: convergence_criteria.h:58
Definition: geo_mechanics_newton_raphson_strategy.hpp:31
std::vector< std::string > mVariableNames
List of every SubModelPart associated to an external load.
Definition: geo_mechanics_newton_raphson_strategy.hpp:124
double CalculateReferenceDofsNorm(DofsArrayType &rDofSet)
Definition: geo_mechanics_newton_raphson_strategy.hpp:135
std::vector< ModelPart * > mSubModelPartList
Member Variables.
Definition: geo_mechanics_newton_raphson_strategy.hpp:123
int Check() override
Name of the nodal variable associated to every SubModelPart.
Definition: geo_mechanics_newton_raphson_strategy.hpp:126
Definition: geo_mechanics_ramm_arc_length_strategy.hpp:28
double mLambda_old
Definition: geo_mechanics_ramm_arc_length_strategy.hpp:420
bool mInitializeArcLengthWasPerformed
This is used to calculate the radius of the next step.
Definition: geo_mechanics_ramm_arc_length_strategy.hpp:415
TSystemVectorPointerType mpf
Member Variables.
Definition: geo_mechanics_ramm_arc_length_strategy.hpp:407
double mNormxEquilibrium
Loading factor.
Definition: geo_mechanics_ramm_arc_length_strategy.hpp:421
double mRadius
Used to limit the radius of the arc length strategy.
Definition: geo_mechanics_ramm_arc_length_strategy.hpp:419
unsigned int mMaxIterationNumber
Definition: residualbased_newton_raphson_strategy.h:1261
void SaveInitializeSystemVector(TSystemVectorPointerType &pv)
Definition: geo_mechanics_ramm_arc_length_strategy.hpp:446
TSystemVectorPointerType mpDxf
Vector of reference external forces.
Definition: geo_mechanics_ramm_arc_length_strategy.hpp:408
double mRadius_0
Definition: geo_mechanics_ramm_arc_length_strategy.hpp:419
void BuildWithDirichlet(TSystemMatrixType &mA, TSystemVectorType &mDx, TSystemVectorType &mb)
Definition: geo_mechanics_ramm_arc_length_strategy.hpp:459
TSystemVectorPointerType mpb
The increment in the solution.
Definition: residualbased_newton_raphson_strategy.h:1237
TSystemVectorPointerType mpDxb
Delta x of A*Dxf=f.
Definition: geo_mechanics_ramm_arc_length_strategy.hpp:409
void UpdateExternalLoads()
Definition: geo_mechanics_ramm_arc_length_strategy.hpp:506
bool SolveSolutionStep() override
Solves the current step. This function returns true if a solution has been found, false otherwise.
Definition: geo_mechanics_ramm_arc_length_strategy.hpp:153
double mDLambdaStep
Norm of the solution vector in equilibrium.
Definition: geo_mechanics_ramm_arc_length_strategy.hpp:422
void InitializeSystemVector(TSystemVectorPointerType &pv)
Definition: geo_mechanics_ramm_arc_length_strategy.hpp:433
void Clear() override
Clears the internal storage.
Definition: geo_mechanics_ramm_arc_length_strategy.hpp:341
TSystemVectorPointerType mpDxPred
Delta x of A*Dxb=b.
Definition: geo_mechanics_ramm_arc_length_strategy.hpp:410
void InitializeSolutionStep() override
Performs all the required operations that should be done (for each step) before solving the solution ...
Definition: geo_mechanics_ramm_arc_length_strategy.hpp:138
int Check() override
Delta lambda of the current step.
Definition: geo_mechanics_ramm_arc_length_strategy.hpp:424
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 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
double mMaxRadiusFactor
Definition: geo_mechanics_ramm_arc_length_strategy.hpp:417
double mLambda
Radius of the arc length strategy.
Definition: geo_mechanics_ramm_arc_length_strategy.hpp:420
TSchemeType::Pointer mpScheme
Definition: residualbased_newton_raphson_strategy.h:1232
GeoMechanicsRammArcLengthStrategy(ModelPart &model_part, typename TSchemeType::Pointer pScheme, typename TLinearSolver::Pointer pNewLinearSolver, typename TConvergenceCriteriaType::Pointer pNewConvergenceCriteria, typename TBuilderAndSolverType::Pointer pNewBuilderAndSolver, Parameters &rParameters, int MaxIterations=30, bool CalculateReactions=false, bool ReformDofSetAtEachStep=false, bool MoveMeshFlag=false)
Definition: geo_mechanics_ramm_arc_length_strategy.hpp:56
TSystemVectorPointerType mpDxStep
Delta x of prediction phase.
Definition: geo_mechanics_ramm_arc_length_strategy.hpp:411
KRATOS_CLASS_POINTER_DEFINITION(GeoMechanicsRammArcLengthStrategy)
virtual void UpdateLoads()
Definition: geo_mechanics_ramm_arc_length_strategy.hpp:392
void ClearStep()
Definition: geo_mechanics_ramm_arc_length_strategy.hpp:482
void FinalizeSolutionStep() override
Performs all the required operations that should be done (for each step) after solving the solution s...
Definition: geo_mechanics_ramm_arc_length_strategy.hpp:289
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
virtual void Update(DofsArrayType &rDofSet, TSystemMatrixType &mA, TSystemVectorType &mDx, TSystemVectorType &mb)
Definition: geo_mechanics_ramm_arc_length_strategy.hpp:469
double mMinRadiusFactor
Definition: geo_mechanics_ramm_arc_length_strategy.hpp:418
unsigned int mDesiredIterations
Delta x of the current step.
Definition: geo_mechanics_ramm_arc_length_strategy.hpp:413
bool mReformDofSetAtEachStep
The LHS matrix of the system of equations.
Definition: residualbased_newton_raphson_strategy.h:1247
void Initialize() override
Initialization of member variables and prior operations.
Definition: geo_mechanics_ramm_arc_length_strategy.hpp:83
typename BaseType::TSystemVectorPointerType TSystemVectorPointerType
Definition: geo_mechanics_ramm_arc_length_strategy.hpp:42
typename BaseType::TSystemVectorType TSystemVectorType
Definition: geo_mechanics_ramm_arc_length_strategy.hpp:41
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::DofsArrayType DofsArrayType
Definition: implicit_solving_strategy.h:90
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
This is the base Newton Raphson strategy.
Definition: residualbased_newton_raphson_strategy.h:66
TSparseSpace SparseSpaceType
Definition: residualbased_newton_raphson_strategy.h:85
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
void Initialize() override
Initialization of member variables and prior operations.
Definition: residualbased_newton_raphson_strategy.h:672
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
bool mReformDofSetAtEachStep
The LHS matrix of the system of equations.
Definition: residualbased_newton_raphson_strategy.h:1247
This class provides the implementation of the basic tasks that are needed by the solution strategy.
Definition: scheme.h:56
Solving strategy base class This is the base class from which we will derive all the strategies (impl...
Definition: solving_strategy.h:64
ModelPart & GetModelPart()
Operations to get the pointer to the model.
Definition: solving_strategy.h:350
bool MoveMeshFlag()
This function returns the flag that says if the mesh is moved.
Definition: solving_strategy.h:290
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_CATCH(MoreInfo)
Definition: define.h:110
#define KRATOS_TRY
Definition: define.h:109
#define KRATOS_ERROR
Definition: exception.h:161
#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