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.
depth_integration_process.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_DEPTH_INTEGRATION_PROCESS_H_INCLUDED
14 #define KRATOS_DEPTH_INTEGRATION_PROCESS_H_INCLUDED
15 
16 
17 // System includes
18 
19 
20 // External includes
21 
22 
23 // Project includes
24 #include "containers/model.h"
25 #include "processes/process.h"
28 
29 namespace Kratos
30 {
33 
37 
41 
45 
49 
53 class ModelPart;
54 
62 template<std::size_t TDim>
63 class KRATOS_API(SHALLOW_WATER_APPLICATION) DepthIntegrationProcess : public Process
64 {
65 public:
68 
71 
73  using NodeType = Node;
74 
77 
81 
87 
91  DepthIntegrationProcess(Model& rModel, Parameters ThisParameters = Parameters());
92 
96  ~DepthIntegrationProcess() override = default;
97 
101 
102 
106 
107  void Execute() override;
108 
109  int Check() override;
110 
111  const Parameters GetDefaultParameters() const override;
112 
116 
117 
121 
122 
126 
128  std::string Info() const override {
129  std::stringstream buffer;
130  buffer << "DepthIntegrationProcess";
131  return buffer.str();
132  }
133 
135  void PrintInfo(std::ostream& rOStream) const override {
136  rOStream << Info();
137  }
138 
140  void PrintData(std::ostream& rOStream) const override {}
141 
145 
146 
148 
149 private:
152 
153  ModelPart& mrVolumeModelPart;
154  ModelPart& mrInterfaceModelPart;
155  array_1d<double,3> mDirection;
156  bool mStoreHistorical;
157 
158  // Option to print a debug file
159  bool mPrintVelocityProfile;
160 
161  // Option to substitute the boundaries by the neighbor
162  bool mExtrapolateBoundaries;
163  NodeType::Pointer mpFirstBoundaryNode;
164  NodeType::Pointer mpSecondBoundaryNode;
165  NodeType::Pointer mpFirstBoundaryNeighbor;
166  NodeType::Pointer mpSecondBoundaryNeighbor;
167 
171 
172 
176 
177  void GetBoundingVolumeLimits(double& rMin, double& rMax);
178 
179  void Integrate(
180  NodeType& rNode,
181  const double Bottom,
182  const double Top,
185  Vector& rShapeFunctionsValues);
186 
187  array_1d<double,3> InterpolateVelocity(
188  const Element::Pointer ElementId,
189  const Vector& rShapeFunctionValues) const;
190 
191  template<class TDataType, class TVarType = Variable<TDataType>>
192  void SetValue(NodeType& rNode, const TVarType& rVariable, TDataType rValue)
193  {
194  if (mStoreHistorical)
195  rNode.FastGetSolutionStepValue(rVariable) = rValue;
196  else
197  rNode.GetValue(rVariable) = rValue;
198  }
199 
200  template<class TDataType, class TVarType = Variable<TDataType>>
201  TDataType GetValue(const NodeType& rNode, const TVarType& rVariable)
202  {
203  if (mStoreHistorical)
204  return rNode.FastGetSolutionStepValue(rVariable);
205  else
206  return rNode.GetValue(rVariable);
207  }
208 
209  void FindBoundaryNeighbors();
210 
211  void CopyValues(const NodeType& rOriginNode, NodeType& rDestinationNode);
212 
216 
217 
221 
222 
226 
228  DepthIntegrationProcess& operator=(DepthIntegrationProcess const& rOther) = delete;
229 
231  DepthIntegrationProcess(DepthIntegrationProcess const& rOther) = delete;
232 
234 
235 }; // Class DepthIntegrationProcess
236 
238 
241 
242 
246 
247 
249 
250 } // namespace Kratos.
251 
252 #endif // KRATOS_DEPTH_INTEGRATION_PROCESS_H_INCLUDED defined
PeriodicInterfaceProcess & operator=(const PeriodicInterfaceProcess &)=delete
std::string Info() const override
Turn back information as a string.
Definition: periodic_interface_process.hpp:93
This class is designed to allow the fast location of MANY points on the top of a 3D mesh.
Definition: binbased_fast_point_locator.h:68
ConfigureType::ResultContainerType ResultContainerType
Definition: binbased_fast_point_locator.h:81
Calculate the minimum distance from all the nodes to a boundary condition in 2D.
Definition: depth_integration_process.h:64
void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: depth_integration_process.h:140
void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: depth_integration_process.h:135
~DepthIntegrationProcess() override=default
Destructor.
std::string Info() const override
Turn back information as a string.
Definition: depth_integration_process.h:128
KRATOS_CLASS_POINTER_DEFINITION(DepthIntegrationProcess)
Pointer definition of DepthIntegrationProcess.
DepthIntegrationProcess()=delete
Default constructor.
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
This class defines the node.
Definition: node.h:65
TVariableType::Type & FastGetSolutionStepValue(const TVariableType &rThisVariable)
Definition: node.h:435
TVariableType::Type & GetValue(const TVariableType &rThisVariable)
Definition: node.h:466
This class provides to Kratos a data structure for I/O based on the standard of JSON.
Definition: kratos_parameters.h:59
The base class for all processes in Kratos.
Definition: process.h:49
Kratos::ModelPart ModelPart
Definition: kratos_wrapper.h:31
Parameters GetValue(Parameters &rParameters, const std::string &rEntry)
Definition: add_kratos_parameters_to_python.cpp:53
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
def SetValue(entity, variable, value)
Definition: coupling_interface_data.py:256