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.
poro_newmark_quasistatic_U_Pw_scheme.hpp
Go to the documentation of this file.
1 
2 // | / |
3 // ' / __| _` | __| _ \ __|
4 // . \ | ( | | ( |\__ `
5 // _|\_\_| \__,_|\__|\___/ ____/
6 // Multi-Physics
7 //
8 // License: BSD License
9 // Kratos default license: kratos/license.txt
10 //
11 // Main authors: Ignasi de Pouplana
12 
13 
14 #if !defined(KRATOS_PORO_NEWMARK_QUASISTATIC_U_PW_SCHEME )
15 #define KRATOS_PORO_NEWMARK_QUASISTATIC_U_PW_SCHEME
16 
17 // Project includes
18 #include "includes/define.h"
19 #include "includes/model_part.h"
22 
23 // Application includes
25 
26 namespace Kratos
27 {
28 
29 template<class TSparseSpace, class TDenseSpace>
30 
31 class PoroNewmarkQuasistaticUPwScheme : public Scheme<TSparseSpace,TDenseSpace>
32 {
33 
34 public:
35 
37 
44 
45 //----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
46 
48  PoroNewmarkQuasistaticUPwScheme(double beta, double gamma, double theta) : Scheme<TSparseSpace,TDenseSpace>()
49  {
50  // Here mBeta and mGamma are not used for the GN11 scheme
51  mBeta = 1.0;
52  mGamma = 1.0;
53  mTheta = theta;
54  }
55 
56  //------------------------------------------------------------------------------------
57 
60 
61 //----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
62 
63  int Check(ModelPart& r_model_part) override
64  {
66 
67  //check for variables keys (verify that the variables are correctly initialized)
68  if(DELTA_TIME.Key() == 0)
69  KRATOS_THROW_ERROR( std::invalid_argument,"DELTA_TIME Key is 0. Check if all applications were correctly registered.", "")
70  if(DISPLACEMENT.Key() == 0)
71  KRATOS_THROW_ERROR( std::invalid_argument,"DISPLACEMENT Key is 0. Check if all applications were correctly registered.", "" )
72  if(VELOCITY.Key() == 0)
73  KRATOS_THROW_ERROR( std::invalid_argument,"VELOCITY Key is 0. Check if all applications were correctly registered.", "" )
74  if(WATER_PRESSURE.Key() == 0)
75  KRATOS_THROW_ERROR( std::invalid_argument, "WATER_PRESSURE Key is 0. Check if all applications were correctly registered.", "" )
76  if(DT_WATER_PRESSURE.Key() == 0)
77  KRATOS_THROW_ERROR( std::invalid_argument, "DT_WATER_PRESSURE Key is 0. Check if all applications were correctly registered.", "" )
78  if ( VELOCITY_COEFFICIENT.Key() == 0 )
79  KRATOS_THROW_ERROR( std::invalid_argument, "VELOCITY_COEFFICIENT Key is 0. Check if all applications were correctly registered.", "" )
80  if ( DT_PRESSURE_COEFFICIENT.Key() == 0 )
81  KRATOS_THROW_ERROR( std::invalid_argument, "DT_PRESSURE_COEFFICIENT Key is 0. Check if all applications were correctly registered.", "" )
82 
83  //check that variables are correctly allocated
84  for(ModelPart::NodesContainerType::iterator it=r_model_part.NodesBegin(); it!=r_model_part.NodesEnd(); it++)
85  {
86  if(it->SolutionStepsDataHas(DISPLACEMENT) == false)
87  KRATOS_THROW_ERROR( std::logic_error, "DISPLACEMENT variable is not allocated for node ", it->Id() )
88  if(it->SolutionStepsDataHas(VELOCITY) == false)
89  KRATOS_THROW_ERROR( std::logic_error, "VELOCITY variable is not allocated for node ", it->Id() )
90  if(it->SolutionStepsDataHas(WATER_PRESSURE) == false)
91  KRATOS_THROW_ERROR( std::logic_error, "WATER_PRESSURE variable is not allocated for node ", it->Id() )
92  if(it->SolutionStepsDataHas(DT_WATER_PRESSURE) == false)
93  KRATOS_THROW_ERROR( std::logic_error, "DT_WATER_PRESSURE variable is not allocated for node ", it->Id() )
94 
95  if(it->HasDofFor(DISPLACEMENT_X) == false)
96  KRATOS_THROW_ERROR( std::invalid_argument,"missing DISPLACEMENT_X dof on node ",it->Id() )
97  if(it->HasDofFor(DISPLACEMENT_Y) == false)
98  KRATOS_THROW_ERROR( std::invalid_argument,"missing DISPLACEMENT_Y dof on node ",it->Id() )
99  if(it->HasDofFor(DISPLACEMENT_Z) == false)
100  KRATOS_THROW_ERROR( std::invalid_argument,"missing DISPLACEMENT_Z dof on node ",it->Id() )
101  if(it->HasDofFor(WATER_PRESSURE) == false)
102  KRATOS_THROW_ERROR( std::invalid_argument,"missing WATER_PRESSURE dof on node ",it->Id() )
103  }
104 
105  //check for minimum value of the buffer index.
106  if (r_model_part.GetBufferSize() < 2)
107  KRATOS_THROW_ERROR( std::logic_error, "insufficient buffer size. Buffer size should be greater than 2. Current size is", r_model_part.GetBufferSize() )
108 
109  // Check theta
110  if(mTheta <= 0.0)
111  KRATOS_THROW_ERROR( std::invalid_argument,"Theta has an invalid value ", "" )
112 
113  return 0;
114 
115  KRATOS_CATCH( "" )
116  }
117 
118 //----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
119 
120  void Initialize(ModelPart& r_model_part) override
121  {
122  KRATOS_TRY
123 
124  mDeltaTime = r_model_part.GetProcessInfo()[DELTA_TIME];
125  // Note: VELOCITY_COEFFICIENT is updated according to the GN11 scheme used here
126  r_model_part.GetProcessInfo().SetValue(VELOCITY_COEFFICIENT,1.0/(mTheta*mDeltaTime));
127  r_model_part.GetProcessInfo().SetValue(DT_PRESSURE_COEFFICIENT,1.0/(mTheta*mDeltaTime));
128 
129  const int NNodes = static_cast<int>(r_model_part.Nodes().size());
130  ModelPart::NodesContainerType::iterator node_begin = r_model_part.NodesBegin();
131 
132  // Initialize INITIAL_STRESS_TENSOR
133  #pragma omp parallel for
134  for(int i = 0; i < NNodes; i++)
135  {
136  ModelPart::NodesContainerType::iterator itNode = node_begin + i;
137 
138  Matrix& rInitialStress = itNode->FastGetSolutionStepValue(INITIAL_STRESS_TENSOR);
139  if(rInitialStress.size1() != 3)
140  rInitialStress.resize(3,3,false);
141  noalias(rInitialStress) = ZeroMatrix(3,3);
142  }
143 
145 
146  KRATOS_CATCH("")
147  }
148 
149 //----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
150 
151  void InitializeElements( ModelPart& rModelPart) override
152  {
153  KRATOS_TRY
154 
155  const ProcessInfo& CurrentProcessInfo = rModelPart.GetProcessInfo();
156 
157  int NElems = static_cast<int>(rModelPart.Elements().size());
158  ModelPart::ElementsContainerType::iterator el_begin = rModelPart.ElementsBegin();
159 
160  // #pragma omp parallel for
161  for(int i = 0; i < NElems; i++)
162  {
163  ModelPart::ElementsContainerType::iterator itElem = el_begin + i;
164  itElem -> Initialize(CurrentProcessInfo);
165  }
166 
168 
169  KRATOS_CATCH("")
170  }
171 
172 //----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
173 
175  ModelPart& r_model_part,
177  TSystemVectorType& Dx,
178  TSystemVectorType& b) override
179  {
180  KRATOS_TRY
181 
182  const ProcessInfo& CurrentProcessInfo = r_model_part.GetProcessInfo();
183 
184  int NElems = static_cast<int>(r_model_part.Elements().size());
185  ModelPart::ElementsContainerType::iterator el_begin = r_model_part.ElementsBegin();
186 
187  #pragma omp parallel for
188  for(int i = 0; i < NElems; i++)
189  {
190  ModelPart::ElementsContainerType::iterator itElem = el_begin + i;
191  itElem -> InitializeSolutionStep(CurrentProcessInfo);
192  }
193 
194  int NCons = static_cast<int>(r_model_part.Conditions().size());
195  ModelPart::ConditionsContainerType::iterator con_begin = r_model_part.ConditionsBegin();
196 
197  #pragma omp parallel for
198  for(int i = 0; i < NCons; i++)
199  {
200  ModelPart::ConditionsContainerType::iterator itCond = con_begin + i;
201  itCond -> InitializeSolutionStep(CurrentProcessInfo);
202  }
203 
204  KRATOS_CATCH("")
205  }
206 
207 //----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
208 
209  void Predict(
210  ModelPart& r_model_part,
211  DofsArrayType& rDofSet,
213  TSystemVectorType& Dx,
214  TSystemVectorType& b) override
215  {
216  this->UpdateVariablesDerivatives(r_model_part);
217  }
218 
219 //----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
220 
222  ModelPart& r_model_part,
224  TSystemVectorType& Dx,
225  TSystemVectorType& b) override
226  {
227  KRATOS_TRY
228 
229  const ProcessInfo& CurrentProcessInfo = r_model_part.GetProcessInfo();
230 
231  int NElems = static_cast<int>(r_model_part.Elements().size());
232  ModelPart::ElementsContainerType::iterator el_begin = r_model_part.ElementsBegin();
233 
234  #pragma omp parallel for
235  for(int i = 0; i < NElems; i++)
236  {
237  ModelPart::ElementsContainerType::iterator itElem = el_begin + i;
238  itElem -> InitializeNonLinearIteration(CurrentProcessInfo);
239  }
240 
241  int NCons = static_cast<int>(r_model_part.Conditions().size());
242  ModelPart::ConditionsContainerType::iterator con_begin = r_model_part.ConditionsBegin();
243 
244  #pragma omp parallel for
245  for(int i = 0; i < NCons; i++)
246  {
247  ModelPart::ConditionsContainerType::iterator itCond = con_begin + i;
248  itCond -> InitializeNonLinearIteration(CurrentProcessInfo);
249  }
250 
251  KRATOS_CATCH("")
252  }
253 
254 //----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
255 
257  ModelPart& r_model_part,
259  TSystemVectorType& Dx,
260  TSystemVectorType& b) override
261  {
262  KRATOS_TRY
263 
264  const ProcessInfo& CurrentProcessInfo = r_model_part.GetProcessInfo();
265 
266  int NElems = static_cast<int>(r_model_part.Elements().size());
267  ModelPart::ElementsContainerType::iterator el_begin = r_model_part.ElementsBegin();
268 
269  #pragma omp parallel for
270  for(int i = 0; i < NElems; i++)
271  {
272  ModelPart::ElementsContainerType::iterator itElem = el_begin + i;
273  itElem -> FinalizeNonLinearIteration(CurrentProcessInfo);
274  }
275 
276  int NCons = static_cast<int>(r_model_part.Conditions().size());
277  ModelPart::ConditionsContainerType::iterator con_begin = r_model_part.ConditionsBegin();
278 
279  #pragma omp parallel for
280  for(int i = 0; i < NCons; i++)
281  {
282  ModelPart::ConditionsContainerType::iterator itCond = con_begin + i;
283  itCond -> FinalizeNonLinearIteration(CurrentProcessInfo);
284  }
285 
286  KRATOS_CATCH("")
287  }
288 
289 //----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
290 
292  ModelPart& rModelPart,
294  TSystemVectorType& Dx,
295  TSystemVectorType& b) override
296  {
297  KRATOS_TRY
298 
299  if(rModelPart.GetProcessInfo()[NODAL_SMOOTHING] == true)
300  {
301  const int NNodes = static_cast<int>(rModelPart.Nodes().size());
302  ModelPart::NodesContainerType::iterator node_begin = rModelPart.NodesBegin();
303 
304  // Clear nodal variables
305  #pragma omp parallel for
306  for(int i = 0; i < NNodes; i++)
307  {
308  ModelPart::NodesContainerType::iterator itNode = node_begin + i;
309 
310  itNode->FastGetSolutionStepValue(NODAL_AREA) = 0.0;
311  Matrix& rNodalStress = itNode->FastGetSolutionStepValue(NODAL_EFFECTIVE_STRESS_TENSOR);
312  if(rNodalStress.size1() != 3)
313  rNodalStress.resize(3,3,false);
314  noalias(rNodalStress) = ZeroMatrix(3,3);
315  array_1d<double,3>& r_nodal_grad_pressure = itNode->FastGetSolutionStepValue(NODAL_WATER_PRESSURE_GRADIENT);
316  noalias(r_nodal_grad_pressure) = ZeroVector(3);
317  itNode->FastGetSolutionStepValue(NODAL_DAMAGE_VARIABLE) = 0.0;
318  itNode->FastGetSolutionStepValue(NODAL_JOINT_AREA) = 0.0;
319  itNode->FastGetSolutionStepValue(NODAL_JOINT_WIDTH) = 0.0;
320  itNode->FastGetSolutionStepValue(NODAL_JOINT_DAMAGE) = 0.0;
321  }
322 
323  BaseType::FinalizeSolutionStep(rModelPart,A,Dx,b);
324 
325  // Compute smoothed nodal variables
326  #pragma omp parallel for
327  for(int n = 0; n < NNodes; n++)
328  {
329  ModelPart::NodesContainerType::iterator itNode = node_begin + n;
330 
331  const double& NodalArea = itNode->FastGetSolutionStepValue(NODAL_AREA);
332  if (NodalArea>1.0e-20)
333  {
334  const double InvNodalArea = 1.0/NodalArea;
335  Matrix& rNodalStress = itNode->FastGetSolutionStepValue(NODAL_EFFECTIVE_STRESS_TENSOR);
336  array_1d<double,3>& r_nodal_grad_pressure = itNode->FastGetSolutionStepValue(NODAL_WATER_PRESSURE_GRADIENT);
337  for(unsigned int i = 0; i<3; i++)
338  {
339  r_nodal_grad_pressure[i] *= InvNodalArea;
340  for(unsigned int j = 0; j<3; j++)
341  {
342  rNodalStress(i,j) *= InvNodalArea;
343  }
344  }
345  double& NodalDamage = itNode->FastGetSolutionStepValue(NODAL_DAMAGE_VARIABLE);
346  NodalDamage *= InvNodalArea;
347  }
348 
349  const double& NodalJointArea = itNode->FastGetSolutionStepValue(NODAL_JOINT_AREA);
350  if (NodalJointArea>1.0e-20)
351  {
352  const double InvNodalJointArea = 1.0/NodalJointArea;
353  double& NodalJointWidth = itNode->FastGetSolutionStepValue(NODAL_JOINT_WIDTH);
354  NodalJointWidth *= InvNodalJointArea;
355  double& NodalJointDamage = itNode->FastGetSolutionStepValue(NODAL_JOINT_DAMAGE);
356  NodalJointDamage *= InvNodalJointArea;
357  }
358  }
359  }
360  else
361  {
362  BaseType::FinalizeSolutionStep(rModelPart,A,Dx,b);
363  }
364 
365  KRATOS_CATCH("")
366  }
367 
368 //----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
369 
370 // Note: this is in a parallel loop
371 
373  Element& rCurrentElement,
374  LocalSystemMatrixType& LHS_Contribution,
375  LocalSystemVectorType& RHS_Contribution,
377  const ProcessInfo& CurrentProcessInfo) override
378  {
379  KRATOS_TRY
380 
381  rCurrentElement.CalculateLocalSystem(LHS_Contribution,RHS_Contribution,CurrentProcessInfo);
382 
383  rCurrentElement.EquationIdVector(EquationId,CurrentProcessInfo);
384 
385  KRATOS_CATCH( "" )
386  }
387 
388 //----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
389 
390 // Note: this is in a parallel loop
391 
393  Condition& rCurrentCondition,
394  LocalSystemMatrixType& LHS_Contribution,
395  LocalSystemVectorType& RHS_Contribution,
397  const ProcessInfo& CurrentProcessInfo) override
398  {
399  KRATOS_TRY
400 
401  rCurrentCondition.CalculateLocalSystem(LHS_Contribution,RHS_Contribution,CurrentProcessInfo);
402 
403  rCurrentCondition.EquationIdVector(EquationId,CurrentProcessInfo);
404 
405  KRATOS_CATCH( "" )
406  }
407 
408 //----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
409 
410 // Note: this is in a parallel loop
411 
413  Element& rCurrentElement,
414  LocalSystemVectorType& RHS_Contribution,
416  const ProcessInfo& CurrentProcessInfo) override
417  {
418  KRATOS_TRY
419 
420  rCurrentElement.CalculateRightHandSide(RHS_Contribution,CurrentProcessInfo);
421 
422  rCurrentElement.EquationIdVector(EquationId,CurrentProcessInfo);
423 
424  KRATOS_CATCH( "" )
425  }
426 
427 //----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
428 
429 // Note: this is in a parallel loop
430 
432  Condition& rCurrentCondition,
433  LocalSystemVectorType& RHS_Contribution,
435  const ProcessInfo& CurrentProcessInfo) override
436  {
437  KRATOS_TRY
438 
439  rCurrentCondition.CalculateRightHandSide(RHS_Contribution, CurrentProcessInfo);
440 
441  rCurrentCondition.EquationIdVector(EquationId, CurrentProcessInfo);
442 
443  KRATOS_CATCH( "" )
444  }
445 
446 //----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
447 
448 // Note: this is in a parallel loop
449 
451  Element& rCurrentElement,
452  LocalSystemMatrixType& LHS_Contribution,
454  const ProcessInfo& CurrentProcessInfo) override
455  {
456  KRATOS_TRY
457 
458  rCurrentElement.CalculateLeftHandSide(LHS_Contribution,CurrentProcessInfo);
459 
460  rCurrentElement.EquationIdVector(EquationId,CurrentProcessInfo);
461 
462  KRATOS_CATCH( "" )
463  }
464 
465 //----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
466 
467 // Note: this is in a parallel loop
468 
470  Condition& rCurrentCondition,
471  LocalSystemMatrixType& LHS_Contribution,
473  const ProcessInfo& CurrentProcessInfo) override
474  {
475  KRATOS_TRY
476 
477  rCurrentCondition.CalculateLeftHandSide(LHS_Contribution, CurrentProcessInfo);
478 
479  rCurrentCondition.EquationIdVector(EquationId, CurrentProcessInfo);
480 
481  KRATOS_CATCH( "" )
482  }
483 
484 //----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
485 
486  void Update(
487  ModelPart& r_model_part,
488  DofsArrayType& rDofSet,
490  TSystemVectorType& Dx,
491  TSystemVectorType& b) override
492  {
493  KRATOS_TRY
494 
495  int NumThreads = ParallelUtilities::GetNumThreads();
496  OpenMPUtils::PartitionVector DofSetPartition;
497  OpenMPUtils::DivideInPartitions(rDofSet.size(), NumThreads, DofSetPartition);
498 
499  #pragma omp parallel
500  {
501  int k = OpenMPUtils::ThisThread();
502 
503  typename DofsArrayType::iterator DofsBegin = rDofSet.begin() + DofSetPartition[k];
504  typename DofsArrayType::iterator DofsEnd = rDofSet.begin() + DofSetPartition[k+1];
505 
506  //Update Displacement and Pressure (DOFs)
507  for (typename DofsArrayType::iterator itDof = DofsBegin; itDof != DofsEnd; ++itDof)
508  {
509  if (itDof->IsFree())
510  itDof->GetSolutionStepValue() += TSparseSpace::GetValue(Dx, itDof->EquationId());
511  }
512  }
513 
514  this->UpdateVariablesDerivatives(r_model_part);
515 
516  KRATOS_CATCH( "" )
517  }
518 
519 //----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
520 
521 protected:
522 
524 
525  double mBeta;
526  double mGamma;
527  double mTheta;
528  double mDeltaTime;
529 
530 //----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
531 
532  virtual inline void UpdateVariablesDerivatives(ModelPart& r_model_part)
533  {
534  KRATOS_TRY
535 
536  //Update Acceleration, Velocity and DtPressure
537 
538  array_1d<double,3> DeltaDisplacement;
539  double DeltaPressure;
540 
541  const int NNodes = static_cast<int>(r_model_part.Nodes().size());
542  ModelPart::NodesContainerType::iterator node_begin = r_model_part.NodesBegin();
543 
544  #pragma omp parallel for private(DeltaDisplacement,DeltaPressure)
545  for(int i = 0; i < NNodes; i++)
546  {
547  ModelPart::NodesContainerType::iterator itNode = node_begin + i;
548 
549  array_1d<double,3>& CurrentVelocity = itNode->FastGetSolutionStepValue(VELOCITY);
550  noalias(DeltaDisplacement) = itNode->FastGetSolutionStepValue(DISPLACEMENT) - itNode->FastGetSolutionStepValue(DISPLACEMENT, 1);
551  const array_1d<double,3>& PreviousVelocity = itNode->FastGetSolutionStepValue(VELOCITY, 1);
552 
553  // Note: Since acceleration is not used in the quasi-static scheme, here we use a GN11 scheme to update velocity.
554  // A GN22 is used in the dynamic scheme
555  noalias(CurrentVelocity) = 1.0/(mTheta*mDeltaTime)*(DeltaDisplacement - (1.0-mTheta)*mDeltaTime*PreviousVelocity);
556 
557  double& CurrentDtPressure = itNode->FastGetSolutionStepValue(DT_WATER_PRESSURE);
558  DeltaPressure = itNode->FastGetSolutionStepValue(WATER_PRESSURE) - itNode->FastGetSolutionStepValue(WATER_PRESSURE, 1);
559  const double& PreviousDtPressure = itNode->FastGetSolutionStepValue(DT_WATER_PRESSURE, 1);
560 
561  CurrentDtPressure = 1.0/(mTheta*mDeltaTime)*(DeltaPressure - (1.0-mTheta)*mDeltaTime*PreviousDtPressure);
562  }
563 
564  KRATOS_CATCH( "" )
565  }
566 
567 }; // Class PoroNewmarkQuasistaticUPwScheme
568 } // namespace Kratos
569 
570 #endif // KRATOS_PORO_NEWMARK_QUASISTATIC_U_PW_SCHEME defined
Base class for all Conditions.
Definition: condition.h:59
virtual void CalculateLeftHandSide(MatrixType &rLeftHandSideMatrix, const ProcessInfo &rCurrentProcessInfo)
Definition: condition.h:426
virtual void EquationIdVector(EquationIdVectorType &rResult, const ProcessInfo &rCurrentProcessInfo) const
Definition: condition.h:260
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
void SetValue(const Variable< TDataType > &rThisVariable, TDataType const &rValue)
Sets the value for a given variable.
Definition: data_value_container.h:320
Base class for all Elements.
Definition: element.h:60
virtual void CalculateLeftHandSide(MatrixType &rLeftHandSideMatrix, const ProcessInfo &rCurrentProcessInfo)
Definition: element.h:423
virtual void CalculateRightHandSide(VectorType &rRightHandSideVector, const ProcessInfo &rCurrentProcessInfo)
Definition: element.h:437
virtual void EquationIdVector(EquationIdVectorType &rResult, const ProcessInfo &rCurrentProcessInfo) const
Definition: element.h:258
virtual void CalculateLocalSystem(MatrixType &rLeftHandSideMatrix, VectorType &rRightHandSideVector, const ProcessInfo &rCurrentProcessInfo)
Definition: element.h:405
std::vector< std::size_t > EquationIdVectorType
Definition: element.h:98
void resize(std::size_t NewSize1, std::size_t NewSize2, bool preserve=0)
Definition: amatrix_interface.h:224
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
ConditionIterator ConditionsBegin(IndexType ThisIndex=0)
Definition: model_part.h:1361
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
ElementsContainerType & Elements(IndexType ThisIndex=0)
Definition: model_part.h:1189
NodeIterator NodesEnd(IndexType ThisIndex=0)
Definition: model_part.h:497
NodesContainerType & Nodes(IndexType ThisIndex=0)
Definition: model_part.h:507
static void DivideInPartitions(const int NumTerms, const int NumThreads, PartitionVector &Partitions)
Divide an array of length NumTerms between NumThreads threads.
Definition: openmp_utils.h:158
static int ThisThread()
Wrapper for omp_get_thread_num().
Definition: openmp_utils.h:108
std::vector< int > PartitionVector
Vector type for the output of DivideInPartitions method.
Definition: openmp_utils.h:53
static int GetNumThreads()
Returns the current number of threads.
Definition: parallel_utilities.cpp:34
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
boost::indirect_iterator< typename TContainerType::iterator > iterator
Definition: pointer_vector_set.h:95
size_type size() const
Returns the number of elements in the container.
Definition: pointer_vector_set.h:502
iterator begin()
Returns an iterator pointing to the beginning of the container.
Definition: pointer_vector_set.h:278
Definition: poro_newmark_quasistatic_U_Pw_scheme.hpp:32
void Update(ModelPart &r_model_part, DofsArrayType &rDofSet, TSystemMatrixType &A, TSystemVectorType &Dx, TSystemVectorType &b) override
Performing the update of the solution.
Definition: poro_newmark_quasistatic_U_Pw_scheme.hpp:486
void InitializeSolutionStep(ModelPart &r_model_part, TSystemMatrixType &A, TSystemVectorType &Dx, TSystemVectorType &b) override
Function called once at the beginning of each solution step.
Definition: poro_newmark_quasistatic_U_Pw_scheme.hpp:174
virtual void UpdateVariablesDerivatives(ModelPart &r_model_part)
Definition: poro_newmark_quasistatic_U_Pw_scheme.hpp:532
void CalculateSystemContributions(Element &rCurrentElement, LocalSystemMatrixType &LHS_Contribution, LocalSystemVectorType &RHS_Contribution, Element::EquationIdVectorType &EquationId, const ProcessInfo &CurrentProcessInfo) override
This function is designed to be called in the builder and solver to introduce the selected time integ...
Definition: poro_newmark_quasistatic_U_Pw_scheme.hpp:372
void InitializeElements(ModelPart &rModelPart) override
This is the place to initialize the elements.
Definition: poro_newmark_quasistatic_U_Pw_scheme.hpp:151
double mGamma
Definition: poro_newmark_quasistatic_U_Pw_scheme.hpp:526
BaseType::DofsArrayType DofsArrayType
Definition: poro_newmark_quasistatic_U_Pw_scheme.hpp:39
void CalculateLHSContribution(Condition &rCurrentCondition, LocalSystemMatrixType &LHS_Contribution, Element::EquationIdVectorType &EquationId, const ProcessInfo &CurrentProcessInfo) override
Functions totally analogous to the precedent but applied to the "condition" objects.
Definition: poro_newmark_quasistatic_U_Pw_scheme.hpp:469
void CalculateSystemContributions(Condition &rCurrentCondition, LocalSystemMatrixType &LHS_Contribution, LocalSystemVectorType &RHS_Contribution, Element::EquationIdVectorType &EquationId, const ProcessInfo &CurrentProcessInfo) override
Functions totally analogous to the precedent but applied to the "condition" objects.
Definition: poro_newmark_quasistatic_U_Pw_scheme.hpp:392
void InitializeNonLinIteration(ModelPart &r_model_part, TSystemMatrixType &A, TSystemVectorType &Dx, TSystemVectorType &b) override
unction to be called when it is needed to initialize an iteration. It is designed to be called at the...
Definition: poro_newmark_quasistatic_U_Pw_scheme.hpp:221
double mBeta
Member Variables.
Definition: poro_newmark_quasistatic_U_Pw_scheme.hpp:525
void FinalizeNonLinIteration(ModelPart &r_model_part, TSystemMatrixType &A, TSystemVectorType &Dx, TSystemVectorType &b) override
Function to be called when it is needed to finalize an iteration. It is designed to be called at the ...
Definition: poro_newmark_quasistatic_U_Pw_scheme.hpp:256
KRATOS_CLASS_POINTER_DEFINITION(PoroNewmarkQuasistaticUPwScheme)
void Predict(ModelPart &r_model_part, DofsArrayType &rDofSet, TSystemMatrixType &A, TSystemVectorType &Dx, TSystemVectorType &b) override
Performing the prediction of the solution.
Definition: poro_newmark_quasistatic_U_Pw_scheme.hpp:209
void CalculateLHSContribution(Element &rCurrentElement, LocalSystemMatrixType &LHS_Contribution, Element::EquationIdVectorType &EquationId, const ProcessInfo &CurrentProcessInfo) override
This function is designed to calculate just the LHS contribution.
Definition: poro_newmark_quasistatic_U_Pw_scheme.hpp:450
BaseType::TSystemVectorType TSystemVectorType
Definition: poro_newmark_quasistatic_U_Pw_scheme.hpp:41
int Check(ModelPart &r_model_part) override
Definition: poro_newmark_quasistatic_U_Pw_scheme.hpp:63
BaseType::LocalSystemVectorType LocalSystemVectorType
Definition: poro_newmark_quasistatic_U_Pw_scheme.hpp:42
double mTheta
Definition: poro_newmark_quasistatic_U_Pw_scheme.hpp:527
void CalculateRHSContribution(Element &rCurrentElement, LocalSystemVectorType &RHS_Contribution, Element::EquationIdVectorType &EquationId, const ProcessInfo &CurrentProcessInfo) override
This function is designed to calculate just the RHS contribution.
Definition: poro_newmark_quasistatic_U_Pw_scheme.hpp:412
Scheme< TSparseSpace, TDenseSpace > BaseType
Definition: poro_newmark_quasistatic_U_Pw_scheme.hpp:38
double mDeltaTime
Definition: poro_newmark_quasistatic_U_Pw_scheme.hpp:528
BaseType::TSystemMatrixType TSystemMatrixType
Definition: poro_newmark_quasistatic_U_Pw_scheme.hpp:40
~PoroNewmarkQuasistaticUPwScheme() override
Destructor.
Definition: poro_newmark_quasistatic_U_Pw_scheme.hpp:59
void CalculateRHSContribution(Condition &rCurrentCondition, LocalSystemVectorType &RHS_Contribution, Element::EquationIdVectorType &EquationId, const ProcessInfo &CurrentProcessInfo) override
Functions totally analogous to the precedent but applied to the "condition" objects.
Definition: poro_newmark_quasistatic_U_Pw_scheme.hpp:431
PoroNewmarkQuasistaticUPwScheme(double beta, double gamma, double theta)
Constructor.
Definition: poro_newmark_quasistatic_U_Pw_scheme.hpp:48
BaseType::LocalSystemMatrixType LocalSystemMatrixType
Definition: poro_newmark_quasistatic_U_Pw_scheme.hpp:43
void FinalizeSolutionStep(ModelPart &rModelPart, TSystemMatrixType &A, TSystemVectorType &Dx, TSystemVectorType &b) override
Function called once at the end of a solution step, after convergence is reached if an iterative proc...
Definition: poro_newmark_quasistatic_U_Pw_scheme.hpp:291
void Initialize(ModelPart &r_model_part) override
This is the place to initialize the Scheme.
Definition: poro_newmark_quasistatic_U_Pw_scheme.hpp:120
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
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 FinalizeSolutionStep(ModelPart &rModelPart, TSystemMatrixType &A, TSystemVectorType &Dx, TSystemVectorType &b)
Function called once at the end of a solution step, after convergence is reached if an iterative proc...
Definition: scheme.h:294
typename TDenseSpace::MatrixType LocalSystemMatrixType
Local system matrix type definition.
Definition: scheme.h:77
void SetElementsAreInitialized(bool ElementsAreInitializedFlag=true)
This method sets if the elements have been initialized or not (true by default)
Definition: scheme.h:206
bool mSchemeIsInitialized
Definition: scheme.h:755
#define KRATOS_THROW_ERROR(ExceptionType, ErrorMessage, MoreInfo)
Definition: define.h:77
#define KRATOS_CATCH(MoreInfo)
Definition: define.h:110
#define KRATOS_TRY
Definition: define.h:109
Parameters GetValue(Parameters &rParameters, const std::string &rEntry)
Definition: add_kratos_parameters_to_python.cpp:53
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
KratosZeroVector< double > ZeroVector
Definition: amatrix_interface.h:561
KratosZeroMatrix< double > ZeroMatrix
Definition: amatrix_interface.h:559
T & noalias(T &TheMatrix)
Definition: amatrix_interface.h:484
b
Definition: generate_total_lagrangian_mixed_volumetric_strain_element.py:31
float gamma
Definition: generate_two_fluid_navier_stokes.py:131
int n
manufactured solution and derivatives (u=0 at z=0 dudz=0 at z=domain_height)
Definition: ode_solve.py:402
int k
Definition: quadrature.py:595
int j
Definition: quadrature.py:648
A
Definition: sensitivityMatrix.py:70
integer i
Definition: TensorModule.f:17