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.
residualbased_predictorcorrector_bossak_scheme.h
Go to the documentation of this file.
1 /*
2 ==============================================================================
3 KratosStructuralApplication
4 A library based on:
5 Kratos
6 A General Purpose Software for Multi-Physics Finite Element Analysis
7 Version 1.0 (Released on march 05, 2007).
8 
9 Copyright 2007
10 Pooyan Dadvand, Riccardo Rossi, Janosch Stascheit, Felix Nagel
11 pooyan@cimne.upc.edu
12 rrossi@cimne.upc.edu
13 janosch.stascheit@rub.de
14 nagel@sd.rub.de
15 - CIMNE (International Center for Numerical Methods in Engineering),
16 Gran Capita' s/n, 08034 Barcelona, Spain
17 - Ruhr-University Bochum, Institute for Structural Mechanics, Germany
18 
19 
20 Permission is hereby granted, free of charge, to any person obtaining
21 a copy of this software and associated documentation files (the
22 "Software"), to deal in the Software without restriction, including
23 without limitation the rights to use, copy, modify, merge, publish,
24 distribute, sublicense and/or sell copies of the Software, and to
25 permit persons to whom the Software is furnished to do so, subject to
26 the following condition:
27 
28 Distribution of this code for any commercial purpose is permissible
29 ONLY BY DIRECT ARRANGEMENT WITH THE COPYRIGHT OWNERS.
30 
31 The above copyright notice and this permission notice shall be
32 included in all copies or substantial portions of the Software.
33 
34 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
35 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
36 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
37 IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
38 CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
39 TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
40 SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
41 
42 ==============================================================================
43  */
44 /* *********************************************************
45  *
46  * Last Modified by: $Author: kazem $
47  * Date: $Date: 2008-07-25 13:07:07 $
48  * Revision: $Revision: 1.8 $
49  *
50  * ***********************************************************/
51 
52 
53 #if !defined(KRATOS_RESIDUALBASED_PREDICTOR_CORRECTOR_BOSSAK_SCHEME )
54 #define KRATOS_RESIDUALBASED_PREDICTOR_CORRECTOR_BOSSAK_SCHEME
55 
56 
57 /* System includes */
58 
59 
60 /* External includes */
61 
62 /* Project includes */
63 #include "includes/define.h"
64 #include "includes/model_part.h"
66 #include "includes/variables.h"
67 #include "containers/array_1d.h"
68 #include "utilities/openmp_utils.h"
69 
70 namespace Kratos
71 {
72 
73 
125 template<class TSparseSpace,
126  class TDenseSpace //= DenseSpace<double>
127  >
128 class ResidualBasedPredictorCorrectorBossakScheme : public Scheme<TSparseSpace, TDenseSpace>
129 {
130 public:
135 
137 
138  typedef typename BaseType::TDataType TDataType;
139 
141 
143 
145 
147 
149 
151 
152 
161  : Scheme<TSparseSpace, TDenseSpace>()
162  {
163  //default values for the Newmark Scheme
164  mAlphaBossak = NewAlphaBossak;
165  mBetaNewmark = 0.25 * pow((1.00 - mAlphaBossak), 2);
166  mGammaNewmark = 0.5 - mAlphaBossak;
167 
168  //Allocate auxiliary memory
169  int NumThreads = OpenMPUtils::GetNumThreads();
170  mMass.resize(NumThreads);
171  mDamp.resize(NumThreads);
172  mvel.resize(NumThreads);
173  macc.resize(NumThreads);
174  maccold.resize(NumThreads);
175 
176  //sizing work matrices
177  //mMass.resize(10,10);
178  //mDamp.resize(10,10);
179 
180  //mvel.resize(10,false);
181  //macc.resize(10,false);
182  //maccold.resize(10,false);
183 
184 
185  std::cout << "using the Bossak Time Integration Scheme" << std::endl;
186  }
187 
191  {
192  }
193 
194 
204  //***************************************************************************
205 
206  void Update(
207  ModelPart& r_model_part,
208  DofsArrayType& rDofSet,
210  TSystemVectorType& Dx,
212  )
213  {
214  KRATOS_TRY
215 
216  //update of displacement (by DOF)
217  for (typename DofsArrayType::iterator i_dof = rDofSet.begin(); i_dof != rDofSet.end(); ++i_dof)
218  {
219  if (i_dof->IsFree())
220  {
221  i_dof->GetSolutionStepValue() += Dx[i_dof->EquationId()];
222  }
223  }
224 
225  //updating time derivatives (nodally for efficiency)
226  array_1d<double, 3 > DeltaDisp;
227  for (ModelPart::NodeIterator i = r_model_part.NodesBegin();
228  i != r_model_part.NodesEnd(); ++i)
229  {
230 
231  noalias(DeltaDisp) = (i)->FastGetSolutionStepValue(DISPLACEMENT) - (i)->FastGetSolutionStepValue(DISPLACEMENT, 1);
232  //KRATOS_WATCH(i->Id());
233  array_1d<double, 3 > & CurrentVelocity = (i)->FastGetSolutionStepValue(VELOCITY, 0);
234  array_1d<double, 3 > & OldVelocity = (i)->FastGetSolutionStepValue(VELOCITY, 1);
235 
236  array_1d<double, 3 > & CurrentAcceleration = (i)->FastGetSolutionStepValue(ACCELERATION, 0);
237  array_1d<double, 3 > & OldAcceleration = (i)->FastGetSolutionStepValue(ACCELERATION, 1);
238  //KRATOS_WATCH("IN UNPDATE");
239  //KRATOS_WATCH((i)->FastGetSolutionStepValue(DISPLACEMENT));
240  UpdateVelocity(CurrentVelocity, DeltaDisp, OldVelocity, OldAcceleration);
241 
242  UpdateAcceleration(CurrentAcceleration, DeltaDisp, OldVelocity, OldAcceleration);
243  //KRATOS_WATCH((i)->FastGetSolutionStepValue(DISPLACEMENT));
244  //KRATOS_WATCH((i)->FastGetSolutionStepValue(DISPLACEMENT,1));
245  //KRATOS_WATCH(DeltaDisp);
246  //KRATOS_WATCH(OldVelocity);
247  //KRATOS_WATCH(CurrentVelocity);
248  //std::cout << "after update" << std::endl;
249 
250  //std::cout << std::endl;
251 
252  }
253 
254 
255  // //updating time derivatives
256  // for (it2=rDofSet.begin(); it2 != rDofSet.end(); ++it2)
257  // {
259  // // if ((*it2)->HasTimeDerivative())
260  // mpModel->Value((*it2)->GetTimeDerivative(), *it2) = Dt(**it2, CurrentTime, DeltaTime);
261  // // if ((*it2)->HasSecondTimeDerivative())
262  // mpModel->Value((*it2)->GetSecondTimeDerivative(), *it2) = Dtt(**it2, CurrentTime, DeltaTime);
263  // }
264 
265  KRATOS_CATCH("")
266 
267  }
268 
269 
270  //***************************************************************************
271  //predicts the solution at the current step as
272  // x = xold + vold * Dt
273 
274  void Predict(
275  ModelPart& r_model_part,
276  DofsArrayType& rDofSet,
278  TSystemVectorType& Dx,
280  )
281  {
282  std::cout << "Prediction" << std::endl;
283  array_1d<double, 3 > DeltaDisp;
284  double DeltaTime = r_model_part.GetProcessInfo()[DELTA_TIME];
285 
286 
287  for (ModelPart::NodeIterator i = r_model_part.NodesBegin();
288  i != r_model_part.NodesEnd(); ++i)
289  {
290  //KRATOS_WATCH(i->Id())
291  //KRATOS_WATCH(i->FastGetSolutionStepValue(DISPLACEMENT))
292  //KRATOS_WATCH(i->FastGetSolutionStepValue(VELOCITY))
293  //KRATOS_WATCH(i->FastGetSolutionStepValue(ACCELERATION))
294  array_1d<double, 3 > & OldVelocity = (i)->FastGetSolutionStepValue(VELOCITY, 1);
295  array_1d<double, 3 > & OldDisp = (i)->FastGetSolutionStepValue(DISPLACEMENT, 1);
296  //predicting displacement = OldDisplacement + OldVelocity * DeltaTime;
297  //ATTENTION::: the prediction is performed only on free nodes
298  array_1d<double, 3 > & CurrentDisp = (i)->FastGetSolutionStepValue(DISPLACEMENT);
299  //KRATOS_WATCH("1")
300 
301  if ((i->pGetDof(DISPLACEMENT_X))->IsFixed() == false)
302  (CurrentDisp[0]) = OldDisp[0] + DeltaTime * OldVelocity[0];
303  if (i->pGetDof(DISPLACEMENT_Y)->IsFixed() == false)
304  (CurrentDisp[1]) = OldDisp[1] + DeltaTime * OldVelocity[1];
305  if (i->HasDofFor(DISPLACEMENT_Z))
306  if (i->pGetDof(DISPLACEMENT_Z)->IsFixed() == false)
307  (CurrentDisp[2]) = OldDisp[2] + DeltaTime * OldVelocity[2];
308  //KRATOS_WATCH("2")
309 
310  //updating time derivatives ::: please note that displacements and its time derivatives
311  //can not be consistently fixed separately
312  noalias(DeltaDisp) = CurrentDisp - OldDisp;
313  array_1d<double, 3 > & OldAcceleration = (i)->FastGetSolutionStepValue(ACCELERATION, 1);
314  //KRATOS_WATCH(DeltaDisp)
315 
316  array_1d<double, 3 > & CurrentVelocity = (i)->FastGetSolutionStepValue(VELOCITY);
317  array_1d<double, 3 > & CurrentAcceleration = (i)->FastGetSolutionStepValue(ACCELERATION);
318  //KRATOS_WATCH(CurrentVelocity)
319  //KRATOS_WATCH(CurrentAcceleration)
320 
321  //KRATOS_WATCH(CurrentVelocity);
322  //KRATOS_WATCH(OldVelocity);
323  UpdateVelocity(CurrentVelocity, DeltaDisp, OldVelocity, OldAcceleration);
324 
325  UpdateAcceleration(CurrentAcceleration, DeltaDisp, OldVelocity, OldAcceleration);
326  }
327 
328  }
329 
330 
331  //***************************************************************************
332 
345  Element::Pointer rCurrentElement,
346  LocalSystemMatrixType& LHS_Contribution,
347  LocalSystemVectorType& RHS_Contribution,
349  ProcessInfo& CurrentProcessInfo
350  )
351  {
352  KRATOS_TRY
353 
354  int k = OpenMPUtils::ThisThread();
355 
356  //basic operations for the element considered
357  (rCurrentElement)->CalculateLocalSystem(LHS_Contribution, RHS_Contribution, CurrentProcessInfo);
358 
359  //KRATOS_WATCH(LHS_Contribution);
360  //KRATOS_WATCH(RHS_Contribution);
361  (rCurrentElement)->CalculateMassMatrix(mMass[k], CurrentProcessInfo);
362 
363  (rCurrentElement)->CalculateDampingMatrix(mDamp[k], CurrentProcessInfo);
364 
365  (rCurrentElement)->EquationIdVector(EquationId, CurrentProcessInfo);
366 
367  //KRATOS_WATCH(LHS_Contribution);
368  //KRATOS_WATCH("ADDED ELEMENT CONTRIBUTION");
369  //KRATOS_WATCH(RHS_Contribution);
370  //KRATOS_WATCH(mMass);
371  //KRATOS_WATCH(mDamp);
372  //adding the dynamic contributions (statics is already included)
373 
374  AddDynamicsToLHS(LHS_Contribution, mDamp[k], mMass[k], CurrentProcessInfo);
375 
376  AddDynamicsToRHS(rCurrentElement, RHS_Contribution, mDamp[k], mMass[k], CurrentProcessInfo);
377  //KRATOS_WATCH("ADDED DYNAMIC CONTRIBUTION");
378  //KRATOS_WATCH(RHS_Contribution);
379 
380  KRATOS_CATCH("")
381 
382  }
383 
385  Element::Pointer rCurrentElement,
386  LocalSystemVectorType& RHS_Contribution,
388  ProcessInfo& CurrentProcessInfo)
389  {
390  int k = OpenMPUtils::ThisThread();
391 
392  //basic operations for the element considered
393  (rCurrentElement)->CalculateRightHandSide(RHS_Contribution, CurrentProcessInfo);
394  (rCurrentElement)->CalculateMassMatrix(mMass[k], CurrentProcessInfo);
395  (rCurrentElement)->CalculateDampingMatrix(mDamp[k], CurrentProcessInfo);
396  (rCurrentElement)->EquationIdVector(EquationId, CurrentProcessInfo);
397 
398  //adding the dynamic contributions (static is already included)
399 
400  AddDynamicsToRHS(rCurrentElement, RHS_Contribution, mDamp[k], mMass[k], CurrentProcessInfo);
401 
402  }
403 
408  Condition::Pointer rCurrentCondition,
409  LocalSystemMatrixType& LHS_Contribution,
410  LocalSystemVectorType& RHS_Contribution,
412  ProcessInfo& CurrentProcessInfo)
413  {
414  KRATOS_TRY
415 
416  int k = OpenMPUtils::ThisThread();
417 
418  (rCurrentCondition)->CalculateLocalSystem(LHS_Contribution, RHS_Contribution, CurrentProcessInfo);
419  (rCurrentCondition)->CalculateMassMatrix(mMass[k], CurrentProcessInfo);
420  (rCurrentCondition)->CalculateDampingMatrix(mDamp[k], CurrentProcessInfo);
421  (rCurrentCondition)->EquationIdVector(EquationId, CurrentProcessInfo);
422 
423  //KRATOS_WATCH("ADDED CONDITION CONTRIBUTION");
424  //KRATOS_WATCH(RHS_Contribution);
425  AddDynamicsToLHS(LHS_Contribution, mDamp[k], mMass[k], CurrentProcessInfo);
426 
427  AddDynamicsToRHS(rCurrentCondition, RHS_Contribution, mDamp[k], mMass[k], CurrentProcessInfo);
428  //KRATOS_WATCH("ADDED DYNAMIC CONDITION CONTRIBUTION");
429  //KRATOS_WATCH(RHS_Contribution);
430 
431  KRATOS_CATCH("")
432  }
433 
435  Condition::Pointer rCurrentCondition,
436  LocalSystemVectorType& RHS_Contribution,
438  ProcessInfo& CurrentProcessInfo)
439  {
440  KRATOS_TRY
441 
442  int k = OpenMPUtils::ThisThread();
443 
444  //basic operations for the element considered
445  (rCurrentCondition)->CalculateRightHandSide(RHS_Contribution, CurrentProcessInfo);
446  (rCurrentCondition)->CalculateMassMatrix(mMass[k], CurrentProcessInfo);
447  (rCurrentCondition)->CalculateDampingMatrix(mDamp[k], CurrentProcessInfo);
448  (rCurrentCondition)->EquationIdVector(EquationId, CurrentProcessInfo);
449 
450  //adding the dynamic contributions (static is already included)
451 
452  AddDynamicsToRHS(rCurrentCondition, RHS_Contribution, mDamp[k], mMass[k], CurrentProcessInfo);
453 
454  KRATOS_CATCH("")
455  }
456 
458  ModelPart& r_model_part,
460  TSystemVectorType& Dx,
462  )
463  {
464  ProcessInfo& CurrentProcessInfo = r_model_part.GetProcessInfo();
465 
467 
468  double DeltaTime = CurrentProcessInfo[DELTA_TIME];
469 
470  if (DeltaTime == 0)
471  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", "");
472 
473  //initializing constants
474  ma0 = 1.0 / (mBetaNewmark * pow(DeltaTime, 2));
475  ma1 = mGammaNewmark / (mBetaNewmark * DeltaTime);
476  ma2 = 1.0 / (mBetaNewmark * DeltaTime);
477  ma3 = 1.0 / (2.0 * mBetaNewmark) - 1.0;
478  ma4 = mGammaNewmark / mBetaNewmark - 1.0;
479  ma5 = DeltaTime * 0.5 * (mGammaNewmark / mBetaNewmark - 2.0);
480  mam = (1.0 - mAlphaBossak) / (mBetaNewmark * pow(DeltaTime, 2));
481  }
482 
490  virtual int Check(ModelPart& r_model_part)
491  {
492  KRATOS_TRY
493 
494  int err = Scheme<TSparseSpace, TDenseSpace>::Check(r_model_part);
495  if(err!=0) return err;
496 
497  //check for variables keys
498  //verify that the variables are correctly initialized
499  if(DISPLACEMENT.Key() == 0)
500  KRATOS_THROW_ERROR(std::invalid_argument,"DISPLACEMENT has Key zero! (check if the application is correctly registered","");
501  if(VELOCITY.Key() == 0)
502  KRATOS_THROW_ERROR(std::invalid_argument,"VELOCITY has Key zero! (check if the application is correctly registered","");
503  if(ACCELERATION.Key() == 0)
504  KRATOS_THROW_ERROR(std::invalid_argument,"ACCELERATION has Key zero! (check if the application is correctly registered","");
505 
506  //check that variables are correctly allocated
507  for(ModelPart::NodesContainerType::iterator it=r_model_part.NodesBegin();
508  it!=r_model_part.NodesEnd(); it++)
509  {
510  if (it->SolutionStepsDataHas(DISPLACEMENT) == false)
511  KRATOS_THROW_ERROR(std::logic_error, "DISPLACEMENT variable is not allocated for node ", it->Id() );
512  if (it->SolutionStepsDataHas(VELOCITY) == false)
513  KRATOS_THROW_ERROR(std::logic_error, "DISPLACEMENT variable is not allocated for node ", it->Id() );
514  if (it->SolutionStepsDataHas(ACCELERATION) == false)
515  KRATOS_THROW_ERROR(std::logic_error, "DISPLACEMENT variable is not allocated for node ", it->Id() );
516  }
517 
518  //check that dofs exist
519  for(ModelPart::NodesContainerType::iterator it=r_model_part.NodesBegin();
520  it!=r_model_part.NodesEnd(); it++)
521  {
522  if(it->HasDofFor(DISPLACEMENT_X) == false)
523  KRATOS_THROW_ERROR(std::invalid_argument,"missing DISPLACEMENT_X dof on node ",it->Id());
524  if(it->HasDofFor(DISPLACEMENT_Y) == false)
525  KRATOS_THROW_ERROR(std::invalid_argument,"missing DISPLACEMENT_Y dof on node ",it->Id());
526  if(it->HasDofFor(DISPLACEMENT_Z) == false)
527  KRATOS_THROW_ERROR(std::invalid_argument,"missing DISPLACEMENT_Z dof on node ",it->Id());
528  }
529 
530 
531  //check for admissible value of the AlphaBossak
532  if(mAlphaBossak > 0.0 || mAlphaBossak < -0.3)
533  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)
534 
535  //check for minimum value of the buffer index
536  //verify buffer size
537  if (r_model_part.GetBufferSize() < 2)
538  KRATOS_THROW_ERROR(std::logic_error, "insufficient buffer size. Buffer size should be greater than 2. Current size is", r_model_part.GetBufferSize());
539 
540 
541  return 0;
542  KRATOS_CATCH("");
543  }
544 
567 protected:
575  double mAlphaBossak;
576  double mBetaNewmark;
578 
579  double ma0;
580  double ma1;
581  double ma2;
582  double ma3;
583  double ma4;
584  double ma5;
585  double mam;
586 
587  std::vector< Matrix >mMass;
588  std::vector< Matrix >mDamp;
589  std::vector< Vector >mvel;
590  std::vector< Vector >macc;
591  std::vector< Vector >maccold;
592 
597  //*********************************************************************************
598  //Updating first time Derivative
599  //*********************************************************************************
600 
601  inline void UpdateVelocity(array_1d<double, 3 > & CurrentVelocity,
602  const array_1d<double, 3 > & DeltaDisp,
603  const array_1d<double, 3 > & OldVelocity,
604  const array_1d<double, 3 > & OldAcceleration)
605  {
606  //KRATOS_WATCH(DeltaDisp);
607  //KRATOS_WATCH(OldVelocity);
608  //KRATOS_WATCH(OldAcceleration);
609  noalias(CurrentVelocity) = ma1 * DeltaDisp - ma4 * OldVelocity - ma5*OldAcceleration;
610 
611  }
612 
613 
614 
615  //**************************************************************************
616 
617  inline void UpdateAcceleration(array_1d<double, 3 > & CurrentAcceleration,
618  const array_1d<double, 3 > & DeltaDisp,
619  const array_1d<double, 3 > & OldVelocity,
620  const array_1d<double, 3 > & OldAcceleration)
621  {
622 
623  noalias(CurrentAcceleration) = ma0 * DeltaDisp - ma2 * OldVelocity - ma3*OldAcceleration;
624  }
625 
626 
627 
628 
629  //****************************************************************************
630 
636  LocalSystemMatrixType& LHS_Contribution,
639  ProcessInfo& CurrentProcessInfo)
640  {
641 
642  // adding mass contribution to the dynamic stiffness
643  if (M.size1() != 0) // if M matrix declared
644  {
645  noalias(LHS_Contribution) += mam*M;
646 
647  }
648 
649  //adding damping contribution
650  if (D.size1() != 0) // if M matrix declared
651  {
652  noalias(LHS_Contribution) += ma1*D;
653  //KRATOS_WATCH(ma1*D);
654 
655  }
656 
657 
658  }
659 
660 
661 
662 
663 
664  //****************************************************************************
665 
671  Element::Pointer rCurrentElement,
672  LocalSystemVectorType& RHS_Contribution,
675  ProcessInfo& CurrentProcessInfo)
676  {
677  int k = OpenMPUtils::ThisThread();
678 
679  //KRATOS_WATCH(RHS_Contribution);
680  //adding inertia contribution
681  if (M.size1() != 0)
682  {
683  rCurrentElement->GetSecondDerivativesVector(macc[k], 0);
684 
685  (macc[k]) *= (1.00 - mAlphaBossak);
686  rCurrentElement->GetSecondDerivativesVector(maccold[k], 1);
687 
689 
690  //KRATOS_WATCH("ACCELERATION");
691 
692  noalias(RHS_Contribution) -= prod(M, macc[k]);
693  //KRATOS_WATCH(prod(M, macc[k] ));
694 
695  }
696 
697  //adding damping contribution
698  //damping contribution
699  if (D.size1() != 0)
700  {
701  rCurrentElement->GetFirstDerivativesVector(mvel[k], 0);
702  //KRATOS_WATCH(mvel[k]);
703  noalias(RHS_Contribution) -= prod(D, mvel[k]);
704  //KRATOS_WATCH(prod(D,mvel[k]));
705  }
706 
707 
708  }
709 
711  Condition::Pointer rCurrentCondition,
712  LocalSystemVectorType& RHS_Contribution,
715  ProcessInfo& CurrentProcessInfo)
716  {
717  int k = OpenMPUtils::ThisThread();
718 
719  //adding inertia contribution
720  if (M.size1() != 0)
721  {
722  rCurrentCondition->GetSecondDerivativesVector(macc[k], 0);
723  (macc[k]) *= (1.00 - mAlphaBossak);
724  rCurrentCondition->GetSecondDerivativesVector(maccold[k], 1);
726 
727  noalias(RHS_Contribution) -= prod(M, macc[k]);
728  }
729 
730  //adding damping contribution
731  //damping contribution
732  if (D.size1() != 0)
733  {
734  rCurrentCondition->GetFirstDerivativesVector(mvel[k], 0);
735  noalias(RHS_Contribution) -= prod(D, mvel[k]);
736  }
737 
738  }
739 
763 private:
771  /* Matrix mMass;
772  Matrix mDamp;
773 
774  Vector mvel;
775  Vector macc;
776  Vector maccold;
777 
778  DofsVectorType mElementalDofList;
779  */
780 
807 }; /* Class Scheme */
808 
817 } /* namespace Kratos.*/
818 
819 #endif /* KRATOS_RESIDUALBASED_PREDICTOR_CORRECTOR_BOSSAK_SCHEME defined */
820 
821 
822 
std::vector< DofType::Pointer > DofsVectorType
Definition: element.h:100
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
static int ThisThread()
Wrapper for omp_get_thread_num().
Definition: openmp_utils.h:108
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: residualbased_predictorcorrector_bossak_scheme.h:129
BaseType::TSystemMatrixType TSystemMatrixType
Definition: residualbased_predictorcorrector_bossak_scheme.h:144
std::vector< Vector > macc
Definition: residualbased_predictorcorrector_bossak_scheme.h:590
double ma1
Definition: residualbased_predictorcorrector_bossak_scheme.h:580
std::vector< Vector > maccold
Definition: residualbased_predictorcorrector_bossak_scheme.h:591
void AddDynamicsToLHS(LocalSystemMatrixType &LHS_Contribution, LocalSystemMatrixType &D, LocalSystemMatrixType &M, ProcessInfo &CurrentProcessInfo)
Definition: residualbased_predictorcorrector_bossak_scheme.h:635
BaseType::TSystemVectorType TSystemVectorType
Definition: residualbased_predictorcorrector_bossak_scheme.h:146
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: residualbased_predictorcorrector_bossak_scheme.h:601
BaseType::TDataType TDataType
Definition: residualbased_predictorcorrector_bossak_scheme.h:138
double ma3
Definition: residualbased_predictorcorrector_bossak_scheme.h:582
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: residualbased_predictorcorrector_bossak_scheme.h:617
void Predict(ModelPart &r_model_part, DofsArrayType &rDofSet, TSystemMatrixType &A, TSystemVectorType &Dx, TSystemVectorType &b)
Performing the prediction of the solution.
Definition: residualbased_predictorcorrector_bossak_scheme.h:274
BaseType::DofsArrayType DofsArrayType
Definition: residualbased_predictorcorrector_bossak_scheme.h:140
void Calculate_RHS_Contribution(Element::Pointer rCurrentElement, LocalSystemVectorType &RHS_Contribution, Element::EquationIdVectorType &EquationId, ProcessInfo &CurrentProcessInfo)
Definition: residualbased_predictorcorrector_bossak_scheme.h:384
void AddDynamicsToRHS(Condition::Pointer rCurrentCondition, LocalSystemVectorType &RHS_Contribution, LocalSystemMatrixType &D, LocalSystemMatrixType &M, ProcessInfo &CurrentProcessInfo)
Definition: residualbased_predictorcorrector_bossak_scheme.h:710
ResidualBasedPredictorCorrectorBossakScheme(double NewAlphaBossak)
Definition: residualbased_predictorcorrector_bossak_scheme.h:160
double ma4
Definition: residualbased_predictorcorrector_bossak_scheme.h:583
double ma2
Definition: residualbased_predictorcorrector_bossak_scheme.h:581
void AddDynamicsToRHS(Element::Pointer rCurrentElement, LocalSystemVectorType &RHS_Contribution, LocalSystemMatrixType &D, LocalSystemMatrixType &M, ProcessInfo &CurrentProcessInfo)
Definition: residualbased_predictorcorrector_bossak_scheme.h:670
virtual ~ResidualBasedPredictorCorrectorBossakScheme()
Definition: residualbased_predictorcorrector_bossak_scheme.h:190
BaseType::LocalSystemMatrixType LocalSystemMatrixType
Definition: residualbased_predictorcorrector_bossak_scheme.h:150
double mGammaNewmark
Definition: residualbased_predictorcorrector_bossak_scheme.h:577
std::vector< Matrix > mMass
Definition: residualbased_predictorcorrector_bossak_scheme.h:587
double ma5
Definition: residualbased_predictorcorrector_bossak_scheme.h:584
void CalculateSystemContributions(Element::Pointer rCurrentElement, LocalSystemMatrixType &LHS_Contribution, LocalSystemVectorType &RHS_Contribution, Element::EquationIdVectorType &EquationId, ProcessInfo &CurrentProcessInfo)
Definition: residualbased_predictorcorrector_bossak_scheme.h:344
double ma0
Definition: residualbased_predictorcorrector_bossak_scheme.h:579
Scheme< TSparseSpace, TDenseSpace > BaseType
Definition: residualbased_predictorcorrector_bossak_scheme.h:136
void InitializeSolutionStep(ModelPart &r_model_part, TSystemMatrixType &A, TSystemVectorType &Dx, TSystemVectorType &b)
Function called once at the beginning of each solution step.
Definition: residualbased_predictorcorrector_bossak_scheme.h:457
BaseType::LocalSystemVectorType LocalSystemVectorType
Definition: residualbased_predictorcorrector_bossak_scheme.h:148
virtual int Check(ModelPart &r_model_part)
Definition: residualbased_predictorcorrector_bossak_scheme.h:490
std::vector< Matrix > mDamp
Definition: residualbased_predictorcorrector_bossak_scheme.h:588
virtual void Condition_Calculate_RHS_Contribution(Condition::Pointer rCurrentCondition, LocalSystemVectorType &RHS_Contribution, Element::EquationIdVectorType &EquationId, ProcessInfo &CurrentProcessInfo)
Definition: residualbased_predictorcorrector_bossak_scheme.h:434
std::vector< Vector > mvel
Definition: residualbased_predictorcorrector_bossak_scheme.h:589
void Update(ModelPart &r_model_part, DofsArrayType &rDofSet, TSystemMatrixType &A, TSystemVectorType &Dx, TSystemVectorType &b)
Definition: residualbased_predictorcorrector_bossak_scheme.h:206
double mam
Definition: residualbased_predictorcorrector_bossak_scheme.h:585
KRATOS_CLASS_POINTER_DEFINITION(ResidualBasedPredictorCorrectorBossakScheme)
double mAlphaBossak
Definition: residualbased_predictorcorrector_bossak_scheme.h:575
double mBetaNewmark
Definition: residualbased_predictorcorrector_bossak_scheme.h:576
virtual void Condition_CalculateSystemContributions(Condition::Pointer rCurrentCondition, LocalSystemMatrixType &LHS_Contribution, LocalSystemVectorType &RHS_Contribution, Element::EquationIdVectorType &EquationId, ProcessInfo &CurrentProcessInfo)
Definition: residualbased_predictorcorrector_bossak_scheme.h:407
Element::DofsVectorType DofsVectorType
Definition: residualbased_predictorcorrector_bossak_scheme.h:142
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
A
Definition: sensitivityMatrix.py:70
integer i
Definition: TensorModule.f:17