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.
embedded_mls_constraint_process.h
Go to the documentation of this file.
1 // KRATOS ___ ___ _ ___ __ ___ ___ ___ ___
2 // / __/ _ \| \| \ \ / /__| \_ _| __| __|
3 // | (_| (_) | .` |\ V /___| |) | || _|| _|
4 // \___\___/|_|\_| \_/ |___/___|_| |_| APPLICATION
5 //
6 // License: BSD License
7 // Kratos default license: kratos/license.txt
8 //
9 // Main authors: Ruben Zorrilla
10 // Franziska Wahl
11 //
12 
13 #pragma once
14 
15 // System includes
16 
17 // External includes
18 
19 // Project includes
20 #include "includes/define.h"
21 #include "containers/model.h"
22 #include "processes/process.h"
24 
25 // Application includes
26 
27 namespace Kratos
28 {
29 
32 
36 
40 
44 
48 
52 class KRATOS_API(CONVECTION_DIFFUSION_APPLICATION) EmbeddedMLSConstraintProcess : public Process
53 {
54 public:
55 
58 
60 
62 
64 
65  using MLSShapeFunctionsFunctionType = std::function<void(const Matrix&, const array_1d<double,3>&, const double, Vector&)>;
66 
67  using NodesCloudSetType = std::unordered_set<NodeType::Pointer, SharedPointerHasher<NodeType::Pointer>, SharedPointerComparator<NodeType::Pointer>>;
68 
70 
71  using NodesCloudMapType = std::unordered_map<NodeType::Pointer, CloudDataVectorType, SharedPointerHasher<NodeType::Pointer>, SharedPointerComparator<NodeType::Pointer>>;
72 
75 
78 
82 
85 
88  Model& rModel,
89  Parameters ThisParameters);
90 
92  virtual ~EmbeddedMLSConstraintProcess() = default;
93 
97 
98 
102 
103  void Execute() override;
104 
105  const Parameters GetDefaultParameters() const override
106  {
107  const Parameters default_parameters = Parameters(R"({
108  "model_part_name" : "",
109  "unknown_variable" : "TEMPERATURE",
110  "mls_extension_operator_order" : 1,
111  "deactivate_negative_elements" : true,
112  "deactivate_intersected_elements" : false
113  })" );
114 
115  return default_parameters;
116  }
117 
121 
125 
129 
131  virtual std::string Info() const override
132  {
133  return "EmbeddedMLSConstraintProcess";
134  }
135 
137  virtual void PrintInfo(std::ostream& rOStream) const override
138  {
139  rOStream << "EmbeddedMLSConstraintProcess";
140  }
141 
143  virtual void PrintData(std::ostream& rOStream) const override
144  {
145  }
146 
150 
152 
153 protected:
154 
157 
161 
165 
169 
173 
177 
181 
183 
184 private:
185 
188 
192 
193  ModelPart* mpModelPart = nullptr;
194 
195  std::string mUnknownVariable;
196 
197  std::size_t mMLSExtensionOperatorOrder;
198 
199  bool mDeactivateNegativeElements;
200  bool mDeactivateIntersectedElements;
201 
205 
209 
210  void CalculateConformingExtensionBasis(
211  NodesCloudMapType& rExtensionOperatorMap);
212 
213  void ApplyExtensionConstraints(
214  NodesCloudMapType& rExtensionOperatorMap);
215 
216  void SetInterfaceFlags();
217 
218  void ReactivateElementsAndNodes();
219 
220  void ModifyDistances();
221 
222  bool IsSplit(const GeometryType& rGeometry);
223 
224  bool IsNegative(const GeometryType& rGeometry);
225 
226  MLSShapeFunctionsFunctionType GetMLSShapeFunctionsFunction();
227 
228  void SetNegativeNodeSupportCloud(
229  const NodeType& rNegativeNode,
230  PointerVector<NodeType>& rCloudNodes,
231  Matrix& rCloudCoordinates);
232 
233  double CalculateKernelRadius(
234  const Matrix& rCloudCoordinates,
235  const array_1d<double,3>& rOrigin);
236 
237  std::size_t GetRequiredNumberOfPoints();
238 
242 
246 
248 
249 }; // Class EmbeddedMLSConstraintProcess
250 
251 } // namespace Kratos.
252 
Definition: embedded_mls_constraint_process.h:53
virtual std::string Info() const override
Turn back information as a string.
Definition: embedded_mls_constraint_process.h:131
const Parameters GetDefaultParameters() const override
This method provides the defaults parameters to avoid conflicts between the different constructors.
Definition: embedded_mls_constraint_process.h:105
std::function< void(const Matrix &, const array_1d< double, 3 > &, const double, Vector &)> MLSShapeFunctionsFunctionType
Definition: embedded_mls_constraint_process.h:65
virtual ~EmbeddedMLSConstraintProcess()=default
Destructor.
std::unordered_set< NodeType::Pointer, SharedPointerHasher< NodeType::Pointer >, SharedPointerComparator< NodeType::Pointer > > NodesCloudSetType
Definition: embedded_mls_constraint_process.h:67
virtual void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: embedded_mls_constraint_process.h:137
virtual void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: embedded_mls_constraint_process.h:143
KRATOS_CLASS_POINTER_DEFINITION(EmbeddedMLSConstraintProcess)
Pointer definition of EmbeddedMLSConstraintProcess.
EmbeddedMLSConstraintProcess()=delete
Default constructor.
std::unordered_map< NodeType::Pointer, CloudDataVectorType, SharedPointerHasher< NodeType::Pointer >, SharedPointerComparator< NodeType::Pointer > > NodesCloudMapType
Definition: embedded_mls_constraint_process.h:71
std::size_t IndexType
Definition: flags.h:74
Geometry base class.
Definition: geometry.h:71
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
The base class for all processes in Kratos.
Definition: process.h:49
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
This is a key comparer between two shared pointers.
Definition: key_hash.h:312