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.
residual_based_relaxation_scheme.hpp
Go to the documentation of this file.
1 // KRATOS ___| | | |
2 // \___ \ __| __| | | __| __| | | __| _` | |
3 // | | | | | ( | | | | ( | |
4 // _____/ \__|_| \__,_|\___|\__|\__,_|_| \__,_|_| MECHANICS
5 //
6 // License: BSD License
7 // license: StructuralMechanicsApplication/license.txt
8 //
9 // Main authors: Riccardo Rossi
10 //
11 
12 #pragma once
13 
14 // System includes
15 
16 // External includes
17 
18 // Project includes
19 #include "includes/define.h"
21 #include "includes/variables.h"
22 #include "containers/array_1d.h"
24 
25 namespace Kratos
26 {
27 
79 template<class TSparseSpace,
80  class TDenseSpace //= DenseSpace<double>
81  >
82 class ResidualBasedRelaxationScheme : public Scheme<TSparseSpace, TDenseSpace>
83 {
84 public:
88  //typedef Kratos::shared_ptr< ResidualBasedRelaxationScheme<TSparseSpace,TDenseSpace> > Pointer;
90 
92 
93  typedef typename BaseType::TDataType TDataType;
94 
96 
98 
100 
102 
104 
106 
107 
115  ResidualBasedRelaxationScheme(double NewAlphaBossak, double damping_factor)
116  : Scheme<TSparseSpace, TDenseSpace>()
117  {
118  //default values for the Newmark Scheme
119  mAlphaBossak = NewAlphaBossak;
120  mBetaNewmark = 0.25 * pow((1.00 - mAlphaBossak), 2);
121  mGammaNewmark = 0.5 - mAlphaBossak;
122 
123  mdamping_factor = damping_factor;
124 
125  // Allocate auxiliary memory
127  mMass.resize(num_threads);
128  mDamp.resize(num_threads);
129  mvel.resize(num_threads);
130 
131  //std::cout << "using the Relaxation Time Integration Scheme" << std::endl;
132  }
133 
137  {
138  }
139 
140 
150  //***************************************************************************
151 
152  void Update(
153  ModelPart& r_model_part,
154  DofsArrayType& rDofSet,
156  TSystemVectorType& Dx,
158  ) override
159  {
160  KRATOS_TRY
161 
162  //update of displacement (by DOF)
163  for (typename DofsArrayType::iterator i_dof = rDofSet.begin(); i_dof != rDofSet.end(); ++i_dof)
164  {
165  if (i_dof->IsFree())
166  {
167  i_dof->GetSolutionStepValue() += Dx[i_dof->EquationId()];
168  }
169  }
170 
171  //updating time derivatives (nodally for efficiency)
172  array_1d<double, 3 > DeltaDisp;
173  for (ModelPart::NodeIterator i = r_model_part.NodesBegin();
174  i != r_model_part.NodesEnd(); ++i)
175  {
176 
177  noalias(DeltaDisp) = (i)->FastGetSolutionStepValue(DISPLACEMENT) - (i)->FastGetSolutionStepValue(DISPLACEMENT, 1);
178  array_1d<double, 3 > & CurrentVelocity = (i)->FastGetSolutionStepValue(VELOCITY, 0);
179  array_1d<double, 3 > & OldVelocity = (i)->FastGetSolutionStepValue(VELOCITY, 1);
180 
181  array_1d<double, 3 > & CurrentAcceleration = (i)->FastGetSolutionStepValue(ACCELERATION, 0);
182  array_1d<double, 3 > & OldAcceleration = (i)->FastGetSolutionStepValue(ACCELERATION, 1);
183 
184  UpdateVelocity(CurrentVelocity, DeltaDisp, OldVelocity, OldAcceleration);
185 
186  UpdateAcceleration(CurrentAcceleration, DeltaDisp, OldVelocity, OldAcceleration);
187 
188  }
189 
190  KRATOS_CATCH( "" )
191 
192  }
193 
194 
195  //***************************************************************************
196  //predicts the solution at the current step as
197  // x = xold + vold * Dt
198 
199  void Predict(
200  ModelPart& r_model_part,
201  DofsArrayType& rDofSet,
203  TSystemVectorType& Dx,
205  ) override
206  {
207  std::cout << "prediction" << std::endl;
208  array_1d<double, 3 > DeltaDisp;
209  double DeltaTime = r_model_part.GetProcessInfo()[DELTA_TIME];
210 
211 
212  for (ModelPart::NodeIterator i = r_model_part.NodesBegin();
213  i != r_model_part.NodesEnd(); ++i)
214  {
215 
216  array_1d<double, 3 > & OldVelocity = (i)->FastGetSolutionStepValue(VELOCITY, 1);
217  array_1d<double, 3 > & OldDisp = (i)->FastGetSolutionStepValue(DISPLACEMENT, 1);
218  //predicting displacement = OldDisplacement + OldVelocity * DeltaTime;
219  //ATTENTION::: the prediction is performed only on free nodes
220  array_1d<double, 3 > & CurrentDisp = (i)->FastGetSolutionStepValue(DISPLACEMENT);
221 
222  if ((i->pGetDof(DISPLACEMENT_X))->IsFixed() == false)
223  (CurrentDisp[0]) = OldDisp[0] + DeltaTime * OldVelocity[0];
224  if (i->pGetDof(DISPLACEMENT_Y)->IsFixed() == false)
225  (CurrentDisp[1]) = OldDisp[1] + DeltaTime * OldVelocity[1];
226  if (i->HasDofFor(DISPLACEMENT_Z))
227  if (i->pGetDof(DISPLACEMENT_Z)->IsFixed() == false)
228  (CurrentDisp[2]) = OldDisp[2] + DeltaTime * OldVelocity[2];
229 
230  //updating time derivatives ::: please note that displacements and its time derivatives
231  //can not be consistently fixed separately
232  noalias(DeltaDisp) = CurrentDisp - OldDisp;
233  array_1d<double, 3 > & OldAcceleration = (i)->FastGetSolutionStepValue(ACCELERATION, 1);
234 
235  array_1d<double, 3 > & CurrentVelocity = (i)->FastGetSolutionStepValue(VELOCITY);
236  array_1d<double, 3 > & CurrentAcceleration = (i)->FastGetSolutionStepValue(ACCELERATION);
237 
238  UpdateVelocity(CurrentVelocity, DeltaDisp, OldVelocity, OldAcceleration);
239 
240  UpdateAcceleration(CurrentAcceleration, DeltaDisp, OldVelocity, OldAcceleration);
241  }
242 
243  }
244 
245 
246  //***************************************************************************
247 
260  Element& rCurrentElement,
261  LocalSystemMatrixType& LHS_Contribution,
262  LocalSystemVectorType& RHS_Contribution,
264  const ProcessInfo& CurrentProcessInfo
265  ) override
266  {
267  KRATOS_TRY
268  int k = OpenMPUtils::ThisThread();
269  //Initializing the non linear iteration for the current element
270  //basic operations for the element considered
271  rCurrentElement.CalculateLocalSystem(LHS_Contribution, RHS_Contribution, CurrentProcessInfo);
272  rCurrentElement.CalculateMassMatrix(mMass[k], CurrentProcessInfo);
273  rCurrentElement.CalculateDampingMatrix(mDamp[k], CurrentProcessInfo);
274  rCurrentElement.EquationIdVector(EquationId, CurrentProcessInfo);
275  //adding the dynamic contributions (statics is already included)
276 
277  AddDynamicsToLHS(LHS_Contribution, mDamp[k], mMass[k], CurrentProcessInfo);
278 
279  AddDynamicsToRHS(rCurrentElement, RHS_Contribution, mDamp[k], mMass[k], CurrentProcessInfo);
280 
281  KRATOS_CATCH( "" )
282 
283  }
284 
286  Element& rCurrentElement,
287  LocalSystemVectorType& RHS_Contribution,
289  const ProcessInfo& CurrentProcessInfo) override
290  {
291  int k = OpenMPUtils::ThisThread();
292  //Initializing the non linear iteration for the current element
293 
294  //basic operations for the element considered
295  rCurrentElement.CalculateRightHandSide(RHS_Contribution, CurrentProcessInfo);
296  rCurrentElement.CalculateMassMatrix(mMass[k], CurrentProcessInfo);
297  rCurrentElement.CalculateDampingMatrix(mDamp[k], CurrentProcessInfo);
298  rCurrentElement.EquationIdVector(EquationId, CurrentProcessInfo);
299 
300  //adding the dynamic contributions (static is already included)
301  AddDynamicsToRHS(rCurrentElement, RHS_Contribution, mDamp[k], mMass[k], CurrentProcessInfo);
302 
303  }
304 
309  Condition& rCurrentCondition,
310  LocalSystemMatrixType& LHS_Contribution,
311  LocalSystemVectorType& RHS_Contribution,
313  const ProcessInfo& CurrentProcessInfo) override
314  {
315  KRATOS_TRY
316  int k = OpenMPUtils::ThisThread();
317  rCurrentCondition.CalculateLocalSystem(LHS_Contribution, RHS_Contribution, CurrentProcessInfo);
318  rCurrentCondition.CalculateMassMatrix(mMass[k], CurrentProcessInfo);
319  rCurrentCondition.CalculateDampingMatrix(mDamp[k], CurrentProcessInfo);
320  rCurrentCondition.EquationIdVector(EquationId, CurrentProcessInfo);
321 
322  AddDynamicsToLHS(LHS_Contribution, mDamp[k], mMass[k], CurrentProcessInfo);
323 
324  AddDynamicsToRHS(rCurrentCondition, RHS_Contribution, mDamp[k], mMass[k], CurrentProcessInfo);
325 
326  KRATOS_CATCH( "" )
327  }
328 
330  Condition& rCurrentCondition,
331  LocalSystemVectorType& RHS_Contribution,
333  const ProcessInfo& CurrentProcessInfo) override
334  {
335  KRATOS_TRY
336  int k = OpenMPUtils::ThisThread();
337  //Initializing the non linear iteration for the current condition
338 
339  //basic operations for the element considered
340  rCurrentCondition.CalculateRightHandSide(RHS_Contribution, CurrentProcessInfo);
341  rCurrentCondition.CalculateMassMatrix(mMass[k], CurrentProcessInfo);
342  rCurrentCondition.CalculateDampingMatrix(mDamp[k], CurrentProcessInfo);
343  rCurrentCondition.EquationIdVector(EquationId, CurrentProcessInfo);
344 
345  //adding the dynamic contributions (static is already included)
346 
347  AddDynamicsToRHS(rCurrentCondition, RHS_Contribution, mDamp[k], mMass[k], CurrentProcessInfo);
348 
349  KRATOS_CATCH( "" )
350  }
351 
353  ModelPart& r_model_part,
355  TSystemVectorType& Dx,
357  ) override
358  {
359  ProcessInfo& CurrentProcessInfo = r_model_part.GetProcessInfo();
360 
362 
363  double DeltaTime = CurrentProcessInfo[DELTA_TIME];
364 
365  if (DeltaTime == 0)
366  KRATOS_THROW_ERROR( std::logic_error, "detected delta_time = 0 in the Bossak Scheme ... check if the time step is created correctly for the current model part", "" )
367 
368  //initializing constants
369  ma0 = 1.0 / (mBetaNewmark * pow(DeltaTime, 2));
370  ma1 = mGammaNewmark / (mBetaNewmark * DeltaTime);
371  ma2 = 1.0 / (mBetaNewmark * DeltaTime);
372  ma3 = 1.0 / (2.0 * mBetaNewmark) - 1.0;
373  ma4 = mGammaNewmark / mBetaNewmark - 1.0;
374  ma5 = DeltaTime * 0.5 * (mGammaNewmark / mBetaNewmark - 2.0);
375  mam = (1.0 - mAlphaBossak) / (mBetaNewmark * pow(DeltaTime, 2));
376  }
377 
385  int Check(const ModelPart& r_model_part) const override
386  {
387  KRATOS_TRY
388 
389  int err = Scheme<TSparseSpace, TDenseSpace>::Check(r_model_part);
390  if (err != 0) return err;
391 
392  //check that variables are correctly allocated
393  for (const auto& r_node : r_model_part.Nodes())
394  {
395  if (r_node.SolutionStepsDataHas(DISPLACEMENT) == false)
396  KRATOS_THROW_ERROR( std::logic_error, "DISPLACEMENT variable is not allocated for node ", r_node.Id() )
397  if (r_node.SolutionStepsDataHas(VELOCITY) == false)
398  KRATOS_THROW_ERROR( std::logic_error, "DISPLACEMENT variable is not allocated for node ", r_node.Id() )
399  if (r_node.SolutionStepsDataHas(ACCELERATION) == false)
400  KRATOS_THROW_ERROR( std::logic_error, "DISPLACEMENT variable is not allocated for node ", r_node.Id() )
401  }
402 
403  //check that dofs exist
404  for (const auto& r_node : r_model_part.Nodes())
405  {
406  if (r_node.HasDofFor(DISPLACEMENT_X) == false)
407  KRATOS_THROW_ERROR( std::invalid_argument, "missing DISPLACEMENT_X dof on node ", r_node.Id() )
408  if (r_node.HasDofFor(DISPLACEMENT_Y) == false)
409  KRATOS_THROW_ERROR( std::invalid_argument, "missing DISPLACEMENT_Y dof on node ", r_node.Id() )
410  if (r_node.HasDofFor(DISPLACEMENT_Z) == false)
411  KRATOS_THROW_ERROR( std::invalid_argument, "missing DISPLACEMENT_Z dof on node ", r_node.Id() )
412  }
413 
414 
415  //check for admissible value of the AlphaBossak
416  if (mAlphaBossak > 0.0 || mAlphaBossak < -0.3)
417  KRATOS_THROW_ERROR( std::logic_error, "Value not admissible for AlphaBossak. Admissible values should be between 0.0 and -0.3. Current value is ", mAlphaBossak )
418 
419  //check for minimum value of the buffer index
420  //verify buffer size
421  if (r_model_part.GetBufferSize() < 2)
422  KRATOS_THROW_ERROR( std::logic_error, "insufficient buffer size. Buffer size should be greater than 2. Current size is", r_model_part.GetBufferSize() )
423 
424 
425  return 0;
426  KRATOS_CATCH( "" )
427  }
428 
451 protected:
459  double mAlphaBossak;
460  double mBetaNewmark;
462 
463  double ma0;
464  double ma1;
465  double ma2;
466  double ma3;
467  double ma4;
468  double ma5;
469  double mam;
470 
471  std::vector< Matrix >mMass;
472  std::vector< Matrix >mDamp;
473  std::vector< Vector >mvel;
474 
476 
477 
482  //*********************************************************************************
483  //Updating first time Derivative
484 
485  //*********************************************************************************
486 
487  inline void UpdateVelocity(array_1d<double, 3 > & CurrentVelocity,
488  const array_1d<double, 3 > & DeltaDisp,
489  const array_1d<double, 3 > & OldVelocity,
490  const array_1d<double, 3 > & OldAcceleration)
491  {
492  noalias(CurrentVelocity) = ma1 * DeltaDisp - ma4 * OldVelocity - ma5*OldAcceleration;
493  }
494 
495 
496 
497  //**************************************************************************
498 
499  inline void UpdateAcceleration(array_1d<double, 3 > & CurrentAcceleration,
500  const array_1d<double, 3 > & DeltaDisp,
501  const array_1d<double, 3 > & OldVelocity,
502  const array_1d<double, 3 > & OldAcceleration)
503  {
504 
505  noalias(CurrentAcceleration) = ma0 * DeltaDisp - ma2 * OldVelocity - ma3*OldAcceleration;
506  }
507 
508 
509 
510 
511  //****************************************************************************
512 
518  LocalSystemMatrixType& LHS_Contribution,
521  const ProcessInfo& CurrentProcessInfo)
522  {
523  // adding mass contribution to the dynamic stiffness
524  if (M.size1() != 0) // if M matrix declared
525  {
526  noalias(LHS_Contribution) += (mdamping_factor * ma1) * M;
527  }
528  }
529 
530  //****************************************************************************
531 
537  Element& rCurrentElement,
538  LocalSystemVectorType& RHS_Contribution,
541  const ProcessInfo& CurrentProcessInfo)
542  {
543  //adding inertia contribution
544  if (M.size1() != 0)
545  {
546  int k = OpenMPUtils::ThisThread();
547  const auto& r_const_elem_ref = rCurrentElement;
548  r_const_elem_ref.GetFirstDerivativesVector(mvel[k], 0);
549  noalias(RHS_Contribution) -= mdamping_factor * prod(M, mvel[k]);
550  }
551 
552  }
553 
555  Condition& rCurrentCondition,
556  LocalSystemVectorType& RHS_Contribution,
559  const ProcessInfo& CurrentProcessInfo)
560  {
561  //adding inertia contribution - DO NOT ADD
562  if (M.size1() != 0)
563  {
564  int k = OpenMPUtils::ThisThread();
565  const auto& r_const_cond_ref = rCurrentCondition;
566  r_const_cond_ref.GetFirstDerivativesVector(mvel[k], 0);
567  noalias(RHS_Contribution) -= mdamping_factor * prod(M, mvel[k]);
568  }
569 
570  }
571 
595 private:
630 }; /* Class Scheme */
631 
640 } /* namespace Kratos.*/
641 
Base class for all Conditions.
Definition: condition.h:59
virtual void GetFirstDerivativesVector(Vector &values, int Step=0) const
Definition: condition.h:313
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 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
Base class for all Elements.
Definition: element.h:60
virtual void GetFirstDerivativesVector(Vector &values, int Step=0) const
Definition: element.h:310
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
virtual void EquationIdVector(EquationIdVectorType &rResult, const ProcessInfo &rCurrentProcessInfo) const
Definition: element.h:258
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
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
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
ProcessInfo & GetProcessInfo()
Definition: model_part.h:1746
MeshType::NodeIterator NodeIterator
Definition: model_part.h:134
NodeIterator NodesEnd(IndexType ThisIndex=0)
Definition: model_part.h:497
NodesContainerType & Nodes(IndexType ThisIndex=0)
Definition: model_part.h:507
static int ThisThread()
Wrapper for omp_get_thread_num().
Definition: openmp_utils.h:108
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
iterator begin()
Returns an iterator pointing to the beginning of the container.
Definition: pointer_vector_set.h:278
iterator end()
Returns an iterator pointing to the end of the container.
Definition: pointer_vector_set.h:314
ProcessInfo holds the current value of different solution parameters.
Definition: process_info.h:59
Definition: residual_based_relaxation_scheme.hpp:83
Element::DofsVectorType DofsVectorType
Definition: residual_based_relaxation_scheme.hpp:97
double mdamping_factor
Definition: residual_based_relaxation_scheme.hpp:475
void UpdateAcceleration(array_1d< double, 3 > &CurrentAcceleration, const array_1d< double, 3 > &DeltaDisp, const array_1d< double, 3 > &OldVelocity, const array_1d< double, 3 > &OldAcceleration)
Definition: residual_based_relaxation_scheme.hpp:499
Scheme< TSparseSpace, TDenseSpace > BaseType
Definition: residual_based_relaxation_scheme.hpp:91
void AddDynamicsToLHS(LocalSystemMatrixType &LHS_Contribution, LocalSystemMatrixType &D, LocalSystemMatrixType &M, const ProcessInfo &CurrentProcessInfo)
Definition: residual_based_relaxation_scheme.hpp:517
BaseType::LocalSystemMatrixType LocalSystemMatrixType
Definition: residual_based_relaxation_scheme.hpp:105
int Check(const ModelPart &r_model_part) const override
Definition: residual_based_relaxation_scheme.hpp:385
void AddDynamicsToRHS(Condition &rCurrentCondition, LocalSystemVectorType &RHS_Contribution, LocalSystemMatrixType &D, LocalSystemMatrixType &M, const ProcessInfo &CurrentProcessInfo)
Definition: residual_based_relaxation_scheme.hpp:554
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: residual_based_relaxation_scheme.hpp:285
void Update(ModelPart &r_model_part, DofsArrayType &rDofSet, TSystemMatrixType &A, TSystemVectorType &Dx, TSystemVectorType &b) override
Definition: residual_based_relaxation_scheme.hpp:152
void CalculateSystemContributions(Condition &rCurrentCondition, LocalSystemMatrixType &LHS_Contribution, LocalSystemVectorType &RHS_Contribution, Element::EquationIdVectorType &EquationId, const ProcessInfo &CurrentProcessInfo) override
Definition: residual_based_relaxation_scheme.hpp:308
std::vector< Vector > mvel
Definition: residual_based_relaxation_scheme.hpp:473
ResidualBasedRelaxationScheme(double NewAlphaBossak, double damping_factor)
Definition: residual_based_relaxation_scheme.hpp:115
double mGammaNewmark
Definition: residual_based_relaxation_scheme.hpp:461
std::vector< Matrix > mMass
Definition: residual_based_relaxation_scheme.hpp:471
double ma1
Definition: residual_based_relaxation_scheme.hpp:464
double ma4
Definition: residual_based_relaxation_scheme.hpp:467
double ma0
Definition: residual_based_relaxation_scheme.hpp:463
BaseType::TSystemVectorType TSystemVectorType
Definition: residual_based_relaxation_scheme.hpp:101
std::vector< Matrix > mDamp
Definition: residual_based_relaxation_scheme.hpp:472
double ma3
Definition: residual_based_relaxation_scheme.hpp:466
double mam
Definition: residual_based_relaxation_scheme.hpp:469
void CalculateSystemContributions(Element &rCurrentElement, LocalSystemMatrixType &LHS_Contribution, LocalSystemVectorType &RHS_Contribution, Element::EquationIdVectorType &EquationId, const ProcessInfo &CurrentProcessInfo) override
Definition: residual_based_relaxation_scheme.hpp:259
void UpdateVelocity(array_1d< double, 3 > &CurrentVelocity, const array_1d< double, 3 > &DeltaDisp, const array_1d< double, 3 > &OldVelocity, const array_1d< double, 3 > &OldAcceleration)
Definition: residual_based_relaxation_scheme.hpp:487
BaseType::LocalSystemVectorType LocalSystemVectorType
Definition: residual_based_relaxation_scheme.hpp:103
void InitializeSolutionStep(ModelPart &r_model_part, TSystemMatrixType &A, TSystemVectorType &Dx, TSystemVectorType &b) override
Function called once at the beginning of each solution step.
Definition: residual_based_relaxation_scheme.hpp:352
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: residual_based_relaxation_scheme.hpp:329
~ResidualBasedRelaxationScheme() override
Definition: residual_based_relaxation_scheme.hpp:136
BaseType::DofsArrayType DofsArrayType
Definition: residual_based_relaxation_scheme.hpp:95
BaseType::TSystemMatrixType TSystemMatrixType
Definition: residual_based_relaxation_scheme.hpp:99
double mBetaNewmark
Definition: residual_based_relaxation_scheme.hpp:460
KRATOS_CLASS_POINTER_DEFINITION(ResidualBasedRelaxationScheme)
double mAlphaBossak
Definition: residual_based_relaxation_scheme.hpp:459
BaseType::TDataType TDataType
Definition: residual_based_relaxation_scheme.hpp:93
double ma5
Definition: residual_based_relaxation_scheme.hpp:468
void Predict(ModelPart &r_model_part, DofsArrayType &rDofSet, TSystemMatrixType &A, TSystemVectorType &Dx, TSystemVectorType &b) override
Performing the prediction of the solution.
Definition: residual_based_relaxation_scheme.hpp:199
void AddDynamicsToRHS(Element &rCurrentElement, LocalSystemVectorType &RHS_Contribution, LocalSystemMatrixType &D, LocalSystemMatrixType &M, const ProcessInfo &CurrentProcessInfo)
Definition: residual_based_relaxation_scheme.hpp:536
double ma2
Definition: residual_based_relaxation_scheme.hpp:465
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 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
#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
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
AMatrix::MatrixProductExpression< TExpression1Type, TExpression2Type > prod(AMatrix::MatrixExpression< TExpression1Type, TCategory1 > const &First, AMatrix::MatrixExpression< TExpression2Type, TCategory2 > const &Second)
Definition: amatrix_interface.h:568
T & noalias(T &TheMatrix)
Definition: amatrix_interface.h:484
b
Definition: generate_total_lagrangian_mixed_volumetric_strain_element.py:31
int k
Definition: quadrature.py:595
def num_threads
Definition: script.py:75
A
Definition: sensitivityMatrix.py:70
integer i
Definition: TensorModule.f:17