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.
remove_and_save_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_REMOVE_SAVE_WALL_PROCESS_INCLUDED )
10 #define KRATOS_REMOVE_SAVE_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 REMOVE AND SAVE WALL CONSTRUCTOR")
84  }
85 
88  {
89  }
90 
91 
95 
96  // void operator()()
97  // {
98  // MergeParts();
99  // }
100 
101 
105 
107  {
108  KRATOS_TRY
109  //ModelPart fluid_only_model_part;
110 
111  for(ModelPart::NodesContainerType::iterator in = fluid_model_part.NodesBegin() ;
112  in != fluid_model_part.NodesEnd() ; ++in)
113  //in a two stage process I distinguish the second wall by the FLAG_VARIABLE=5
114  {
115  //second mould nodes are marked with FLAG=5
116  if (in->FastGetSolutionStepValue(FLAG_VARIABLE)==5)
117  {
118  wall_model_part.AddNode(*(in.base()),0);
119  }
120  }
121 
122  wall_model_part.SetProcessInfo(fluid_model_part.pGetProcessInfo());
123 
124 
125  //removing second mould nodes (wall nodes) from fluid_model_part
126  for(ModelPart::NodesContainerType::iterator in = wall_model_part.NodesBegin() ;
127  in != wall_model_part.NodesEnd() ; ++in)
128  {
129  unsigned int id=in->GetId();
130  fluid_model_part.RemoveNode(id);
131  }
132 
133 
134  unsigned int id=1;
135  for(ModelPart::NodesContainerType::iterator in = fluid_model_part.NodesBegin() ;
136  in != fluid_model_part.NodesEnd() ; ++in)
137  {
138  in->SetId(id);
139  id++;
140  }
141 
142  //wall_nodes_id must still be reset when the wall nodes are added
143  for(ModelPart::NodesContainerType::iterator in = wall_model_part.NodesBegin() ;
144  in != wall_model_part.NodesEnd() ; ++in)
145  {
146  in->SetId(id);
147  id++;
148  }
149 
150  KRATOS_CATCH("")
151  }
152 
153 
157 
158 
162 
163 
167 
169  std::string Info() const override
170  {
171  return "RemoveAndSaveWallNodesProcess";
172  }
173 
175  void PrintInfo(std::ostream& rOStream) const override
176  {
177  rOStream << "RemoveAndSaveWallNodesProcess";
178  }
179 
181  void PrintData(std::ostream& rOStream) const override
182  {
183  }
184 
185 
189 
190 
192 
193 protected:
196 
197 
201 
202 
206 
207 
211 
212 
216 
217 
221 
222 
226 
227 
229 
230 private:
233 
234 
238  //ModelPart& mr_fluid_model_part;
239  //ModelPart& mr_structure_model_part;
240  //ModelPart& mr_combined_model_part;
241 
245 
246 
250 
251 
255 
256 
260 
261 
265 
267 // RemoveAndSaveWallNodesProcess& operator=(RemoveAndSaveWallNodesProcess const& rOther);
268 
270 // RemoveAndSaveWallNodesProcess(RemoveAndSaveWallNodesProcess const& rOther);
271 
272 
274 
275 }; // Class RemoveAndSaveWallNodesProcess
276 
278 
281 
282 
286 
287 
289 inline std::istream& operator >> (std::istream& rIStream,
291 
293 inline std::ostream& operator << (std::ostream& rOStream,
294  const RemoveAndSaveWallNodesProcess& rThis)
295 {
296  rThis.PrintInfo(rOStream);
297  rOStream << std::endl;
298  rThis.PrintData(rOStream);
299 
300  return rOStream;
301 }
303 
304 
305 } // namespace Kratos.
306 
307 #endif // KRATOS_REMOVE_SAVE_WALL_PROCESS_INCLUDED defined
308 
309 
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
Short class definition.
Definition: remove_and_save_wall_process.h:66
void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: remove_and_save_wall_process.h:181
void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: remove_and_save_wall_process.h:175
std::string Info() const override
Turn back information as a string.
Definition: remove_and_save_wall_process.h:169
KRATOS_CLASS_POINTER_DEFINITION(RemoveAndSaveWallNodesProcess)
Pointer definition of PushStructureProcess.
RemoveAndSaveWallNodesProcess()
Default constructor.
Definition: remove_and_save_wall_process.h:79
void RemoveAndSave(ModelPart &fluid_model_part, ModelPart &wall_model_part)
Definition: remove_and_save_wall_process.h:106
~RemoveAndSaveWallNodesProcess() override
Destructor.
Definition: remove_and_save_wall_process.h:87
#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