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.
explicit_builder.h
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: Ruben Zorrilla
11 //
12 //
13 
14 #if !defined(KRATOS_EXPLICIT_BUILDER)
15 #define KRATOS_EXPLICIT_BUILDER
16 
17 // System includes
18 #include <set>
19 #include <unordered_set>
20 
21 // External includes
22 
23 // Project includes
24 #include "includes/define.h"
25 #include "includes/model_part.h"
29 #include "factories/factory.h"
31 
32 namespace Kratos
33 {
36 
37 
41 
42 
46 
47 
51 
52 
56 
66 template<class TSparseSpace, class TDenseSpace >
68 {
69 public:
72 
74  typedef std::size_t SizeType;
75 
77  typedef std::size_t IndexType;
78 
80  typedef typename TSparseSpace::DataType TDataType;
81 
84 
87 
89  typedef typename TSparseSpace::MatrixPointerType TSystemMatrixPointerType;
90 
92  typedef typename TSparseSpace::VectorPointerType TSystemVectorPointerType;
93 
96 
99 
102 
105 
108 
110  typedef typename std::unordered_set<DofType::Pointer, DofPointerHasher> DofSetType;
111 
116 
119 
122 
125 
129 
135  explicit ExplicitBuilder(Parameters ThisParameters)
136  {
137  // Validate and assign defaults
138  ThisParameters = this->ValidateAndAssignParameters(ThisParameters, this->GetDefaultParameters());
139  this->AssignSettings(ThisParameters);
140  }
141 
146  explicit ExplicitBuilder() = default;
147 
152  virtual ~ExplicitBuilder() = default;
153 
154 
159  virtual typename ClassType::Pointer Create(Parameters ThisParameters) const
160  {
161  return Kratos::make_shared<ClassType>(ThisParameters);
162  }
163 
167 
168 
172 
178  {
180  }
181 
186  void SetCalculateReactionsFlag(bool CalculateReactionsFlag)
187  {
188  mCalculateReactionsFlag = CalculateReactionsFlag;
189  }
190 
196  {
197  return mDofSetIsInitialized;
198  }
199 
204  void SetDofSetIsInitializedFlag(bool DofSetIsInitialized)
205  {
206  mDofSetIsInitialized = DofSetIsInitialized;
207  }
208 
213  bool GetResetDofSetFlag() const
214  {
215  return mResetDofSetFlag;
216  }
217 
222  void SetResetDofSetFlag(bool ResetDofSetFlag)
223  {
224  mResetDofSetFlag = ResetDofSetFlag;
225  }
226 
232  {
234  }
235 
240  void SetResetLumpedMassVectorFlag(bool ResetLumpedMassVectorFlag)
241  {
242  mResetLumpedMassVectorFlag = ResetLumpedMassVectorFlag;
243  }
244 
249  unsigned int GetEquationSystemSize() const
250  {
251  return mEquationSystemSize;
252  }
253 
258  {
259  return mDofSet;
260  }
261 
265  const DofsArrayType& GetDofSet() const
266  {
267  return mDofSet;
268  }
269 
276  {
277  return mpLumpedMassVector;
278  }
279 
286  {
287  KRATOS_ERROR_IF_NOT(mpLumpedMassVector) << "Lumped mass matrix vector is not initialized!" << std::endl;
288  return (*mpLumpedMassVector);
289  }
290 
296  virtual void BuildRHS(ModelPart& rModelPart)
297  {
298  KRATOS_TRY
299 
300  // Build the Right Hand Side without Dirichlet conditions
301  // We skip setting the Dirichlet nodes residual to zero for the sake of efficiency
302  // Note that this is not required as the Dirichlet conditions are set in the strategy
303  BuildRHSNoDirichlet(rModelPart);
304 
305  KRATOS_CATCH("")
306  }
307 
313  virtual void BuildRHSNoDirichlet(ModelPart& rModelPart)
314  {
315  KRATOS_TRY
316 
317  // Initialize the reaction (residual)
319 
320  // Gets the array of elements, conditions and constraints from the modeler
321  const auto &r_elements_array = rModelPart.Elements();
322  const auto &r_conditions_array = rModelPart.Conditions();
323  const int n_elems = static_cast<int>(r_elements_array.size());
324  const int n_conds = static_cast<int>(r_conditions_array.size());
325 
326  const auto& r_process_info = rModelPart.GetProcessInfo();
327 
328 #pragma omp parallel firstprivate(n_elems, n_conds)
329  {
330 #pragma omp for schedule(guided, 512) nowait
331  // Assemble all elements
332  for (int i_elem = 0; i_elem < n_elems; ++i_elem) {
333  auto it_elem = r_elements_array.begin() + i_elem;
334  // If the element is active
335  if (it_elem->IsActive()) {
336  // Calculate elemental explicit residual contribution
337  // The explicit builder and solver assumes that the residual contribution is assembled in the REACTION variables
338  it_elem->AddExplicitContribution(r_process_info);
339  }
340  }
341 
342  // Assemble all conditions
343 #pragma omp for schedule(guided, 512)
344  for (int i_cond = 0; i_cond < n_conds; ++i_cond) {
345  auto it_cond = r_conditions_array.begin() + i_cond;
346  // If the condition is active
347  if (it_cond->IsActive()) {
348  // Calculate condition explicit residual contribution
349  // The explicit builder and solver assumes that the residual contribution is assembled in the REACTION variables
350  it_cond->AddExplicitContribution(r_process_info);
351  }
352  }
353  }
354 
355  KRATOS_CATCH("")
356  }
357 
364  virtual void ApplyConstraints(ModelPart& rModelPart)
365  {
366  // First we reset the slave dofs
368 
369  // Now we apply the constraints
371  }
372 
377  virtual void Initialize(ModelPart& rModelPart)
378  {
379  if (!mDofSetIsInitialized) {
380  // Initialize the DOF set and the equation ids
381  this->SetUpDofSet(rModelPart);
382  this->SetUpDofSetEquationIds();
383  // Set up the lumped mass vector
384  this->SetUpLumpedMassVector(rModelPart);
385  } else if (!mLumpedMassVectorIsInitialized) {
386  KRATOS_WARNING("ExplicitBuilder") << "Calling Initialize() with already initialized DOF set. Initializing lumped mass vector." << std::endl;;
387  // Only set up the lumped mass vector
388  this->SetUpLumpedMassVector(rModelPart);
389  } else {
390  KRATOS_WARNING("ExplicitBuilder") << "Calling Initialize() with already initialized DOF set and lumped mass vector." << std::endl;;
391  }
392  }
393 
398  virtual void InitializeSolutionStep(ModelPart& rModelPart)
399  {
400  // Check the operations that are required to be done
401  if (mResetDofSetFlag) {
402  // If required (e.g. topology changes) reset the DOF set
403  // Note that we also set lumped mass vector in this case
404  this->SetUpDofSet(rModelPart);
405  this->SetUpDofSetEquationIds();
406  this->SetUpLumpedMassVector(rModelPart);
407  } else if (mResetLumpedMassVectorFlag) {
408  // Only reset the lumped mass vector
409  this->SetUpLumpedMassVector(rModelPart);
410  }
411 
412  // Initialize the reactions (residual)
414  }
415 
420  virtual void FinalizeSolutionStep(ModelPart& rModelPart)
421  {
422  // If required, calculate the reactions
424  this->CalculateReactions();
425  }
426  }
427 
432  virtual void Clear()
433  {
434  this->mDofSet = DofsArrayType();
435  this->mpLumpedMassVector.reset();
436 
437  KRATOS_INFO_IF("ExplicitBuilder", this->GetEchoLevel() > 0) << "Clear Function called" << std::endl;
438  }
439 
447  virtual int Check(const ModelPart& rModelPart) const
448  {
449  KRATOS_TRY
450 
451  return 0;
452 
453  KRATOS_CATCH("");
454  }
455 
461  {
462  const Parameters default_parameters = Parameters(R"(
463  {
464  "name" : "explicit_builder"
465  })");
466  return default_parameters;
467  }
468 
473  static std::string Name()
474  {
475  return "explicit_builder";
476  }
477 
488  void SetEchoLevel(int Level)
489  {
490  mEchoLevel = Level;
491  }
492 
497  int GetEchoLevel() const
498  {
499  return mEchoLevel;
500  }
501 
505 
506 
510 
511 
515 
517  virtual std::string Info() const
518  {
519  return "ExplicitBuilder";
520  }
521 
523  virtual void PrintInfo(std::ostream& rOStream) const
524  {
525  rOStream << Info();
526  }
527 
529  virtual void PrintData(std::ostream& rOStream) const
530  {
531  rOStream << Info();
532  }
533 
537 
538 
540 protected:
543 
544 
548 
550 
551  TSystemVectorPointerType mpLumpedMassVector; // The lumped mass vector associated to the DOF set
552 
553  bool mResetDofSetFlag = false;
554 
556 
557  bool mDofSetIsInitialized = false;
558 
560 
561  bool mCalculateReactionsFlag = false;
562 
563  unsigned int mEquationSystemSize;
564 
565  int mEchoLevel = 0;
566 
570 
571 
575 
581  virtual void SetUpDofSet(const ModelPart& rModelPart)
582  {
583  KRATOS_TRY;
584 
585  KRATOS_INFO_IF("ExplicitBuilder", this->GetEchoLevel() > 1) << "Setting up the dofs" << std::endl;
586 
587  // Gets the array of elements, conditions and constraints from the modeler
588  const auto &r_elements_array = rModelPart.Elements();
589  const auto &r_conditions_array = rModelPart.Conditions();
590  const auto &r_constraints_array = rModelPart.MasterSlaveConstraints();
591  const int n_elems = static_cast<int>(r_elements_array.size());
592  const int n_conds = static_cast<int>(r_conditions_array.size());
593  const int n_constraints = static_cast<int>(r_constraints_array.size());
594 
595  // Global dof set
596  DofSetType dof_global_set;
597  dof_global_set.reserve(n_elems*20);
598 
599  // Auxiliary DOFs list
600  DofsVectorType dof_list;
601  DofsVectorType second_dof_list; // The second_dof_list is only used on constraints to include master/slave relations
602 
603 #pragma omp parallel firstprivate(dof_list, second_dof_list)
604  {
605  const auto& r_process_info = rModelPart.GetProcessInfo();
606 
607  // We cleate the temporal set and we reserve some space on them
608  DofSetType dofs_tmp_set;
609  dofs_tmp_set.reserve(20000);
610 
611  // Get the DOFs list from each element and insert it in the temporary set
612 #pragma omp for schedule(guided, 512) nowait
613  for (int i_elem = 0; i_elem < n_elems; ++i_elem) {
614  const auto it_elem = r_elements_array.begin() + i_elem;
615  it_elem->GetDofList(dof_list, r_process_info);
616  dofs_tmp_set.insert(dof_list.begin(), dof_list.end());
617  }
618 
619  // Get the DOFs list from each condition and insert it in the temporary set
620 #pragma omp for schedule(guided, 512) nowait
621  for (int i_cond = 0; i_cond < n_conds; ++i_cond) {
622  const auto it_cond = r_conditions_array.begin() + i_cond;
623  it_cond->GetDofList(dof_list, r_process_info);
624  dofs_tmp_set.insert(dof_list.begin(), dof_list.end());
625  }
626 
627  // Get the DOFs list from each constraint and insert it in the temporary set
628 #pragma omp for schedule(guided, 512) nowait
629  for (int i_const = 0; i_const < n_constraints; ++i_const) {
630  auto it_const = r_constraints_array.begin() + i_const;
631  it_const->GetDofList(dof_list, second_dof_list, r_process_info);
632  dofs_tmp_set.insert(dof_list.begin(), dof_list.end());
633  dofs_tmp_set.insert(second_dof_list.begin(), second_dof_list.end());
634  }
635 
636  // We merge all the sets in one thread
637 #pragma omp critical
638  {
639  dof_global_set.insert(dofs_tmp_set.begin(), dofs_tmp_set.end());
640  }
641  }
642 
643  KRATOS_INFO_IF("ExplicitBuilder", ( this->GetEchoLevel() > 2)) << "Initializing ordered array filling\n" << std::endl;
644 
645  // Ordering the global DOF set
647  DofsArrayType temp_dof_set;
648  temp_dof_set.reserve(dof_global_set.size());
649  for (auto it_dof = dof_global_set.begin(); it_dof != dof_global_set.end(); ++it_dof) {
650  temp_dof_set.push_back(*it_dof);
651  }
652  temp_dof_set.Sort();
653  mDofSet = temp_dof_set;
655 
656  // DoFs set checks
657  // Throws an exception if there are no Degrees Of Freedom involved in the analysis
658  KRATOS_ERROR_IF(mDofSet.size() == 0) << "No degrees of freedom!" << std::endl;
659 
660  // Check if each DOF has a reaction. Note that the explicit residual is stored in these
661  for (auto it_dof = mDofSet.begin(); it_dof != mDofSet.end(); ++it_dof) {
662  KRATOS_ERROR_IF_NOT(it_dof->HasReaction()) << "Reaction variable not set for the following : " << std::endl
663  << "Node : " << it_dof->Id() << std::endl
664  << "Dof : " << (*it_dof) << std::endl << "Not possible to calculate reactions." << std::endl;
665  }
666 
667  mDofSetIsInitialized = true;
668 
669  KRATOS_INFO_IF("ExplicitBuilder", ( this->GetEchoLevel() > 2)) << "Number of degrees of freedom:" << mDofSet.size() << std::endl;
670  KRATOS_INFO_IF("ExplicitBuilder", ( this->GetEchoLevel() > 2 && rModelPart.GetCommunicator().MyPID() == 0)) << "Finished setting up the dofs" << std::endl;
671  KRATOS_INFO_IF("ExplicitBuilder", ( this->GetEchoLevel() > 2)) << "End of setup dof set\n" << std::endl;
672 
673  KRATOS_CATCH("");
674  }
675 
680  virtual void SetUpDofSetEquationIds()
681  {
682  // Firstly check that the DOF set is initialized
683  KRATOS_ERROR_IF_NOT(mDofSetIsInitialized) << "Trying to set the equation ids. before initializing the DOF set. Please call the SetUpDofSet() before." << std::endl;
684  KRATOS_ERROR_IF(mEquationSystemSize == 0) << "Trying to set the equation ids. in an empty DOF set (equation system size is 0)." << std::endl;
685 
686  // Loop the DOF set to assign the equation ids
688  [&](int i_dof){
689  auto it_dof = mDofSet.begin() + i_dof;
690  it_dof->SetEquationId(i_dof);
691  }
692  );
693  }
694 
703  virtual void SetUpLumpedMassVector(const ModelPart &rModelPart)
704  {
705  KRATOS_TRY;
706 
707  KRATOS_INFO_IF("ExplicitBuilder", this->GetEchoLevel() > 1) << "Setting up the lumped mass matrix vector" << std::endl;
708 
709  // Initialize the lumped mass matrix vector
710  // Note that the lumped mass matrix vector size matches the dof set one
712  TDenseSpace::SetToZero(*mpLumpedMassVector);
713 
714  // Loop the elements to get the lumped mass vector
715  LocalSystemVectorType elem_mass_vector;
716  std::vector<std::size_t> elem_equation_id;
717  const auto &r_elements_array = rModelPart.Elements();
718  const auto &r_process_info = rModelPart.GetProcessInfo();
719  const int n_elems = static_cast<int>(r_elements_array.size());
720 
721 #pragma omp for private(elem_mass_vector) schedule(guided, 512) nowait
722  for (int i_elem = 0; i_elem < n_elems; ++i_elem) {
723  const auto it_elem = r_elements_array.begin() + i_elem;
724 
725  // Calculate the elemental lumped mass vector
726  it_elem->CalculateLumpedMassVector(elem_mass_vector, r_process_info);
727  it_elem->EquationIdVector(elem_equation_id, r_process_info);
728 
729  // Update value of lumped mass vector
730  for (IndexType i = 0; i < elem_equation_id.size(); ++i) {
731  AtomicAdd((*mpLumpedMassVector)[elem_equation_id[i]], elem_mass_vector(i));
732  }
733  }
734 
735  // Set the lumped mass vector flag as true
737 
738  KRATOS_CATCH("");
739  }
740 
748  {
749  // Firstly check that the DOF set is initialized
750  KRATOS_ERROR_IF_NOT(mDofSetIsInitialized) << "Trying to initialize the explicit residual but the DOFs set is not initialized yet." << std::endl;
751  KRATOS_ERROR_IF(mEquationSystemSize == 0) << "Trying to set the equation ids. in an empty DOF set (equation system size is 0)." << std::endl;
752 
753  // Loop the reactions to initialize them to zero
755  mDofSet,
756  [](DofType& rDof){
757  rDof.GetSolutionStepReactionValue() = 0.0;
758  }
759  );
760  }
761 
766  virtual void CalculateReactions()
767  {
769  // Firstly check that the DOF set is initialized
770  KRATOS_ERROR_IF_NOT(mDofSetIsInitialized) << "Trying to initialize the explicit residual but the DOFs set is not initialized yet." << std::endl;
771  KRATOS_ERROR_IF(mEquationSystemSize == 0) << "Trying to set the equation ids. in an empty DOF set (equation system size is 0)." << std::endl;
772 
773  // Calculate the reactions as minus the current value
774  // Note that we take advantage of the fact that Kratos always works with a residual based formulation
775  // This means that the reactions are minus the residual. As we use the reaction as residual container
776  // during the explicit resolution of the problem, the calculate reactions is as easy as switching the sign
778  mDofSet,
779  [](DofType& rDof){
780  auto& r_reaction_value = rDof.GetSolutionStepReactionValue();
781  r_reaction_value *= -1.0;
782  }
783  );
784  }
785  }
786 
794  Parameters ThisParameters,
795  const Parameters DefaultParameters
796  ) const
797  {
798  ThisParameters.ValidateAndAssignDefaults(DefaultParameters);
799  return ThisParameters;
800  }
801 
806  virtual void AssignSettings(const Parameters ThisParameters)
807  {
808  }
809 
813 
814 
818 
819 
823 
824 
826 private:
829 
830  static std::vector<Internals::RegisteredPrototypeBase<ClassType>> msPrototypes;
831 
835 
839 
840 
844 
845 
849 
850 
854 
855 
859 
860 
862 }; /* Class ExplicitBuilder */
866 
867 
869 } /* namespace Kratos.*/
870 
871 #endif /* KRATOS_EXPLICIT_BUILDER defined */
virtual int MyPID() const
Definition: communicator.cpp:91
iterator begin()
Iterator pointing to the beginning of the container.
Definition: data_value_container.h:209
Dof represents a degree of freedom (DoF).
Definition: dof.h:86
TDataType & GetSolutionStepReactionValue(IndexType SolutionStepIndex=0)
Definition: dof.h:278
Current class provides an implementation for the base explicit builder and solving operations.
Definition: explicit_builder.h:68
ModelPart::ConditionsContainerType ConditionsArrayType
Definition: explicit_builder.h:115
std::size_t IndexType
Definition of the index type.
Definition: explicit_builder.h:77
virtual Parameters ValidateAndAssignParameters(Parameters ThisParameters, const Parameters DefaultParameters) const
This method validate and assign default parameters.
Definition: explicit_builder.h:793
ModelPart::DofsVectorType DofsVectorType
Definition of the DoF vector type.
Definition: explicit_builder.h:107
KRATOS_CLASS_POINTER_DEFINITION(ExplicitBuilder)
Pointer definition of ExplicitBuilder.
TDenseSpace::VectorType LocalSystemVectorType
The local vector definition.
Definition: explicit_builder.h:98
PointerVectorSet< Element, IndexedObject > ElementsContainerType
The definition of the element container type.
Definition: explicit_builder.h:118
virtual void Initialize(ModelPart &rModelPart)
It applied those operations that are expected to be executed once.
Definition: explicit_builder.h:377
bool GetCalculateReactionsFlag() const
This method returns the flag mCalculateReactionsFlag.
Definition: explicit_builder.h:177
static std::string Name()
Returns the name of the class as used in the settings (snake_case format)
Definition: explicit_builder.h:473
unsigned int mEquationSystemSize
Flag taking in account if it is needed or not to calculate the reactions.
Definition: explicit_builder.h:563
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: explicit_builder.h:447
bool mResetDofSetFlag
Definition: explicit_builder.h:553
bool GetResetLumpedMassVectorFlag() const
This method returns the flag GetResetLumpedMassVectorFlag.
Definition: explicit_builder.h:231
virtual void ApplyConstraints(ModelPart &rModelPart)
Applies the constraints.
Definition: explicit_builder.h:364
virtual void FinalizeSolutionStep(ModelPart &rModelPart)
It applies certain operations at the system of equations at the end of the solution step.
Definition: explicit_builder.h:420
virtual void PrintInfo(std::ostream &rOStream) const
Print information about this object.
Definition: explicit_builder.h:523
DofsArrayType & GetDofSet()
It allows to get the list of Dofs from the element.
Definition: explicit_builder.h:257
ExplicitBuilder()=default
Construct a new Explicit Builder object Default empty constructor.
TSparseSpace::MatrixType TSystemMatrixType
Definition of the sparse matrix.
Definition: explicit_builder.h:83
void SetResetLumpedMassVectorFlag(bool ResetLumpedMassVectorFlag)
This method sets the flag mResetLumpedMassVectorFlag.
Definition: explicit_builder.h:240
ModelPart::NodesContainerType NodesArrayType
The containers of the entities.
Definition: explicit_builder.h:113
virtual void SetUpDofSet(const ModelPart &rModelPart)
Builds the list of the DofSets involved in the problem by "asking" to each element and condition its ...
Definition: explicit_builder.h:581
virtual void SetUpDofSetEquationIds()
Set the Up Dof Set Equation Ids object Set up the DOF set equation ids.
Definition: explicit_builder.h:680
virtual std::string Info() const
Turn back information as a string.
Definition: explicit_builder.h:517
virtual ~ExplicitBuilder()=default
Destroy the Explicit Builder object Default destructor.
TSparseSpace::MatrixPointerType TSystemMatrixPointerType
Definition of the pointer to the sparse matrix.
Definition: explicit_builder.h:89
bool mCalculateReactionsFlag
Flag taking care if the lumped mass vector was initialized or not.
Definition: explicit_builder.h:561
DofsArrayType mDofSet
Definition: explicit_builder.h:549
std::unordered_set< DofType::Pointer, DofPointerHasher > DofSetType
The definition of the DoF set type.
Definition: explicit_builder.h:110
ModelPart::DofsArrayType DofsArrayType
Definition of the DoF array type.
Definition: explicit_builder.h:104
int mEchoLevel
Number of degrees of freedom of the problem to be solve.
Definition: explicit_builder.h:565
virtual void BuildRHS(ModelPart &rModelPart)
Function to perform the build of the RHS. The vector could be sized as the total number of dofs or as...
Definition: explicit_builder.h:296
virtual void InitializeDofSetReactions()
Initialize the DOF set reactions For an already initialized dof set (mDofSet), this method sets to ze...
Definition: explicit_builder.h:747
bool mResetLumpedMassVectorFlag
If the DOF set requires to be set at each time step.
Definition: explicit_builder.h:555
bool mDofSetIsInitialized
If the lumped mass vector requires to be set at each time step.
Definition: explicit_builder.h:557
void SetDofSetIsInitializedFlag(bool DofSetIsInitialized)
This method sets the flag mDofSetIsInitialized.
Definition: explicit_builder.h:204
virtual void CalculateReactions()
It computes the reactions of the system.
Definition: explicit_builder.h:766
virtual ClassType::Pointer Create(Parameters ThisParameters) const
Create method.
Definition: explicit_builder.h:159
std::size_t SizeType
Definition of the size type.
Definition: explicit_builder.h:74
ModelPart::ElementsContainerType ElementsArrayType
Definition: explicit_builder.h:114
TSparseSpace::DataType TDataType
Definition of the data type.
Definition: explicit_builder.h:80
bool GetDofSetIsInitializedFlag() const
This method returns the flag mDofSetIsInitialized.
Definition: explicit_builder.h:195
virtual Parameters GetDefaultParameters() const
This method provides the defaults parameters to avoid conflicts between the different constructors.
Definition: explicit_builder.h:460
void SetCalculateReactionsFlag(bool CalculateReactionsFlag)
This method sets the flag mCalculateReactionsFlag.
Definition: explicit_builder.h:186
TSystemVectorPointerType & pGetLumpedMassMatrixVector()
Get the lumped mass matrix vector pointer It allows to get the lumped mass matrix vector pointer.
Definition: explicit_builder.h:275
ExplicitBuilder(Parameters ThisParameters)
Construct a new Explicit Builder object Default constructor with Parameters.
Definition: explicit_builder.h:135
const DofsArrayType & GetDofSet() const
It allows to get the list of Dofs from the element.
Definition: explicit_builder.h:265
virtual void InitializeSolutionStep(ModelPart &rModelPart)
It applies certain operations at the system of equations at the beginning of the solution step.
Definition: explicit_builder.h:398
bool GetResetDofSetFlag() const
This method returns the flag mReshapeMatrixFlag.
Definition: explicit_builder.h:213
void SetEchoLevel(int Level)
It sets the level of echo for the solving strategy.
Definition: explicit_builder.h:488
unsigned int GetEquationSystemSize() const
This method returns the value mEquationSystemSize.
Definition: explicit_builder.h:249
bool mLumpedMassVectorIsInitialized
Flag taking care if the dof set was initialized ot not.
Definition: explicit_builder.h:559
ExplicitBuilder< TSparseSpace, TDenseSpace > ClassType
The definition of the current class.
Definition: explicit_builder.h:121
TSystemVectorPointerType mpLumpedMassVector
The set containing the DoF of the system.
Definition: explicit_builder.h:551
virtual void Clear()
This function is intended to be called at the end of the solution step to clean up memory storage not...
Definition: explicit_builder.h:432
TSparseSpace::VectorPointerType TSystemVectorPointerType
Definition of the pointer to the vector.
Definition: explicit_builder.h:92
virtual void PrintData(std::ostream &rOStream) const
Print object's data.
Definition: explicit_builder.h:529
int GetEchoLevel() const
It returns the echo level.
Definition: explicit_builder.h:497
TSparseSpace::VectorType TSystemVectorType
Definition of the vector size.
Definition: explicit_builder.h:86
virtual void SetUpLumpedMassVector(const ModelPart &rModelPart)
Set the Up Lumped Mass Vector object This method sets up the lumped mass vector used in the explicit ...
Definition: explicit_builder.h:703
TDenseSpace::MatrixType LocalSystemMatrixType
The local matrix definition.
Definition: explicit_builder.h:95
void SetResetDofSetFlag(bool ResetDofSetFlag)
This method sets the flag mResetDofSetFlag.
Definition: explicit_builder.h:222
virtual void BuildRHSNoDirichlet(ModelPart &rModelPart)
Function to perform the build of the RHS. The vector could be sized as the total number of dofs or as...
Definition: explicit_builder.h:313
TSystemVectorType & GetLumpedMassMatrixVector()
Get the lumped mass matrix vector It allows to get the lumped mass matrix vector.
Definition: explicit_builder.h:285
ModelPart::DofType DofType
Definition of the DoF class.
Definition: explicit_builder.h:101
virtual void AssignSettings(const Parameters ThisParameters)
This method assigns settings to member variables.
Definition: explicit_builder.h:806
This class is useful for index iteration over containers.
Definition: parallel_utilities.h:451
void for_each(TUnaryFunction &&f)
Definition: parallel_utilities.h:514
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
MasterSlaveConstraintContainerType & MasterSlaveConstraints(IndexType ThisIndex=0)
Definition: model_part.h:654
Communicator & GetCommunicator()
Definition: model_part.h:1821
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
std::vector< DofType::Pointer > DofsVectorType
Definition: model_part.h:110
This class provides to Kratos a data structure for I/O based on the standard of JSON.
Definition: kratos_parameters.h:59
void ValidateAndAssignDefaults(const Parameters &rDefaultParameters)
This function is designed to verify that the parameters under testing match the form prescribed by th...
Definition: kratos_parameters.cpp:1306
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
size_type size() const
Returns the number of elements in the container.
Definition: pointer_vector_set.h:502
void Sort()
Sort the elements in the set.
Definition: pointer_vector_set.h:753
void push_back(TPointerType x)
Adds a pointer to the end of the set.
Definition: pointer_vector_set.h:544
iterator begin()
Returns an iterator pointing to the beginning of the container.
Definition: pointer_vector_set.h:278
void reserve(int reservedsize)
Reserves memory for a specified number of elements.
Definition: pointer_vector_set.h:733
iterator end()
Returns an iterator pointing to the end of the container.
Definition: pointer_vector_set.h:314
#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_ERROR_IF(conditional)
Definition: exception.h:162
#define KRATOS_INFO_IF(label, conditional)
Definition: logger.h:251
#define KRATOS_WARNING(label)
Definition: logger.h:265
void ApplyConstraints(ModelPart &rModelPart)
This method resets the values of the slave dofs.
Definition: constraint_utilities.cpp:159
void ResetSlaveDofs(ModelPart &rModelPart)
This method resets the values of the slave dofs.
Definition: constraint_utilities.cpp:136
Vector VectorType
Definition: geometrical_transformation_utilities.h:56
Matrix MatrixType
Definition: geometrical_transformation_utilities.h:55
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
void AtomicAdd(TDataType &target, const TDataType &value)
Definition: atomic_utilities.h:55
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
integer i
Definition: TensorModule.f:17