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_explicit_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: Peter Wilson (thanks Klaus Sautter)
11 //
12 //
13 
14 #if !defined(KRATOS_MPM_EXPLICIT_SCHEME)
15 #define KRATOS_MPM_EXPLICIT_SCHEME
16 
17 // System includes
18 
19 // External includes
20 
21 // Project includes
22 #include "includes/define.h"
23 #include "includes/model_part.h"
24 #include "includes/variables.h"
28 
29 namespace Kratos {
39  template <class TSparseSpace,
40  class TDenseSpace //= DenseSpace<double>
41  >
43  : public Scheme<TSparseSpace, TDenseSpace> {
44 
45  public:
50 
52 
53  typedef typename BaseType::TDataType TDataType;
54 
56 
58 
60 
62 
64 
66 
68 
70 
71  typedef typename BaseType::Pointer BaseTypePointer;
72 
75 
78 
80  typedef std::size_t SizeType;
81 
83  typedef std::size_t IndexType;
84 
86  static constexpr double numerical_limit = std::numeric_limits<double>::epsilon();
87 
96  ModelPart& grid_model_part
97  )
98  : Scheme<TSparseSpace, TDenseSpace>(),
99  mr_grid_model_part(grid_model_part)
100  {
101  }
102 
104  virtual ~MPMExplicitScheme() {}
105 
110  {
111  return BaseTypePointer(new MPMExplicitScheme(*this));
112  }
113 
118  void Initialize(ModelPart& rModelPart) override
119  {
120  KRATOS_TRY
121  // Initialize scheme
123  KRATOS_CATCH("")
124  }
125 
126  //***************************************************************************
127  //***************************************************************************
128 
138  void Update(
139  ModelPart& r_model_part,
140  DofsArrayType& rDofSet,
142  TSystemVectorType& Dx,
143  TSystemVectorType& b) override
144  {
145  KRATOS_TRY
146  // The current process info
147  const ProcessInfo& r_current_process_info = r_model_part.GetProcessInfo();
148 
150  const SizeType dim = r_current_process_info[DOMAIN_SIZE];
151  const double delta_time = r_current_process_info[DELTA_TIME];
152 
153  // The iterator of the first node
154  const auto it_node_begin = r_model_part.NodesBegin();
155 
156  // Getting dof position
157  const IndexType disppos = it_node_begin->GetDofPosition(DISPLACEMENT_X);
158 
159  #pragma omp parallel for schedule(guided,512)
160  for (int i = 0; i < static_cast<int>(r_model_part.Nodes().size()); ++i) {
161  auto it_node = it_node_begin + i;
162  if ((it_node)->Is(ACTIVE))
163  {
164  this->UpdateTranslationalDegreesOfFreedom(r_current_process_info, it_node, disppos, delta_time, dim);
165  }
166  } // for Node parallel
167 
168  KRATOS_CATCH("")
169  }
170 
171  //***************************************************************************
172  //***************************************************************************
173 
175  const ProcessInfo& r_current_process_info,
176  NodeIterator itCurrentNode,
177  const IndexType DisplacementPosition,
178  const double delta_time,
179  const SizeType DomainSize = 3
180  )
181  {
182  std::array<bool, 3> fix_displacements = { false, false, false };
183  fix_displacements[0] = (itCurrentNode->GetDof(DISPLACEMENT_X, DisplacementPosition).IsFixed());
184  fix_displacements[1] = (itCurrentNode->GetDof(DISPLACEMENT_Y, DisplacementPosition + 1).IsFixed());
185  if (DomainSize == 3)
186  fix_displacements[2] = (itCurrentNode->GetDof(DISPLACEMENT_Z, DisplacementPosition + 2).IsFixed());
187 
188  array_1d<double, 3>& r_nodal_momenta = itCurrentNode->FastGetSolutionStepValue(NODAL_MOMENTUM);
189  array_1d<double, 3>& r_current_residual = itCurrentNode->FastGetSolutionStepValue(FORCE_RESIDUAL);
190 
191  const double gamma = (r_current_process_info.GetValue(IS_EXPLICIT_CENTRAL_DIFFERENCE))
192  ? 0.5
193  : 1.0;
194  // we are only adding the central difference corrector here
195 
196  for (IndexType j = 0; j < DomainSize; j++)
197  {
198  if (fix_displacements[j])
199  {
200  r_nodal_momenta[j] = 0.0;
201  r_current_residual[j] = 0.0;
202  }
203  else {
204  r_nodal_momenta[j] += gamma * delta_time * r_current_residual[j];
205  }
206  } // for DomainSize
207  }
208 
209  //***************************************************************************
210  //***************************************************************************
211 
221  ModelPart& r_model_part,
223  TSystemVectorType& Dx,
224  TSystemVectorType& b) override
225  {
226  KRATOS_TRY
227 
228  const ProcessInfo& rCurrentProcessInfo = r_model_part.GetProcessInfo();
229  BaseType::InitializeSolutionStep(r_model_part, A, Dx, b);
230  #pragma omp parallel for
231  for (int iter = 0; iter < static_cast<int>(mr_grid_model_part.Nodes().size()); ++iter)
232  {
233  auto i = mr_grid_model_part.NodesBegin() + iter;
234 
235  if(i->Is(ACTIVE))
236  {
237  // Variables to be cleaned
238  double& nodal_mass = (i)->FastGetSolutionStepValue(NODAL_MASS);
239  array_1d<double, 3 >& nodal_momentum = (i)->FastGetSolutionStepValue(NODAL_MOMENTUM);
240  array_1d<double, 3 >& nodal_inertia = (i)->FastGetSolutionStepValue(NODAL_INERTIA);
241  array_1d<double, 3 >& nodal_force = (i)->FastGetSolutionStepValue(FORCE_RESIDUAL);
242  array_1d<double, 3 >& nodal_displacement = (i)->FastGetSolutionStepValue(DISPLACEMENT);
243  array_1d<double, 3 >& nodal_velocity = (i)->FastGetSolutionStepValue(VELOCITY);
244  array_1d<double, 3 >& nodal_acceleration = (i)->FastGetSolutionStepValue(ACCELERATION);
245 
246  double& nodal_old_pressure = (i)->FastGetSolutionStepValue(PRESSURE, 1);
247  double& nodal_pressure = (i)->FastGetSolutionStepValue(PRESSURE);
248  if (i->SolutionStepsDataHas(NODAL_MPRESSURE)) {
249  double& nodal_mpressure = (i)->FastGetSolutionStepValue(NODAL_MPRESSURE);
250  nodal_mpressure = 0.0;
251  }
252 
253  // Clear
254  nodal_mass = 0.0;
255  nodal_momentum.clear();
256  nodal_inertia.clear();
257  nodal_force.clear();
258 
259  nodal_displacement.clear();
260  nodal_velocity.clear();
261  nodal_acceleration.clear();
262  nodal_old_pressure = 0.0;
263  nodal_pressure = 0.0;
264  }
265  }
266 
267  // Extrapolate from Material Point Elements and Conditions
269 
270  // If we are updating stress before momenta update (USF and central difference),
271  if (rCurrentProcessInfo.GetValue(EXPLICIT_STRESS_UPDATE_OPTION) == 0 ||
272  rCurrentProcessInfo.GetValue(IS_EXPLICIT_CENTRAL_DIFFERENCE))
273  {
274  // calculate nodal velocities from momenta and apply BCs
275  calculateGridVelocityAndApplyDirichletBC(rCurrentProcessInfo,true);
276 
277  // calculate stresses
278  const auto it_elem_begin = r_model_part.ElementsBegin();
279  #pragma omp parallel for
280  for (int i = 0; i < static_cast<int>(r_model_part.Elements().size()); ++i) {
281  auto it_elem = it_elem_begin + i;
282  std::vector<bool> dummy;
283  it_elem->CalculateOnIntegrationPoints(CALCULATE_EXPLICIT_MP_STRESS, dummy, rCurrentProcessInfo);
284  }
285  }
286  KRATOS_CATCH("")
287  }
288 
291  const ProcessInfo rCurrentProcessInfo,
292  bool calculateVelocityFromMomenta = false)
293  {
294  KRATOS_TRY
295 
296  const IndexType DisplacementPosition = mr_grid_model_part.NodesBegin()->GetDofPosition(DISPLACEMENT_X);
297  const SizeType DomainSize = rCurrentProcessInfo[DOMAIN_SIZE];
298 
299  #pragma omp parallel for
300  for (int iter = 0; iter < static_cast<int>(mr_grid_model_part.Nodes().size()); ++iter)
301  {
303 
304  if ((i)->Is(ACTIVE))
305  {
306  double& nodal_mass = (i)->FastGetSolutionStepValue(NODAL_MASS);
307  array_1d<double, 3 >& nodal_momentum = (i)->FastGetSolutionStepValue(NODAL_MOMENTUM);
308  array_1d<double, 3 >& nodal_velocity = (i)->FastGetSolutionStepValue(VELOCITY);
309 
310  std::array<bool, 3> fix_displacements = { false, false, false };
311  fix_displacements[0] = (i->GetDof(DISPLACEMENT_X, DisplacementPosition).IsFixed());
312  fix_displacements[1] = (i->GetDof(DISPLACEMENT_Y, DisplacementPosition + 1).IsFixed());
313  if (DomainSize == 3)
314  fix_displacements[2] = (i->GetDof(DISPLACEMENT_Z, DisplacementPosition + 2).IsFixed());
315 
316  for (IndexType j = 0; j < DomainSize; j++)
317  {
318  if (fix_displacements[j])
319  {
320  nodal_velocity[j] = 0.0;
321  }
322  else if (calculateVelocityFromMomenta && nodal_mass > numerical_limit)
323  {
324  nodal_velocity[j] = nodal_momentum[j] / nodal_mass;
325  }
326  }
327  }
328  }
329 
330  KRATOS_CATCH("")
331  }
332 
333 
337  ModelPart& rModelPart,
339  TSystemVectorType& Dx,
340  TSystemVectorType& b) override
341  {
342  KRATOS_TRY
343 
344  ElementsArrayType& rElements = rModelPart.Elements();
345  const ProcessInfo& rCurrentProcessInfo = rModelPart.GetProcessInfo();
346  const auto it_elem_begin = rModelPart.ElementsBegin();
347 
348 
349  // map grid to MPs
350  #pragma omp parallel for
351  for (int i = 0; i < static_cast<int>(rElements.size()); ++i)
352  {
353  auto it_elem = it_elem_begin + i;
354  std::vector<bool> dummy;
355  it_elem->CalculateOnIntegrationPoints(EXPLICIT_MAP_GRID_TO_MP, dummy, rCurrentProcessInfo);
356  }
357 
358  //update stress after momenta update for USL(1) and MUSL(2)
359  if (rCurrentProcessInfo.GetValue(EXPLICIT_STRESS_UPDATE_OPTION) > 0)
360  {
361  this->CalculateUpdatedGridVelocityField(rCurrentProcessInfo, rModelPart);
362 
363  #pragma omp parallel for
364  for (int i = 0; i < static_cast<int>(rElements.size()); ++i)
365  {
366  auto it_elem = it_elem_begin + i;
367  std::vector<bool> dummy;
368  it_elem->CalculateOnIntegrationPoints(CALCULATE_EXPLICIT_MP_STRESS, dummy, rCurrentProcessInfo);
369  }
370  }
371 
372  // Finalizes solution step for all of the conditions
373  const auto it_cond_begin = rModelPart.ConditionsBegin();
374  #pragma omp parallel for
375  for (int i = 0; i < static_cast<int>(rModelPart.Conditions().size()); ++i) {
376  auto it_cond = it_cond_begin + i;
377  it_cond->FinalizeSolutionStep(rCurrentProcessInfo);
378  }
379 
380  KRATOS_CATCH("")
381  }
382  //***************************************************************************
383  //***************************************************************************
384 
385  void CalculateUpdatedGridVelocityField(const ProcessInfo& rCurrentProcessInfo, ModelPart& rModelPart)
386  {
387  if (rCurrentProcessInfo.GetValue(EXPLICIT_STRESS_UPDATE_OPTION) == 1)
388  {
389  // USL
390  const SizeType DomainSize = rCurrentProcessInfo[DOMAIN_SIZE];
391  #pragma omp parallel for
392  for (int iter = 0; iter < static_cast<int>(rModelPart.Nodes().size()); ++iter)
393  {
394  NodeIterator i = rModelPart.NodesBegin() + iter;
395  if ((i)->Is(ACTIVE))
396  {
397  array_1d<double, 3 >& r_nodal_momenta = (i)->FastGetSolutionStepValue(NODAL_MOMENTUM);
398  array_1d<double, 3>& r_current_velocity = i->FastGetSolutionStepValue(VELOCITY);
399  r_current_velocity.clear();
400  const double nodal_mass = i->FastGetSolutionStepValue(NODAL_MASS);
401  if (nodal_mass > numerical_limit)
402  {
403  for (IndexType j = 0; j < DomainSize; j++)
404  {
405  r_current_velocity[j] = r_nodal_momenta[j] / nodal_mass;
406  } // for DomainSize
407  }
408  }
409  }
410  }
411  else if (rCurrentProcessInfo.GetValue(EXPLICIT_STRESS_UPDATE_OPTION) == 2)
412  {
413  // MUSL stress update. This works by projecting the updated particle
414  // velocity back to the nodes. The nodal velocity field is then
415  // used for stress computations.
416 
417  // Reset grid velocities
418  #pragma omp parallel for
419  for (int iter = 0; iter < static_cast<int>(rModelPart.Nodes().size()); ++iter)
420  {
421  auto i = rModelPart.NodesBegin() + iter;
422  array_1d<double, 3 >& nodal_velocity = (i)->FastGetSolutionStepValue(VELOCITY);
423  nodal_velocity.clear();
424  }
425 
426  // Map updated MP velocities back to grid
427  const auto it_elem_begin = rModelPart.ElementsBegin();
428  #pragma omp parallel for
429  for (int i = 0; i < static_cast<int>(rModelPart.Elements().size()); ++i) {
430  auto it_elem = it_elem_begin + i;
431  std::vector<bool> dummy;
432  it_elem->CalculateOnIntegrationPoints(CALCULATE_MUSL_VELOCITY_FIELD, dummy, rCurrentProcessInfo);
433  }
434 
435  // Reapply dirichlet BCs to MUSL velocity field
436  calculateGridVelocityAndApplyDirichletBC(rCurrentProcessInfo);
437  }
438  }
439 
440  //***************************************************************************
441  //***************************************************************************
442 
447  const Element& rCurrentElement,
448  Element::DofsVectorType& ElementalDofList,
449  const ProcessInfo& CurrentProcessInfo) override
450  {
451  rCurrentElement.GetDofList(ElementalDofList, CurrentProcessInfo);
452  }
453 
454  //***************************************************************************
455  //***************************************************************************
456 
461  const Condition& rCurrentCondition,
462  Element::DofsVectorType& rConditionDofList,
463  const ProcessInfo& rCurrentProcessInfo) override
464  {
465  rCurrentCondition.GetDofList(rConditionDofList, rCurrentProcessInfo);
466  }
467 
468  //***************************************************************************
469  //***************************************************************************
470 
478  int Check(const ModelPart& rModelPart) const override
479  {
480  KRATOS_TRY
481 
482  int err = Scheme<TSparseSpace, TDenseSpace>::Check(rModelPart);
483  if (err != 0) return err;
484 
485  //check that variables are correctly allocated
486  for (auto it = rModelPart.NodesBegin();
487  it != rModelPart.NodesEnd(); ++it)
488  {
489  KRATOS_ERROR_IF(it->SolutionStepsDataHas(DISPLACEMENT) == false) << "DISPLACEMENT variable is not allocated for node " << it->Id() << std::endl;
490  KRATOS_ERROR_IF(it->SolutionStepsDataHas(VELOCITY) == false) << "VELOCITY variable is not allocated for node " << it->Id() << std::endl;
491  KRATOS_ERROR_IF(it->SolutionStepsDataHas(ACCELERATION) == false) << "ACCELERATION variable is not allocated for node " << it->Id() << std::endl;
492  }
493 
494  //check that dofs exist
495  for (auto it = rModelPart.NodesBegin();
496  it != rModelPart.NodesEnd(); ++it)
497  {
498  KRATOS_ERROR_IF(it->HasDofFor(DISPLACEMENT_X) == false) << "Missing DISPLACEMENT_X dof on node " << it->Id() << std::endl;
499  KRATOS_ERROR_IF(it->HasDofFor(DISPLACEMENT_Y) == false) << "Missing DISPLACEMENT_Y dof on node " << it->Id() << std::endl;
500  KRATOS_ERROR_IF(it->HasDofFor(DISPLACEMENT_Z) == false) << "Missing DISPLACEMENT_Z dof on node " << it->Id() << std::endl;
501  }
502 
503  //check for minimum value of the buffer index
504  KRATOS_ERROR_IF(rModelPart.GetBufferSize() < 2) << "Insufficient buffer size. Buffer size should be greater than 2. Current size is" << rModelPart.GetBufferSize() << std::endl;
505  KRATOS_CATCH("")
506  return 0;
507  }
508 
510  Element& rCurrentElement,
511  LocalSystemVectorType& RHS_Contribution,
513  const ProcessInfo& rCurrentProcessInfo
514  ) override
515  {
516  KRATOS_TRY
517  rCurrentElement.CalculateRightHandSide(RHS_Contribution, rCurrentProcessInfo);
518  rCurrentElement.AddExplicitContribution(RHS_Contribution, RESIDUAL_VECTOR, FORCE_RESIDUAL, rCurrentProcessInfo);
519  KRATOS_CATCH("")
520  }
521 
530  Condition& rCurrentCondition,
531  LocalSystemVectorType& RHS_Contribution,
533  const ProcessInfo& rCurrentProcessInfo
534  ) override
535  {
536  KRATOS_TRY
537  rCurrentCondition.CalculateRightHandSide(RHS_Contribution, rCurrentProcessInfo);
538  rCurrentCondition.AddExplicitContribution(RHS_Contribution, RESIDUAL_VECTOR, FORCE_RESIDUAL, rCurrentProcessInfo);
539  KRATOS_CATCH("")
540  }
541 
542  protected:
545 
546  private:
547  }; /* Class MPMExplicitScheme */
548 } /* namespace Kratos.*/
549 
550 #endif /* KRATOS_MPM_EXPLICIT_SCHEME defined */
Base class for all Conditions.
Definition: condition.h:59
virtual void GetDofList(DofsVectorType &rElementalDofList, const ProcessInfo &rCurrentProcessInfo) const
Definition: condition.h:273
virtual void CalculateRightHandSide(VectorType &rRightHandSideVector, const ProcessInfo &rCurrentProcessInfo)
Definition: condition.h:440
virtual void AddExplicitContribution(const ProcessInfo &rCurrentProcessInfo)
Definition: condition.h:609
TDataType & GetValue(const Variable< TDataType > &rThisVariable)
Gets the value associated with a given variable.
Definition: data_value_container.h:268
Base class for all Elements.
Definition: element.h:60
virtual void CalculateRightHandSide(VectorType &rRightHandSideVector, const ProcessInfo &rCurrentProcessInfo)
Definition: element.h:437
std::vector< DofType::Pointer > DofsVectorType
Definition: element.h:100
virtual void AddExplicitContribution(const ProcessInfo &rCurrentProcessInfo)
Definition: element.h:622
virtual void GetDofList(DofsVectorType &rElementalDofList, const ProcessInfo &rCurrentProcessInfo) const
Definition: element.h:271
std::vector< std::size_t > EquationIdVectorType
Definition: element.h:98
A MPM explicit scheme.
Definition: mpm_explicit_scheme.hpp:43
ModelPart::ElementsContainerType ElementsArrayType
Definition: mpm_explicit_scheme.hpp:67
ModelPart::ConditionsContainerType ConditionsArrayType
Definition: mpm_explicit_scheme.hpp:69
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_explicit_scheme.hpp:529
void Initialize(ModelPart &rModelPart) override
This is the place to initialize the Scheme. This is intended to be called just once when the strategy...
Definition: mpm_explicit_scheme.hpp:118
BaseType::TDataType TDataType
Definition: mpm_explicit_scheme.hpp:53
BaseType::Pointer BaseTypePointer
Definition: mpm_explicit_scheme.hpp:71
std::size_t IndexType
Definition of the index type.
Definition: mpm_explicit_scheme.hpp:83
ModelPart::NodesContainerType NodesArrayType
The arrays of elements and nodes.
Definition: mpm_explicit_scheme.hpp:74
void UpdateTranslationalDegreesOfFreedom(const ProcessInfo &r_current_process_info, NodeIterator itCurrentNode, const IndexType DisplacementPosition, const double delta_time, const SizeType DomainSize=3)
Definition: mpm_explicit_scheme.hpp:174
ModelPart & mr_grid_model_part
Definition: mpm_explicit_scheme.hpp:544
void InitializeSolutionStep(ModelPart &r_model_part, TSystemMatrixType &A, TSystemVectorType &Dx, TSystemVectorType &b) override
Definition: mpm_explicit_scheme.hpp:220
BaseTypePointer Clone() override
Definition: mpm_explicit_scheme.hpp:109
static constexpr double numerical_limit
The definition of the numerical limit.
Definition: mpm_explicit_scheme.hpp:86
void FinalizeSolutionStep(ModelPart &rModelPart, TSystemMatrixType &A, TSystemVectorType &Dx, TSystemVectorType &b) override
Definition: mpm_explicit_scheme.hpp:336
virtual ~MPMExplicitScheme()
Destructor.
Definition: mpm_explicit_scheme.hpp:104
void GetDofList(const Element &rCurrentElement, Element::DofsVectorType &ElementalDofList, const ProcessInfo &CurrentProcessInfo) override
Definition: mpm_explicit_scheme.hpp:446
int Check(const ModelPart &rModelPart) const override
Definition: mpm_explicit_scheme.hpp:478
ModelPart::NodeIterator NodeIterator
Definition for the node iterator.
Definition: mpm_explicit_scheme.hpp:77
BaseType::LocalSystemVectorType LocalSystemVectorType
Definition: mpm_explicit_scheme.hpp:63
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_explicit_scheme.hpp:509
BaseType::TSystemVectorType TSystemVectorType
Definition: mpm_explicit_scheme.hpp:61
void Update(ModelPart &r_model_part, DofsArrayType &rDofSet, TSystemMatrixType &A, TSystemVectorType &Dx, TSystemVectorType &b) override
Definition: mpm_explicit_scheme.hpp:138
void CalculateUpdatedGridVelocityField(const ProcessInfo &rCurrentProcessInfo, ModelPart &rModelPart)
Definition: mpm_explicit_scheme.hpp:385
Element::DofsVectorType DofsVectorType
Definition: mpm_explicit_scheme.hpp:57
BaseType::DofsArrayType DofsArrayType
Definition: mpm_explicit_scheme.hpp:55
KRATOS_CLASS_POINTER_DEFINITION(MPMExplicitScheme)
void calculateGridVelocityAndApplyDirichletBC(const ProcessInfo rCurrentProcessInfo, bool calculateVelocityFromMomenta=false)
Apply Dirichlet BCs to nodal velocity field.
Definition: mpm_explicit_scheme.hpp:290
MPMExplicitScheme(ModelPart &grid_model_part)
Default constructor.
Definition: mpm_explicit_scheme.hpp:95
BaseType::TSystemMatrixType TSystemMatrixType
Definition: mpm_explicit_scheme.hpp:59
BaseType::LocalSystemMatrixType LocalSystemMatrixType
Definition: mpm_explicit_scheme.hpp:65
std::size_t SizeType
Definition of the size type.
Definition: mpm_explicit_scheme.hpp:80
Scheme< TSparseSpace, TDenseSpace > BaseType
Definition: mpm_explicit_scheme.hpp:51
void GetDofList(const Condition &rCurrentCondition, Element::DofsVectorType &rConditionDofList, const ProcessInfo &rCurrentProcessInfo) override
Definition: mpm_explicit_scheme.hpp:460
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
ElementIterator ElementsBegin(IndexType ThisIndex=0)
Definition: model_part.h:1169
MeshType::ConditionsContainerType ConditionsContainerType
Condintions container. A vector set of Conditions with their Id's as key.
Definition: model_part.h:183
ConditionIterator ConditionsBegin(IndexType ThisIndex=0)
Definition: model_part.h:1361
MeshType::ElementsContainerType ElementsContainerType
Element container. A vector set of Elements with their Id's as key.
Definition: model_part.h:168
IndexType GetBufferSize() const
This method gets the suffer size of the model part database.
Definition: model_part.h:1876
NodeIterator NodesBegin(IndexType ThisIndex=0)
Definition: model_part.h:487
ConditionsContainerType & Conditions(IndexType ThisIndex=0)
Definition: model_part.h:1381
ProcessInfo & GetProcessInfo()
Definition: model_part.h:1746
MeshType::NodeIterator NodeIterator
Definition: model_part.h:134
ElementsContainerType & Elements(IndexType ThisIndex=0)
Definition: model_part.h:1189
MeshType::NodesContainerType NodesContainerType
Nodes container. Which is a vector set of nodes with their Id's as key.
Definition: model_part.h:128
NodeIterator NodesEnd(IndexType ThisIndex=0)
Definition: model_part.h:497
NodesContainerType & Nodes(IndexType ThisIndex=0)
Definition: model_part.h:507
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
ProcessInfo holds the current value of different solution parameters.
Definition: process_info.h:59
This class provides the implementation of the basic tasks that are needed by the solution strategy.
Definition: scheme.h:56
typename TSparseSpace::MatrixType TSystemMatrixType
Matrix type definition.
Definition: scheme.h:71
void SetSchemeIsInitialized(bool SchemeIsInitializedFlag=true)
This method sets if the elements have been initialized or not (true by default)
Definition: scheme.h:188
ModelPart::ElementsContainerType ElementsArrayType
Elements containers definition.
Definition: scheme.h:89
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
typename TSparseSpace::VectorType TSystemVectorType
Vector type definition.
Definition: scheme.h:74
typename TDenseSpace::VectorType LocalSystemVectorType
Local system vector type definition.
Definition: scheme.h:80
virtual void InitializeSolutionStep(ModelPart &rModelPart, TSystemMatrixType &A, TSystemVectorType &Dx, TSystemVectorType &b)
Function called once at the beginning of each solution step.
Definition: scheme.h:272
typename TSparseSpace::DataType TDataType
Data type definition.
Definition: scheme.h:68
typename TDenseSpace::MatrixType LocalSystemMatrixType
Local system matrix type definition.
Definition: scheme.h:77
virtual int Check(const ModelPart &rModelPart) const
This function is designed to be called once to perform all the checks needed on the input provided....
Definition: scheme.h:508
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
#define KRATOS_ERROR_IF(conditional)
Definition: exception.h:162
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
delta_time
Definition: generate_frictional_mortar_condition.py:130
b
Definition: generate_total_lagrangian_mixed_volumetric_strain_element.py:31
float gamma
Definition: generate_two_fluid_navier_stokes.py:131
int j
Definition: quadrature.py:648
dummy
Definition: script.py:194
A
Definition: sensitivityMatrix.py:70
int dim
Definition: sensitivityMatrix.py:25
integer i
Definition: TensorModule.f:17