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.
vector_field.h
Go to the documentation of this file.
1 #if !defined(KRATOS_VECTOR_FIELD_H)
2 #define KRATOS_VECTOR_FIELD_H
3 
4 /* System includes */
5 #include <limits>
6 #include <iostream>
7 #include <iomanip>
8 
9 /* External includes */
10 #ifdef _OPENMP
11 #include <omp.h>
12 #endif
13 
14 /* Project includes */
15 #include "includes/define.h"
16 #include "includes/variables.h"
17 #include "utilities/openmp_utils.h"
18 #include "real_functions.h"
19 #include "includes/variables.h"
20 #include "includes/model_part.h"
21 
22 namespace Kratos
23 {
24 template<std::size_t TDim>
26 {
27 public:
28 
30 
32 
34 mUx(LinearFunction(0, 0)), mUy(LinearFunction(0, 0)), mUz(LinearFunction(0, 0)){}
35 
37 mUx(u_x), mUy(u_y), mUz(u_z){}
39 
40 virtual ~VectorField(){}
41 
42 
43 //***************************************************************************************************************
44 //***************************************************************************************************************
45 
46 virtual void Evaluate(const double time, const array_1d<double, 3>& coor, array_1d<double, 3>& vector, const int i_thread = 0)
47 {
48  vector[0] = 0.0;
49  vector[1] = 0.0;
50  vector[2] = 0.0;
51 }
52 
53 virtual void CalculateTimeDerivative(const double time, const array_1d<double, 3>& coor, array_1d<double, 3>& deriv, const int i_thread = 0){}
54 
55 virtual void CalculateGradient(const double time, const array_1d<double, 3>& coor, array_1d< array_1d<double, 3>, 3>& gradient, const int i_thread = 0){}
56 
57 virtual double CalculateDivergence(const double time, const array_1d<double, 3>& coor, const int i_thread = 0){return 0.0;}
58 
59 virtual void CalculateRotational(const double time, const array_1d<double, 3>& coor, array_1d<double, 3>& rot, const int i_thread = 0){}
60 
61 virtual void CalculateLaplacian(const double time, const array_1d<double, 3>& coor, array_1d<double, 3>& lapl, const int i_thread = 0){}
62 
63 virtual void Evaluate(const double time, const DenseVector<double>& coor, DenseVector<double>& result, const int i_thread = 0)
64 {
65  result[0] = 0.0;
66  result[1] = 0.0;
67  result[2] = 0.0;
68 }
69 
70 virtual void CalculateTimeDerivative(const double time, const DenseVector<double>& coor, DenseVector<double>& result, const int i_thread = 0){}
71 
72 virtual double CalculateDivergence(const double time, const DenseVector<double>& coor, const int i_thread = 0){return 0.0;}
73 
74 virtual void CalculateRotational(const double time, const DenseVector<double>& coor, DenseVector<double>& result, const int i_thread = 0){}
75 
76 virtual void CalculateLaplacian(const double time, const DenseVector<double>& coor, DenseVector<double>& result, const int i_thread = 0){}
77 
78 virtual void ResizeVectorsForParallelism(const int n_threads){}
79 
80 virtual void ImposeFieldOnNodes(ModelPart& r_model_part, const VariablesList& variables_to_be_imposed){}
81 
82 //virtual void ImposeVelocityOnNodes(ModelPart& r_model_part, const VariableData& container_variable){}
83 
84 //***************************************************************************************************************
85 //***************************************************************************************************************
86 
90 
91 
95 
97 
98 virtual std::string Info() const
99 {
100  return "";
101 }
102 
104 
105 virtual void PrintInfo(std::ostream& rOStream) const
106 {
107 }
108 
110 
111 virtual void PrintData(std::ostream& rOStream) const
112 {
113 }
114 
115 
119 
121 
122 protected:
125 
126 
130 
131 
135 
136 
140 
141 
145 
149 
150 
154 
155 
157 
158 private:
159 
162 
163 
167 
168 RealFunction mUx;
169 RealFunction mUy;
170 RealFunction mUz;
171 
175 
179 
180 
184 
185 
189 
190 
194 
196 VectorField & operator=(VectorField const& rOther);
197 
198 
200 
201 }; // Class VectorField
202 
204 
207 
208 
212 
213 } // namespace Kratos.
214 
215 #endif // KRATOS_VECTOR_FIELD_H defined
Definition: amatrix_interface.h:41
Definition: real_functions.h:185
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
Definition: real_functions.h:27
Holds a list of variables and their position in VariablesListDataValueContainer.
Definition: variables_list.h:50
Definition: vector_field.h:26
virtual void CalculateTimeDerivative(const double time, const array_1d< double, 3 > &coor, array_1d< double, 3 > &deriv, const int i_thread=0)
Definition: vector_field.h:53
virtual void CalculateRotational(const double time, const DenseVector< double > &coor, DenseVector< double > &result, const int i_thread=0)
Definition: vector_field.h:74
VectorField()
Default constructor.
Definition: vector_field.h:33
KRATOS_CLASS_POINTER_DEFINITION(VectorField)
virtual void CalculateGradient(const double time, const array_1d< double, 3 > &coor, array_1d< array_1d< double, 3 >, 3 > &gradient, const int i_thread=0)
Definition: vector_field.h:55
virtual double CalculateDivergence(const double time, const DenseVector< double > &coor, const int i_thread=0)
Definition: vector_field.h:72
virtual void ResizeVectorsForParallelism(const int n_threads)
Definition: vector_field.h:78
virtual void CalculateRotational(const double time, const array_1d< double, 3 > &coor, array_1d< double, 3 > &rot, const int i_thread=0)
Definition: vector_field.h:59
virtual void CalculateTimeDerivative(const double time, const DenseVector< double > &coor, DenseVector< double > &result, const int i_thread=0)
Definition: vector_field.h:70
virtual std::string Info() const
Turn back information as a stemplate<class T, std::size_t dim> tring.
Definition: vector_field.h:98
virtual void PrintData(std::ostream &rOStream) const
Print object's data.
Definition: vector_field.h:111
virtual void PrintInfo(std::ostream &rOStream) const
Print information about this object.
Definition: vector_field.h:105
virtual void CalculateLaplacian(const double time, const array_1d< double, 3 > &coor, array_1d< double, 3 > &lapl, const int i_thread=0)
Definition: vector_field.h:61
virtual ~VectorField()
Destructor.
Definition: vector_field.h:40
virtual void Evaluate(const double time, const array_1d< double, 3 > &coor, array_1d< double, 3 > &vector, const int i_thread=0)
Definition: vector_field.h:46
virtual void Evaluate(const double time, const DenseVector< double > &coor, DenseVector< double > &result, const int i_thread=0)
Definition: vector_field.h:63
VectorField(RealFunction &u_x, RealFunction &u_y, RealFunction &u_z)
Definition: vector_field.h:36
virtual void ImposeFieldOnNodes(ModelPart &r_model_part, const VariablesList &variables_to_be_imposed)
Definition: vector_field.h:80
virtual double CalculateDivergence(const double time, const array_1d< double, 3 > &coor, const int i_thread=0)
Definition: vector_field.h:57
virtual void CalculateLaplacian(const double time, const DenseVector< double > &coor, DenseVector< double > &result, const int i_thread=0)
Definition: vector_field.h:76
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
time
Definition: face_heat.py:85