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.
fluid_element_data.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 authors: Jordi Cotela
11 //
12 
13 #if !defined(KRATOS_FLUID_ELEMENT_DATA_H)
14 #define KRATOS_FLUID_ELEMENT_DATA_H
15 
16 // External includes
17 
18 // Project includes
19 #include "geometries/geometry.h"
20 #include "includes/define.h"
21 #include "includes/node.h"
22 #include "includes/element.h"
23 #include "includes/process_info.h"
25 
26 namespace Kratos
27 {
30 
33 
35 template< size_t TDim, size_t TNumNodes, bool TElementIntegratesInTime >
36 class KRATOS_API(FLUID_DYNAMICS_APPLICATION) FluidElementData
37 {
38 public:
41 
43 
45 
46  using NodalTensorData = std::array<BoundedMatrix<double,TDim,TDim>,TNumNodes>;
47 
49 
51 
53 
55  constexpr static unsigned int Dim = TDim;
56 
58  constexpr static unsigned int NumNodes = TNumNodes;
59 
61  constexpr static unsigned int StrainSize = (TDim-1)*3; // 3 in 2D, 6 in 3D
62 
64  constexpr static bool ElementManagesTimeIntegration = TElementIntegratesInTime;
65 
69 
72 
74  virtual ~FluidElementData();
75 
77  FluidElementData& operator=(FluidElementData const& rOther) = delete;
78 
80  FluidElementData(FluidElementData const& rOther) = delete;
81 
85 
86  virtual void Initialize(const Element& rElement, const ProcessInfo& rProcessInfo);
87 
88  static int Check(const Element& rElement, const ProcessInfo& rProcessInfo);
89 
90  virtual void UpdateGeometryValues(
91  unsigned int IntegrationPointIndex,
92  double NewWeight,
93  const MatrixRowType& rN,
94  const ShapeDerivativesType& rDN_DX);
95 
99 
100  unsigned int IntegrationPointIndex;
101 
102  double Weight;
103 
105 
107 
109 
111 
113 
115 
117 
119 
122 
125 
127 protected:
128 
131 
132  //TODO: This needs to be removed
134  NodalScalarData &rData,
135  const Variable<double> &rVariable,
136  const Geometry<Node> &rGeometry)
137  {
138  KRATOS_WARNING("FluidElementData") << "\'FillFromNodalData\' is deprecated. Use \'FillFromHistoricalNodalData\' instead." << std::endl;
139  FillFromHistoricalNodalData(rData, rVariable, rGeometry);
140  }
141 
142  //TODO: This needs to be removed
144  NodalVectorData &rData,
145  const Variable<array_1d<double, 3>> &rVariable,
146  const Geometry<Node> &rGeometry)
147  {
148  KRATOS_WARNING("FluidElementData") << "\'FillFromNodalData\' is deprecated. Use \'FillFromHistoricalNodalData\' instead." << std::endl;
149  FillFromHistoricalNodalData(rData, rVariable, rGeometry);
150  }
151 
152  void FillFromHistoricalNodalData(
153  NodalScalarData &rData,
154  const Variable<double> &rVariable,
155  const Geometry<Node> &rGeometry);
156 
157  void FillFromHistoricalNodalData(
158  NodalVectorData &rData,
159  const Variable<array_1d<double, 3>> &rVariable,
160  const Geometry<Node> &rGeometry);
161 
162  void FillFromHistoricalNodalData(
163  NodalTensorData& rData,
164  const Variable<Matrix>& rVariable,
165  const Geometry<Node>& rGeometry);
166 
167  void FillFromHistoricalNodalData(NodalScalarData& rData, const Variable<double>& rVariable, const Geometry<Node>& rGeometry, const unsigned int Step);
168 
169  void FillFromHistoricalNodalData(NodalVectorData& rData, const Variable<array_1d<double,3>>& rVariable, const Geometry<Node>& rGeometry, const unsigned int Step);
170 
171  void FillFromNonHistoricalNodalData(
172  NodalScalarData& rData,
173  const Variable<double>& rVariable,
174  const Geometry<Node>& rGeometry);
175 
176  void FillFromNonHistoricalNodalData(
177  NodalVectorData& rData,
178  const Variable<array_1d<double,3>>& rVariable,
179  const Geometry<Node>& rGeometry);
180 
181  void FillFromProcessInfo(double& rData, const Variable<double>& rVariable, const ProcessInfo& rProcessInfo);
182 
183  void FillFromProcessInfo(int& rData, const Variable<int>& rVariable, const ProcessInfo& rProcessInfo);
184 
185  void FillFromElementData(double& rData, const Variable<double>& rVariable, const Element& rElement);
186 
187  void FillFromElementData(Vector& rData, const Variable<Vector>& rVariable, const Element& rElement);
188 
189  void FillFromElementData(NodalScalarData& rData, const Variable<Vector>& rVariable, const Element& rElement);
190 
191  void FillFromProperties(double& rData, const Variable<double>& rVariable, const Properties& rProperties);
192 
194 };
195 
197 
199 }
200 
201 #endif // KRATOS_FLUID_ELEMENT_DATA_H
Base class for all Elements.
Definition: element.h:60
Base class for data containers used within FluidElement and derived types.
Definition: fluid_element_data.h:37
MatrixRow< Matrix > MatrixRowType
Definition: fluid_element_data.h:52
void FillFromNodalData(NodalVectorData &rData, const Variable< array_1d< double, 3 >> &rVariable, const Geometry< Node > &rGeometry)
Definition: fluid_element_data.h:143
unsigned int IntegrationPointIndex
Definition: fluid_element_data.h:100
double Weight
Definition: fluid_element_data.h:102
ShapeFunctionsType N
Definition: fluid_element_data.h:104
FluidElementData(FluidElementData const &rOther)=delete
(deleted) copy constructor.
Vector StrainRate
Strain rate (symmetric gradient of velocity) vector in Voigt notation.
Definition: fluid_element_data.h:110
ConstitutiveLaw::Parameters ConstitutiveLawValues
Constitutive law configuration (stored here to avoid re-initialization within the element).
Definition: fluid_element_data.h:121
std::array< BoundedMatrix< double, TDim, TDim >, TNumNodes > NodalTensorData
Definition: fluid_element_data.h:46
Vector ShearStress
Shear stress vector in Voigt notation.
Definition: fluid_element_data.h:114
FluidElementData & operator=(FluidElementData const &rOther)=delete
(deleted) assignment operator.
double EffectiveViscosity
Effective viscosity (in dynamic units) produced by the constitutive law.
Definition: fluid_element_data.h:124
ShapeDerivativesType DN_DX
Definition: fluid_element_data.h:106
void FillFromNodalData(NodalScalarData &rData, const Variable< double > &rVariable, const Geometry< Node > &rGeometry)
Definition: fluid_element_data.h:133
Matrix C
Constitutive tensor C (expressed as a Matrix).
Definition: fluid_element_data.h:118
Geometry base class.
Definition: geometry.h:71
Definition: amatrix_interface.h:41
ProcessInfo holds the current value of different solution parameters.
Definition: process_info.h:59
Properties encapsulates data shared by different Elements or Conditions. It can store any type of dat...
Definition: properties.h:69
#define KRATOS_WARNING(label)
Definition: logger.h:265
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
AMatrix::MatrixRow< TExpressionType > MatrixRow
Definition: amatrix_interface.h:492
Definition: constitutive_law.h:189