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.
arc_length_strategy.h
Go to the documentation of this file.
1 // | / |
2 // ' / __| _` | __| _ \ __|
3 // . \ | ( | | ( |\__ \.
4 // _|\_\_| \__,_|\__|\___/ ____/
5 // Multi-Physics
6 //
7 // License: BSD License
8 // Kratos default license: kratos/license.txt
9 //
10 // Main authors: Alejandro Cornejo
11 // Ignasi Pouplana
12 //
13 
14 #if !defined(KRATOS_ARC_LENGTH_STRATEGY)
15 #define KRATOS_ARC_LENGTH_STRATEGY
16 
17 // System includes
18 #include <iostream>
19 
20 // External includes
21 
22 // Project includes
23 #include "includes/define.h"
27 
28 namespace Kratos
29 {
30 
33 
37 
39 
42 
46 
50 
59 template <class TSparseSpace, class TDenseSpace, class TLinearSolver>
61  : public ResidualBasedNewtonRaphsonStrategy<TSparseSpace, TDenseSpace, TLinearSolver>
62 {
63  public:
66 
67  // Counted pointer of ClassName
69 
72  typedef typename BaseType::TDataType TDataType;
73  typedef TSparseSpace SparseSpaceType;
83 
87 
88  // Constructor
91  typename TSchemeType::Pointer pScheme,
92  typename TConvergenceCriteriaType::Pointer pNewConvergenceCriteria,
93  typename TBuilderAndSolverType::Pointer pNewBuilderAndSolver,
94  Parameters ThisParameters
95  ) : ResidualBasedNewtonRaphsonStrategy<TSparseSpace, TDenseSpace, TLinearSolver>(model_part, pScheme,
96  pNewConvergenceCriteria, pNewBuilderAndSolver, ThisParameters["max_iteration"].GetInt(),
97  ThisParameters["compute_reactions"].GetBool(), ThisParameters["reform_dofs_at_each_step"].GetBool(),
98  ThisParameters["move_mesh_flag"].GetBool())
99  {
100  ThisParameters = this->ValidateAndAssignParameters(ThisParameters, this->GetDefaultParameters());
101  AssignSettings(ThisParameters);
102  }
103 
108  ~ArcLengthStrategy() override = default;
109 
110 
115  void AssignSettings(const Parameters ThisParameters) override
116  {
117  ModelPart& r_model_part = BaseType::GetModelPart();
118  BaseType::AssignSettings(ThisParameters);
119  mDesiredIterations = ThisParameters["desired_iterations"].GetInt();
120  mMaxRadiusFactor = ThisParameters["max_radius_factor"].GetDouble();
121  mMinRadiusFactor = ThisParameters["min_radius_factor"].GetDouble();
123 
124  // we initialize the list of load processes to be taken into account
125  if (ThisParameters["loads_sub_model_part_list"].size() > 0) {
126  mSubModelPartList.resize(ThisParameters["loads_sub_model_part_list"].size());
127  mVariableNames.resize(ThisParameters["loads_variable_list"].size());
128 
129  KRATOS_ERROR_IF(mSubModelPartList.size() != mVariableNames.size()) << "For each SubModelPart there must be a corresponding nodal Variable" << std::endl;
130 
131  const auto& r_sub_model_parts_names = ThisParameters["loads_sub_model_part_list"].GetStringArray();
132  for (std::size_t i = 0; i < mVariableNames.size(); i++) {
133  mSubModelPartList[i] = &( r_model_part.GetSubModelPart(r_sub_model_parts_names[i]));
134  mVariableNames[i] = ThisParameters["loads_variable_list"][i].GetString();
135  }
136  }
137  }
138 
142  void Initialize() override
143  {
144  KRATOS_TRY;
146  KRATOS_CATCH("");
147  }
148 
152  void Clear() override
153  {
154  KRATOS_TRY;
155 
161 
162  TSystemVectorType& mf = *mpf;
163  TSystemVectorType& mDxf = *mpDxf;
164  TSystemVectorType& mDxb = *mpDxb;
165  TSystemVectorType& mDxPred = *mpDxPred;
166  TSystemVectorType& mDxStep = *mpDxStep;
167 
169  SparseSpaceType::Resize(mDxf, 0);
170  SparseSpaceType::Resize(mDxb, 0);
171  SparseSpaceType::Resize(mDxPred, 0);
172  SparseSpaceType::Resize(mDxStep, 0);
173 
174  BaseType::Clear();
175 
176  KRATOS_CATCH("");
177  }
178 
183  void InitializeSolutionStep() override
184  {
185  KRATOS_TRY;
186 
188  ModelPart& r_model_part = BaseType::GetModelPart();
189  //set up the system
190  if (!this->mpBuilderAndSolver->GetDofSetIsInitializedFlag()) {
191  // Setting up the list of the DOFs to be solved
192  this->mpBuilderAndSolver->SetUpDofSet(this->mpScheme, r_model_part);
193 
194  // Shaping correctly the system
195  this->mpBuilderAndSolver->SetUpSystem(r_model_part);
196  }
197 
198  // Compute initial radius (mRadius_0)
199  this->mpBuilderAndSolver->ResizeAndInitializeVectors(this->mpScheme, this->mpA, this->mpDx, this->mpb, r_model_part);
200  TSystemMatrixType& rA = *(this->mpA);
201  TSystemVectorType& rDx = *(this->mpDx);
202  TSystemVectorType& rb = *(this->mpb);
203  TSparseSpace::SetToZero(rA);
204  TSparseSpace::SetToZero(rDx);
205  TSparseSpace::SetToZero(rb);
206 
207  this->mpBuilderAndSolver->BuildAndSolve(this->mpScheme, r_model_part, rA, rDx, rb);
208 
210  mRadius = mRadius_0;
211 
212  // Compute vector of reference external force (mf)
214  TSystemVectorType& rf = *mpf;
215  TSparseSpace::SetToZero(rf);
216 
217  // We build it now to only include external loads
218  this->mpBuilderAndSolver->BuildRHS(this->mpScheme, r_model_part, rf);
219 
220  //Initialize the loading factor Lambda
221  mLambda = 0.0;
222  mLambda_old = 1.0;
223 
224  // Initialize Norm of solution
225  mNormxEquilibrium = 0.0;
226 
228 
229  KRATOS_INFO_IF("ArcLengthStrategy", BaseType::GetEchoLevel() > 0) << "Strategy Initialized" << std::endl;
230  }
231 
238 
239  KRATOS_CATCH("");
240  }
241 
246  void FinalizeSolutionStep() override
247  {
248  KRATOS_TRY;
249 
250  ModelPart& r_model_part = BaseType::GetModelPart();
251 
252  const std::size_t iteration_number = r_model_part.GetProcessInfo()[NL_ITERATION_NUMBER];
253 
254  // Update the radius
255  mRadius = mRadius * std::sqrt(double(mDesiredIterations) / double(iteration_number));
258  } else if (mRadius < mMinRadiusFactor*mRadius_0) {
260  }
261 
263 
264  KRATOS_CATCH("");
265  }
266 
270  bool SolveSolutionStep() override
271  {
272  KRATOS_INFO_IF("ArcLengthStrategy", BaseType::GetEchoLevel() > 0) << "INITIAL ARC-LENGTH RADIUS: " << mRadius_0 << std::endl;
273  KRATOS_INFO_IF("ArcLengthStrategy", BaseType::GetEchoLevel() > 0) << "ARC-LENGTH RADIUS: " << mRadius/mRadius_0 << " X initial radius" << std::endl;
274  mInsideIterationLoop = false;
275 
276  ModelPart& r_model_part = BaseType::GetModelPart();
277 
278  // Initialize variables
279  DofsArrayType& r_dof_set = this->mpBuilderAndSolver->GetDofSet();
280  TSystemMatrixType& r_A = *(this->mpA);
281  TSystemVectorType& r_Dx = *(this->mpDx);
282  TSystemVectorType& r_b = *(this->mpb);
283  TSystemVectorType& r_f = *mpf;
284  TSystemVectorType& r_Dxb = *mpDxb;
285  TSystemVectorType& r_Dxf = *mpDxf;
286  TSystemVectorType& r_DxPred = *mpDxPred;
287  TSystemVectorType& r_DxStep = *mpDxStep;
288 
289  // Initialize iterations info
290  unsigned int iteration_number = 1;
291  r_model_part.GetProcessInfo()[NL_ITERATION_NUMBER] = iteration_number;
292 
293  this->mpScheme->InitializeNonLinIteration(r_model_part, r_A, r_Dx, r_b);
294  this->mpConvergenceCriteria->InitializeNonLinearIteration(r_model_part, r_dof_set, r_A, r_Dx, r_b);
295  bool is_converged = this->mpConvergenceCriteria->PreCriteria(r_model_part, r_dof_set, r_A, r_Dx, r_b);
296 
297  TSparseSpace::SetToZero(r_A);
298  TSparseSpace::SetToZero(r_b);
299  TSparseSpace::SetToZero(r_Dxf);
300 
301  // Now we compute Dxf
302  this->mpBuilderAndSolver->Build(this->mpScheme, r_model_part, r_A, r_b);
303  this->mpBuilderAndSolver->ApplyDirichletConditions(this->mpScheme, r_model_part, r_A, r_Dx, r_b);
304  TSparseSpace::Assign(r_b, 1.0, r_f);
305  this->mpBuilderAndSolver->SystemSolve(r_A, r_Dxf, r_b);
306  double lambda_increment = mRadius / TSparseSpace::TwoNorm(r_Dxf);
307  mDLambdaStep = lambda_increment;
308  mLambda += lambda_increment;
309 
310  KRATOS_INFO_IF("ArcLengthStrategy", BaseType::GetEchoLevel() > 0) << "ARC-LENGTH LAMBDA: " << mLambda << std::endl;
311 
312  TSparseSpace::InplaceMult(r_Dxf, lambda_increment);
313  TSparseSpace::Assign(r_DxPred, 1.0, r_Dxf);
314  TSparseSpace::Assign(r_DxStep, 1.0, r_DxPred);
315  TSparseSpace::InplaceMult(r_Dxf, 1.0 / lambda_increment);
316  UpdateDatabase(r_A, r_DxPred, r_b, BaseType::MoveMeshFlag());
317 
318  this->mpScheme->FinalizeNonLinIteration(r_model_part, r_A, r_DxPred, r_b);
319  this->mpConvergenceCriteria->FinalizeNonLinearIteration(r_model_part, r_dof_set, r_A, r_Dx, r_b);
320 
321  if (is_converged) {
322  if (this->mpConvergenceCriteria->GetActualizeRHSflag()) {
323  TSparseSpace::SetToZero(r_b);
324  this->mpBuilderAndSolver->BuildRHS(this->mpScheme, r_model_part, r_b);
325  }
326 
327  is_converged = this->mpConvergenceCriteria->PostCriteria(r_model_part, r_dof_set, r_A, r_Dxf, r_b);
328  }
329 
330  while (!is_converged && iteration_number++ < BaseType::mMaxIterationNumber) {
331  mInsideIterationLoop = true;
332  //setting the number of iteration
333  r_model_part.GetProcessInfo()[NL_ITERATION_NUMBER] = iteration_number;
334 
335  this->mpScheme->InitializeNonLinIteration(r_model_part, r_A, r_Dx, r_b);
336  this->mpConvergenceCriteria->InitializeNonLinearIteration(r_model_part, r_dof_set, r_A, r_Dx, r_b);
337  is_converged = this->mpConvergenceCriteria->PreCriteria(r_model_part, r_dof_set, r_A, r_Dx, r_b);
338 
339  TSparseSpace::SetToZero(r_A);
340  TSparseSpace::SetToZero(r_b);
341  TSparseSpace::SetToZero(r_Dxf);
342 
343  // We compute r_Dxf
344  this->mpBuilderAndSolver->Build(this->mpScheme, r_model_part, r_A, r_b);
345  this->mpBuilderAndSolver->ApplyDirichletConditions(this->mpScheme, r_model_part, r_A, r_Dxf, r_b);
346  TSparseSpace::Assign(r_b, 1.0, r_f);
347  this->mpBuilderAndSolver->SystemSolve(r_A, r_Dxf, r_b);
348 
349  TSparseSpace::SetToZero(r_A);
350  TSparseSpace::SetToZero(r_b);
351  TSparseSpace::SetToZero(r_Dxb);
352 
353  this->mpBuilderAndSolver->BuildAndSolve(this->mpScheme, r_model_part, r_A, r_Dxb, r_b);
354  lambda_increment = -TSparseSpace::Dot(r_DxPred, r_Dxb) / TSparseSpace::Dot(r_DxPred, r_Dxf);
355  TSparseSpace::Assign(r_Dx, 1.0, r_Dxb + lambda_increment*r_Dxf);
356 
357  // Update results
358  mDLambdaStep += lambda_increment;
359  mLambda += lambda_increment;
360  TSparseSpace::UnaliasedAdd(r_DxStep, 1.0, r_Dx);
361  UpdateDatabase(r_A, r_Dx, r_b, BaseType::MoveMeshFlag());
362 
363  this->mpScheme->FinalizeNonLinIteration(r_model_part, r_A, r_Dx, r_b);
364  this->mpConvergenceCriteria->FinalizeNonLinearIteration(r_model_part, r_dof_set, r_A, r_Dx, r_b);
365 
366  if (is_converged) {
367  if (this->mpConvergenceCriteria->GetActualizeRHSflag()) {
368  TSparseSpace::SetToZero(r_b);
369  this->mpBuilderAndSolver->BuildRHS(this->mpScheme, r_model_part, r_b);
370  }
371  is_converged = this->mpConvergenceCriteria->PostCriteria(r_model_part, r_dof_set, r_A, r_Dx, r_b);
372  }
373  }
374  // Prints a warning if the maximum number of iterations is exceeded
375  if (iteration_number >= BaseType::mMaxIterationNumber) {
377  } else {
378  KRATOS_INFO_IF("Arc-Length Strategy", this->GetEchoLevel() > 0)
379  << "Convergence achieved after " << iteration_number << " / "
380  << BaseType::mMaxIterationNumber << " iterations" << std::endl;
381  }
382  //calculate reactions if required
384  this->mpBuilderAndSolver->CalculateReactions(this->mpScheme, r_model_part, r_A, r_Dx, r_b);
385  return is_converged;
386  }
387 
392  {
393  // Update External Loads
394  for (unsigned int i = 0; i < mVariableNames.size(); i++) {
395  ModelPart& r_sub_model_part = *(mSubModelPartList[i]);
396  const std::string& r_variable_name = mVariableNames[i];
397 
398  if (KratosComponents<Variable<double>>::Has(r_variable_name)) {
399  const Variable<double>& var = KratosComponents<Variable<double>>::Get(r_variable_name);
400  block_for_each(r_sub_model_part.Nodes(), [&](Node& r_node){
401  r_node.FastGetSolutionStepValue(var) *= (mLambda/mLambda_old);
402  });
403  } else if (KratosComponents<Variable<array_1d<double,3>>>::Has(r_variable_name)) {
404  typedef Variable<array_1d<double,3>> array_type;
405  const array_type& r_var = KratosComponents<array_type>::Get(r_variable_name);
406 
407  block_for_each(r_sub_model_part.Conditions(), [&](Condition& r_condition) {
408  /* we are multipying by Lambda instead of Lambda/Lambda_old because
409  the load processes reset the loads to its initial values
410  when the InitSolStep is called */
411  if (mInsideIterationLoop)
412  r_condition.GetValue(r_var) *= mLambda / mLambda_old;
413  else
414  r_condition.GetValue(r_var) *= mLambda;
415  });
416 
417  // TODO-> add for node loads
418 
419  } else {
420  KRATOS_ERROR << "One variable of the applied loads has a non supported type. Variable: " << r_variable_name << std::endl;
421  }
422  }
423 
424  // Save the applied Lambda factor
426  }
427 
433  {
434  Parameters default_parameters = Parameters(R"(
435  {
436  "name" : "arc_length_strategy",
437  "desired_iterations" : 4,
438  "max_radius_factor" : 10.0,
439  "min_radius_factor" : 0.1,
440  "loads_sub_model_part_list" : [],
441  "loads_variable_list" : []
442  })");
443 
444  // Getting base class default parameters
445  const Parameters base_default_parameters = BaseType::GetDefaultParameters();
446  default_parameters.RecursivelyAddMissingParameters(base_default_parameters);
447  return default_parameters;
448  }
449 
454  static std::string Name()
455  {
456  return "arc_length_strategy";
457  }
458 
463  {
464  if (!pv) {
466  pv.swap(pNewv);
467  }
468 
469  TSystemVectorType& v = *pv;
470 
471  if (v.size() != this->mpBuilderAndSolver->GetEquationSystemSize())
472  v.resize(this->mpBuilderAndSolver->GetEquationSystemSize(), false);
473  }
474 
478  void SaveInitializeSystemVector(TSystemVectorPointerType& pv)
479  {
480  if (!pv) {
482  pv.swap(pNewv);
483  }
484  TSystemVectorType& v = *pv;
485  if (v.size() != this->mpBuilderAndSolver->GetEquationSystemSize())
486  v.resize(this->mpBuilderAndSolver->GetEquationSystemSize(), true);
487  }
488 
491 
493 
497 
500 
502 
506 
510 
512  std::string Info() const override
513  {
514  return "ArcLengthStrategy";
515  }
516 
518  void PrintInfo(std::ostream& rOStream) const override
519  {
520  rOStream << Info();
521  }
522 
524  void PrintData(std::ostream& rOStream) const override
525  {
526  rOStream << Info();
527  }
528 
532 
534 
535  private:
538 
542 
546 
550 
554 
558 
562 
564 
565  protected:
568 
572 
578 
579  unsigned int mDesiredIterations;
580 
583 
585  double mRadius, mRadius_0;
588  double mDLambdaStep;
589 
590  std::vector<ModelPart*> mSubModelPartList;
591  std::vector<std::string> mVariableNames;
592 
593 
597 
606  TSystemMatrixType& rA,
607  TSystemVectorType& rDx,
608  TSystemVectorType& rb,
609  const bool MoveMesh) override
610  {
611  BaseType::UpdateDatabase(rA, rDx, rb, MoveMesh);
613  }
614 
615 
620  void MaxIterationsExceeded() override
621  {
622  KRATOS_INFO_IF("ARC-LENGTH Strategy", this->GetEchoLevel() > 0) << "ATTENTION: max iterations ("<< this->mMaxIterationNumber <<") exceeded!" << std::endl;
623  }
624 
628 
632 
636 
640 
646 
648 
649 }; /* Class ArcLengthStrategy */
650 
652 
655 
657 
658 } /* namespace Kratos. */
659 
660 #endif /* KRATOS_ARC_LENGTH_STRATEGY defined */
This is the base ArcLengthStrategy.
Definition: arc_length_strategy.h:62
void MaxIterationsExceeded() override
This method prints information after reach the max number of iterations.
Definition: arc_length_strategy.h:620
void FinalizeSolutionStep() override
Performs all the required operations that should be done (for each step) after solving the solution s...
Definition: arc_length_strategy.h:246
bool SolveSolutionStep() override
Solves the current step. This function returns true if a solution has been found, false otherwise.
Definition: arc_length_strategy.h:270
void InitializeSolutionStep() override
Performs all the required operations that should be done (for each step) before solving the solution ...
Definition: arc_length_strategy.h:183
void Clear() override
Clears the internal storage.
Definition: arc_length_strategy.h:152
ResidualBasedNewtonRaphsonStrategy< TSparseSpace, TDenseSpace, TLinearSolver > BaseType
Definition: arc_length_strategy.h:70
void UpdateExternalLoads()
This method updates the value of the external load according to the new load factor Lambda.
Definition: arc_length_strategy.h:391
void SaveInitializeSystemVector(TSystemVectorPointerType &pv)
It saves system vector pointer.
Definition: arc_length_strategy.h:478
BaseType::LocalSystemVectorType LocalSystemVectorType
Definition: arc_length_strategy.h:79
BaseType::TSystemVectorPointerType TSystemVectorPointerType
Definition: arc_length_strategy.h:82
void Initialize() override
Initialization of member variables and prior operations.
Definition: arc_length_strategy.h:142
BaseType::TSchemeType TSchemeType
Definition: arc_length_strategy.h:74
TSystemVectorPointerType mpf
Definition: arc_length_strategy.h:573
void UpdateDatabase(TSystemMatrixType &rA, TSystemVectorType &rDx, TSystemVectorType &rb, const bool MoveMesh) override
Here the database is updated.
Definition: arc_length_strategy.h:605
BaseType::TBuilderAndSolverType TBuilderAndSolverType
Definition: arc_length_strategy.h:71
BaseType::TDataType TDataType
Definition: arc_length_strategy.h:72
std::vector< std::string > mVariableNames
List of SubModelParts associated to an external load.
Definition: arc_length_strategy.h:591
double mMaxRadiusFactor
Definition: arc_length_strategy.h:584
~ArcLengthStrategy() override=default
Destructor.
TSystemVectorPointerType mpDxStep
Delta x of prediction phase.
Definition: arc_length_strategy.h:577
ArcLengthStrategy(ModelPart &model_part, typename TSchemeType::Pointer pScheme, typename TConvergenceCriteriaType::Pointer pNewConvergenceCriteria, typename TBuilderAndSolverType::Pointer pNewBuilderAndSolver, Parameters ThisParameters)
Definition: arc_length_strategy.h:89
BaseType::TSystemMatrixType TSystemMatrixType
Definition: arc_length_strategy.h:77
double mLambda_old
Definition: arc_length_strategy.h:586
double mRadius
Used to limit the radius of the arc length strategy.
Definition: arc_length_strategy.h:585
TSparseSpace SparseSpaceType
Definition: arc_length_strategy.h:73
TSystemVectorPointerType mpDxf
Vector of reference external forces.
Definition: arc_length_strategy.h:574
void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: arc_length_strategy.h:524
static std::string Name()
Returns the name of the class as used in the settings (snake_case format)
Definition: arc_length_strategy.h:454
ArcLengthStrategy(const ArcLengthStrategy &Other)
Definition: arc_length_strategy.h:645
TSystemVectorPointerType mpDxPred
Delta x of A*Dxb=b.
Definition: arc_length_strategy.h:576
std::string Info() const override
Turn back information as a string.
Definition: arc_length_strategy.h:512
bool mInsideIterationLoop
Definition: arc_length_strategy.h:582
double mLambda
Radius of the arc length strategy.
Definition: arc_length_strategy.h:586
BaseType::DofsArrayType DofsArrayType
Definition: arc_length_strategy.h:76
double mNormxEquilibrium
current and old loading factor
Definition: arc_length_strategy.h:587
double mDLambdaStep
Norm of the solution vector in equilibrium.
Definition: arc_length_strategy.h:588
bool mInitializeArcLengthWasPerformed
This is used to calculate the radius of the next step.
Definition: arc_length_strategy.h:581
void AssignSettings(const Parameters ThisParameters) override
This method assigns settings to member variables.
Definition: arc_length_strategy.h:115
unsigned int mDesiredIterations
Delta x of the current step.
Definition: arc_length_strategy.h:579
BaseType::LocalSystemMatrixType LocalSystemMatrixType
Definition: arc_length_strategy.h:80
BaseType::TSystemVectorType TSystemVectorType
Definition: arc_length_strategy.h:78
double mMinRadiusFactor
Definition: arc_length_strategy.h:584
void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: arc_length_strategy.h:518
KRATOS_CLASS_POINTER_DEFINITION(ArcLengthStrategy)
double mRadius_0
Definition: arc_length_strategy.h:585
std::vector< ModelPart * > mSubModelPartList
Delta lambda of the current step.
Definition: arc_length_strategy.h:590
void InitializeSystemVector(TSystemVectorPointerType &pv)
It resizes and initializes a system vector.
Definition: arc_length_strategy.h:462
Parameters GetDefaultParameters() const override
This method provides the defaults parameters to avoid conflicts between the different constructors.
Definition: arc_length_strategy.h:432
BaseType::TSystemMatrixPointerType TSystemMatrixPointerType
Definition: arc_length_strategy.h:81
TSystemVectorPointerType mpDxb
Delta x of A*Dxf=f.
Definition: arc_length_strategy.h:575
BaseType::TConvergenceCriteriaType TConvergenceCriteriaType
Definition: arc_length_strategy.h:75
Base class for all Conditions.
Definition: condition.h:59
This is the base class to define the different convergence criterion considered.
Definition: convergence_criteria.h:58
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
ConditionsContainerType & Conditions(IndexType ThisIndex=0)
Definition: model_part.h:1381
ProcessInfo & GetProcessInfo()
Definition: model_part.h:1746
ModelPart & GetSubModelPart(std::string const &SubModelPartName)
Definition: model_part.cpp:2029
NodesContainerType & Nodes(IndexType ThisIndex=0)
Definition: model_part.h:507
This class defines the node.
Definition: node.h:65
This class provides to Kratos a data structure for I/O based on the standard of JSON.
Definition: kratos_parameters.h:59
std::vector< std::string > GetStringArray() const
This method returns the array of strings in the current Parameter.
Definition: kratos_parameters.cpp:693
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
void RecursivelyAddMissingParameters(const Parameters &rDefaultParameters)
This function is designed to verify that the parameters under testing contain at least all parameters...
Definition: kratos_parameters.cpp:1457
std::string GetString() const
This method returns the string contained in the current Parameter.
Definition: kratos_parameters.cpp:684
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
BaseType::LocalSystemMatrixType LocalSystemMatrixType
Definition: residualbased_newton_raphson_strategy.h:97
virtual void UpdateDatabase(TSystemMatrixType &rA, TSystemVectorType &rDx, TSystemVectorType &rb, const bool MoveMesh)
Here the database is updated.
Definition: residualbased_newton_raphson_strategy.h:1278
BaseType::TDataType TDataType
Definition: residualbased_newton_raphson_strategy.h:83
unsigned int mMaxIterationNumber
Definition: residualbased_newton_raphson_strategy.h:1261
BaseType::TSystemVectorType TSystemVectorType
Definition: residualbased_newton_raphson_strategy.h:93
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
bool mCalculateReactionsFlag
Flag telling if it is needed or not to compute the reactions.
Definition: residualbased_newton_raphson_strategy.h:1253
Parameters GetDefaultParameters() const override
This method provides the defaults parameters to avoid conflicts between the different constructors.
Definition: residualbased_newton_raphson_strategy.h:1069
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
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 AssignSettings(const Parameters ThisParameters) override
This method assigns settings to member variables.
Definition: residualbased_newton_raphson_strategy.h:1351
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
BaseType::TBuilderAndSolverType TBuilderAndSolverType
Definition: residualbased_newton_raphson_strategy.h:81
BaseType::TSystemMatrixType TSystemMatrixType
Definition: residualbased_newton_raphson_strategy.h:91
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
BaseType::TSystemVectorPointerType TSystemVectorPointerType
Definition: residualbased_newton_raphson_strategy.h:101
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
BaseType::LocalSystemVectorType LocalSystemVectorType
Definition: residualbased_newton_raphson_strategy.h:95
BaseType::TSystemMatrixPointerType TSystemMatrixPointerType
Definition: residualbased_newton_raphson_strategy.h:99
ModelPart & GetModelPart()
Operations to get the pointer to the model.
Definition: solving_strategy.h:350
virtual Parameters ValidateAndAssignParameters(Parameters ThisParameters, const Parameters DefaultParameters) const
This method validate and assign default parameters.
Definition: solving_strategy.h:507
int GetEchoLevel()
This returns the level of echo for the solving strategy.
Definition: solving_strategy.h:271
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_ERROR_IF(conditional)
Definition: exception.h:162
#define KRATOS_INFO_IF(label, conditional)
Definition: logger.h:251
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
double Dot(SparseSpaceType &dummy, SparseSpaceType::VectorType &rX, SparseSpaceType::VectorType &rY)
Definition: add_strategies_to_python.cpp:85
void UnaliasedAdd(TSpaceType &dummy, typename TSpaceType::VectorType &x, const double A, const typename TSpaceType::VectorType &rY)
Definition: add_strategies_to_python.cpp:170
void Assign(const Expression &rExpression, const IndexType EntityIndex, const IndexType EntityDataBeginIndex, TDataType &rValue, std::index_sequence< TIndex... >)
Definition: variable_expression_data_io.cpp:41
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
void block_for_each(TIterator itBegin, TIterator itEnd, TFunction &&rFunction)
Execute a functor on all items of a range in parallel.
Definition: parallel_utilities.h:299
model_part
Definition: face_heat.py:14
v
Definition: generate_convection_diffusion_explicit_element.py:114
integer i
Definition: TensorModule.f:17