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.
mpm_residual_based_bossak_scheme.hpp
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: Ilaria Iaconeta, Bodhinanda Chandra
11 //
12 //
13 
14 
15 #if !defined(KRATOS_MPM_RESIDUAL_BASED_BOSSAK_SCHEME )
16 #define KRATOS_MPM_RESIDUAL_BASED_BOSSAK_SCHEME
17 
18 /* System includes */
19 
20 /* External includes */
21 
22 /* Project includes */
23 #include "includes/define.h"
24 #include "includes/model_part.h"
25 #include "includes/variables.h"
26 #include "includes/element.h"
27 #include "containers/array_1d.h"
32 
33 namespace Kratos
34 {
35 
48 template<class TSparseSpace, class TDenseSpace >
50  : public ResidualBasedBossakDisplacementScheme<TSparseSpace,TDenseSpace>
51 {
52 public:
56 
58 
60 
62 
64 
66 
68 
70 
72 
74 
76 
78 
80 
81  typedef typename BaseType::Pointer BaseTypePointer;
82 
84 
86 
88 
102  MPMResidualBasedBossakScheme(ModelPart& rGridModelPart, unsigned int DomainSize,
103  unsigned int BlockSize, double Alpha = 0.0,
104  double NewmarkBeta = 0.25, bool IsDynamic = true)
105  :ResidualBasedBossakDisplacementScheme<TSparseSpace,TDenseSpace>(Alpha, NewmarkBeta),
106  mGridModelPart(rGridModelPart), mRotationTool(DomainSize, BlockSize, IS_STRUCTURE)
107  {
108  // To distinguish quasi-static and dynamic
109  mIsDynamic = IsDynamic;
110 
111  // For Rotation Utility
112  mDomainSize = DomainSize;
113  mBlockSize = BlockSize;
114  }
115 
120  :BossakBaseType(rOther)
122  ,mRotationTool(rOther.mDomainSize,rOther.mBlockSize,IS_STRUCTURE)
123  {
124  }
125 
130  {
131  return BaseTypePointer( new MPMResidualBasedBossakScheme(*this) );
132  }
133 
137  () {}
138 
139 
140  //***************************************************************************
141  //***************************************************************************
142 
152  void Update(
153  ModelPart& rModelPart,
154  DofsArrayType& rDofSet,
155  TSystemMatrixType& rA,
156  TSystemVectorType& rDx,
157  TSystemVectorType& rb ) override
158  {
159  KRATOS_TRY
160 
161  // Rotate the current displacement to the modified coordinate system since rDx is currently at the modified coordinate system
163 
164  // Update of displacement (by DOF)
165  mpDofUpdater->UpdateDofs(rDofSet, rDx);
166 
167  // Rotate the displacement back to the original coordinate system to calculate the velocity and acceleration
169 
170  // Updating time derivatives (nodally for efficiency)
171  const int num_nodes = static_cast<int>( rModelPart.Nodes().size() );
172  const auto it_node_begin = rModelPart.Nodes().begin();
173 
174  #pragma omp parallel for
175  for(int i = 0; i < num_nodes; ++i) {
176  auto it_node = it_node_begin + i;
177 
178  // In MPM the delta_displacement is the current displacement as the previous_displacement is always reset
179  const array_1d<double, 3 > & r_delta_displacement = it_node->FastGetSolutionStepValue(DISPLACEMENT);
180 
181  array_1d<double, 3>& r_current_velocity = it_node->FastGetSolutionStepValue(VELOCITY);
182  const array_1d<double, 3>& r_previous_velocity = it_node->FastGetSolutionStepValue(VELOCITY, 1);
183 
184  array_1d<double, 3>& r_current_acceleration = it_node->FastGetSolutionStepValue(ACCELERATION);
185  const array_1d<double, 3>& r_previous_acceleration = it_node->FastGetSolutionStepValue(ACCELERATION, 1);
186 
187  if (mIsDynamic){
188  BossakBaseType::UpdateVelocity(r_current_velocity, r_delta_displacement, r_previous_velocity, r_previous_acceleration);
189  BossakBaseType::UpdateAcceleration(r_current_acceleration, r_delta_displacement, r_previous_velocity, r_previous_acceleration);
190  }
191  }
192 
193  KRATOS_CATCH( "" )
194  }
195 
205  void Predict(
206  ModelPart& rModelPart,
207  DofsArrayType& rDofSet,
208  TSystemMatrixType& rA,
209  TSystemVectorType& rDx,
210  TSystemVectorType& rb) override
211  {
212  KRATOS_TRY;
213 
214  #pragma omp parallel for
215  for(int iter = 0; iter < static_cast<int>(rModelPart.Nodes().size()); ++iter)
216  {
217  auto i = rModelPart.NodesBegin() + iter;
218  const array_1d<double, 3 > & r_previous_displacement = (i)->FastGetSolutionStepValue(DISPLACEMENT, 1);
219  const array_1d<double, 3 > & r_previous_velocity = (i)->FastGetSolutionStepValue(VELOCITY, 1);
220  const array_1d<double, 3 > & r_previous_acceleration = (i)->FastGetSolutionStepValue(ACCELERATION, 1);
221 
222  array_1d<double, 3 > & r_current_displacement = (i)->FastGetSolutionStepValue(DISPLACEMENT);
223 
224  // Displacement prediction for implicit MPM
225  if (!(i->pGetDof(DISPLACEMENT_X)->IsFixed()))
226  r_current_displacement[0] = 0.0;
227  else
228  r_current_displacement[0] = r_previous_displacement[0];
229 
230  if (!(i->pGetDof(DISPLACEMENT_Y)->IsFixed()))
231  r_current_displacement[1] = 0.0;
232  else
233  r_current_displacement[1] = r_previous_displacement[1];
234 
235  if (i->HasDofFor(DISPLACEMENT_Z))
236  {
237  if (!(i->pGetDof(DISPLACEMENT_Z)->IsFixed()))
238  r_current_displacement[2] = 0.0;
239  else
240  r_current_displacement[2] = r_previous_displacement[2];
241  }
242 
243  // Pressure prediction for implicit MPM
244  if (i->HasDofFor(PRESSURE))
245  {
246  double& r_current_pressure = (i)->FastGetSolutionStepValue(PRESSURE);
247  const double& r_previous_pressure = (i)->FastGetSolutionStepValue(PRESSURE, 1);
248 
249  if (!(i->pGetDof(PRESSURE))->IsFixed())
250  r_current_pressure = r_previous_pressure;
251  }
252 
253  // Updating time derivatives
254  array_1d<double, 3 > & current_velocity = (i)->FastGetSolutionStepValue(VELOCITY);
255  array_1d<double, 3 > & current_acceleration = (i)->FastGetSolutionStepValue(ACCELERATION);
256 
257  if (mIsDynamic){
258  BossakBaseType::UpdateVelocity(current_velocity, r_current_displacement, r_previous_velocity, r_previous_acceleration);
259  BossakBaseType::UpdateAcceleration (current_acceleration, r_current_displacement, r_previous_velocity, r_previous_acceleration);
260  }
261 
262  }
263 
264  KRATOS_CATCH( "" );
265  }
266 
267  // Clear friction-related flags so that RHS can be properly constructed for current iteration
269  TSystemVectorType &rb) override {
270 
271  // clear nodal reaction values if they were assigned a value outside from the condition
272  ClearReaction();
273 
274  BossakBaseType::FinalizeNonLinIteration(rModelPart, rA, rDx, rb);
275 
276  // modify reaction forces for particle slip conditions (Penalty)
278  }
279 
291  ModelPart& rModelPart,
292  TSystemMatrixType& rA,
293  TSystemVectorType& rDx,
294  TSystemVectorType& rb) override
295  {
296  KRATOS_TRY
297 
298  // Loop over the grid nodes performed to clear all nodal information
299  #pragma omp parallel for
300  for(int iter = 0; iter < static_cast<int>(mGridModelPart.Nodes().size()); ++iter)
301  {
302  auto i = mGridModelPart.NodesBegin() + iter;
303 
304  // Variables to be cleaned
305  double & r_nodal_mass = (i)->FastGetSolutionStepValue(NODAL_MASS);
306  array_1d<double, 3 > & r_nodal_momentum = (i)->FastGetSolutionStepValue(NODAL_MOMENTUM);
307  array_1d<double, 3 > & r_nodal_inertia = (i)->FastGetSolutionStepValue(NODAL_INERTIA);
308 
309  array_1d<double, 3 > & r_nodal_displacement = (i)->FastGetSolutionStepValue(DISPLACEMENT);
310  array_1d<double, 3 > & r_nodal_velocity = (i)->FastGetSolutionStepValue(VELOCITY,1);
311  array_1d<double, 3 > & r_nodal_acceleration = (i)->FastGetSolutionStepValue(ACCELERATION,1);
312 
313  double & r_nodal_old_pressure = (i)->FastGetSolutionStepValue(PRESSURE,1);
314  double & r_nodal_pressure = (i)->FastGetSolutionStepValue(PRESSURE);
315 
316  // Clear
317  r_nodal_mass = 0.0;
318  r_nodal_momentum.clear();
319  r_nodal_inertia.clear();
320 
321  r_nodal_displacement.clear();
322  r_nodal_velocity.clear();
323  r_nodal_acceleration.clear();
324  r_nodal_old_pressure = 0.0;
325  r_nodal_pressure = 0.0;
326 
327  // Other additional variables
328  if ((i)->SolutionStepsDataHas(NODAL_AREA)){
329  double & r_nodal_area = (i)->FastGetSolutionStepValue(NODAL_AREA);
330  r_nodal_area = 0.0;
331  }
332  if(i->SolutionStepsDataHas(NODAL_MPRESSURE)) {
333  double & r_nodal_mpressure = (i)->FastGetSolutionStepValue(NODAL_MPRESSURE);
334  r_nodal_mpressure = 0.0;
335  }
336  }
337 
338  // Extrapolate from Material Point Elements and Conditions
339  ImplicitBaseType::InitializeSolutionStep(rModelPart,rA,rDx,rb);
340 
341  // Assign nodal variables after extrapolation
342  #pragma omp parallel for
343  for(int iter = 0; iter < static_cast<int>(mGridModelPart.Nodes().size()); ++iter)
344  {
345  auto i = mGridModelPart.NodesBegin() + iter;
346  const double & r_nodal_mass = (i)->FastGetSolutionStepValue(NODAL_MASS);
347 
348  if (r_nodal_mass > std::numeric_limits<double>::epsilon())
349  {
350  const array_1d<double, 3 > & r_nodal_momentum = (i)->FastGetSolutionStepValue(NODAL_MOMENTUM);
351  const array_1d<double, 3 > & r_nodal_inertia = (i)->FastGetSolutionStepValue(NODAL_INERTIA);
352 
353  array_1d<double, 3 > & r_nodal_velocity = (i)->FastGetSolutionStepValue(VELOCITY,1);
354  array_1d<double, 3 > & r_nodal_acceleration = (i)->FastGetSolutionStepValue(ACCELERATION,1);
355  double & r_nodal_pressure = (i)->FastGetSolutionStepValue(PRESSURE,1);
356 
357  double delta_nodal_pressure = 0.0;
358 
359  // For mixed formulation
360  if (i->HasDofFor(PRESSURE) && i->SolutionStepsDataHas(NODAL_MPRESSURE))
361  {
362  double & nodal_mpressure = (i)->FastGetSolutionStepValue(NODAL_MPRESSURE);
363  delta_nodal_pressure = nodal_mpressure/r_nodal_mass;
364  }
365 
366  const array_1d<double, 3 > delta_nodal_velocity = r_nodal_momentum/r_nodal_mass;
367  const array_1d<double, 3 > delta_nodal_acceleration = r_nodal_inertia/r_nodal_mass;
368 
369  r_nodal_velocity += delta_nodal_velocity;
370  r_nodal_acceleration += delta_nodal_acceleration;
371 
372  r_nodal_pressure += delta_nodal_pressure;
373  }
374  }
375 
376  const ProcessInfo& r_current_process_info = rModelPart.GetProcessInfo();
377  const double delta_time = r_current_process_info[DELTA_TIME];
378 
379  // Initializing Bossak constants
380  mBossak.c0 = ( 1.0 / (mBossak.beta * delta_time * delta_time) );
382  mBossak.c2 = ( 1.0 / (mBossak.beta * delta_time) );
383  mBossak.c3 = ( 0.5 / (mBossak.beta) - 1.0 );
384  mBossak.c4 = ( (mBossak.gamma / mBossak.beta) - 1.0 );
385  mBossak.c5 = ( delta_time * 0.5 * ( ( mBossak.gamma / mBossak.beta ) - 2.0 ) );
386 
387  KRATOS_CATCH( "" )
388  }
389 
399  Element& rCurrentElement,
400  LocalSystemMatrixType& LHS_Contribution,
401  LocalSystemVectorType& RHS_Contribution,
403  const ProcessInfo& rCurrentProcessInfo) override
404  {
405  KRATOS_TRY
406 
407  const IndexType this_thread = OpenMPUtils::ThisThread();
408  const auto& rConstElemRef = rCurrentElement;
409  rCurrentElement.CalculateLocalSystem(LHS_Contribution,RHS_Contribution,rCurrentProcessInfo);
410  rConstElemRef.EquationIdVector(EquationId,rCurrentProcessInfo);
411 
412  if(mIsDynamic)
413  {
414  rCurrentElement.CalculateMassMatrix(mMatrix.M[this_thread],rCurrentProcessInfo);
415  rCurrentElement.CalculateDampingMatrix(mMatrix.D[this_thread],rCurrentProcessInfo);
416  BossakBaseType::AddDynamicsToLHS(LHS_Contribution, mMatrix.D[this_thread], mMatrix.M[this_thread], rCurrentProcessInfo);
417  BossakBaseType::AddDynamicsToRHS(rCurrentElement, RHS_Contribution, mMatrix.D[this_thread], mMatrix.M[this_thread], rCurrentProcessInfo);
418  }
419 
420  // If there is a slip condition, apply it on a rotated system of coordinates
421  mRotationTool.Rotate(LHS_Contribution,RHS_Contribution,rCurrentElement.GetGeometry());
422  mRotationTool.ElementApplySlipCondition(LHS_Contribution,RHS_Contribution,rCurrentElement.GetGeometry());
423 
424  KRATOS_CATCH( "" )
425  }
426 
435  Element& rCurrentElement,
436  LocalSystemVectorType& RHS_Contribution,
438  const ProcessInfo& rCurrentProcessInfo) override
439  {
440 
441  KRATOS_TRY
442 
443  const IndexType this_thread = OpenMPUtils::ThisThread();
444  const auto& r_const_elem_ref = rCurrentElement;
445 
446  // Basic operations for the element considered
447  rCurrentElement.CalculateRightHandSide(RHS_Contribution,rCurrentProcessInfo);
448  r_const_elem_ref.EquationIdVector(EquationId,rCurrentProcessInfo);
449 
450  if(mIsDynamic)
451  {
452  rCurrentElement.CalculateMassMatrix(mMatrix.M[this_thread],rCurrentProcessInfo);
453  rCurrentElement.CalculateDampingMatrix(mMatrix.D[this_thread],rCurrentProcessInfo);
454  BossakBaseType::AddDynamicsToRHS(rCurrentElement, RHS_Contribution, mMatrix.D[this_thread], mMatrix.M[this_thread], rCurrentProcessInfo);
455  }
456 
457  // If there is a slip condition, apply it on a rotated system of coordinates
458  mRotationTool.RotateRHS(RHS_Contribution,rCurrentElement.GetGeometry());
459  mRotationTool.ElementApplySlipCondition(RHS_Contribution,rCurrentElement.GetGeometry());
460 
461  KRATOS_CATCH( "" )
462  }
463 
473  Condition& rCurrentCondition,
474  LocalSystemMatrixType& LHS_Contribution,
475  LocalSystemVectorType& RHS_Contribution,
477  const ProcessInfo& rCurrentProcessInfo) override
478  {
479 
480  KRATOS_TRY
481 
482  const IndexType this_thread = OpenMPUtils::ThisThread();
483  const auto& r_const_cond_ref = rCurrentCondition;
484 
485  rCurrentCondition.CalculateLocalSystem(LHS_Contribution,RHS_Contribution,rCurrentProcessInfo);
486  r_const_cond_ref.EquationIdVector(EquationId,rCurrentProcessInfo);
487 
488  if(mIsDynamic)
489  {
490  rCurrentCondition.CalculateMassMatrix(mMatrix.M[this_thread],rCurrentProcessInfo);
491  rCurrentCondition.CalculateDampingMatrix(mMatrix.D[this_thread],rCurrentProcessInfo);
492  BossakBaseType::AddDynamicsToLHS(LHS_Contribution, mMatrix.D[this_thread], mMatrix.M[this_thread], rCurrentProcessInfo);
493  BossakBaseType::AddDynamicsToRHS(rCurrentCondition, RHS_Contribution, mMatrix.D[this_thread], mMatrix.M[this_thread], rCurrentProcessInfo);
494  }
495 
496  // Rotate contributions (to match coordinates for slip conditions)
497  mRotationTool.Rotate(LHS_Contribution,RHS_Contribution,rCurrentCondition.GetGeometry());
498  mRotationTool.ConditionApplySlipCondition(LHS_Contribution,RHS_Contribution,rCurrentCondition.GetGeometry());
499 
500  KRATOS_CATCH( "" )
501  }
502 
511  Condition& rCurrentCondition,
512  LocalSystemVectorType& RHS_Contribution,
514  const ProcessInfo& rCurrentProcessInfo) override
515  {
516  KRATOS_TRY
517 
518  const IndexType this_thread = OpenMPUtils::ThisThread();
519  const auto& r_const_cond_ref = rCurrentCondition;
520  rCurrentCondition.CalculateRightHandSide(RHS_Contribution,rCurrentProcessInfo);
521  r_const_cond_ref.EquationIdVector(EquationId,rCurrentProcessInfo);
522 
523  if(mIsDynamic)
524  {
525  rCurrentCondition.CalculateMassMatrix(mMatrix.M[this_thread],rCurrentProcessInfo);
526  rCurrentCondition.CalculateDampingMatrix(mMatrix.D[this_thread],rCurrentProcessInfo);
527  BossakBaseType::AddDynamicsToRHS(rCurrentCondition, RHS_Contribution, mMatrix.D[this_thread], mMatrix.M[this_thread], rCurrentProcessInfo);
528  }
529 
530  // Rotate contributions (to match coordinates for slip conditions)
531  mRotationTool.RotateRHS(RHS_Contribution,rCurrentCondition.GetGeometry());
532  mRotationTool.ConditionApplySlipCondition(RHS_Contribution,rCurrentCondition.GetGeometry());
533 
534  KRATOS_CATCH( "" )
535  }
536 
537 protected:
538 
539  // MPM Background Grid
541 
542  // To distinguish quasi-static and dynamic
544 
545  // For Rotation Utility
546  unsigned int mDomainSize;
547  unsigned int mBlockSize;
549 
550  void ClearReaction() const
551  {
552  #pragma omp parallel for
553  for (int iter = 0; iter < static_cast<int>(mGridModelPart.Nodes().size()); ++iter) {
554  auto i = mGridModelPart.NodesBegin() + iter;
555  (i)->FastGetSolutionStepValue(REACTION).clear();
556  }
557  }
558 
559 }; /* Class MPMResidualBasedBossakScheme */
560 } /* namespace Kratos.*/
561 
562 #endif /* KRATOS_MPM_RESIDUAL_BASED_BOSSAK_SCHEME defined */
563 
Base class for all Conditions.
Definition: condition.h:59
virtual void CalculateMassMatrix(MatrixType &rMassMatrix, const ProcessInfo &rCurrentProcessInfo)
Definition: condition.h:574
virtual void CalculateDampingMatrix(MatrixType &rDampingMatrix, const ProcessInfo &rCurrentProcessInfo)
Definition: condition.h:586
virtual void CalculateRightHandSide(VectorType &rRightHandSideVector, const ProcessInfo &rCurrentProcessInfo)
Definition: condition.h:440
virtual void CalculateLocalSystem(MatrixType &rLeftHandSideMatrix, VectorType &rRightHandSideVector, const ProcessInfo &rCurrentProcessInfo)
Definition: condition.h:408
Base class for all Elements.
Definition: element.h:60
virtual void CalculateMassMatrix(MatrixType &rMassMatrix, const ProcessInfo &rCurrentProcessInfo)
Definition: element.h:570
virtual void CalculateRightHandSide(VectorType &rRightHandSideVector, const ProcessInfo &rCurrentProcessInfo)
Definition: element.h:437
virtual void CalculateDampingMatrix(MatrixType &rDampingMatrix, const ProcessInfo &rCurrentProcessInfo)
Definition: element.h:583
std::vector< DofType::Pointer > DofsVectorType
Definition: element.h:100
virtual void CalculateLocalSystem(MatrixType &rLeftHandSideMatrix, VectorType &rRightHandSideVector, const ProcessInfo &rCurrentProcessInfo)
Definition: element.h:405
std::vector< std::size_t > EquationIdVectorType
Definition: element.h:98
GeometryType & GetGeometry()
Returns the reference of the geometry.
Definition: geometrical_object.h:158
void Rotate(TLocalMatrixType &rLocalMatrix, TLocalVectorType &rLocalVector, GeometryType &rGeometry) const override
Rotate the local system contributions so that they are oriented with each node's normal.
Definition: mpm_boundary_rotation_utility.h:105
virtual void RotateDisplacements(ModelPart &rModelPart) const
Same functionalities as RotateVelocities, just to have a clear function naming.
Definition: mpm_boundary_rotation_utility.h:293
void ElementApplySlipCondition(TLocalMatrixType &rLocalMatrix, TLocalVectorType &rLocalVector, GeometryType &rGeometry) const
Definition: mpm_boundary_rotation_utility.h:189
void CalculateReactionForces(ModelPart &rModelPart)
Definition: mpm_boundary_rotation_utility.h:381
void RotateRHS(TLocalVectorType &rLocalVector, GeometryType &rGeometry) const
RHS only version of Rotate.
Definition: mpm_boundary_rotation_utility.h:124
void ConditionApplySlipCondition(TLocalMatrixType &rLocalMatrix, TLocalVectorType &rLocalVector, GeometryType &rGeometry) const
Definition: mpm_boundary_rotation_utility.h:214
virtual void RecoverDisplacements(ModelPart &rModelPart) const
Same functionalities as RecoverVelocities, just to have a clear function naming.
Definition: mpm_boundary_rotation_utility.h:338
Bossak integration scheme (for linear and nonlinear dynamic problems) for displacements adjusted for ...
Definition: mpm_residual_based_bossak_scheme.hpp:51
MPMResidualBasedBossakScheme(ModelPart &rGridModelPart, unsigned int DomainSize, unsigned int BlockSize, double Alpha=0.0, double NewmarkBeta=0.25, bool IsDynamic=true)
Constructor. @detail The MPM bossak method.
Definition: mpm_residual_based_bossak_scheme.hpp:102
BaseType::Pointer BaseTypePointer
Definition: mpm_residual_based_bossak_scheme.hpp:81
bool mIsDynamic
Definition: mpm_residual_based_bossak_scheme.hpp:543
TSparseSpace::DofUpdaterPointerType mpDofUpdater
Definition: residual_based_bossak_displacement_scheme.hpp:490
void InitializeSolutionStep(ModelPart &rModelPart, TSystemMatrixType &rA, TSystemVectorType &rDx, TSystemVectorType &rb) override
It initializes time step solution for MPM simulations.
Definition: mpm_residual_based_bossak_scheme.hpp:290
BossakBaseType::LocalSystemMatrixType LocalSystemMatrixType
Definition: mpm_residual_based_bossak_scheme.hpp:75
BossakBaseType::DofsArrayType DofsArrayType
Definition: mpm_residual_based_bossak_scheme.hpp:65
void CalculateSystemContributions(Element &rCurrentElement, LocalSystemMatrixType &LHS_Contribution, LocalSystemVectorType &RHS_Contribution, Element::EquationIdVectorType &EquationId, const ProcessInfo &rCurrentProcessInfo) override
This function is designed to be called in the builder and solver to introduce the selected time integ...
Definition: mpm_residual_based_bossak_scheme.hpp:398
void Update(ModelPart &rModelPart, DofsArrayType &rDofSet, TSystemMatrixType &rA, TSystemVectorType &rDx, TSystemVectorType &rb) override
Performing the update of the solution.
Definition: mpm_residual_based_bossak_scheme.hpp:152
void Predict(ModelPart &rModelPart, DofsArrayType &rDofSet, TSystemMatrixType &rA, TSystemVectorType &rDx, TSystemVectorType &rb) override
Performing the prediction of the solution.
Definition: mpm_residual_based_bossak_scheme.hpp:205
Element::DofsVectorType DofsVectorType
Definition: mpm_residual_based_bossak_scheme.hpp:67
void ClearReaction() const
Definition: mpm_residual_based_bossak_scheme.hpp:550
virtual ~MPMResidualBasedBossakScheme()
Definition: mpm_residual_based_bossak_scheme.hpp:137
void FinalizeNonLinIteration(ModelPart &rModelPart, TSystemMatrixType &rA, TSystemVectorType &rDx, TSystemVectorType &rb) override
Function to be called when it is needed to finalize an iteration. It is designed to be called at the ...
Definition: mpm_residual_based_bossak_scheme.hpp:268
ModelPart::ConditionsContainerType ConditionsArrayType
Definition: mpm_residual_based_bossak_scheme.hpp:79
ModelPart & mGridModelPart
Definition: mpm_residual_based_bossak_scheme.hpp:540
BaseTypePointer Clone() override
Clone method.
Definition: mpm_residual_based_bossak_scheme.hpp:129
GeneralMatrices mMatrix
Definition: residual_based_implicit_time_scheme.h:351
void CalculateSystemContributions(Condition &rCurrentCondition, LocalSystemMatrixType &LHS_Contribution, LocalSystemVectorType &RHS_Contribution, Element::EquationIdVectorType &EquationId, const ProcessInfo &rCurrentProcessInfo) override
Functions totally analogous to the precedent but applied to the "condition" objects.
Definition: mpm_residual_based_bossak_scheme.hpp:472
unsigned int mDomainSize
Definition: mpm_residual_based_bossak_scheme.hpp:546
KRATOS_CLASS_POINTER_DEFINITION(MPMResidualBasedBossakScheme)
BossakBaseType::LocalSystemVectorType LocalSystemVectorType
Definition: mpm_residual_based_bossak_scheme.hpp:73
ModelPart::ElementsContainerType ElementsArrayType
Definition: mpm_residual_based_bossak_scheme.hpp:77
unsigned int mBlockSize
Definition: mpm_residual_based_bossak_scheme.hpp:547
BossakBaseType::TSystemMatrixType TSystemMatrixType
Definition: mpm_residual_based_bossak_scheme.hpp:69
BossakBaseType::TSystemVectorType TSystemVectorType
Definition: mpm_residual_based_bossak_scheme.hpp:71
ResidualBasedImplicitTimeScheme< TSparseSpace, TDenseSpace > ImplicitBaseType
Definition: mpm_residual_based_bossak_scheme.hpp:59
void CalculateRHSContribution(Condition &rCurrentCondition, LocalSystemVectorType &RHS_Contribution, Element::EquationIdVectorType &EquationId, const ProcessInfo &rCurrentProcessInfo) override
Functions that calculates the RHS of a "condition" object.
Definition: mpm_residual_based_bossak_scheme.hpp:510
Scheme< TSparseSpace, TDenseSpace > BaseType
Definition: mpm_residual_based_bossak_scheme.hpp:57
BossakBaseType::TDataType TDataType
Definition: mpm_residual_based_bossak_scheme.hpp:63
ResidualBasedBossakDisplacementScheme< TSparseSpace, TDenseSpace > BossakBaseType
Definition: mpm_residual_based_bossak_scheme.hpp:61
void CalculateRHSContribution(Element &rCurrentElement, LocalSystemVectorType &RHS_Contribution, Element::EquationIdVectorType &EquationId, const ProcessInfo &rCurrentProcessInfo) override
This function is designed to calculate just the RHS contribution.
Definition: mpm_residual_based_bossak_scheme.hpp:434
MPMBoundaryRotationUtility< LocalSystemMatrixType, LocalSystemVectorType > mRotationTool
Definition: mpm_residual_based_bossak_scheme.hpp:548
MPMResidualBasedBossakScheme(MPMResidualBasedBossakScheme &rOther)
Copy Constructor.
Definition: mpm_residual_based_bossak_scheme.hpp:119
BossakAlphaMethod mBossak
Bossak Alpha parameters.
Definition: residual_based_bossak_displacement_scheme.hpp:532
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
MeshType::ConditionsContainerType ConditionsContainerType
Condintions container. A vector set of Conditions with their Id's as key.
Definition: model_part.h:183
MeshType::ElementsContainerType ElementsContainerType
Element container. A vector set of Elements with their Id's as key.
Definition: model_part.h:168
NodeIterator NodesBegin(IndexType ThisIndex=0)
Definition: model_part.h:487
ProcessInfo & GetProcessInfo()
Definition: model_part.h:1746
NodesContainerType & Nodes(IndexType ThisIndex=0)
Definition: model_part.h:507
static int ThisThread()
Wrapper for omp_get_thread_num().
Definition: openmp_utils.h:108
ProcessInfo holds the current value of different solution parameters.
Definition: process_info.h:59
Bossak integration scheme (for linear and nonlinear dynamic problems) for displacements.
Definition: residual_based_bossak_displacement_scheme.hpp:43
TSparseSpace::DofUpdaterPointerType mpDofUpdater
Definition: residual_based_bossak_displacement_scheme.hpp:490
void UpdateVelocity(array_1d< double, 3 > &rCurrentVelocity, const array_1d< double, 3 > &rDeltaDisplacement, const array_1d< double, 3 > &rPreviousVelocity, const array_1d< double, 3 > &rPreviousAcceleration)
Update the first time derivative.
Definition: residual_based_bossak_displacement_scheme.hpp:549
void UpdateAcceleration(array_1d< double, 3 > &rCurrentAcceleration, const array_1d< double, 3 > &rDeltaDisplacement, const array_1d< double, 3 > &rPreviousVelocity, const array_1d< double, 3 > &rPreviousAcceleration)
Update the second time derivative.
Definition: residual_based_bossak_displacement_scheme.hpp:565
typename ImplicitBaseType::TSystemMatrixType TSystemMatrixType
Type for the system matrix within ImplicitBaseType.
Definition: residual_based_bossak_displacement_scheme.hpp:69
typename ImplicitBaseType::LocalSystemMatrixType LocalSystemMatrixType
Type for local system matrices within ImplicitBaseType.
Definition: residual_based_bossak_displacement_scheme.hpp:78
typename ImplicitBaseType::LocalSystemVectorType LocalSystemVectorType
Type for local system vectors within ImplicitBaseType.
Definition: residual_based_bossak_displacement_scheme.hpp:75
typename ImplicitBaseType::TSystemVectorType TSystemVectorType
Type for the system vector within ImplicitBaseType.
Definition: residual_based_bossak_displacement_scheme.hpp:72
void AddDynamicsToLHS(LocalSystemMatrixType &LHS_Contribution, LocalSystemMatrixType &D, LocalSystemMatrixType &M, const ProcessInfo &rCurrentProcessInfo) override
Add dynamic left hand side contribution from Element s.
Definition: residual_based_bossak_displacement_scheme.hpp:582
void AddDynamicsToRHS(Element &rElement, LocalSystemVectorType &RHS_Contribution, LocalSystemMatrixType &D, LocalSystemMatrixType &M, const ProcessInfo &rCurrentProcessInfo) override
Add dynamic right hand side contribution from an Element.
Definition: residual_based_bossak_displacement_scheme.hpp:606
typename ImplicitBaseType::TDataType TDataType
Data type used within the ImplicitBaseType.
Definition: residual_based_bossak_displacement_scheme.hpp:60
BossakAlphaMethod mBossak
Bossak Alpha parameters.
Definition: residual_based_bossak_displacement_scheme.hpp:532
typename ImplicitBaseType::DofsArrayType DofsArrayType
Array type for degrees of freedom within ImplicitBaseType.
Definition: residual_based_bossak_displacement_scheme.hpp:63
typename BaseType::Pointer BaseTypePointer
Pointer type for the BaseType.
Definition: residual_based_bossak_displacement_scheme.hpp:93
This is the base class for the implicit time schemes.
Definition: residual_based_implicit_time_scheme.h:55
void InitializeSolutionStep(ModelPart &rModelPart, TSystemMatrixType &rA, TSystemVectorType &rDx, TSystemVectorType &rb) override
It initializes time step solution. Only for reasons if the time step solution is restarted.
Definition: residual_based_implicit_time_scheme.h:245
GeneralMatrices mMatrix
Definition: residual_based_implicit_time_scheme.h:351
std::size_t IndexType
Index type definition.
Definition: residual_based_implicit_time_scheme.h:89
This class provides the implementation of the basic tasks that are needed by the solution strategy.
Definition: scheme.h:56
virtual void EquationId(const Element &rElement, Element::EquationIdVectorType &rEquationId, const ProcessInfo &rCurrentProcessInfo)
This method gets the eqaution id corresponding to the current element.
Definition: scheme.h:636
virtual void FinalizeNonLinIteration(ModelPart &rModelPart, TSystemMatrixType &A, TSystemVectorType &Dx, TSystemVectorType &b)
Function to be called when it is needed to finalize an iteration. It is designed to be called at the ...
Definition: scheme.h:393
BOOST_UBLAS_INLINE void clear()
Definition: array_1d.h:325
#define KRATOS_CATCH(MoreInfo)
Definition: define.h:110
#define KRATOS_TRY
Definition: define.h:109
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
delta_time
Definition: generate_frictional_mortar_condition.py:130
def Alpha(n, j)
Definition: quadrature.py:93
integer i
Definition: TensorModule.f:17
double c2
Definition: residual_based_bossak_displacement_scheme.hpp:505
double c4
Definition: residual_based_bossak_displacement_scheme.hpp:505
double c0
System constants.
Definition: residual_based_bossak_displacement_scheme.hpp:505
double beta
Bossak Beta.
Definition: residual_based_bossak_displacement_scheme.hpp:499
double c1
Definition: residual_based_bossak_displacement_scheme.hpp:505
double c3
Definition: residual_based_bossak_displacement_scheme.hpp:505
double c5
Definition: residual_based_bossak_displacement_scheme.hpp:505
double gamma
Bossak Gamma.
Definition: residual_based_bossak_displacement_scheme.hpp:502
std::vector< Matrix > M
Definition: residual_based_implicit_time_scheme.h:347
std::vector< Matrix > D
First derivative matrix (usually mass matrix)
Definition: residual_based_implicit_time_scheme.h:348