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.
assign_surface_tension_conditions.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 author: Alex Jarauta
11 // Co-author : Elaf Mahrous
12 
13 
14 #if !defined(ASSIGN_SURFACE_TENSION2D_CONDITION_INCLUDED )
15 #define ASSIGN_SURFACE_TENSION2D_CONDITION_INCLUDED
16 
17 
18 
19 // System includes
20 #include <string>
21 #include <iostream>
22 #include <algorithm>
23 
24 // External includes
25 
26 
27 // Project includes
28 #include "includes/define.h"
29 #include "includes/model_part.h"
30 #include "includes/node.h"
31 #include "utilities/math_utils.h"
32 #include "utilities/geometry_utilities.h"
33 #include "processes/process.h"
34 #include "includes/condition.h"
35 #include "includes/element.h"
36 #include "ULF_application.h"
37 #include "custom_conditions/Surface_Tension2D.h"
38 
39 
40 
41 namespace Kratos
42 {
43 
46 
50 
51 
55 
59 
63 
65 
73  : public Process
74  {
75  public:
76 
79 
82 
86 
89  {
90  }
91 
94  {
95  }
96 
97 
101 
102  // void operator()()
103  // {
104  // MergeParts();
105  // }
106 
107 
111 
113  {
114  KRATOS_TRY
115 
116  // This is the code written to apply the surface tension condition looping over nodes
117 
118  Properties::Pointer properties = ThisModelPart.GetMesh().pGetProperties(1);
119  int id = ThisModelPart.Conditions().size();
120  for(ModelPart::NodesContainerType::iterator im = ThisModelPart.NodesBegin() ; im != ThisModelPart.NodesEnd() ; ++im)
121  {
122  if (im->FastGetSolutionStepValue(IS_FREE_SURFACE) != 0.0 || im->FastGetSolutionStepValue(TRIPLE_POINT) != 0.0)
123  {
125  temp.reserve(1);
126  temp.push_back(*(im.base()));
127  Condition::Pointer p_cond = (KratosComponents<Condition>::Get("SurfaceTension2D")).Create(id, temp, properties);
128  ThisModelPart.Conditions().push_back(p_cond);
129  id++;
130  }
131  }
132  ThisModelPart.Conditions().Sort();
133  KRATOS_WATCH(ThisModelPart.Conditions().size())
134 
135 
136  KRATOS_CATCH("")
137  }
138 
142 
143 
147 
148 
152 
154  std::string Info() const override
155  {
156  return "AssignSurfaceTensionConditions";
157  }
158 
160  void PrintInfo(std::ostream& rOStream) const override
161  {
162  rOStream << "AssignSurfaceTensionConditions";
163  }
164 
166  void PrintData(std::ostream& rOStream) const override
167  {
168  }
169 
170 
174 
175 
177 
178 protected:
181 
182 
186 
187 
191 
192 
196 
197 
201 
202 
206 
207 
211 
212 
214 
215 private:
218 
219 
223 
224 
228 
229 
233 
234 
238 
239 
243 
244 
248 
250 // AssignSurfaceTensionConditions& operator=(AssignSurfaceTensionConditions const& rOther);
251 
253 // AssignSurfaceTensionConditions(AssignSurfaceTensionConditions const& rOther);
254 
255 
257 
258 }; // Class AssignSurfaceTensionConditions
259 
261 
264 
265 
269 
270 
272 inline std::istream& operator >> (std::istream& rIStream,
274 
276 inline std::ostream& operator << (std::ostream& rOStream,
277  const AssignSurfaceTensionConditions& rThis)
278 {
279  rThis.PrintInfo(rOStream);
280  rOStream << std::endl;
281  rThis.PrintData(rOStream);
282 
283  return rOStream;
284 }
286 
287 
288 
289 } // namespace Kratos.
290 
291 #endif // KRATOS_CREATE_INTERFACE_CONDITIONS_PROCESS_INCLUDED defined
292 
293 
Short class definition.
Definition: assign_surface_tension_conditions.h:74
~AssignSurfaceTensionConditions() override
Destructor.
Definition: assign_surface_tension_conditions.h:93
void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: assign_surface_tension_conditions.h:160
void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: assign_surface_tension_conditions.h:166
AssignSurfaceTensionConditions()
Default constructor.
Definition: assign_surface_tension_conditions.h:88
std::string Info() const override
Turn back information as a string.
Definition: assign_surface_tension_conditions.h:154
KRATOS_CLASS_POINTER_DEFINITION(AssignSurfaceTensionConditions)
Pointer definition of PushStructureProcess.
void AssignSurfaceTensionConditions2D(ModelPart &ThisModelPart)
Definition: assign_surface_tension_conditions.h:112
static const TComponentType & Get(const std::string &rName)
Retrieves a component with the specified name.
Definition: kratos_components.h:114
PropertiesType::Pointer pGetProperties(IndexType PropertiesId)
Definition: mesh.h:394
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
ConditionsContainerType & Conditions(IndexType ThisIndex=0)
Definition: model_part.h:1381
NodeIterator NodesEnd(IndexType ThisIndex=0)
Definition: model_part.h:497
MeshType & GetMesh(IndexType ThisIndex=0)
Definition: model_part.h:1791
PointerVector is a container like stl vector but using a vector to store pointers to its data.
Definition: pointer_vector.h:72
The base class for all processes in Kratos.
Definition: process.h:49
virtual Process::Pointer Create(Model &rModel, Parameters ThisParameters)
This method creates an pointer of the process.
Definition: process.h:89
#define KRATOS_CATCH(MoreInfo)
Definition: define.h:110
#define KRATOS_WATCH(variable)
Definition: define.h:806
#define KRATOS_TRY
Definition: define.h:109
im
Definition: GenerateCN.py:100
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
float temp
Definition: rotating_cone.py:85