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.
save_lagrangian_surface_process_p.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: Author Julio Marti.
11 //
12 
13 // this process saves the boundary of a Lagrangian part for EMBEDDED technique
14 
15 #if !defined(KRATOS_SAVE_LAGRANGIAN_SURFACE_PROCESS_P_INCLUDED )
16 #define KRATOS_SAVE_LAGRANGIAN_SURFACE_PROCESS_P_INCLUDED
17 
18 
19 
20 // System includes
21 #include <string>
22 #include <iostream>
23 #include <algorithm>
24 
25 // External includes
26 
27 
28 // Project includes
29 #include "includes/define.h"
30 #include "processes/process.h"
31 #include "includes/node.h"
32 #include "includes/condition.h"
33 #include "includes/model_part.h"
35 
36 
37 
38 namespace Kratos
39 {
40 
43 
47 
48 
52 
56 
60 
62 
69  : public Process
70 {
71 public:
74 
77 
81 
84  {
85  }
86 
89  {
90  }
91 
92 
96 
97 // void operator()()
98 // {
99 // SaveStructure();
100 // }
101 
102 
106 
107  //FLUID_MODEL_PART is the whole Lagrangian fluid domain, surface model_part is its boundary
109  {
110  KRATOS_TRY
111  surface_model_part.Elements().clear();
112  surface_model_part.Conditions().clear();
113  surface_model_part.Nodes().clear();
114 
115  KRATOS_WATCH("SaveSurfaceConditions");
116 
117  //ModelPart::IndexType default_index = 0;
118 
119  for(ModelPart::NodesContainerType::iterator in = lagrangian_model_part.NodesBegin() ;
120  in != lagrangian_model_part.NodesEnd() ; ++in)
121  {
122  if (in->FastGetSolutionStepValue(IS_BOUNDARY)==1.0 && in->GetValue(NEIGHBOUR_CONDITIONS).size()!=0)
123  surface_model_part.Nodes().push_back(*(in.base()));
124 
125  }
126  int id = 1;
127  Properties::Pointer properties = lagrangian_model_part.GetMesh().pGetProperties(1);
128  for(ModelPart::ConditionsContainerType::iterator ic = lagrangian_model_part.ConditionsBegin() ; ic != lagrangian_model_part.ConditionsEnd() ; ++ic)
129  {
130  //surface_model_part.Conditions().push_back(*(ic.base()));
131  Geometry< Node >& geom = ic->GetGeometry();
132 
133  std::vector<std::size_t> NodeIds(3);
134 
135  for(int i=0; i<3; i++) NodeIds[i]= geom[i].Id();
136 
137  surface_model_part.CreateNewElement("Element3D3N",id, NodeIds,0);//,default_index);
138 
139  id = id + 1;
140  }
141 
142 
143 
144 
145 
146  KRATOS_CATCH("")
147  }
148 
149 
150 
154 
155 
159 
160 
164 
166  virtual std::string Info() const override
167  {
168  return "SaveLagrangianSurfaceProcess_p";
169  }
170 
172  virtual void PrintInfo(std::ostream& rOStream) const override
173  {
174  rOStream << "SaveLagrangianSurfaceProcess_p";
175  }
176 
178  virtual void PrintData(std::ostream& rOStream) const override
179  {
180  }
181 
182 
186 
187 
189 
190 protected:
193 
194 
198 
199 
203 
204 
208 
209 
213 
214 
218 
219 
223 
224 
226 
227 private:
230 
231 
235  //ModelPart& mr_fluid_model_part;
236  //ModelPart& mr_structure_model_part;
237 
241 
242 
246 
247 
251 
252 
256 
257 
261 
263 // SaveLagrangianSurfaceProcess& operator=(SaveLagrangianSurfaceProcess const& rOther);
264 
266 // SaveLagrangianSurfaceProcess(SaveLagrangianSurfaceProcess const& rOther);
267 
268 
270 
271 }; // Class SaveLagrangianSurfaceProcess
272 
274 
277 
278 
282 
283 
285 inline std::istream& operator >> (std::istream& rIStream,
287 
289 inline std::ostream& operator << (std::ostream& rOStream,
290  const SaveLagrangianSurfaceProcess_p& rThis)
291 {
292  rThis.PrintInfo(rOStream);
293  rOStream << std::endl;
294  rThis.PrintData(rOStream);
295 
296  return rOStream;
297 }
299 
300 
301 } // namespace Kratos.
302 
303 #endif // KRATOS_SAVE_LAGRANGIAN_SURFACE_PROCESS_INCLUDED defined
Geometry base class.
Definition: geometry.h:71
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
ElementType::Pointer CreateNewElement(std::string ElementName, IndexType Id, std::vector< IndexType > ElementNodeIds, PropertiesType::Pointer pProperties, IndexType ThisIndex=0)
Creates new element with a node ids list.
ConditionsContainerType & Conditions(IndexType ThisIndex=0)
Definition: model_part.h:1381
ElementsContainerType & Elements(IndexType ThisIndex=0)
Definition: model_part.h:1189
NodesContainerType & Nodes(IndexType ThisIndex=0)
Definition: model_part.h:507
The base class for all processes in Kratos.
Definition: process.h:49
Short class definition.
Definition: save_lagrangian_surface_process_p.h:70
SaveLagrangianSurfaceProcess_p()
Default constructor.
Definition: save_lagrangian_surface_process_p.h:83
virtual void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: save_lagrangian_surface_process_p.h:178
void SaveSurfaceConditions_p(ModelPart &lagrangian_model_part, ModelPart &surface_model_part)
Definition: save_lagrangian_surface_process_p.h:108
virtual std::string Info() const override
Turn back information as a string.
Definition: save_lagrangian_surface_process_p.h:166
virtual ~SaveLagrangianSurfaceProcess_p()
Destructor.
Definition: save_lagrangian_surface_process_p.h:88
virtual void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: save_lagrangian_surface_process_p.h:172
KRATOS_CLASS_POINTER_DEFINITION(SaveLagrangianSurfaceProcess_p)
Pointer definition of PushStructureProcess.
#define KRATOS_CATCH(MoreInfo)
Definition: define.h:110
#define KRATOS_WATCH(variable)
Definition: define.h:806
#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
lagrangian_model_part
Definition: lagrangian_droplet_test.py:45
integer i
Definition: TensorModule.f:17