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_main_material_property_process.hpp
Go to the documentation of this file.
1 //
2 // Project Name: KratosPfemFluidApplication $
3 // Created by: $Author: AFranci $
4 // Last modified by: $Co-Author: $
5 // Date: $Date: April 2022 $
6 // Revision: $Revision: 0.0 $
7 //
8 //
9 
10 #if !defined(KRATOS_SET_MAIN_MATERIAL_PROPERTY_PROCESS_H_INCLUDED)
11 #define KRATOS_SET_MAIN_MATERIAL_PROPERTY_PROCESS_H_INCLUDED
12 
13 // System includes
14 
15 // External includes
16 
17 // Project includes
18 
20 
23 #include "includes/model_part.h"
24 #include "utilities/openmp_utils.h"
25 #include "utilities/math_utils.h"
27 
29 // Data:
30 // StepData:
31 // Flags: (checked)
32 // (set)
33 // (modified)
34 // (reset)
35 
36 namespace Kratos
37 {
38 
41 
48  typedef std::size_t SizeType;
49 
53 
57 
61 
63 
66  : public MesherProcess
67  {
68  public:
71 
74 
78 
81  : mrModelPart(rModelPart)
82  {
83  }
84 
87  {
88  }
89 
90  void operator()()
91  {
92  Execute();
93  }
94 
98 
99  void Execute() override
100  {
101  KRATOS_TRY
102  const auto elem_begin = mrModelPart.ElementsBegin();
103  unsigned int main_property_id = elem_begin->GetProperties().Id();
104  ProcessInfo &rCurrentProcessInfo = mrModelPart.GetProcessInfo();
105  rCurrentProcessInfo[MAIN_MATERIAL_PROPERTY] = main_property_id;
106  KRATOS_CATCH(" ")
107  }; // namespace Kratos
108 
112 
116 
120 
124 
126  std::string Info() const override
127  {
128  return "SetMainMaterialPropertyProcess";
129  }
130 
132  void PrintInfo(std::ostream &rOStream) const override
133  {
134  rOStream << "SetMainMaterialPropertyProcess";
135  }
136 
137  protected:
140 
144 
149 
153 
157 
159 
160  private:
163 
167 
171 
175 
179 
183 
187 
190 
192  // SetMainMaterialPropertyProcess(SetMainMaterialPropertyProcess const& rOther);
193 
195  }; // Class SetMainMaterialPropertyProcess
196 
198 
201 
205 
207  inline std::istream &operator>>(std::istream &rIStream,
209 
211  inline std::ostream &operator<<(std::ostream &rOStream,
212  const SetMainMaterialPropertyProcess &rThis)
213  {
214  rThis.PrintInfo(rOStream);
215  rOStream << std::endl;
216  rThis.PrintData(rOStream);
217 
218  return rOStream;
219  }
221 
222 } // namespace Kratos.
223 
224 #endif // KRATOS_SET_MAIN_MATERIAL_PROPERTY_PROCESS_H_INCLUDED defined
PointerVector< TPointType > PointsArrayType
Definition: geometry.h:118
The base class for processes passed to the solution scheme.
Definition: mesher_process.hpp:37
void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: mesher_process.hpp:157
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
MeshType::ElementsContainerType ElementsContainerType
Element container. A vector set of Elements with their Id's as key.
Definition: model_part.h:168
ProcessInfo & GetProcessInfo()
Definition: model_part.h:1746
MeshType::NodesContainerType NodesContainerType
Nodes container. Which is a vector set of nodes with their Id's as key.
Definition: model_part.h:128
ProcessInfo holds the current value of different solution parameters.
Definition: process_info.h:59
Short class definition.
Definition: set_main_material_property_process.hpp:67
std::string Info() const override
Turn back information as a string.
Definition: set_main_material_property_process.hpp:126
void operator()()
Definition: set_main_material_property_process.hpp:90
virtual ~SetMainMaterialPropertyProcess()
Destructor.
Definition: set_main_material_property_process.hpp:86
void Execute() override
Execute method is used to execute the MesherProcess algorithms.
Definition: set_main_material_property_process.hpp:99
void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: set_main_material_property_process.hpp:132
SetMainMaterialPropertyProcess(ModelPart &rModelPart)
Default constructor.
Definition: set_main_material_property_process.hpp:80
ModelPart & mrModelPart
Definition: set_main_material_property_process.hpp:148
KRATOS_CLASS_POINTER_DEFINITION(SetMainMaterialPropertyProcess)
Pointer definition of SetMainMaterialPropertyProcess.
#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
ModelPart::NodesContainerType NodesContainerType
Definition: find_conditions_neighbours_process.h:44
std::size_t SizeType
The definition of the size type.
Definition: mortar_classes.h:43
std::istream & operator>>(std::istream &rIStream, LinearMasterSlaveConstraint &rThis)
input stream function
ModelPart::ElementsContainerType ElementsContainerType
Definition: clear_contact_conditions_mesher_process.hpp:43
std::ostream & operator<<(std::ostream &rOStream, const LinearMasterSlaveConstraint &rThis)
output stream function
Definition: linear_master_slave_constraint.h:432
GeometryType::PointsArrayType PointsArrayType
Definition: settle_model_structure_process.hpp:48