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_free_surface_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: 2008-10-23 12:50:01 $
47 // Revision: $Revision: 1.4 $
48 //
49 // this process save structural elements in a separate list
50 
51 #if !defined(KRATOS_MARK_FS_PROCESS_INCLUDED )
52 #define KRATOS_MARK_FS_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"
72 
73 
74 namespace Kratos
75 {
76 
79 
83 
84 
88 
92 
96 
98 
105  : public Process
106 {
107 public:
110 
113 
117 
120  : mr_model_part(model_part)
121  {
122  }
123 
126  {
127  }
128 
129 
133 
134  void operator()()
135  {
136  Execute();
137  }
138 
139 
143 
144  void Execute() override
145  {
146  KRATOS_TRY
147  for(ModelPart::NodesContainerType::const_iterator in = mr_model_part.NodesBegin(); in!=mr_model_part.NodesEnd(); in++)
148  {
149  //marking wet nodes
150  /* if(in->FastGetSolutionStepValue(IS_STRUCTURE) )
151  if( (in->GetValue(NEIGHBOUR_ELEMENTS)).size() != 0)
152  in->FastGetSolutionStepValue(IS_FLUID) = 1.0;
153  else //it is not anymore of fluid
154  in->FastGetSolutionStepValue(IS_FLUID) = 0.0;
155  //marking as free surface the lonely nodes
156  else
157  */ if( (in->GetValue(NEIGHBOUR_ELEMENTS)).size() == 0)
158  in->FastGetSolutionStepValue(IS_BOUNDARY) = 1.0;
159  }
160 
161  //identify the free surface
162  for(ModelPart::NodeIterator i = mr_model_part.NodesBegin() ;
163  i != mr_model_part.NodesEnd() ; ++i)
164  {
165  //reset the free surface
166  i->FastGetSolutionStepValue(IS_FREE_SURFACE) = 0;
167  //identify the free surface and fix the pressure accordingly
168  if( i->FastGetSolutionStepValue(IS_BOUNDARY) != 0
169  &&
170  i->FastGetSolutionStepValue(IS_STRUCTURE) == 0)
171  {
172  i->FastGetSolutionStepValue(IS_FREE_SURFACE) = 1;
173  }
174  }
175 
176 
177  KRATOS_CATCH("")
178  }
179 
180 
184 
185 
189 
190 
194 
196  std::string Info() const override
197  {
198  return "MarkFreeSurfaceProcess";
199  }
200 
202  void PrintInfo(std::ostream& rOStream) const override
203  {
204  rOStream << "MarkFreeSurfaceProcess";
205  }
206 
208  void PrintData(std::ostream& rOStream) const override
209  {
210  }
211 
212 
216 
217 
219 
220 protected:
223 
224 
228 
229 
233 
234 
238 
239 
243 
244 
248 
249 
253 
254 
256 
257 private:
260 
261 
265  ModelPart& mr_model_part;
266 
270 
271 
275 
276 
280 
281 
285 
286 
290 
292 // MarkFreeSurfaceProcess& operator=(MarkFreeSurfaceProcess const& rOther);
293 
295 // MarkFreeSurfaceProcess(MarkFreeSurfaceProcess const& rOther);
296 
297 
299 
300 }; // Class MarkFreeSurfaceProcess
301 
303 
306 
307 
311 
312 
314 inline std::istream& operator >> (std::istream& rIStream,
315  MarkFreeSurfaceProcess& rThis);
316 
318 inline std::ostream& operator << (std::ostream& rOStream,
319  const MarkFreeSurfaceProcess& rThis)
320 {
321  rThis.PrintInfo(rOStream);
322  rOStream << std::endl;
323  rThis.PrintData(rOStream);
324 
325  return rOStream;
326 }
328 
329 
330 } // namespace Kratos.
331 
332 #endif // KRATOS_ULF_MARK_FS_PROCESS_INCLUDED defined
333 
334 
Short class definition.
Definition: mark_free_surface_process.h:106
~MarkFreeSurfaceProcess() override
Destructor.
Definition: mark_free_surface_process.h:125
MarkFreeSurfaceProcess(ModelPart &model_part)
Default constructor.
Definition: mark_free_surface_process.h:119
void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: mark_free_surface_process.h:208
void operator()()
Definition: mark_free_surface_process.h:134
KRATOS_CLASS_POINTER_DEFINITION(MarkFreeSurfaceProcess)
Pointer definition of PushStructureProcess.
void Execute() override
Execute method is used to execute the Process algorithms.
Definition: mark_free_surface_process.h:144
void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: mark_free_surface_process.h:202
std::string Info() const override
Turn back information as a string.
Definition: mark_free_surface_process.h:196
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
NodeIterator NodesBegin(IndexType ThisIndex=0)
Definition: model_part.h:487
MeshType::NodeIterator NodeIterator
Definition: model_part.h:134
NodeIterator NodesEnd(IndexType ThisIndex=0)
Definition: model_part.h:497
The base class for all processes in Kratos.
Definition: process.h:49
#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
integer i
Definition: TensorModule.f:17