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.
swimming_dem_in_pfem_utils.h
Go to the documentation of this file.
1 #ifndef KRATOS_SWIMMING_DEM_IN_PFEM_UTILS_H
2 #define KRATOS_SWIMMING_DEM_IN_PFEM_UTILS_H
3 // /* External includes */
4 
5 // System includes
6 
7 // Project includes
8 #include "includes/variables.h"
9 
10 /* System includes */
11 #include <limits>
12 #include <iostream>
13 #include <iomanip>
14 
15 /* External includes */
16 #ifdef _OPENMP
17 #include <omp.h>
18 #endif
19 
20 /* Project includes */
21 #include "includes/define.h"
22 #include "includes/model_part.h"
23 
24 namespace Kratos
25 {
27 {
28 public:
29 typedef ModelPart::NodesContainerType::ContainerType::iterator NodesIteratorType;
30 
32 
34 
36 
38 
40 
41 //***************************************************************************************************************
42 //***************************************************************************************************************
43 
44 void TransferWalls(ModelPart& r_source_model_part, ModelPart& r_destination_model_part)
45 {
46  Properties::Pointer props;
47  if(r_destination_model_part.GetMesh(0).Properties().size()) {
48  int props_id = r_destination_model_part.PropertiesBegin()->Id();
49  props = r_destination_model_part.pGetProperties(props_id);
50  }
51  else {
52  props = Properties::Pointer(new Properties(0));
53  props->SetValue(STATIC_FRICTION, 0.5773502691896257);
54  props->SetValue(WALL_COHESION, 0.0);
55  props->SetValue(COMPUTE_WEAR, 0);
56  props->SetValue(SEVERITY_OF_WEAR, 0.001);
57  props->SetValue(IMPACT_WEAR_SEVERITY, 0.001);
58  props->SetValue(BRINELL_HARDNESS, 200.0);
59  props->SetValue(YOUNG_MODULUS, 1e20);
60  props->SetValue(POISSON_RATIO, 0.25);
61  }
62 
63  r_destination_model_part.Conditions().Sort();
64  int id = 1;
65  if (r_destination_model_part.Conditions().size()) {
66  id = (r_destination_model_part.ConditionsEnd()-1)->Id() + 1;
67  }
68 
69  ModelPart::ElementsContainerType& source_elements = r_source_model_part.Elements();
70 
71  for (unsigned int i = 0; i < source_elements.size(); i++) {
72  ModelPart::ElementsContainerType::iterator it = r_source_model_part.ElementsBegin() + i;
73  Geometry< Node >::Pointer p_geometry = it->pGetGeometry();
74  Condition::Pointer cond = Condition::Pointer(new RigidFace3D(id, p_geometry, props));
75  r_destination_model_part.AddCondition(cond);
76  id++;
77  }
78 
79 }
80 
81 //***************************************************************************************************************
82 //***************************************************************************************************************
83 
87 
88 
92 
94 
95 virtual std::string Info() const
96 {
97 return "";
98 }
99 
101 
102 virtual void PrintInfo(std::ostream& rOStream) const
103 {
104 }
105 
107 
108 virtual void PrintData(std::ostream& rOStream) const
109 {
110 }
111 
112 
116 
118 
119 protected:
122 
123 
127 
128 
132 
133 
137 
138 
142 
146 
147 
151 
152 
154 
155 private:
156 
159 
160 
164 RealField mPorosityField;
168 
172 
173 
177 
178 
182 
183 
187 
189 SwimmingDemInPfemUtils & operator=(SwimmingDemInPfemUtils const& rOther);
190 
191 
193 
194 }; // Class SwimmingDemInPfemUtils
195 
196 } // namespace Python.
197 
198 #endif // KRATOS_SWIMMING_DEM_IN_PFEM_UTILS_H
Geometry base class.
Definition: geometry.h:71
PropertiesContainerType & Properties()
Definition: mesh.h:446
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
PropertiesType::Pointer pGetProperties(IndexType PropertiesId, IndexType MeshIndex=0)
Returns the Properties::Pointer corresponding to it's identifier.
Definition: model_part.cpp:664
PropertiesIterator PropertiesBegin(IndexType ThisIndex=0)
Definition: model_part.h:978
MeshType::ElementsContainerType ElementsContainerType
Element container. A vector set of Elements with their Id's as key.
Definition: model_part.h:168
ConditionsContainerType & Conditions(IndexType ThisIndex=0)
Definition: model_part.h:1381
ElementsContainerType & Elements(IndexType ThisIndex=0)
Definition: model_part.h:1189
void AddCondition(ConditionType::Pointer pNewCondition, IndexType ThisIndex=0)
Definition: model_part.cpp:1436
MeshType & GetMesh(IndexType ThisIndex=0)
Definition: model_part.h:1791
ConditionIterator ConditionsEnd(IndexType ThisIndex=0)
Definition: model_part.h:1371
size_type size() const
Returns the number of elements in the container.
Definition: pointer_vector_set.h:502
Properties encapsulates data shared by different Elements or Conditions. It can store any type of dat...
Definition: properties.h:69
Definition: real_field.h:29
Definition: RigidFace.h:21
Definition: swimming_dem_in_pfem_utils.h:27
virtual void PrintData(std::ostream &rOStream) const
Print object's data.
Definition: swimming_dem_in_pfem_utils.h:108
virtual void PrintInfo(std::ostream &rOStream) const
Print information about this object.
Definition: swimming_dem_in_pfem_utils.h:102
SwimmingDemInPfemUtils()
Default constructor.
Definition: swimming_dem_in_pfem_utils.h:35
virtual ~SwimmingDemInPfemUtils()
Destructor.
Definition: swimming_dem_in_pfem_utils.h:39
ModelPart::NodesContainerType::ContainerType::iterator NodesIteratorType
Definition: swimming_dem_in_pfem_utils.h:29
virtual std::string Info() const
Turn back information as a stemplate<class T, std::size_t dim> tring.
Definition: swimming_dem_in_pfem_utils.h:95
KRATOS_CLASS_POINTER_DEFINITION(SwimmingDemInPfemUtils)
void TransferWalls(ModelPart &r_source_model_part, ModelPart &r_destination_model_part)
Definition: swimming_dem_in_pfem_utils.h:44
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
integer i
Definition: TensorModule.f:17