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.
vertex_utilities.h
Go to the documentation of this file.
1 // | / |
2 // ' / __| _` | __| _ \ __|
3 // . \ | ( | | ( |\__ `
4 // _|\_\_| \__,_|\__|\___/ ____/
5 // Multi-Physics
6 //
7 // License: BSD License
8 // license: HDF5Application/license.txt
9 //
10 // Main author: Máté Kelemen
11 //
12 
13 #ifndef KRATOS_HDF5APPLICATION_VERTEX_UTILITIES_H
14 #define KRATOS_HDF5APPLICATION_VERTEX_UTILITIES_H
15 
16 // Project includes
17 #include "includes/node.h"
18 #include "includes/variables.h"
19 
20 // Core includes
21 #include "includes/element.h"
23 #include "includes/model_part.h"
24 
25 
26 namespace Kratos
27 {
28 namespace HDF5
29 {
30 
31 
32 #define KRATOS_DECLARE_VIRTUAL_VARIABLE_GETTER(TValue) \
33  virtual TValue GetValue(const Node& rNode, const Variable<TValue>& rVariable) const = 0
34 
35 
36 #define KRATOS_DEFINE_HISTORICAL_VARIABLE_GETTER(TValue) \
37  TValue GetValue(const Node& rNode, const Variable<TValue>& rVariable) const override final \
38  { \
39  return rNode.GetSolutionStepValue(rVariable); \
40  }
41 
42 
43 #define KRATOS_DEFINE_NON_HISTORICAL_VARIABLE_GETTER(TValue) \
44  TValue GetValue(const Node& rNode, const Variable<TValue>& rVariable) const override final \
45  { \
46  return rNode.GetValue(rVariable); \
47  }
48 
49 
57 {
59 
64 
65  virtual ~NodalVariableGetter() {}
66 
77 }; // struct NodalVariableGetter
78 
79 
81 {
87 
98 }; // struct HistoricalVariableGetter
99 
100 
102 {
108 
119 }; // struct NonHistoricalVariableGetter
120 
121 
122 #undef KRATOS_DEFINE_NON_HISTORICAL_VARIABLE_GETTER
123 #undef KRATOS_DEFINE_HISTORICAL_VARIABLE_GETTER
124 #undef KRATOS_DECLARE_VIRTUAL_VARIABLE_GETTER
125 
126 
130 struct KRATOS_API(HDF5_APPLICATION) PointLocatorAdaptor
131 {
133 
134  virtual ~PointLocatorAdaptor() {}
135 
136  virtual const Element::WeakPointer FindElement(const Point& rPoint) const = 0;
137 }; // struct PointLocatorAdaptor
138 
139 
141 class KRATOS_API(HDF5_APPLICATION) BruteForcePointLocatorAdaptor final : public PointLocatorAdaptor
142 {
143 public:
145 
147  const Globals::Configuration configuration,
148  const double tolerance);
149 
150  const Element::WeakPointer FindElement(const Point& rPoint) const override;
151 
152 private:
153  BruteForcePointLocator mLocator;
154 
155  const ModelPart& mrModelPart;
156 
157  const Globals::Configuration mConfiguration;
158 
159  const double mTolerance;
160 }; // class BruteForcePointLocatorAdaptor
161 
162 
163 } // namespace HDF5
164 } // namespace Kratos
165 
166 #endif // KRATOS_HDF5APPLICATION_NODAL_VARIABLE_GETTER_H
Utility class to find an entity of a mesh based on a location.
Definition: brute_force_point_locator.h:43
BruteForcePointLocator with configuration and tolerance persistence.
Definition: vertex_utilities.h:142
KRATOS_CLASS_POINTER_DEFINITION(BruteForcePointLocatorAdaptor)
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
Point class.
Definition: point.h:59
Configuration
Enum for Initial and Current configurations.
Definition: global_variables.h:38
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
Definition: vertex_utilities.h:81
KRATOS_DEFINE_HISTORICAL_VARIABLE_GETTER(DenseVector< int >)
KRATOS_DEFINE_HISTORICAL_VARIABLE_GETTER(Kratos::Vector)
KRATOS_DEFINE_HISTORICAL_VARIABLE_GETTER(Kratos::Matrix)
KRATOS_CLASS_POINTER_DEFINITION(HistoricalVariableGetter)
Definition: vertex_utilities.h:57
KRATOS_DECLARE_VIRTUAL_VARIABLE_GETTER(Kratos::Vector)
array_1d< double, 9 > Array9
Definition: vertex_utilities.h:63
KRATOS_DECLARE_VIRTUAL_VARIABLE_GETTER(DenseVector< int >)
array_1d< double, 6 > Array6
Definition: vertex_utilities.h:62
array_1d< double, 4 > Array4
Definition: vertex_utilities.h:61
virtual ~NodalVariableGetter()
Definition: vertex_utilities.h:65
KRATOS_CLASS_POINTER_DEFINITION(NodalVariableGetter)
array_1d< double, 3 > Array3
Definition: vertex_utilities.h:60
KRATOS_DECLARE_VIRTUAL_VARIABLE_GETTER(Kratos::Matrix)
Definition: vertex_utilities.h:102
KRATOS_CLASS_POINTER_DEFINITION(NonHistoricalVariableGetter)
KRATOS_DEFINE_NON_HISTORICAL_VARIABLE_GETTER(Kratos::Matrix)
KRATOS_DEFINE_NON_HISTORICAL_VARIABLE_GETTER(DenseVector< int >)
KRATOS_DEFINE_NON_HISTORICAL_VARIABLE_GETTER(Kratos::Vector)
Definition: vertex_utilities.h:131
virtual const Element::WeakPointer FindElement(const Point &rPoint) const =0
virtual ~PointLocatorAdaptor()
Definition: vertex_utilities.h:134
KRATOS_CLASS_POINTER_DEFINITION(PointLocatorAdaptor)