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.
split_internal_interfaces_process.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: Riccardo Rossi
11 // Collaborators: Miguel Angel Celigueta
12 // Ruben Zorrilla
13 //
14 
15 #if !defined(KRATOS_SPLIT_INTERNAL_INTERFACES_PROCESS_H_INCLUDED )
16 #define KRATOS_SPLIT_INTERNAL_INTERFACES_PROCESS_H_INCLUDED
17 
18 // System includes
19 
20 // External includes
21 
22 // Project includes
23 #include "processes/process.h"
24 #include "containers/model.h"
25 #include "includes/model_part.h"
27 
28 namespace Kratos
29 {
32 
36 
40 
44 
48 
57 class KRATOS_API(KRATOS_CORE) SplitInternalInterfacesProcess : public Process {
58 
59 public:
62 
64  typedef std::size_t IndexType;
65 
67  typedef std::size_t SizeType;
68 
70  typedef Node NodeType;
71 
74 
78 
85  Model& rModel,
86  Parameters rParameters)
87  : Process()
88  , mrModelPart(rModel.GetModelPart(rParameters["model_part_name"].GetString()))
89  {
91 
92  // Validate input parameters
93  const Parameters default_parameters = GetDefaultParameters();
94  rParameters.ValidateAndAssignDefaults(default_parameters);
95 
96  // Get or create the interfaces sub model part
97  std::string interfaces_sub_model_part_name = rParameters["interfaces_sub_model_part_name"].GetString();
98  if (mrModelPart.HasSubModelPart(interfaces_sub_model_part_name)) {
99  mpInterfacesSubModelPart = &(mrModelPart.GetSubModelPart(interfaces_sub_model_part_name));
100  } else {
101  mpInterfacesSubModelPart = &(mrModelPart.CreateSubModelPart(interfaces_sub_model_part_name));
102  }
103 
104  // Get the registering name of the conditions to be created
105  mConditionName = rParameters["condition_name"].GetString();
106 
107  KRATOS_CATCH("");
108  }
109 
111  virtual ~SplitInternalInterfacesProcess() override { }
112 
116 
117 
121 
122  void ExecuteInitialize() override;
123 
124  const Parameters GetDefaultParameters() const override
125  {
126  const Parameters default_parameters( R"(
127  {
128  "model_part_name" :"MODEL_PART_NAME",
129  "interfaces_sub_model_part_name" : "internal_interfaces",
130  "condition_name" : "CONDITION_NAME"
131  } )" );
132  return default_parameters;
133  }
134 
138 
142 
143 
147 
149  std::string Info() const override
150  {
151  return "SplitInternalInterfacesProcess";
152  }
153 
155  void PrintInfo(std::ostream& rOStream) const override
156  {
157  rOStream << "SplitInternalInterfacesProcess";
158  }
159 
161  void PrintData(std::ostream& rOStream) const override
162  {
163  }
164 
165 
169 
170 
172 
173 protected:
176 
177 
181 
182  void SplitBoundary(
183  const std::size_t PropertyIdBeingProcessed,
184  const std::size_t InterfaceConditionsPropertyId,
185  const std::unordered_map<IndexType,IndexType>& rConditionsParentMap,
186  ModelPart& rModelPart);
187 
191 
192 
196 
197 
201 
202 
206 
207 
211 
212 
214 
215 private:
218 
219 
223 
224  ModelPart& mrModelPart;
225  ModelPart* mpInterfacesSubModelPart;
226  std::string mConditionName;
227 
231 
232 
236 
237 
238 
242 
243 
247 
248 
252 
254  //SplitInternalInterfacesProcess& operator=(SplitInternalInterfacesProcess const& rOther);
255 
257  //SplitInternalInterfacesProcess(SplitInternalInterfacesProcess const& rOther);
258 
259 
261 
262 }; // Class SplitInternalInterfacesProcess
263 
265 
268 
269 
273 
274 
276 inline std::istream& operator >> (std::istream& rIStream, SplitInternalInterfacesProcess& rThis) {
277  return rIStream;
278 }
279 
281 inline std::ostream& operator << (std::ostream& rOStream, const SplitInternalInterfacesProcess& rThis) {
282  rThis.PrintInfo(rOStream);
283  rOStream << std::endl;
284  rThis.PrintData(rOStream);
285 
286  return rOStream;
287 }
289 
290 
291 } // namespace Kratos.
292 
293 #endif // KRATOS_SPLIT_INTERNAL_INTERFACES_PROCESS_H_INCLUDED defined
void ExecuteInitialize() override
Definition: periodic_interface_process.hpp:37
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
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
void ValidateAndAssignDefaults(const Parameters &rDefaultParameters)
This function is designed to verify that the parameters under testing match the form prescribed by th...
Definition: kratos_parameters.cpp:1306
std::string GetString() const
This method returns the string contained in the current Parameter.
Definition: kratos_parameters.cpp:684
The base class for all processes in Kratos.
Definition: process.h:49
Computes NODAL_AREA.
Definition: split_internal_interfaces_process.h:57
virtual ~SplitInternalInterfacesProcess() override
Destructor.
Definition: split_internal_interfaces_process.h:111
KRATOS_CLASS_POINTER_DEFINITION(SplitInternalInterfacesProcess)
Pointer definition of SplitInternalInterfacesProcess.
std::size_t IndexType
Index type definition.
Definition: split_internal_interfaces_process.h:64
Node NodeType
The definition of the node.
Definition: split_internal_interfaces_process.h:70
std::string Info() const override
Turn back information as a string.
Definition: split_internal_interfaces_process.h:149
void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: split_internal_interfaces_process.h:161
const Parameters GetDefaultParameters() const override
This method provides the defaults parameters to avoid conflicts between the different constructors.
Definition: split_internal_interfaces_process.h:124
void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: split_internal_interfaces_process.h:155
SplitInternalInterfacesProcess(Model &rModel, Parameters rParameters)
Default constructor.
Definition: split_internal_interfaces_process.h:84
std::size_t SizeType
Size type definition.
Definition: split_internal_interfaces_process.h:67
#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
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