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.
derivatives_recovery_utility.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: Miguel Maso Sotomayor
11 //
12 
13 #ifndef KRATOS_DERIVATIVES_RECOVERY_UTILITY_H_INCLUDED
14 #define KRATOS_DERIVATIVES_RECOVERY_UTILITY_H_INCLUDED
15 
16 // System includes
17 #include <unordered_set>
18 
19 
20 // External includes
21 
22 
23 // Project includes
24 #include "includes/define.h"
25 #include "includes/node.h"
26 
27 
28 namespace Kratos
29 {
30 
33 
35 class ModelPart;
36 
50 template<std::size_t TDim>
51 class KRATOS_API(SHALLOW_WATER_APPLICATION) DerivativesRecoveryUtility
52 {
53 public:
56 
57  typedef Node NodeType;
58 
62 
64 
68 
72 
77  static void Check(ModelPart& rModelPart);
78 
83  static void CheckRequiredNeighborsPatch(ModelPart& rModelPart);
84 
90  static void ExtendNeighborsPatch(ModelPart& rModelPart, const std::size_t RequiredNeighbors);
91 
98  static void CalculatePolynomialWeights(ModelPart& rModelPart);
99 
107  static void RecoverDivergence(
108  ModelPart& rModelPart,
109  const Variable<array_1d<double,3>>& rOriginVariable,
110  const Variable<double>& rDestinationVariable,
111  const std::size_t BufferStep = 0);
112 
120  static void RecoverGradient(
121  ModelPart& rModelPart,
122  const Variable<double>& rOriginVariable,
123  const Variable<array_1d<double,3>>& rDestinationVariable,
124  const std::size_t BufferStep = 0);
125 
133  static void RecoverLaplacian(
134  ModelPart& rModelPart,
135  const Variable<double>& rOriginVariable,
136  const Variable<double>& rDestinationVariable,
137  const std::size_t BufferStep = 0);
138 
146  static void RecoverLaplacian(
147  ModelPart& rModelPart,
148  const Variable<array_1d<double,3>>& rOriginVariable,
149  const Variable<array_1d<double,3>>& rDestinationVariable,
150  const std::size_t BufferStep = 0);
151 
155 
156 
160 
161 
163 
164 private:
167 
168 
172 
173 
177 
178 
182 
183  static double CalculateMaximumDistance(
184  const NodeType& rNode,
185  GlobalPointersVector<NodeType>& rNeighbors);
186 
187  static void FindExtendedNeighbors(
188  NodeType& rNode,
189  GlobalPointersVector<NodeType>& rNeighbors,
190  std::unordered_set<int>& rExtendedNeighborsId);
191 
192  static void AppendExtendedNeighbors(
193  ModelPart& rModelPart,
194  GlobalPointersVector<NodeType>& rNeighbors,
195  std::unordered_set<int>& rExtendedNeighborsId);
196 
197  static bool CalculateNodalPolynomialWeights(
198  NodeType& rNode);
199 
200  static bool GeneralizedInvertMatrix(
201  Matrix& rInputMatrix,
202  Matrix& rResult);
203 
207 
208 
210 
211 }; // Class DerivativesRecoveryUtility
212 
216 
217 
221 
222 
224 
225 
226 } // namespace Kratos.
227 
228 #endif // KRATOS_DERIVATIVES_RECOVERY_UTILITY_H_INCLUDED defined
Superconvergent patch recovery for linear meshes using quadratic polynomials.
Definition: derivatives_recovery_utility.h:52
Node NodeType
Definition: derivatives_recovery_utility.h:57
KRATOS_CLASS_POINTER_DEFINITION(DerivativesRecoveryUtility)
This class is a vector which stores global pointers.
Definition: global_pointers_vector.h:61
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
This class defines the node.
Definition: node.h:65
Variable class contains all information needed to store and retrive data from a data container.
Definition: variable.h:63
Kratos::ModelPart ModelPart
Definition: kratos_wrapper.h:31
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21