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.
ethier_flow_field.h
Go to the documentation of this file.
1 #if !defined(KRATOS_ETHIER_FLOW_FIELD_H)
2 #define KRATOS_ETHIER_FLOW_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 "velocity_field.h"
26 
27 
28 namespace Kratos
29 {
30 class KRATOS_API(SWIMMING_DEM_APPLICATION) EthierFlowField : public VelocityField
31 {
32 public:
33 
35 
37 
38 EthierFlowField():VelocityField(), mA(0.25 * Globals::Pi), mD(0.5 * Globals::Pi)
39 {
40  unsigned int number_of_threads = ParallelUtilities::GetNumThreads();
41  ResizeVectorsForParallelism(number_of_threads);
42 }
43 
44 EthierFlowField(const double a, const double b)
45  :VelocityField(), mA(a), mD(b)
46 {
47  unsigned int number_of_threads = ParallelUtilities::GetNumThreads();
48  ResizeVectorsForParallelism(number_of_threads);
49 }
50 
51 
53 
54 virtual ~EthierFlowField(){}
55 
56 
57 //***************************************************************************************************************
58 //***************************************************************************************************************
59 void ResizeVectorsForParallelism(const int n_threads) override;
60 
61 void UpdateCoordinates(const double time, const array_1d<double, 3>& coor, const int i_thread = 0) override;
62 
63 void UpdateCoordinates(const double time, const DenseVector<double>& coor, const int i_thread = 0) override;
64 
65 void LockCoordinates(const int i_thread = 0) override;
66 
67 void UnlockCoordinates(const int i_thread = 0) override;
68 //***************************************************************************************************************
69 //***************************************************************************************************************
70 
74 
75 
79 
81 
82 virtual std::string Info() const override
83 {
84  return "";
85 }
86 
88 
89 virtual void PrintInfo(std::ostream& rOStream) const override
90 {
91 }
92 
94 
95 virtual void PrintData(std::ostream& rOStream) const override
96 {
97 }
98 
99 
103 
105 
106 protected:
109 
110 
114 
115 
119 
120 
121 // Values
122 
123 double U0(const int i_thread = 0) override;
124 double U1(const int i_thread = 0) override;
125 double U2(const int i_thread = 0) override;
126 
127 // First-order derivatives
128 
129 double U0DT(const int i_thread = 0) override;
130 double U0D0(const int i_thread = 0) override;
131 double U0D1(const int i_thread = 0) override;
132 double U0D2(const int i_thread = 0) override;
133 
134 double U1DT(const int i_thread = 0) override;
135 double U1D0(const int i_thread = 0) override;
136 double U1D1(const int i_thread = 0) override;
137 double U1D2(const int i_thread = 0) override;
138 
139 double U2DT(const int i_thread = 0) override;
140 double U2D0(const int i_thread = 0) override;
141 double U2D1(const int i_thread = 0) override;
142 double U2D2(const int i_thread = 0) override;
143 
144 // Second-order derivatives
145 
146 double U0DTDT(const int i_thread = 0) override;
147 double U0DTD0(const int i_thread = 0) override;
148 double U0DTD1(const int i_thread = 0) override;
149 double U0DTD2(const int i_thread = 0) override;
150 double U0D0D0(const int i_thread = 0) override;
151 double U0D0D1(const int i_thread = 0) override;
152 double U0D0D2(const int i_thread = 0) override;
153 double U0D1D1(const int i_thread = 0) override;
154 double U0D1D2(const int i_thread = 0) override;
155 double U0D2D2(const int i_thread = 0) override;
156 
157 double U1DTDT(const int i_thread = 0) override;
158 double U1DTD0(const int i_thread = 0) override;
159 double U1DTD1(const int i_thread = 0) override;
160 double U1DTD2(const int i_thread = 0) override;
161 double U1D0D0(const int i_thread = 0) override;
162 double U1D0D1(const int i_thread = 0) override;
163 double U1D0D2(const int i_thread = 0) override;
164 double U1D1D1(const int i_thread = 0) override;
165 double U1D1D2(const int i_thread = 0) override;
166 double U1D2D2(const int i_thread = 0) override;
167 
168 double U2DTDT(const int i_thread = 0) override;
169 double U2DTD0(const int i_thread = 0) override;
170 double U2DTD1(const int i_thread = 0) override;
171 double U2DTD2(const int i_thread = 0) override;
172 double U2D0D0(const int i_thread = 0) override;
173 double U2D0D1(const int i_thread = 0) override;
174 double U2D0D2(const int i_thread = 0) override;
175 double U2D1D1(const int i_thread = 0) override;
176 double U2D1D2(const int i_thread = 0) override;
177 double U2D2D2(const int i_thread = 0) override;
178 
182 
183 
187 
191 
192 
196 
197 
199 
200 private:
201 
205 
209 
210 double mA;
211 double mD;
212 std::vector<int> mCoordinatesAreUpToDate;
213 std::vector<double> mExpD2T;
214 std::vector<double> mExpAX;
215 std::vector<double> mExpAZ;
216 std::vector<double> mExpAY;
217 std::vector<double> mSinAXDY;
218 std::vector<double> mCosAXDY;
219 std::vector<double> mSinAYDZ;
220 std::vector<double> mCosAYDZ;
221 std::vector<double> mSinAZDX;
222 std::vector<double> mCosAZDX;
223 
224 
228 
232 
233 
237 
238 
242 
243 
247 
249 EthierFlowField & operator=(EthierFlowField const& rOther);
250 
251 
253 
254 }; // Class EthierFlowField
255 
257 
260 
261 
265 
266 } // namespace Kratos.
267 
268 #endif // KRATOS_ETHIER_FLOW_FIELD_H defined
PeriodicInterfaceProcess & operator=(const PeriodicInterfaceProcess &)=delete
Definition: ethier_flow_field.h:31
virtual void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: ethier_flow_field.h:89
EthierFlowField(const double a, const double b)
Definition: ethier_flow_field.h:44
KRATOS_CLASS_POINTER_DEFINITION(EthierFlowField)
virtual std::string Info() const override
Turn back information as a stemplate<class T, std::size_t dim> tring.
Definition: ethier_flow_field.h:82
virtual void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: ethier_flow_field.h:95
virtual ~EthierFlowField()
Destructor.
Definition: ethier_flow_field.h:54
EthierFlowField()
Default constructor.
Definition: ethier_flow_field.h:38
Definition: amatrix_interface.h:41
static int GetNumThreads()
Returns the current number of threads.
Definition: parallel_utilities.cpp:34
Definition: velocity_field.h:32
constexpr double Pi
Definition: global_variables.h:25
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
time
Definition: face_heat.py:85
a
Definition: generate_stokes_twofluid_element.py:77
b
Definition: generate_total_lagrangian_mixed_volumetric_strain_element.py:31