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.
refinement_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_REFINEMENT_MODELER_H_INCLUDED )
14 #define KRATOS_REFINEMENT_MODELER_H_INCLUDED
15 
16 
17 // System includes
18 
19 // External includes
20 
21 // Project includes
22 #include "modeler/modeler.h"
23 
26 
27 namespace Kratos
28 {
29 
32 
34 
36 class KRATOS_API(IGA_APPLICATION) RefinementModeler
37  : public Modeler
38 {
39 public:
42 
45 
46  typedef std::size_t SizeType;
47  typedef std::size_t IndexType;
48 
49  typedef Node NodeType;
52 
56 
59  : Modeler()
60  {
61  }
62 
65  Model& rModel,
66  Parameters ModelerParameters = Parameters())
67  : Modeler(rModel, ModelerParameters)
68  , mpModel(&rModel)
69  {
70  }
71 
73  virtual ~RefinementModeler() = default;
74 
76  Modeler::Pointer Create(
77  Model& rModel, const Parameters ModelParameters) const override
78  {
79  return Kratos::make_shared<RefinementModeler>(rModel, ModelParameters);
80  }
81 
85 
86  void PrepareGeometryModel() override;
87 
91 
93  std::string Info() const override
94  {
95  return "RefinementModeler";
96  }
97 
99  void PrintInfo(std::ostream & rOStream) const override
100  {
101  rOStream << Info();
102  }
103 
105  void PrintData(std::ostream & rOStream) const override
106  {
107  }
108 
110 
111 private:
114 
115  Model* mpModel = nullptr;
116 
120 
121  void ApplyRefinements(
122  const Parameters rParameters) const;
123 
124  void ApplyRefinement(
125  const Parameters rParameters) const;
126 
127  void GetGeometryList(
128  GeometriesArrayType& rGeometryList,
129  ModelPart& rModelPart,
130  const Parameters rParameters) const;
131 
132  Parameters ReadParamatersFile(
133  const std::string& rDataFileName) const;
134 
138 
139  friend class Serializer;
140 
142 }; // Class RefinementModeler
143 
147 
149 inline std::istream& operator >> (
150  std::istream& rIStream,
151  RefinementModeler& rThis);
152 
154 inline std::ostream& operator << (
155  std::ostream& rOStream,
156  const RefinementModeler& rThis)
157 {
158  rThis.PrintInfo(rOStream);
159  rOStream << std::endl;
160  rThis.PrintData(rOStream);
161 
162  return rOStream;
163 }
164 
166 
167 } // namespace Kratos.
168 
169 #endif // KRATOS_IGA_IO_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
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
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
Short class definition.
Definition: refinement_modeler.h:38
Node NodeType
Definition: refinement_modeler.h:49
std::string Info() const override
Turn back information as a string.
Definition: refinement_modeler.h:93
void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: refinement_modeler.h:99
std::size_t IndexType
Definition: refinement_modeler.h:47
virtual ~RefinementModeler()=default
Destructor.
Modeler::Pointer Create(Model &rModel, const Parameters ModelParameters) const override
Creates the Modeler Pointer.
Definition: refinement_modeler.h:76
Geometry< NodeType > GeometryType
Definition: refinement_modeler.h:50
GeometryType::GeometriesArrayType GeometriesArrayType
Definition: refinement_modeler.h:51
void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: refinement_modeler.h:105
RefinementModeler()
Default constructor.
Definition: refinement_modeler.h:58
RefinementModeler(Model &rModel, Parameters ModelerParameters=Parameters())
Constructor.
Definition: refinement_modeler.h:64
KRATOS_CLASS_POINTER_DEFINITION(RefinementModeler)
Pointer definition of Modeler.
std::size_t SizeType
Definition: refinement_modeler.h:46
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::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