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.
copy_properties_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: Miguel Maso Sotomayor
11 //
12 //
13 
14 #ifndef KRATOS_COPY_PROPERTIES_MODELER_H_INCLUDED
15 #define KRATOS_COPY_PROPERTIES_MODELER_H_INCLUDED
16 
17 
18 // System includes
19 
20 
21 // External includes
22 
23 
24 // Project includes
25 #include "modeler/modeler.h"
26 
27 
28 namespace Kratos
29 {
30 
33 
40 class KRATOS_API(KRATOS_CORE) CopyPropertiesModeler : public Modeler
41 {
42 public:
45 
47 
51 
55 
58 
65  Model& rModel,
66  Parameters ModelerParameters);
67 
74  ModelPart& rOriginModelPart,
75  ModelPart& rDestinationModelPart);
76 
79 
81  ~CopyPropertiesModeler() override = default;
82 
86 
89 
93 
100  Modeler::Pointer Create(
101  Model& rModel,
102  const Parameters ModelParameters) const override;
103 
108  const Parameters GetDefaultParameters() const override;
109 
113 
117  void SetupModelPart() override;
118 
122 
124  std::string Info() const override
125  {
126  return "CopyPropertiesModeler";
127  }
128 
130 
131 private:
132 
135 
136  Model* mpModel = nullptr;
137 
141 
142  void RecursivelyCopyProperties(
143  ModelPart& rOriginModelPart,
144  ModelPart& rDestinationModelPart);
145 
146  template<class TContainerType>
147  void ReplaceProperties(
148  TContainerType& rContainer,
149  const ModelPart& rModelPart);
150 
152 };
153 
157 
159 inline std::istream& operator>>(std::istream& rIStream,
160  CopyPropertiesModeler& rThis)
161 {
162  return rIStream;
163 }
164 
166 inline std::ostream& operator<<(std::ostream& rOStream, const CopyPropertiesModeler& rThis)
167 {
168  rThis.PrintInfo(rOStream);
169  rOStream << std::endl;
170  rThis.PrintData(rOStream);
171 
172  return rOStream;
173 }
174 
176 
177 } // namespace Kratos.
178 
179 #endif //KRATOS_COPY_PROPERTIES_MODELER_H_INCLUDED defined
Copy the properties from one model part to another.
Definition: copy_properties_modeler.h:41
~CopyPropertiesModeler() override=default
Destructor.
CopyPropertiesModeler & operator=(CopyPropertiesModeler const &rOther)=delete
Assignment operator.
std::string Info() const override
Turn back information as a string.
Definition: copy_properties_modeler.h:124
KRATOS_CLASS_POINTER_DEFINITION(CopyPropertiesModeler)
CopyPropertiesModeler()
Default constructor.
Definition: copy_properties_modeler.h:57
CopyPropertiesModeler(CopyPropertiesModeler const &rOther)=delete
Copy constructor.
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
virtual void PrintData(std::ostream &rOStream) const
Print object's data.
Definition: modeler.h:145
virtual void PrintInfo(std::ostream &rOStream) const
Print information about this object.
Definition: modeler.h:139
This class provides to Kratos a data structure for I/O based on the standard of JSON.
Definition: kratos_parameters.h:59
Modeler::Pointer Create(const std::string &ModelerName, Model &rModel, const Parameters ModelParameters)
Checks if the modeler is registered.
Definition: modeler_factory.cpp:30
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