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.
iga_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 //
11 
12 
13 #if !defined(KRATOS_IGA_MODELER_H_INCLUDED )
14 #define KRATOS_IGA_MODELER_H_INCLUDED
15 
16 
17 // System includes
18 
19 // External includes
20 
21 // Project includes
22 #include "modeler/modeler.h"
23 #include "includes/properties.h"
24 #include "includes/define.h"
25 
27 
28 namespace Kratos
29 {
30 
33 
35 
37 class KRATOS_API(IGA_APPLICATION) IgaModeler
38  : public Modeler
39 {
40 public:
43 
46 
47  typedef std::size_t SizeType;
48  typedef std::size_t IndexType;
49 
50  typedef Node NodeType;
53 
54  typedef typename Properties::Pointer PropertiesPointerType;
55 
58 
62 
65  : Modeler()
66  {
67  }
68 
71  Model & rModel,
72  const Parameters ModelerParameters = Parameters())
73  : Modeler(rModel, ModelerParameters)
74  , mpModel(&rModel)
75  {
76  }
77 
79  virtual ~IgaModeler() = default;
80 
82  Modeler::Pointer Create(Model& rModel, const Parameters ModelParameters) const override
83  {
84  return Kratos::make_shared<IgaModeler>(rModel, ModelParameters);
85  }
86 
90 
91  void SetupModelPart() override;
92 
96 
98  std::string Info() const override
99  {
100  return "IgaModeler";
101  }
102 
104  void PrintInfo(std::ostream & rOStream) const override
105  {
106  rOStream << Info();
107  }
108 
110  void PrintData(std::ostream & rOStream) const override
111  {
112  }
113 
115 
116 private:
119 
120  Model* mpModel = nullptr;
121 
125 
127  void CreateIntegrationDomain(
128  ModelPart& rCadModelPart,
129  ModelPart& rModelPart,
130  const Parameters rParameters) const;
131 
132  void CreateIntegrationDomainPerUnit(
133  ModelPart& rCadModelPart,
134  ModelPart& rModelPart,
135  const Parameters rParameters) const;
136 
138  void CreateQuadraturePointGeometries(
139  GeometriesArrayType& rQuadraturePointGeometryList,
140  ModelPart& rModelPart,
141  const Parameters rParameters,
142  std::string GeometryType) const;
143 
147 
149  void GetCadGeometryList(
150  GeometriesArrayType& rGeometryList,
151  ModelPart& rModelPart,
152  const Parameters rParameters) const;
153 
157 
159  void CreateElements(
160  typename GeometriesArrayType::ptr_iterator rGeometriesBegin,
161  typename GeometriesArrayType::ptr_iterator rGeometriesEnd,
162  ModelPart& rDestinationModelPart,
163  std::string& rElementName,
164  SizeType& rIdCounter,
165  PropertiesPointerType pProperties) const;
166 
168  void CreateConditions(
169  typename GeometriesArrayType::ptr_iterator rGeometriesBegin,
170  typename GeometriesArrayType::ptr_iterator rGeometriesEnd,
171  ModelPart& rDestinationModelPart,
172  std::string& rConditionName,
173  SizeType& rIdCounter,
174  PropertiesPointerType pProperties) const;
175 
179 
181  void GetPointsAt(
182  GeometriesArrayType& rGeometryList,
183  const std::string& rGeometryType,
184  const Parameters rParameters,
185  ModelPart& rModelPart) const;
186 
190 
191  Parameters ReadParamatersFile(
192  const std::string& rDataFileName) const;
193 
197 
198  friend class Serializer;
199 
201 }; // Class CadModeler
202 
206 
208 inline std::istream& operator >> (
209  std::istream& rIStream,
210  IgaModeler& rThis);
211 
213 inline std::ostream& operator << (
214  std::ostream& rOStream,
215  const IgaModeler& rThis)
216 {
217  rThis.PrintInfo(rOStream);
218  rOStream << std::endl;
219  rThis.PrintData(rOStream);
220 
221  return rOStream;
222 }
223 
225 
226 } // namespace Kratos.
227 
228 #endif // KRATOS_IGA_MODELER_H_INCLUDED defined
std::string Info() const override
Turn back information as a string.
Definition: periodic_interface_process.hpp:93
Geometry base class.
Definition: geometry.h:71
Short class definition.
Definition: iga_modeler.h:39
std::size_t IndexType
Definition: iga_modeler.h:48
void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: iga_modeler.h:104
void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: iga_modeler.h:110
std::string Info() const override
Turn back information as a string.
Definition: iga_modeler.h:98
KRATOS_CLASS_POINTER_DEFINITION(IgaModeler)
Pointer definition of Modeler.
ModelPart::ElementsContainerType ElementsContainerType
Definition: iga_modeler.h:56
Properties::Pointer PropertiesPointerType
Definition: iga_modeler.h:54
Node NodeType
Definition: iga_modeler.h:50
virtual ~IgaModeler()=default
Destructor.
GeometryType::GeometriesArrayType GeometriesArrayType
Definition: iga_modeler.h:52
IgaModeler(Model &rModel, const Parameters ModelerParameters=Parameters())
Constructor.
Definition: iga_modeler.h:70
std::size_t SizeType
Definition: iga_modeler.h:47
Modeler::Pointer Create(Model &rModel, const Parameters ModelParameters) const override
Creates the Modeler Pointer.
Definition: iga_modeler.h:82
Geometry< NodeType > GeometryType
Definition: iga_modeler.h:51
ModelPart::ConditionsContainerType ConditionsContainerType
Definition: iga_modeler.h:57
IgaModeler()
Default constructor.
Definition: iga_modeler.h:64
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 defines the node.
Definition: node.h:65
This class provides to Kratos a data structure for I/O based on the standard of JSON.
Definition: kratos_parameters.h:59
PointerVector is a container like stl vector but using a vector to store pointers to its data.
Definition: pointer_vector.h:72
The serialization consists in storing the state of an object into a storage format like data file or ...
Definition: serializer.h:123
typename GeometryType::GeometriesArrayType GeometriesArrayType
Definition: add_geometries_to_python.cpp:62
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
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
std::ostream & operator<<(std::ostream &rOStream, const LinearMasterSlaveConstraint &rThis)
output stream function
Definition: linear_master_slave_constraint.h:432