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.
set_dummy_property_for_rigid_boundaries_process.hpp
Go to the documentation of this file.
1 //-------------------------------------------------------------
2 // ___ __ ___ _ _ _
3 // KRATOS| _ \/ _|___ _ __ | __| |_ _(_)__| |
4 // | _/ _/ -_) ' \| _|| | || | / _` |
5 // |_| |_| \___|_|_|_|_| |_|\_,_|_\__,_|DYNAMICS
6 //
7 // BSD License: PfemFluidDynamicsApplication/license.txt
8 //
9 // Main authors: Massimiliano Zecchetto
10 // Collaborators:
11 //
12 //-------------------------------------------------------------
13 //
14 
15 #if !defined(SET_DUMMY_PROPERTY_FOR_RIGID_ELEMENTS_PROCESS)
16 #define SET_DUMMY_PROPERTY_FOR_RIGID_ELEMENTS_PROCESS
17 
18 #include "includes/define.h"
19 #include "includes/model_part.h"
20 #include "processes/process.h"
21 
22 namespace Kratos
23 {
24 
26 
27 public:
28 
30 
33  unsigned int dummy_property_id)
35  rDummyPropertyId = dummy_property_id;
36  }
37 
40 
41  void operator()() {
42  Execute();
43  }
44 
45  void Execute() override {
46 
47  KRATOS_TRY;
48 
49  Properties::Pointer rDummyProperty = rModelPart.pGetProperties(rDummyPropertyId);
50  const auto& it_elem_begin = rModelPart.ElementsBegin();
51 
52  #pragma omp parallel for
53  for (int i = 0; i < static_cast<int>(rModelPart.Elements().size()); i++) {
54  auto it_elem = it_elem_begin + i;
55  it_elem->SetProperties(rDummyProperty);
56  }
57 
58  KRATOS_CATCH("");
59 
60  }
61 
62  void ExecuteInitialize() override {}
63 
64  void ExecuteInitializeSolutionStep() override {}
65 
66 protected:
67 
69  unsigned int rDummyPropertyId;
70 
71 private:
72 
73 }; // Class SetDummyPropertyForRigidElementsProcess
74 
76 inline std::istream &operator>>(std::istream &rIStream,
78 
80 inline std::ostream &operator<<(std::ostream &rOStream,
82  rThis.PrintInfo(rOStream);
83  rOStream << std::endl;
84  rThis.PrintData(rOStream);
85 
86  return rOStream;
87 }
88 
89 } // namespace Kratos.
90 
91 #endif /* SET_DUMMY_PROPERTY_FOR_RIGID_ELEMENTS_PROCESS defined */
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
ElementIterator ElementsBegin(IndexType ThisIndex=0)
Definition: model_part.h:1169
PropertiesType::Pointer pGetProperties(IndexType PropertiesId, IndexType MeshIndex=0)
Returns the Properties::Pointer corresponding to it's identifier.
Definition: model_part.cpp:664
ElementsContainerType & Elements(IndexType ThisIndex=0)
Definition: model_part.h:1189
The base class for all processes in Kratos.
Definition: process.h:49
void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: process.h:204
void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: process.h:210
Definition: set_dummy_property_for_rigid_boundaries_process.hpp:25
SetDummyPropertyForRigidElementsProcess(ModelPart &model_part, unsigned int dummy_property_id)
Constructor.
Definition: set_dummy_property_for_rigid_boundaries_process.hpp:32
ModelPart & rModelPart
Definition: set_dummy_property_for_rigid_boundaries_process.hpp:68
unsigned int rDummyPropertyId
Definition: set_dummy_property_for_rigid_boundaries_process.hpp:69
~SetDummyPropertyForRigidElementsProcess() override
Destructor.
Definition: set_dummy_property_for_rigid_boundaries_process.hpp:39
void Execute() override
Execute method is used to execute the Process algorithms.
Definition: set_dummy_property_for_rigid_boundaries_process.hpp:45
void operator()()
Definition: set_dummy_property_for_rigid_boundaries_process.hpp:41
KRATOS_CLASS_POINTER_DEFINITION(SetDummyPropertyForRigidElementsProcess)
void ExecuteInitialize() override
This function is designed for being called at the beginning of the computations right after reading t...
Definition: set_dummy_property_for_rigid_boundaries_process.hpp:62
void ExecuteInitializeSolutionStep() override
This function will be executed at every time step BEFORE performing the solve phase.
Definition: set_dummy_property_for_rigid_boundaries_process.hpp:64
#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
std::istream & operator>>(std::istream &rIStream, LinearMasterSlaveConstraint &rThis)
input stream function
std::ostream & operator<<(std::ostream &rOStream, const LinearMasterSlaveConstraint &rThis)
output stream function
Definition: linear_master_slave_constraint.h:432
model_part
Definition: face_heat.py:14
integer i
Definition: TensorModule.f:17