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.
mark_fluid_process.h
Go to the documentation of this file.
1 /*
2 ==============================================================================
3 KratosULFApplication
4 A library based on:
5 Kratos
6 A General Purpose Software for Multi-Physics Finite Element Analysis
7 Version 1.0 (Released on march 05, 2007).
8 
9 Copyright 2007
10 Pooyan Dadvand, Riccardo Rossi, Pawel Ryzhakov
11 pooyan@cimne.upc.edu
12 rrossi@cimne.upc.edu
13 - CIMNE (International Center for Numerical Methods in Engineering),
14 Gran Capita' s/n, 08034 Barcelona, Spain
15 
16 
17 Permission is hereby granted, free of charge, to any person obtaining
18 a copy of this software and associated documentation files (the
19 "Software"), to deal in the Software without restriction, including
20 without limitation the rights to use, copy, modify, merge, publish,
21 distribute, sublicense and/or sell copies of the Software, and to
22 permit persons to whom the Software is furnished to do so, subject to
23 the following condition:
24 
25 Distribution of this code for any commercial purpose is permissible
26 ONLY BY DIRECT ARRANGEMENT WITH THE COPYRIGHT OWNERS.
27 
28 The above copyright notice and this permission notice shall be
29 included in all copies or substantial portions of the Software.
30 
31 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
32 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
33 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
34 IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
35 CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
36 TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
37 SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
38 
39 ==============================================================================
40 */
41 
42 
43 //
44 // Project Name: Kratos
45 // Last Modified by: $Author: anonymous $
46 // Date: $Date: 2007-11-06 12:34:26 $
47 // Revision: $Revision: 1.5 $
48 //
49 // this process puts a IS_FLUID flag on the nodes of fluid elements
50 
51 #if !defined(KRATOS_MARK_FLUID_PROCESS_INCLUDED )
52 #define KRATOS_MARK_FLUID_PROCESS_INCLUDED
53 
54 
55 
56 // System includes
57 #include <string>
58 #include <iostream>
59 #include <algorithm>
60 
61 // External includes
62 
63 
64 // Project includes
65 #include "includes/define.h"
66 #include "processes/process.h"
67 #include "includes/node.h"
68 #include "includes/element.h"
69 #include "includes/model_part.h"
70 //#include "custom_utilities/geometry_utilities2D.h"
75 
76 
77 namespace Kratos
78 {
79 
82 
86 
87 
91 
95 
99 
101 
107 class MarkFluidProcess
108  : public Process
109 {
110 public:
113 
116 
120 
123  : mr_model_part(model_part)
124  {
125  }
126 
128  ~MarkFluidProcess() override
129  {
130  }
131 
132 
136 
137  void operator()()
138  {
139  Execute();
140  }
141 
142 
146 
147  void Execute() override
148  {
149  KRATOS_TRY
150 
151  ProcessInfo& proc_info = mr_model_part.GetProcessInfo();
152  double temp;
153 
154  for(ModelPart::NodesContainerType::iterator in = mr_model_part.NodesBegin(); in!=mr_model_part.NodesEnd(); in++)
155  {
156  in->FastGetSolutionStepValue(IS_FLUID) = 0.0;
157  }
158  //set to 1 all the nodes surrounded by at least one fluid element
159  for(ModelPart::ElementsContainerType::iterator ie = mr_model_part.ElementsBegin(); ie!=mr_model_part.ElementsEnd(); ie++)
160  {
161  ie->Calculate(IS_FLUID,temp,proc_info);
162  }
163 
164  /* for(ModelPart::NodesContainerType::const_iterator in = mr_model_part.NodesBegin(); in!=mr_model_part.NodesEnd(); in++)
165  {
166  if( (in->GetValue(NEIGHBOUR_ELEMENTS)).size() != 0)
167  {
168  in->FastGetSolutionStepValue(IS_FLUID) = 1.0;
169 
170  }
171  else
172  in->FastGetSolutionStepValue(IS_FLUID) = 0.0;
173  }*/
174  KRATOS_CATCH("")
175  }
176 
177 
181 
182 
186 
187 
191 
193  std::string Info() const override
194  {
195  return "MarkFluidProcess";
196  }
197 
199  void PrintInfo(std::ostream& rOStream) const override
200  {
201  rOStream << "MarkFluidProcess";
202  }
203 
205  void PrintData(std::ostream& rOStream) const override
206  {
207  }
208 
209 
213 
214 
216 
217 protected:
220 
221 
225 
226 
230 
231 
235 
236 
240 
241 
245 
246 
250 
251 
253 
254 private:
257 
258 
262  ModelPart& mr_model_part;
263 
267 
268 
272 
273 
277 
278 
282 
283 
287 
289 // MarkFluidProcess& operator=(MarkFluidProcess const& rOther);
290 
292 // MarkFluidProcess(MarkFluidProcess const& rOther);
293 
294 
296 
297 }; // Class MarkFluidProcess
298 
300 
303 
304 
308 
309 
311 inline std::istream& operator >> (std::istream& rIStream,
312  MarkFluidProcess& rThis);
313 
315 inline std::ostream& operator << (std::ostream& rOStream,
316  const MarkFluidProcess& rThis)
317 {
318  rThis.PrintInfo(rOStream);
319  rOStream << std::endl;
320  rThis.PrintData(rOStream);
321 
322  return rOStream;
323 }
325 
326 
327 } // namespace Kratos.
328 
329 #endif // KRATOS_MARK_FLUID_PROCESS_INCLUDED defined
330 
331 
Short class definition.
Definition: mark_fluid_process.h:74
MarkFluidProcess(ModelPart &model_part)
Default constructor.
Definition: mark_fluid_process.h:122
void operator()()
Definition: mark_fluid_process.h:137
KRATOS_CLASS_POINTER_DEFINITION(MarkFluidProcess)
Pointer definition of PushStructureProcess.
~MarkFluidProcess() override
Destructor.
Definition: mark_fluid_process.h:128
void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: mark_fluid_process.h:205
void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: mark_fluid_process.h:199
void Execute() override
Execute method is used to execute the Process algorithms.
Definition: mark_fluid_process.h:147
std::string Info() const override
Turn back information as a string.
Definition: mark_fluid_process.h:193
virtual void Execute() override
Execute method is used to execute the Process algorithms.
Definition: mark_fluid_process.h:112
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
ElementIterator ElementsBegin(IndexType ThisIndex=0)
Definition: model_part.h:1169
NodeIterator NodesBegin(IndexType ThisIndex=0)
Definition: model_part.h:487
ProcessInfo & GetProcessInfo()
Definition: model_part.h:1746
ElementIterator ElementsEnd(IndexType ThisIndex=0)
Definition: model_part.h:1179
NodeIterator NodesEnd(IndexType ThisIndex=0)
Definition: model_part.h:497
ProcessInfo holds the current value of different solution parameters.
Definition: process_info.h:59
#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
model_part
Definition: face_heat.py:14
float temp
Definition: rotating_cone.py:85