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.
shifted_boundary_meshless_interface_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: Ruben Zorrilla
11 //
12 
13 #pragma once
14 
15 // System includes
16 
17 // External includes
18 
19 // Project includes
20 #include "containers/model.h"
21 #include "includes/define.h"
22 #include "includes/key_hash.h"
24 
25 namespace Kratos
26 {
27 
30 
34 
38 
42 
46 
52 class KRATOS_API(KRATOS_CORE) ShiftedBoundaryMeshlessInterfaceUtility
53 {
54 public:
55 
58 
59  enum class ExtensionOperator
60  {
61  MLS,
62  RBF,
63  GradientBased
64  };
65 
67 
69 
71 
73 
74  using ModifiedShapeFunctionsFactoryType = std::function<ModifiedShapeFunctions::UniquePointer(const GeometryType::Pointer, const Vector&)>;
75 
76  using MeshlessShapeFunctionsFunctionType = std::function<void(const Matrix&, const array_1d<double,3>&, const double, Vector&)>;
77 
78  using MLSShapeFunctionsAndGradientsFunctionType = std::function<void(const Matrix&, const array_1d<double,3>&, const double, Vector&, Matrix&)>;
79 
80  using ElementSizeFunctionType = std::function<double(const GeometryType&)>;
81 
82  using NodesCloudSetType = std::unordered_set<NodeType::Pointer, SharedPointerHasher<NodeType::Pointer>, SharedPointerComparator<NodeType::Pointer>>;
83 
85 
86  using NodesCloudMapType = std::unordered_map<NodeType::Pointer, CloudDataVectorType, SharedPointerHasher<NodeType::Pointer>, SharedPointerComparator<NodeType::Pointer>>;
87 
90 
93 
97 
102  Model& rModel,
103  Parameters ThisParameters);
104 
107 
111 
114 
118 
119  void CalculateExtensionOperator();
120 
124 
128 
129  const Parameters GetDefaultParameters() const;
130 
134 
136  std::string Info() const
137  {
138  return "ShiftedBoundaryMeshlessInterfaceUtility";
139  }
140 
142  void PrintInfo(std::ostream& rOStream) const
143  {
144  rOStream << "ShiftedBoundaryMeshlessInterfaceUtility";
145  }
146 
148  void PrintData(std::ostream& rOStream) const
149  {
150  }
151 
155 
157 private:
160 
164 
165  ModelPart* mpModelPart = nullptr;
166  ModelPart* mpBoundarySubModelPart = nullptr;
167 
168  bool mConformingBasis;
169 
170  const Variable<double>* mpLevelSetVariable;
171 
172  ExtensionOperator mExtensionOperator;
173 
174  std::size_t mMLSExtensionOperatorOrder;
175 
176  const Condition* mpConditionPrototype;
177 
181 
185 
194  void CalculateGradientBasedConformingExtensionBasis();
195 
203  void CalculateMeshlessBasedConformingExtensionBasis();
204 
211  void CalculateMeshlessBasedNonConformingExtensionBasis();
212 
223  void SetInterfaceFlags();
224 
230  MLSShapeFunctionsAndGradientsFunctionType GetMLSShapeFunctionsAndGradientsFunction() const;
231 
237  MeshlessShapeFunctionsFunctionType GetMLSShapeFunctionsFunction() const;
238 
244  MeshlessShapeFunctionsFunctionType GetRBFShapeFunctionsFunction() const;
245 
252  ElementSizeFunctionType GetElementSizeFunction(const GeometryType& rGeometry);
253 
261  void SetSplitElementSupportCloud(
262  const Element& rSplitElement,
263  PointerVector<NodeType>& rCloudNodes,
264  Matrix& rCloudCoordinates);
265 
274  void SetNegativeNodeSupportCloud(
275  const NodeType& rNegativeNode,
276  PointerVector<NodeType>& rCloudNodes,
277  Matrix& rCloudCoordinates);
278 
288  double CalculateKernelRadius(
289  const Matrix& rCloudCoordinates,
290  const array_1d<double,3>& rOrigin);
291 
299  std::size_t GetRequiredNumberOfPoints();
300 
309  std::unordered_map<std::size_t, std::map<std::size_t, Vector>> SetSurrogateBoundaryNodalGradientWeights();
310 
314 
318 
322 
324 }; // Class ShiftedBoundaryMeshlessInterfaceUtility
325 
326 } // namespace Kratos.
Base class for all Conditions.
Definition: condition.h:59
Base class for all Elements.
Definition: element.h:60
Geometry base class.
Definition: geometry.h:71
GeometryData::ShapeFunctionsGradientsType ShapeFunctionsGradientsType
Definition: geometry.h:189
Definition: amatrix_interface.h:41
This class aims to manage different model parts across multi-physics simulations.
Definition: model.h:60
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
std::size_t IndexType
Pointer definition of ModelPart.
Definition: model_part.h:105
Node NodeType
Definition: model_part.h:117
Geometry< NodeType > GeometryType
Definition: model_part.h:118
This class defines the node.
Definition: node.h:65
This class provides to Kratos a data structure for I/O based on the standard of JSON.
Definition: kratos_parameters.h:59
PointerVector is a container like stl vector but using a vector to store pointers to its data.
Definition: pointer_vector.h:72
Utilities for the SBM-WTE extension operator calculation This class encapsulates several utilities fo...
Definition: shifted_boundary_meshless_interface_utility.h:53
std::function< void(const Matrix &, const array_1d< double, 3 > &, const double, Vector &)> MeshlessShapeFunctionsFunctionType
Definition: shifted_boundary_meshless_interface_utility.h:76
std::unordered_map< NodeType::Pointer, CloudDataVectorType, SharedPointerHasher< NodeType::Pointer >, SharedPointerComparator< NodeType::Pointer > > NodesCloudMapType
Definition: shifted_boundary_meshless_interface_utility.h:86
std::function< ModifiedShapeFunctions::UniquePointer(const GeometryType::Pointer, const Vector &)> ModifiedShapeFunctionsFactoryType
Definition: shifted_boundary_meshless_interface_utility.h:74
KRATOS_CLASS_POINTER_DEFINITION(ShiftedBoundaryMeshlessInterfaceUtility)
Pointer definition of ShiftedBoundaryMeshlessInterfaceUtility.
std::unordered_set< NodeType::Pointer, SharedPointerHasher< NodeType::Pointer >, SharedPointerComparator< NodeType::Pointer > > NodesCloudSetType
Definition: shifted_boundary_meshless_interface_utility.h:82
ShiftedBoundaryMeshlessInterfaceUtility & operator=(ShiftedBoundaryMeshlessInterfaceUtility const &rOther)=delete
Assignment operator.
ModelPart::IndexType IndexType
Definition: shifted_boundary_meshless_interface_utility.h:66
std::string Info() const
Turn back information as a string.
Definition: shifted_boundary_meshless_interface_utility.h:136
std::function< double(const GeometryType &)> ElementSizeFunctionType
Definition: shifted_boundary_meshless_interface_utility.h:80
ShiftedBoundaryMeshlessInterfaceUtility(ShiftedBoundaryMeshlessInterfaceUtility const &rOther)=delete
Copy constructor.
std::function< void(const Matrix &, const array_1d< double, 3 > &, const double, Vector &, Matrix &)> MLSShapeFunctionsAndGradientsFunctionType
Definition: shifted_boundary_meshless_interface_utility.h:78
void PrintInfo(std::ostream &rOStream) const
Print information about this object.
Definition: shifted_boundary_meshless_interface_utility.h:142
void PrintData(std::ostream &rOStream) const
Print object's data.
Definition: shifted_boundary_meshless_interface_utility.h:148
ExtensionOperator
Definition: shifted_boundary_meshless_interface_utility.h:60
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
TABLE_NUMBER_ANGULAR_VELOCITY TABLE_NUMBER_MOMENT I33 BEAM_INERTIA_ROT_UNIT_LENGHT_Y KRATOS_DEFINE_APPLICATION_VARIABLE(DEM_APPLICATION, double, BEAM_INERTIA_ROT_UNIT_LENGHT_Z) typedef std double
Definition: DEM_application_variables.h:182
This is a key comparer between two shared pointers.
Definition: key_hash.h:312