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.
add_wall_process.h
Go to the documentation of this file.
1 //
2 // Project Name: Kratos
3 // Last Modified by: $Author: anonymous $
4 // Date: $Date: 2007-11-06 12:34:26 $
5 // Revision: $Revision: 1.4 $
6 //
7 // this process save structural elements in a separate list
8 
9 #if !defined(KRATOS_ADD_WALL_PROCESS_INCLUDED )
10 #define KRATOS_ADD_WALL_PROCESS_INCLUDED
11 
12 
13 
14 // System includes
15 #include <string>
16 #include <iostream>
17 #include <algorithm>
18 
19 // External includes
20 
21 
22 // Project includes
23 #include "includes/define.h"
24 #include "processes/process.h"
25 #include "includes/node.h"
26 #include "includes/element.h"
27 #include "includes/model_part.h"
28 //#include "custom_elements/updated_lagrangian_fluid.h"
29 //#include "custom_elements/updated_lagrangian_fluid3D.h"
30 //#include "custom_elements/updated_lagrangian_fluid_inc.h"
31 //#include "custom_elements/updated_lagrangian_fluid3D_inc.h"
32 
33 
34 namespace Kratos
35 {
36 
39 
43 
44 
48 
52 
56 
58 
65  : public Process
66 {
67 public:
70 
73 
77 
80  //ModelPart& fluid_model_part, ModelPart& structure_model_part, ModelPart& combined_model_part)
81  //: mr_fluid_model_part(fluid_model_part), mr_structure_model_part(structure_model_part), mr_combined_model_part(combined_model_part)
82  {
83  //KRATOS_WATCH(" INSIDE ADD WALL NODES CONSTRUCTOR")
84  }
85 
87  ~AddWallProcess() override
88  {
89  }
90 
91 
95 
96  // void operator()()
97  // {
98  // MergeParts();
99  // }
100 
101 
105 
107  {
108  KRATOS_TRY
109 
110  //COMPUTING AVERAGE NODAL_H in FLUID
111  double av_mesh_size=0.0;
112  for(ModelPart::NodesContainerType::iterator in = fluid_model_part.NodesBegin() ;
113  in != fluid_model_part.NodesEnd() ; ++in)
114  {
115  av_mesh_size+=in->FastGetSolutionStepValue(NODAL_H);
116  }
117 
118  unsigned int n_fluid_nodes=fluid_model_part.Nodes().size();
119  av_mesh_size/=n_fluid_nodes;
120 
121  unsigned wall_node_id=n_fluid_nodes+1;
122 
123  if (av_mesh_size==0)
124  KRATOS_THROW_ERROR(std::logic_error,"your wall nodes will have NODAL_H=0","");
126  for(ModelPart::NodesContainerType::iterator in = wall_model_part.NodesBegin() ;
127  in != wall_model_part.NodesEnd() ; ++in)
128  {
129  //set the NODAL_H in the wall node to the average size and then add this node to the fluid model part
130  in->FastGetSolutionStepValue(NODAL_H)=av_mesh_size;
131  in->SetId(wall_node_id);
132  wall_node_id++;
133  //ADDING ALL THE SECOND MOULD WALL NODES TO THE MODEL PART
134  fluid_model_part.AddNode(*(in.base()),0);
135 
136 
137  }
138 
139  //fluid_model_part.AddNodes(wall_model_part.NodesBegin(), wall_model_part.NodesEnd());
140  //sorting and renumbering the fluid elements
141  unsigned int id=1;
142  for(ModelPart::NodesContainerType::iterator in = fluid_model_part.NodesBegin() ;
143  in != fluid_model_part.NodesEnd() ; ++in)
144  {
145  in->SetId(id);
146  id++;
147  }
148 
149 
150 
151  KRATOS_CATCH("")
152  }
153 
154 
158 
159 
163 
164 
168 
170  std::string Info() const override
171  {
172  return "AddWallProcess";
173  }
174 
176  void PrintInfo(std::ostream& rOStream) const override
177  {
178  rOStream << "AddWallProcess";
179  }
180 
182  void PrintData(std::ostream& rOStream) const override
183  {
184  }
185 
186 
190 
191 
193 
194 protected:
197 
198 
202 
203 
207 
208 
212 
213 
217 
218 
222 
223 
227 
228 
230 
231 private:
234 
235 
239  //ModelPart& mr_fluid_model_part;
240  //ModelPart& mr_structure_model_part;
241  //ModelPart& mr_combined_model_part;
242 
246 
247 
251 
252 
256 
257 
261 
262 
266 
268 // AddWallProcess& operator=(AddWallProcess const& rOther);
269 
271 // AddWallProcess(AddWallProcess const& rOther);
272 
273 
275 
276 }; // Class AddWallProcess
277 
279 
282 
283 
287 
288 
290 inline std::istream& operator >> (std::istream& rIStream,
291  AddWallProcess& rThis);
292 
294 inline std::ostream& operator << (std::ostream& rOStream,
295  const AddWallProcess& rThis)
296 {
297  rThis.PrintInfo(rOStream);
298  rOStream << std::endl;
299  rThis.PrintData(rOStream);
300 
301  return rOStream;
302 }
304 
305 
306 } // namespace Kratos.
307 
308 #endif // KRATOS_ADD_WALL_PROCESS_INCLUDED defined
309 
310 
Short class definition.
Definition: add_wall_process.h:66
std::string Info() const override
Turn back information as a string.
Definition: add_wall_process.h:170
KRATOS_CLASS_POINTER_DEFINITION(AddWallProcess)
Pointer definition of PushStructureProcess.
~AddWallProcess() override
Destructor.
Definition: add_wall_process.h:87
AddWallProcess()
Default constructor.
Definition: add_wall_process.h:79
void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: add_wall_process.h:182
void AddWall(ModelPart &fluid_model_part, ModelPart &wall_model_part)
Definition: add_wall_process.h:106
void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: add_wall_process.h:176
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
The base class for all processes in Kratos.
Definition: process.h:49
#define KRATOS_THROW_ERROR(ExceptionType, ErrorMessage, MoreInfo)
Definition: define.h:77
#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
fluid_model_part
Definition: edgebased_PureConvection.py:18
wall_model_part
Definition: script_THERMAL_CORRECT.py:30