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_bossak_displacement_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: Josep Maria Carbonell
11 // Vicente Mataix Ferrandiz
12 // Andreas Winterstein (refactoring)
13 //
14 
15 #pragma once
16 
17 // Project includes
19 #include "includes/variables.h"
20 #include "includes/checks.h"
21 
22 namespace Kratos
23 {
24 
27 
40 template<class TSparseSpace, class TDenseSpace >
42  : public ResidualBasedImplicitTimeScheme<TSparseSpace, TDenseSpace>
43 {
44 public:
47 
49 
52 
55 
58 
61 
64 
67 
70 
73 
76 
79 
82 
85 
88 
91 
93  using BaseTypePointer = typename BaseType::Pointer;
94 
97 
101 
106  : ImplicitBaseType()
107  {
108  // Validate and assign defaults
109  ThisParameters = this->ValidateAndAssignParameters(ThisParameters, this->GetDefaultParameters());
110  this->AssignSettings(ThisParameters);
111 
112  // For pure Newmark Scheme
113  mNewmark.gamma = 0.5;
114 
115  AuxiliarInitializeBossak();
116  }
117 
122  explicit ResidualBasedBossakDisplacementScheme(const double Alpha = 0.0)
124  {
125  }
126 
133  explicit ResidualBasedBossakDisplacementScheme(const double Alpha, const double NewmarkBeta)
135  {
136  // For pure Newmark Scheme
137  mBossak.alpha = Alpha;
138  mNewmark.beta = NewmarkBeta;
139  mNewmark.gamma = 0.5;
140 
141  AuxiliarInitializeBossak();
142  }
143 
145  :ImplicitBaseType(rOther)
146  ,mBossak(rOther.mBossak)
147  ,mNewmark(rOther.mNewmark)
148  ,mVector(rOther.mVector)
149  {
150  }
151 
153  {
155  }
156 
158  () override {}
159 
163 
167  typename BaseType::Pointer Create(Parameters ThisParameters) const override
168  {
169  return Kratos::make_shared<ClassType>(ThisParameters);
170  }
171 
174  {
175  mBossak.beta = (1.0 - mBossak.alpha) * (1.0 - mBossak.alpha) * mNewmark.beta;
177  }
178 
187  void Update(
188  ModelPart& rModelPart,
189  DofsArrayType& rDofSet,
190  TSystemMatrixType& rA,
191  TSystemVectorType& rDx,
193  ) override
194  {
195  KRATOS_TRY;
196 
197  mpDofUpdater->UpdateDofs(rDofSet, rDx);
198 
199  // Updating time derivatives (nodally for efficiency)
200  block_for_each(rModelPart.Nodes(), array_1d<double,3>(), [&](Node& rNode, array_1d<double,3>& rDeltaDisplacementTLS){
201  noalias(rDeltaDisplacementTLS) = rNode.FastGetSolutionStepValue(DISPLACEMENT) - rNode.FastGetSolutionStepValue(DISPLACEMENT, 1);
202 
203  array_1d<double, 3>& r_current_velocity = rNode.FastGetSolutionStepValue(VELOCITY);
204  const array_1d<double, 3>& r_previous_velocity = rNode.FastGetSolutionStepValue(VELOCITY, 1);
205 
206  array_1d<double, 3>& r_current_acceleration = rNode.FastGetSolutionStepValue(ACCELERATION);
207  const array_1d<double, 3>& r_previous_acceleration = rNode.FastGetSolutionStepValue(ACCELERATION, 1);
208 
209  UpdateVelocity(r_current_velocity, rDeltaDisplacementTLS, r_previous_velocity, r_previous_acceleration);
210  UpdateAcceleration(r_current_acceleration, rDeltaDisplacementTLS, r_previous_velocity, r_previous_acceleration);
211  });
212 
213  KRATOS_CATCH( "" );
214  }
215 
225  void Predict(
226  ModelPart& rModelPart,
227  DofsArrayType& rDofSet,
228  TSystemMatrixType& rA,
229  TSystemVectorType& rDx,
231  ) override
232  {
233  KRATOS_TRY;
234 
235  // The current process info
236  const ProcessInfo& r_current_process_info = rModelPart.GetProcessInfo();
237  const double delta_time = r_current_process_info[DELTA_TIME];
238 
239  // Updating time derivatives (nodally for efficiency)
240  if (rModelPart.Nodes().size() > 0) {
241  const auto it_node_begin = rModelPart.Nodes().begin();
242 
243  // Getting position
244  KRATOS_ERROR_IF_NOT(it_node_begin->HasDofFor(DISPLACEMENT_X)) << "ResidualBasedBossakDisplacementScheme:: DISPLACEMENT is not added" << std::endl;
245  const int disppos = it_node_begin->GetDofPosition(DISPLACEMENT_X);
246  const int velpos = it_node_begin->HasDofFor(VELOCITY_X) ? static_cast<int>(it_node_begin->GetDofPosition(VELOCITY_X)) : -1;
247  const int accelpos = it_node_begin->HasDofFor(ACCELERATION_X) ? static_cast<int>(it_node_begin->GetDofPosition(ACCELERATION_X)) : -1;
248 
249  // Getting dimension
250  KRATOS_WARNING_IF("ResidualBasedBossakDisplacementScheme", !r_current_process_info.Has(DOMAIN_SIZE)) << "DOMAIN_SIZE not defined. Please define DOMAIN_SIZE. 3D case will be assumed" << std::endl;
251  const std::size_t dimension = r_current_process_info.Has(DOMAIN_SIZE) ? r_current_process_info.GetValue(DOMAIN_SIZE) : 3;
252 
253  // Auxiliar variables
254  array_1d<double, 3 > delta_displacement;
255  std::array<bool, 3> predicted = {false, false, false};
256  const std::array<const Variable<ComponentType>*, 3> disp_components = {&DISPLACEMENT_X, &DISPLACEMENT_Y, &DISPLACEMENT_Z};
257  const std::array<const Variable<ComponentType>*, 3> vel_components = {&VELOCITY_X, &VELOCITY_Y, &VELOCITY_Z};
258  const std::array<const Variable<ComponentType>*, 3> accel_components = {&ACCELERATION_X, &ACCELERATION_Y, &ACCELERATION_Z};
259 
260  typedef std::tuple<array_1d<double,3>, std::array<bool,3>> TLSContainerType;
261  TLSContainerType aux_TLS = std::make_tuple(delta_displacement, predicted);
262 
263  block_for_each(rModelPart.Nodes(), aux_TLS, [&](Node& rNode, TLSContainerType& rAuxTLS){
264  auto& r_delta_displacement = std::get<0>(rAuxTLS);
265  auto& r_predicted = std::get<1>(rAuxTLS);
266 
267  for (std::size_t i_dim = 0; i_dim < dimension; ++i_dim) {
268  r_predicted[i_dim] = false;
269  }
270 
271  // Predicting: NewDisplacement = r_previous_displacement + r_previous_velocity * delta_time;
272  const array_1d<double, 3>& r_previous_acceleration = rNode.FastGetSolutionStepValue(ACCELERATION, 1);
273  const array_1d<double, 3>& r_previous_velocity = rNode.FastGetSolutionStepValue(VELOCITY, 1);
274  const array_1d<double, 3>& r_previous_displacement = rNode.FastGetSolutionStepValue(DISPLACEMENT, 1);
275  array_1d<double, 3>& r_current_acceleration = rNode.FastGetSolutionStepValue(ACCELERATION);
276  array_1d<double, 3>& r_current_velocity = rNode.FastGetSolutionStepValue(VELOCITY);
277  array_1d<double, 3>& r_current_displacement = rNode.FastGetSolutionStepValue(DISPLACEMENT);
278 
279  if (accelpos > -1) {
280  for (std::size_t i_dim = 0; i_dim < dimension; ++i_dim) {
281  if (rNode.GetDof(*accel_components[i_dim], accelpos + i_dim).IsFixed()) {
282  r_delta_displacement[i_dim] = (r_current_acceleration[i_dim] + mBossak.c3 * r_previous_acceleration[i_dim] + mBossak.c2 * r_previous_velocity[i_dim])/mBossak.c0;
283  r_current_displacement[i_dim] = r_previous_displacement[i_dim] + r_delta_displacement[i_dim];
284  r_predicted[i_dim] = true;
285  }
286  }
287  }
288  if (velpos > -1) {
289  for (std::size_t i_dim = 0; i_dim < dimension; ++i_dim) {
290  if (rNode.GetDof(*vel_components[i_dim], velpos + i_dim).IsFixed() && !r_predicted[i_dim]) {
291  r_delta_displacement[i_dim] = (r_current_velocity[i_dim] + mBossak.c4 * r_previous_velocity[i_dim] + mBossak.c5 * r_previous_acceleration[i_dim])/mBossak.c1;
292  r_current_displacement[i_dim] = r_previous_displacement[i_dim] + r_delta_displacement[i_dim];
293  r_predicted[i_dim] = true;
294  }
295  }
296  }
297  for (std::size_t i_dim = 0; i_dim < dimension; ++i_dim) {
298  if (!rNode.GetDof(*disp_components[i_dim], disppos + i_dim).IsFixed() && !r_predicted[i_dim]) {
299  r_current_displacement[i_dim] = r_previous_displacement[i_dim] + delta_time * r_previous_velocity[i_dim] + 0.5 * std::pow(delta_time, 2) * r_previous_acceleration[i_dim];
300  }
301  }
302 
303  // Updating time derivatives ::: Please note that displacements and its time derivatives can not be consistently fixed separately
304  noalias(r_delta_displacement) = r_current_displacement - r_previous_displacement;
305  UpdateVelocity(r_current_velocity, r_delta_displacement, r_previous_velocity, r_previous_acceleration);
306  UpdateAcceleration(r_current_acceleration, r_delta_displacement, r_previous_velocity, r_previous_acceleration);
307  });
308  }
309 
310  KRATOS_CATCH( "" );
311  }
312 
322  ModelPart& rModelPart,
324  TSystemVectorType& Dx,
326  ) override
327  {
328  KRATOS_TRY;
329 
330  // The current process info
331  const ProcessInfo& r_current_process_info = rModelPart.GetProcessInfo();
332 
333  ImplicitBaseType::InitializeSolutionStep(rModelPart, A, Dx, b);
334 
335  const double delta_time = r_current_process_info[DELTA_TIME];
336 
337  // Initializing Bossak constants
338  mBossak.c0 = ( 1.0 / (mBossak.beta * delta_time * delta_time) );
339  mBossak.c1 = ( mBossak.gamma / (mBossak.beta * delta_time) );
340  mBossak.c2 = ( 1.0 / (mBossak.beta * delta_time) );
341  mBossak.c3 = ( 0.5 / (mBossak.beta) - 1.0 );
342  mBossak.c4 = ( (mBossak.gamma / mBossak.beta) - 1.0 );
343  mBossak.c5 = ( delta_time * 0.5 * ( ( mBossak.gamma / mBossak.beta ) - 2.0 ) );
344 
345  // Updating time derivatives (nodally for efficiency)
346  if (rModelPart.Nodes().size() > 0) {
347  const auto it_node_begin = rModelPart.Nodes().begin();
348 
349  // Getting dimension
350  KRATOS_WARNING_IF("ResidualBasedBossakDisplacementScheme", !r_current_process_info.Has(DOMAIN_SIZE)) << "DOMAIN_SIZE not defined. Please define DOMAIN_SIZE. 3D case will be assumed" << std::endl;
351  const std::size_t dimension = r_current_process_info.Has(DOMAIN_SIZE) ? r_current_process_info.GetValue(DOMAIN_SIZE) : 3;
352 
353  // Getting position
354  const int velpos = it_node_begin->HasDofFor(VELOCITY_X) ? static_cast<int>(it_node_begin->GetDofPosition(VELOCITY_X)) : -1;
355  const int accelpos = it_node_begin->HasDofFor(ACCELERATION_X) ? static_cast<int>(it_node_begin->GetDofPosition(ACCELERATION_X)) : -1;
356 
357  std::array<bool, 3> fixed = {false, false, false};
358  const std::array<const Variable<ComponentType>*, 3> disp_components = {&DISPLACEMENT_X, &DISPLACEMENT_Y, &DISPLACEMENT_Z};
359  const std::array<const Variable<ComponentType>*, 3> vel_components = {&VELOCITY_X, &VELOCITY_Y, &VELOCITY_Z};
360  const std::array<const Variable<ComponentType>*, 3> accel_components = {&ACCELERATION_X, &ACCELERATION_Y, &ACCELERATION_Z};
361 
362  block_for_each(rModelPart.Nodes(), fixed, [&](Node& rNode, std::array<bool,3>& rFixedTLS){
363  for (std::size_t i_dim = 0; i_dim < dimension; ++i_dim) {
364  rFixedTLS[i_dim] = false;
365  }
366 
367  if (accelpos > -1) {
368  for (std::size_t i_dim = 0; i_dim < dimension; ++i_dim) {
369  if (rNode.GetDof(*accel_components[i_dim], accelpos + i_dim).IsFixed()) {
370  rNode.Fix(*disp_components[i_dim]);
371  rFixedTLS[i_dim] = true;
372  }
373  }
374  }
375  if (velpos > -1) {
376  for (std::size_t i_dim = 0; i_dim < dimension; ++i_dim) {
377  if (rNode.GetDof(*vel_components[i_dim], velpos + i_dim).IsFixed() && !rFixedTLS[i_dim]) {
378  rNode.Fix(*disp_components[i_dim]);
379  }
380  }
381  }
382  });
383  }
384 
385  KRATOS_CATCH( "" );
386  }
387 
393  int Check(const ModelPart& rModelPart) const override
394  {
395  KRATOS_TRY;
396 
397  const int err = ImplicitBaseType::Check(rModelPart);
398  if(err != 0) return err;
399 
400  // Check that variables are correctly allocated
401  for (const auto& rnode : rModelPart.Nodes()) {
402  KRATOS_CHECK_VARIABLE_IN_NODAL_DATA(DISPLACEMENT,rnode)
404  KRATOS_CHECK_VARIABLE_IN_NODAL_DATA(ACCELERATION,rnode)
405 
406  KRATOS_CHECK_DOF_IN_NODE(DISPLACEMENT_X, rnode)
407  KRATOS_CHECK_DOF_IN_NODE(DISPLACEMENT_Y, rnode)
408  KRATOS_CHECK_DOF_IN_NODE(DISPLACEMENT_Z, rnode)
409  }
410 
411  // Check for minimum value of the buffer index
412  // Verify buffer size
413  KRATOS_ERROR_IF(rModelPart.GetBufferSize() < 2)
414  << "Insufficient buffer size. Buffer size should be greater than 2. Current size is: "
415  << rModelPart.GetBufferSize() << std::endl;
416 
417  // Check for admissible value of the AlphaBossak
418  KRATOS_ERROR_IF(mBossak.alpha > 0.0 || mBossak.alpha < -0.5) << "Value not admissible for "
419  << "AlphaBossak. Admissible values are between 0.0 and -0.5\nCurrent value is: "
420  << mBossak.alpha << std::endl;
421 
422  static const double epsilon = 1e-12;
423  KRATOS_ERROR_IF_NOT(std::abs(mNewmark.beta - 0.0) < epsilon ||
424  std::abs(mNewmark.beta - 0.167) < epsilon ||
425  std::abs(mNewmark.beta - 0.25) < epsilon)
426  << "Value not admissible for NewmarkBeta. Admissible values are:\n"
427  << "0.0 for central-differencing\n"
428  << "0.25 for mean-constant-acceleration\n"
429  << "0.167 for linear-acceleration\n"
430  << "Current value is: " << mNewmark.beta << std::endl;
431 
432  return 0;
433  KRATOS_CATCH( "" );
434  }
435 
437  void Clear() override
438  {
439  this->mpDofUpdater->Clear();
440  }
441 
444  {
445  Parameters default_parameters = Parameters(R"(
446  {
447  "name" : "bossak_scheme",
448  "damp_factor_m" : -0.3,
449  "newmark_beta" : 0.25
450  })");
451 
452  // Getting base class default parameters
453  const Parameters base_default_parameters = ImplicitBaseType::GetDefaultParameters();
454  default_parameters.RecursivelyAddMissingParameters(base_default_parameters);
455  return default_parameters;
456  }
457 
459  static std::string Name()
460  {
461  return "bossak_scheme";
462  }
463 
467 
469  std::string Info() const override
470  {
471  return "ResidualBasedBossakDisplacementScheme";
472  }
473 
475  void PrintInfo(std::ostream& rOStream) const override
476  {
477  rOStream << Info();
478  }
479 
481  void PrintData(std::ostream& rOStream) const override
482  {
483  rOStream << Info();
484  }
485 
487 
488 protected:
490  typename TSparseSpace::DofUpdaterPointerType mpDofUpdater = TSparseSpace::CreateDofUpdater();
491 
494  {
496  double alpha;
497 
499  double beta;
500 
502  double gamma;
503 
505  double c0, c1, c2, c3, c4, c5;
506  };
507 
510  {
512  double beta;
513 
515  double gamma;
516  };
517 
520  {
522  std::vector< Vector > v;
523 
525  std::vector< Vector > a;
526 
528  std::vector< Vector > ap;
529  };
530 
533 
536 
539 
542 
549  inline void UpdateVelocity(
550  array_1d<double, 3>& rCurrentVelocity,
551  const array_1d<double, 3>& rDeltaDisplacement,
552  const array_1d<double, 3>& rPreviousVelocity,
553  const array_1d<double, 3>& rPreviousAcceleration
554  )
555  {
556  noalias(rCurrentVelocity) = (mBossak.c1 * rDeltaDisplacement - mBossak.c4 * rPreviousVelocity - mBossak.c5 * rPreviousAcceleration);
557  }
558 
565  inline void UpdateAcceleration(
566  array_1d<double, 3>& rCurrentAcceleration,
567  const array_1d<double, 3>& rDeltaDisplacement,
568  const array_1d<double, 3>& rPreviousVelocity,
569  const array_1d<double, 3>& rPreviousAcceleration
570  )
571  {
572  noalias(rCurrentAcceleration) = (mBossak.c0 * rDeltaDisplacement - mBossak.c2 * rPreviousVelocity - mBossak.c3 * rPreviousAcceleration);
573  }
574 
583  LocalSystemMatrixType& LHS_Contribution,
586  const ProcessInfo& rCurrentProcessInfo
587  ) override
588  {
589  // Adding mass contribution to the dynamic stiffness
590  if (M.size1() != 0) // if M matrix declared
591  noalias(LHS_Contribution) += M * (1.0 - mBossak.alpha) * mBossak.c0;
592 
593  // Adding damping contribution
594  if (D.size1() != 0) // if D matrix declared
595  noalias(LHS_Contribution) += D * mBossak.c1;
596  }
597 
607  Element& rElement,
608  LocalSystemVectorType& RHS_Contribution,
611  const ProcessInfo& rCurrentProcessInfo
612  ) override
613  {
614  const std::size_t this_thread = OpenMPUtils::ThisThread();
615 
616  const auto& r_const_elem_ref = rElement;
617  // Adding inertia contribution
618  if (M.size1() != 0) {
619 
620  r_const_elem_ref.GetSecondDerivativesVector(mVector.a[this_thread], 0);
621  mVector.a[this_thread] *= (1.00 - mBossak.alpha);
622 
623  r_const_elem_ref.GetSecondDerivativesVector(mVector.ap[this_thread], 1);
624  noalias(mVector.a[this_thread]) += mBossak.alpha * mVector.ap[this_thread];
625 
626  noalias(RHS_Contribution) -= prod(M, mVector.a[this_thread]);
627  }
628 
629  // Adding damping contribution
630  if (D.size1() != 0) {
631  r_const_elem_ref.GetFirstDerivativesVector(mVector.v[this_thread], 0);
632  noalias(RHS_Contribution) -= prod(D, mVector.v[this_thread]);
633  }
634  }
635 
645  Condition& rCondition,
646  LocalSystemVectorType& RHS_Contribution,
649  const ProcessInfo& rCurrentProcessInfo
650  ) override
651  {
652  const std::size_t this_thread = OpenMPUtils::ThisThread();
653  const auto& r_const_cond_ref = rCondition;
654 
655  // Adding inertia contribution
656  if (M.size1() != 0) {
657  r_const_cond_ref.GetSecondDerivativesVector(mVector.a[this_thread], 0);
658  mVector.a[this_thread] *= (1.00 - mBossak.alpha);
659 
660  r_const_cond_ref.GetSecondDerivativesVector(mVector.ap[this_thread], 1);
661  noalias(mVector.a[this_thread]) += mBossak.alpha * mVector.ap[this_thread];
662 
663  noalias(RHS_Contribution) -= prod(M, mVector.a[this_thread]);
664  }
665 
666  // Adding damping contribution
667  // Damping contribution
668  if (D.size1() != 0) {
669  r_const_cond_ref.GetFirstDerivativesVector(mVector.v[this_thread], 0);
670 
671  noalias(RHS_Contribution) -= prod(D, mVector.v[this_thread]);
672  }
673  }
674 
676  void AssignSettings(const Parameters ThisParameters) override
677  {
678  ImplicitBaseType::AssignSettings(ThisParameters);
679  mBossak.alpha = ThisParameters["damp_factor_m"].GetDouble();
680  mNewmark.beta = ThisParameters["newmark_beta"].GetDouble();
681  }
682 
684 
685 private:
688 
690  void AuxiliarInitializeBossak()
691  {
692  // Initialize Bossak coefficients
693  CalculateBossakCoefficients();
694 
695  // Allocate auxiliary memory
696  const std::size_t num_threads = ParallelUtilities::GetNumThreads();
697 
698  mVector.v.resize(num_threads);
699  mVector.a.resize(num_threads);
700  mVector.ap.resize(num_threads);
701 
702  KRATOS_DETAIL("MECHANICAL SCHEME: The Bossak Time Integration Scheme ") << "[alpha_m= " << mBossak.alpha << " beta= " << mNewmark.beta << " gamma= " << mNewmark.gamma << "]" <<std::endl;
703  }
704 
706 }; // Class ResidualBasedBossakDisplacementScheme
707 
709 
710 } // namespace Kratos
std::string Info() const override
Turn back information as a string.
Definition: periodic_interface_process.hpp:93
Base class for all Conditions.
Definition: condition.h:59
virtual void GetSecondDerivativesVector(Vector &values, int Step=0) const
Definition: condition.h:323
bool Has(const Variable< TDataType > &rThisVariable) const
Checks if the data container has a value associated with a given variable.
Definition: data_value_container.h:382
TDataType & GetValue(const Variable< TDataType > &rThisVariable)
Gets the value associated with a given variable.
Definition: data_value_container.h:268
bool IsFixed() const
Definition: dof.h:376
Base class for all Elements.
Definition: element.h:60
std::vector< DofType::Pointer > DofsVectorType
Definition: element.h:100
virtual void GetSecondDerivativesVector(Vector &values, int Step=0) const
Definition: element.h:320
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
IndexType GetBufferSize() const
This method gets the suffer size of the model part database.
Definition: model_part.h:1876
ProcessInfo & GetProcessInfo()
Definition: model_part.h:1746
MeshType::NodeIterator NodeIterator
Definition: model_part.h:134
MeshType::NodesContainerType NodesContainerType
Nodes container. Which is a vector set of nodes with their Id's as key.
Definition: model_part.h:128
NodesContainerType & Nodes(IndexType ThisIndex=0)
Definition: model_part.h:507
This class defines the node.
Definition: node.h:65
const DofType & GetDof(TVariableType const &rDofVariable, int pos) const
Get dof with a given position. If not found it is search.
Definition: node.h:649
TVariableType::Type & FastGetSolutionStepValue(const TVariableType &rThisVariable)
Definition: node.h:435
This class provides to Kratos a data structure for I/O based on the standard of JSON.
Definition: kratos_parameters.h:59
double GetDouble() const
This method returns the double contained in the current Parameter.
Definition: kratos_parameters.cpp:657
void RecursivelyAddMissingParameters(const Parameters &rDefaultParameters)
This function is designed to verify that the parameters under testing contain at least all parameters...
Definition: kratos_parameters.cpp:1457
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
Bossak integration scheme (for linear and nonlinear dynamic problems) for displacements.
Definition: residual_based_bossak_displacement_scheme.hpp:43
BaseType::Pointer Create(Parameters ThisParameters) const override
Construct a dynamically allocated new scheme from a Parameters object.
Definition: residual_based_bossak_displacement_scheme.hpp:167
void Update(ModelPart &rModelPart, DofsArrayType &rDofSet, TSystemMatrixType &rA, TSystemVectorType &rDx, TSystemVectorType &rb) override
Update state variables within a newton iteration at the end of the time step.
Definition: residual_based_bossak_displacement_scheme.hpp:187
std::string Info() const override
Return information as a string.
Definition: residual_based_bossak_displacement_scheme.hpp:469
TSparseSpace::DofUpdaterPointerType mpDofUpdater
Definition: residual_based_bossak_displacement_scheme.hpp:490
void PrintData(std::ostream &rOStream) const override
Print the instance's data.
Definition: residual_based_bossak_displacement_scheme.hpp:481
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
ResidualBasedBossakDisplacementScheme(const double Alpha, const double NewmarkBeta)
Constructor.
Definition: residual_based_bossak_displacement_scheme.hpp:133
void CalculateBossakCoefficients()
Recalculate the Newmark coefficients, taking the alpha parameters into account.
Definition: residual_based_bossak_displacement_scheme.hpp:173
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
int Check(const ModelPart &rModelPart) const override
Check whether the scheme and the provided ModelPart are configured correctly.
Definition: residual_based_bossak_displacement_scheme.hpp:393
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
~ResidualBasedBossakDisplacementScheme() override
Definition: residual_based_bossak_displacement_scheme.hpp:158
void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: residual_based_bossak_displacement_scheme.hpp:475
Parameters GetDefaultParameters() const override
This function returns the default Parameters to help avoiding conflicts between different constructor...
Definition: residual_based_bossak_displacement_scheme.hpp:443
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
ResidualBasedBossakDisplacementScheme(const double Alpha=0.0)
Constructor from a Bossak parameter.
Definition: residual_based_bossak_displacement_scheme.hpp:122
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
ResidualBasedBossakDisplacementScheme(ResidualBasedBossakDisplacementScheme &rOther)
Definition: residual_based_bossak_displacement_scheme.hpp:144
ResidualBasedBossakDisplacementScheme(Parameters ThisParameters)
Construct from a Parameters object.
Definition: residual_based_bossak_displacement_scheme.hpp:105
BaseTypePointer Clone() override
Clone method.
Definition: residual_based_bossak_displacement_scheme.hpp:152
static std::string Name()
Return the name of the class as used in the settings (snake_case).
Definition: residual_based_bossak_displacement_scheme.hpp:459
typename Element::DofsVectorType DofsVectorType
Vector type for degrees of freedom within an Element.
Definition: residual_based_bossak_displacement_scheme.hpp:66
NewmarkMethod mNewmark
Newmark Beta parameters.
Definition: residual_based_bossak_displacement_scheme.hpp:535
GeneralVectors mVector
Aggregate struct for velocities and accelerations.
Definition: residual_based_bossak_displacement_scheme.hpp:538
void InitializeSolutionStep(ModelPart &rModelPart, TSystemMatrixType &A, TSystemVectorType &Dx, TSystemVectorType &b) override
Prepare state variables for a new solution step.
Definition: residual_based_bossak_displacement_scheme.hpp:321
double ComponentType
Component type as 'double'.
Definition: residual_based_bossak_displacement_scheme.hpp:96
void Predict(ModelPart &rModelPart, DofsArrayType &rDofSet, TSystemMatrixType &rA, TSystemVectorType &rDx, TSystemVectorType &rb) override
Apply the predictor.
Definition: residual_based_bossak_displacement_scheme.hpp:225
KRATOS_CLASS_POINTER_DEFINITION(ResidualBasedBossakDisplacementScheme)
ModelPart::NodeIterator NodeIterator
Iterator for nodes in a ModelPart.
Definition: residual_based_bossak_displacement_scheme.hpp:81
void AssignSettings(const Parameters ThisParameters) override
Assign member variables from Parameters.
Definition: residual_based_bossak_displacement_scheme.hpp:676
void Clear() override
Release dynamic memory allocated by this instance.
Definition: residual_based_bossak_displacement_scheme.hpp:437
void AddDynamicsToRHS(Condition &rCondition, LocalSystemVectorType &RHS_Contribution, LocalSystemMatrixType &D, LocalSystemMatrixType &M, const ProcessInfo &rCurrentProcessInfo) override
Add dynamic right hand side contribution of a Condition.
Definition: residual_based_bossak_displacement_scheme.hpp:644
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
BaseType::TDataType TDataType
Data type definition.
Definition: residual_based_implicit_time_scheme.h:71
BaseType::TSystemMatrixType TSystemMatrixType
Matrix type definition.
Definition: residual_based_implicit_time_scheme.h:73
BaseType::LocalSystemMatrixType LocalSystemMatrixType
Local system vector type definition.
Definition: residual_based_implicit_time_scheme.h:79
BaseType::LocalSystemVectorType LocalSystemVectorType
Local system matrix type definition.
Definition: residual_based_implicit_time_scheme.h:77
BaseType::DofsArrayType DofsArrayType
DoF array type definition.
Definition: residual_based_implicit_time_scheme.h:66
BaseType::TSystemVectorType TSystemVectorType
Vector type definition.
Definition: residual_based_implicit_time_scheme.h:75
This class provides the implementation of the basic tasks that are needed by the solution strategy.
Definition: scheme.h:56
virtual Parameters ValidateAndAssignParameters(Parameters ThisParameters, const Parameters DefaultParameters) const
This method validate and assign default parameters.
Definition: scheme.h:773
#define KRATOS_CATCH(MoreInfo)
Definition: define.h:110
#define KRATOS_TRY
Definition: define.h:109
#define KRATOS_ERROR_IF_NOT(conditional)
Definition: exception.h:163
#define KRATOS_CHECK_DOF_IN_NODE(TheVariable, TheNode)
Definition: checks.h:176
#define KRATOS_ERROR_IF(conditional)
Definition: exception.h:162
#define KRATOS_CHECK_VARIABLE_IN_NODAL_DATA(TheVariable, TheNode)
Definition: checks.h:171
#define KRATOS_DETAIL(label)
Definition: logger.h:280
#define KRATOS_WARNING_IF(label, conditional)
Definition: logger.h:266
void InitializeSolutionStep(ConstructionUtility &rThisUtil, std::string ThermalSubModelPartName, std::string MechanicalSubModelPartName, std::string HeatFluxSubModelPartName, std::string HydraulicPressureSubModelPartName, bool thermal_conditions, bool mechanical_conditions, int phase)
Definition: add_custom_utilities_to_python.cpp:45
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
void block_for_each(TIterator itBegin, TIterator itEnd, TFunction &&rFunction)
Execute a functor on all items of a range in parallel.
Definition: parallel_utilities.h:299
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
TABLE_NUMBER_ANGULAR_VELOCITY TABLE_NUMBER_MOMENT I33 BEAM_INERTIA_ROT_UNIT_LENGHT_Y KRATOS_DEFINE_APPLICATION_VARIABLE(DEM_APPLICATION, double, BEAM_INERTIA_ROT_UNIT_LENGHT_Z) typedef std double
Definition: DEM_application_variables.h:182
delta_time
Definition: generate_frictional_mortar_condition.py:130
b
Definition: generate_total_lagrangian_mixed_volumetric_strain_element.py:31
int dimension
Definition: isotropic_damage_automatic_differentiation.py:123
def Alpha(n, j)
Definition: quadrature.py:93
def num_threads
Definition: script.py:75
A
Definition: sensitivityMatrix.py:70
e
Definition: run_cpp_mpi_tests.py:31
Bossak Alpha parameters.
Definition: residual_based_bossak_displacement_scheme.hpp:494
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 alpha
Bossak Alpha.
Definition: residual_based_bossak_displacement_scheme.hpp:496
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
Velocities and accelerations used for integration.
Definition: residual_based_bossak_displacement_scheme.hpp:520
std::vector< Vector > v
Velocity.
Definition: residual_based_bossak_displacement_scheme.hpp:522
std::vector< Vector > a
Acceleration.
Definition: residual_based_bossak_displacement_scheme.hpp:525
std::vector< Vector > ap
Previous acceleration.
Definition: residual_based_bossak_displacement_scheme.hpp:528
Newmark parameters used for integration.
Definition: residual_based_bossak_displacement_scheme.hpp:510
double gamma
Newmark Gamma.
Definition: residual_based_bossak_displacement_scheme.hpp:515
double beta
Newmark Beta.
Definition: residual_based_bossak_displacement_scheme.hpp:512