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.
velocity_field.h
Go to the documentation of this file.
1 #if !defined(KRATOS_VELOCITY_FIELD_H)
2 #define KRATOS_VELOCITY_FIELD_H
3 
4 // /* External includes */
5 
6 // System includes
7 
8 // Project includes
9 #include "includes/variables.h"
10 
11 /* System includes */
12 #include <limits>
13 #include <iostream>
14 #include <iomanip>
15 
16 /* External includes */
17 #ifdef _OPENMP
18 #include <omp.h>
19 #endif
20 
21 /* Project includes */
22 #include "includes/define.h"
23 #include "utilities/openmp_utils.h"
24 #include "real_functions.h"
25 #include "vector_field.h"
27 
28 
29 namespace Kratos
30 {
31 class KRATOS_API(SWIMMING_DEM_APPLICATION) VelocityField : public VectorField<3>
32 {
33 public:
34 
36 
38 
41 
42 virtual ~VelocityField(){}
43 
44 
45 //***************************************************************************************************************
46 //***************************************************************************************************************
47 void Evaluate(const double time,
48  const array_1d<double, 3>& coor,
49  array_1d<double, 3>& vector,
50  const int i_thread = 0) override;
51 
52 void CalculateTimeDerivative(const double time,
53  const array_1d<double, 3>& coor,
54  array_1d<double, 3>& deriv,
55  const int i_thread = 0) override;
56 
57 void CalculateGradient(const double time,
58  const array_1d<double, 3>& coor,
59  array_1d< array_1d<double, 3>, 3>& gradient,
60  const int i_thread = 0) override;
61 
62 void CalculateGradient(const double time,
63  const array_1d<double, 3>& coor,
64  DenseVector< double>& gradient_x,
65  DenseVector< double>& gradient_y,
66  DenseVector< double>& gradient_z,
67  const int i_thread);
68 
69 double CalculateDivergence(const double time,
70  const array_1d<double, 3>& coor,
71  const int i_thread = 0) override;
72 
73 void CalculateRotational(const double time,
74  const array_1d<double, 3>& coor,
76  const int i_thread = 0) override;
77 
78 void CalculateLaplacian(const double time,
79  const array_1d<double, 3>& coor,
80  array_1d<double, 3>& lapl,
81  const int i_thread = 0) override;
82 
83 virtual void CalculateMaterialAcceleration(const double time,
84  const array_1d<double, 3>& coor,
85  array_1d<double, 3>& accel,
86  const int i_thread = 0);
87 
88 virtual void CalculateConvectiveDerivative(const double time,
89  const array_1d<double, 3>& coor,
90  array_1d<double, 3>& accel,
91  const int i_thread = 0);
92 
93 virtual void CalculateAccelerationFollowingTheParticle(const double time,
94  const array_1d<double, 3>& coor,
95  array_1d<double, 3>& accel,
96  const array_1d<double, 3>& particle_vel,
97  const int i_thread);
98 
99 virtual void UpdateCoordinates(const double time,
100  const array_1d<double, 3>& coor,
101  const int i_thread = 0){}
102 
103 virtual void LockCoordinates(const int i_thread = 0){(void)i_thread;}
104 
105 virtual void UnlockCoordinates(const int i_thread = 0){(void)i_thread;}
106 
107 void Evaluate(const double time,
108  const DenseVector<double>& coor,
109  DenseVector<double>& result,
110  const int i_thread = 0) override;
111 
112 void CalculateTimeDerivative(const double time,
113  const DenseVector<double>& coor,
114  DenseVector<double>& result,
115  const int i_thread = 0) override;
116 
117 double CalculateDivergence(const double time, const DenseVector<double>& coor, const int i_thread = 0) override;
118 
119 void CalculateRotational(const double time,
120  const DenseVector<double>& coor,
121  DenseVector<double>& result,
122  const int i_thread = 0) override;
123 
124 void CalculateLaplacian(const double time,
125  const DenseVector<double>& coor,
126  DenseVector<double>& result,
127  const int i_thread = 0) override;
128 
129 virtual void CalculateMaterialAcceleration(const double time,
130  const DenseVector<double>& coor,
131  DenseVector<double>& result,
132  const int i_thread = 0);
133 
134 virtual void CalculateConvectiveDerivative(const double time,
135  const DenseVector<double>& coor,
136  DenseVector<double>& result,
137  const int i_thread = 0);
138 
139 void ImposeFieldOnNodes(ModelPart& r_model_part, const VariablesList& variables_to_be_imposed) override;
140 
141 virtual void ImposeVelocityOnNodes(ModelPart& r_model_part, const Variable<array_1d<double, 3> >& container_variable);
142 
143 virtual void UpdateCoordinates(const double time, const DenseVector<double>& coor, const int i_thread = 0){}
144 //***************************************************************************************************************
145 //***************************************************************************************************************
146 
150 
151 
155 
157 
158 virtual std::string Info() const override
159 {
160  return "";
161 }
162 
164 
165 virtual void PrintInfo(std::ostream& rOStream) const override
166 {
167 }
168 
170 
171 virtual void PrintData(std::ostream& rOStream) const override
172 {
173 }
174 
175 
179 
181 
182 protected:
185 
186 
190 
191 
195 
196 
200 
201 
205 // Values
206 
207 virtual double U0(const int i_thread = 0){return 0.0;}
208 
209 virtual double U1(const int i_thread = 0){return 0.0;}
210 
211 virtual double U2(const int i_thread = 0){return 0.0;}
212 
213 // First-order derivatives
214 
215 virtual double U0DT(const int i_thread = 0){return 0.0;}
216 virtual double U0D0(const int i_thread = 0){return 0.0;}
217 virtual double U0D1(const int i_thread = 0){return 0.0;}
218 virtual double U0D2(const int i_thread = 0){return 0.0;}
219 
220 virtual double U1DT(const int i_thread = 0){return 0.0;}
221 virtual double U1D0(const int i_thread = 0){return 0.0;}
222 virtual double U1D1(const int i_thread = 0){return 0.0;}
223 virtual double U1D2(const int i_thread = 0){return 0.0;}
224 
225 virtual double U2DT(const int i_thread = 0){return 0.0;}
226 virtual double U2D0(const int i_thread = 0){return 0.0;}
227 virtual double U2D1(const int i_thread = 0){return 0.0;}
228 virtual double U2D2(const int i_thread = 0){return 0.0;}
229 
230 // Second-order derivatives
231 
232 virtual double U0DTDT(const int i_thread = 0){return 0.0;}
233 virtual double U0DTD0(const int i_thread = 0){return 0.0;}
234 virtual double U0DTD1(const int i_thread = 0){return 0.0;}
235 virtual double U0DTD2(const int i_thread = 0){return 0.0;}
236 virtual double U0D0D0(const int i_thread = 0){return 0.0;}
237 virtual double U0D0D1(const int i_thread = 0){return 0.0;}
238 virtual double U0D0D2(const int i_thread = 0){return 0.0;}
239 virtual double U0D1D1(const int i_thread = 0){return 0.0;}
240 virtual double U0D1D2(const int i_thread = 0){return 0.0;}
241 virtual double U0D2D2(const int i_thread = 0){return 0.0;}
242 
243 virtual double U1DTDT(const int i_thread = 0){return 0.0;}
244 virtual double U1DTD0(const int i_thread = 0){return 0.0;}
245 virtual double U1DTD1(const int i_thread = 0){return 0.0;}
246 virtual double U1DTD2(const int i_thread = 0){return 0.0;}
247 virtual double U1D0D0(const int i_thread = 0){return 0.0;}
248 virtual double U1D0D1(const int i_thread = 0){return 0.0;}
249 virtual double U1D0D2(const int i_thread = 0){return 0.0;}
250 virtual double U1D1D1(const int i_thread = 0){return 0.0;}
251 virtual double U1D1D2(const int i_thread = 0){return 0.0;}
252 virtual double U1D2D2(const int i_thread = 0){return 0.0;}
253 
254 virtual double U2DTDT(const int i_thread = 0){return 0.0;}
255 virtual double U2DTD0(const int i_thread = 0){return 0.0;}
256 virtual double U2DTD1(const int i_thread = 0){return 0.0;}
257 virtual double U2DTD2(const int i_thread = 0){return 0.0;}
258 virtual double U2D0D0(const int i_thread = 0){return 0.0;}
259 virtual double U2D0D1(const int i_thread = 0){return 0.0;}
260 virtual double U2D0D2(const int i_thread = 0){return 0.0;}
261 virtual double U2D1D1(const int i_thread = 0){return 0.0;}
262 virtual double U2D1D2(const int i_thread = 0){return 0.0;}
263 virtual double U2D2D2(const int i_thread = 0){return 0.0;}
264 
268 
269 
273 
274 
276 
277 private:
278 
281 
282 
286 
290 
294 
295 
299 
300 
304 
305 
309 
310 bool VariableIsInList(const VariablesList var_list, const VariableData& var);
311 
313 VelocityField & operator=(VelocityField const& rOther);
314 
315 
317 
318 }; // Class VelocityField
319 
321 
324 
325 
329 
330 } // namespace Kratos.
331 
332 #endif // KRATOS_VELOCITY_FIELD_H defined
PeriodicInterfaceProcess & operator=(const PeriodicInterfaceProcess &)=delete
Definition: amatrix_interface.h:41
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
This class is the base of variables and variable's components which contains their common data.
Definition: variable_data.h:49
Variable class contains all information needed to store and retrive data from a data container.
Definition: variable.h:63
Holds a list of variables and their position in VariablesListDataValueContainer.
Definition: variables_list.h:50
Definition: vector_field.h:26
Definition: velocity_field.h:32
virtual double U2DTDT(const int i_thread=0)
Definition: velocity_field.h:254
virtual double U1D1D1(const int i_thread=0)
Definition: velocity_field.h:250
virtual double U2D0D1(const int i_thread=0)
Definition: velocity_field.h:259
virtual double U2(const int i_thread=0)
Definition: velocity_field.h:211
virtual double U0DTD1(const int i_thread=0)
Definition: velocity_field.h:234
virtual double U1D0D1(const int i_thread=0)
Definition: velocity_field.h:248
virtual double U2D1D2(const int i_thread=0)
Definition: velocity_field.h:262
virtual double U2D1(const int i_thread=0)
Definition: velocity_field.h:227
virtual double U2D2D2(const int i_thread=0)
Definition: velocity_field.h:263
virtual double U0D0(const int i_thread=0)
Definition: velocity_field.h:216
virtual double U0D2(const int i_thread=0)
Definition: velocity_field.h:218
virtual void UnlockCoordinates(const int i_thread=0)
Definition: velocity_field.h:105
VelocityField()
Default constructor.
Definition: velocity_field.h:39
virtual double U1D2(const int i_thread=0)
Definition: velocity_field.h:223
virtual double U2DT(const int i_thread=0)
Definition: velocity_field.h:225
virtual double U1(const int i_thread=0)
Definition: velocity_field.h:209
virtual double U0DTD2(const int i_thread=0)
Definition: velocity_field.h:235
virtual double U0D1(const int i_thread=0)
Definition: velocity_field.h:217
virtual double U1DT(const int i_thread=0)
Definition: velocity_field.h:220
virtual double U0D1D2(const int i_thread=0)
Definition: velocity_field.h:240
virtual ~VelocityField()
Destructor.
Definition: velocity_field.h:42
virtual double U1D2D2(const int i_thread=0)
Definition: velocity_field.h:252
virtual double U1D1D2(const int i_thread=0)
Definition: velocity_field.h:251
virtual double U0D1D1(const int i_thread=0)
Definition: velocity_field.h:239
virtual double U0DTDT(const int i_thread=0)
Definition: velocity_field.h:232
virtual double U1DTDT(const int i_thread=0)
Definition: velocity_field.h:243
virtual double U2DTD1(const int i_thread=0)
Definition: velocity_field.h:256
virtual void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: velocity_field.h:165
virtual void UpdateCoordinates(const double time, const DenseVector< double > &coor, const int i_thread=0)
Definition: velocity_field.h:143
virtual double U0DT(const int i_thread=0)
Definition: velocity_field.h:215
virtual double U0DTD0(const int i_thread=0)
Definition: velocity_field.h:233
virtual double U2D0D0(const int i_thread=0)
Definition: velocity_field.h:258
virtual double U1D0D2(const int i_thread=0)
Definition: velocity_field.h:249
virtual double U1D0D0(const int i_thread=0)
Definition: velocity_field.h:247
virtual double U0(const int i_thread=0)
Definition: velocity_field.h:207
virtual double U0D0D0(const int i_thread=0)
Definition: velocity_field.h:236
virtual double U2DTD2(const int i_thread=0)
Definition: velocity_field.h:257
virtual double U1DTD1(const int i_thread=0)
Definition: velocity_field.h:245
virtual double U2D1D1(const int i_thread=0)
Definition: velocity_field.h:261
KRATOS_CLASS_POINTER_DEFINITION(VelocityField)
virtual double U1D0(const int i_thread=0)
Definition: velocity_field.h:221
virtual double U0D0D1(const int i_thread=0)
Definition: velocity_field.h:237
virtual double U2D2(const int i_thread=0)
Definition: velocity_field.h:228
virtual double U1D1(const int i_thread=0)
Definition: velocity_field.h:222
virtual double U1DTD2(const int i_thread=0)
Definition: velocity_field.h:246
virtual double U2D0(const int i_thread=0)
Definition: velocity_field.h:226
virtual double U1DTD0(const int i_thread=0)
Definition: velocity_field.h:244
virtual double U2DTD0(const int i_thread=0)
Definition: velocity_field.h:255
virtual void LockCoordinates(const int i_thread=0)
Definition: velocity_field.h:103
virtual void UpdateCoordinates(const double time, const array_1d< double, 3 > &coor, const int i_thread=0)
Definition: velocity_field.h:99
virtual double U0D2D2(const int i_thread=0)
Definition: velocity_field.h:241
virtual void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: velocity_field.h:171
virtual double U0D0D2(const int i_thread=0)
Definition: velocity_field.h:238
virtual std::string Info() const override
Turn back information as a stemplate<class T, std::size_t dim> tring.
Definition: velocity_field.h:158
virtual double U2D0D2(const int i_thread=0)
Definition: velocity_field.h:260
double Evaluate(const PolynomialType &rPolynomial, double x)
Definition: polynomial_utilities.cpp:77
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
time
Definition: face_heat.py:85