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.
create_entities_from_geometries_modeler.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 #pragma once
15 
16 // System includes
17 
18 // External includes
19 
20 // Project includes
21 #include "containers/model.h"
22 #include "includes/define.h"
25 #include "modeler/modeler.h"
28 
29 namespace Kratos
30 {
31 
34 
43 class KRATOS_API(KRATOS_CORE) CreateEntitiesFromGeometriesModeler
44  : public Modeler
45 {
46 public:
49 
52 
54  using SizeType = std::size_t;
55 
58 
61 
65 
68 
71  Model &rModel,
72  Parameters Settings)
73  : Modeler(rModel, Settings)
74  {
75  mpModel = &rModel;
76  mParameters.ValidateAndAssignDefaults(GetDefaultParameters());
77  }
78 
81 
83  Modeler::Pointer Create(
84  Model& rModel,
85  const Parameters Settings) const override
86  {
87  return Kratos::make_shared<CreateEntitiesFromGeometriesModeler>(rModel, Settings);
88  }
89 
93 
95  void SetupModelPart() override;
96 
98  const Parameters GetDefaultParameters() const override
99  {
100  const Parameters default_parameters = Parameters(R"({
101  "echo_level" : 0,
102  "elements_list" : [],
103  "conditions_list" : []
104  })");
105  return default_parameters;
106  }
107 
111 
112 
116 
118  std::string Info() const override
119  {
120  return "CreateEntitiesFromGeometriesModeler";
121  }
122 
124  void PrintInfo(std::ostream& rOStream) const override
125  {
126  rOStream << Info();
127  }
128 
130  void PrintData(std::ostream& rOStream) const override
131  {
132  }
133 
135 private:
138 
141 
142 
144 
145  Model* mpModel = nullptr;
146 
150 
156  template <class TEntitytiesContainerType>
157  void LoopEntitiesList(Parameters EntitiesList);
158 
164  template <class TEntitiesContainerType>
165  void RemoveModelPartEntities(ModelPart& rModelPart);
166 
168 }; // Class CreateEntitiesFromGeometriesModeler
169 
173 
175 inline std::istream& operator >> (
176  std::istream& rIStream,
178 
180 inline std::ostream& operator << (
181  std::ostream& rOStream,
183 {
184  rThis.PrintInfo(rOStream);
185  rOStream << std::endl;
186  rThis.PrintData(rOStream);
187 
188  return rOStream;
189 }
191 
192 } // namespace Kratos.
std::string Info() const override
Turn back information as a string.
Definition: periodic_interface_process.hpp:93
Modeler to create element/condition entities from geometries.
Definition: create_entities_from_geometries_modeler.h:45
~CreateEntitiesFromGeometriesModeler()=default
Destructor.
CreateEntitiesFromGeometriesModeler(Model &rModel, Parameters Settings)
Constructor with Model.
Definition: create_entities_from_geometries_modeler.h:70
ModelPart::ConditionsContainerType ConditionsContainerType
Conditions container type.
Definition: create_entities_from_geometries_modeler.h:60
std::size_t SizeType
Size type definition.
Definition: create_entities_from_geometries_modeler.h:54
void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: create_entities_from_geometries_modeler.h:124
void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: create_entities_from_geometries_modeler.h:130
std::string Info() const override
Turn back information as a string.
Definition: create_entities_from_geometries_modeler.h:118
ModelPart::ElementsContainerType ElementsContainerType
Elements container type.
Definition: create_entities_from_geometries_modeler.h:57
Modeler::Pointer Create(Model &rModel, const Parameters Settings) const override
Creates the CreateEntitiesFromGeometriesModeler Pointer.
Definition: create_entities_from_geometries_modeler.h:83
CreateEntitiesFromGeometriesModeler()
Default constructor.
Definition: create_entities_from_geometries_modeler.h:67
KRATOS_CLASS_POINTER_DEFINITION(CreateEntitiesFromGeometriesModeler)
Pointer definition of Modeler.
const Parameters GetDefaultParameters() const override
This method provides the defaults parameters to avoid conflicts between the different constructors.
Definition: create_entities_from_geometries_modeler.h:98
This class aims to manage different model parts across multi-physics simulations.
Definition: model.h:60
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
Modeler to interact with ModelParts.
Definition: modeler.h:39
This class provides to Kratos a data structure for I/O based on the standard of JSON.
Definition: kratos_parameters.h:59
#define KRATOS_REGISTRY_ADD_PROTOTYPE(NAME, X, Y)
Macro to register class prototypes This macro creates a static bool in the class (which value is not ...
Definition: define_registry.h:43
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