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.
compute_nodal_normal_divergence_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: Mohammad R. Hashemi (based on the work by Riccardo Rossi and Vicente Mataix Ferrandiz)
11 //
12 
13 #if !defined(KRATOS_COMPUTE_DIVERGENCE_PROCESS_INCLUDED )
14 #define KRATOS_COMPUTE_DIVERGENCE_PROCESS_INCLUDED
15 
16 // System includes
17 
18 // External includes
19 
20 // Project includes
21 #include "includes/define.h"
22 #include "processes/process.h"
23 #include "includes/model_part.h"
25 #include "utilities/geometry_utilities.h"
27 
28 namespace Kratos
29 {
30 
33 
37 
41 
45 
49 
54 {
55  // Defining clearer options
56  constexpr static bool SaveAsHistoricalVariable = true;
57  constexpr static bool SaveAsNonHistoricalVariable = false;
58 };
59 
68 template<bool THistorical>
69 class KRATOS_API(KRATOS_CORE) ComputeNodalNormalDivergenceProcess
70  : public Process
71 {
72 public:
75 
78 
82 
85  ModelPart& rModelPart,
86  const Variable<array_1d<double,3> >& rOriginVariable,
87  const Variable<double>& rDivergenceVariable,
88  const Variable<double>& rAreaVariable = NODAL_AREA,
89  const bool NormalizeDivergence = true,
90  const bool NonHistoricalOriginVariable = false
91  );
92 
95 
99 
101  void operator()()
102  {
103  Execute();
104  }
105 
106 
110 
115  void Execute() override;
116 
120 
121 
125 
126 
130 
132  std::string Info() const override
133  {
134  return "ComputeNodalNormalDivergenceProcess";
135  }
136 
138  void PrintInfo(std::ostream& rOStream) const override
139  {
140  rOStream << "ComputeNodalNormalDivergenceProcess";
141  }
142 
144  void PrintData(std::ostream& rOStream) const override
145  {
146  }
147 
148 
152 
153 
155 
156 private:
159 
160 
164 
165  ModelPart& mrModelPart;
166  const Variable<array_1d<double,3>>* mpOriginVariable;
167  const Variable<double>* mpDivergenceVariable;
168  const Variable<double>* mpAreaVariable;
169  bool mNormalizeDivergence = true;
170  bool mNonHistoricalOriginVariable = false;
171 
175 
179 
183  void ClearDivergence();
184 
190  double& GetDivergence(
191  Element::GeometryType& rThisGeometry,
192  unsigned int i
193  );
194 
198  void SynchronizeDivergenceAndVolume();
199 
203  void PonderateDivergence();
204 
208  static array_1d<double,3> GetHistoricalNormalVectorField(
209  const Node& rNode,
210  const Variable<array_1d<double,3>>& rVariable
211  );
212 
216  static array_1d<double,3> GetNonHistoricalNormalVectorField(
217  const Node& rNode,
218  const Variable<array_1d<double,3>>& rVariable
219  );
220 
224  static array_1d<double,3> GetHistoricalVectorField(
225  const Node& rNode,
226  const Variable<array_1d<double,3>>& rVariable
227  );
228 
232  static array_1d<double,3> GetNonHistoricalVectorField(
233  const Node& rNode,
234  const Variable<array_1d<double,3>>& rVariable
235  );
236 
240 
241 
245 
246 
250 
252 
254 
255 }; // Class ComputeNodalNormalDivergenceProcess
256 
258 
261 
262 
266 
268 
269 } // namespace Kratos.
270 
271 #endif // KRATOS_COMPUTE_DIVERGENCE_PROCESS_INCLUDED defined
Compute Nodal Normal Divergence process.
Definition: compute_nodal_normal_divergence_process.h:71
void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: compute_nodal_normal_divergence_process.h:138
ComputeNodalNormalDivergenceProcess(ModelPart &rModelPart, const Variable< array_1d< double, 3 > > &rOriginVariable, const Variable< double > &rDivergenceVariable, const Variable< double > &rAreaVariable=NODAL_AREA, const bool NormalizeDivergence=true, const bool NonHistoricalOriginVariable=false)
Default constructor. (component)
void operator()()
This operator is provided to call the process as a function and simply calls the Execute method.
Definition: compute_nodal_normal_divergence_process.h:101
std::string Info() const override
Turn back information as a string.
Definition: compute_nodal_normal_divergence_process.h:132
~ComputeNodalNormalDivergenceProcess() override=default
Destructor.
void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: compute_nodal_normal_divergence_process.h:144
KRATOS_CLASS_POINTER_DEFINITION(ComputeNodalNormalDivergenceProcess)
Pointer definition of ComputeNodalNormalDivergenceProcess.
Geometry base class.
Definition: geometry.h:71
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
This class defines the node.
Definition: node.h:65
The base class for all processes in Kratos.
Definition: process.h:49
Variable class contains all information needed to store and retrive data from a data container.
Definition: variable.h:63
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
integer i
Definition: TensorModule.f:17
This struct is used in order to identify when using the hitorical and non historical variables.
Definition: compute_nodal_normal_divergence_process.h:54
constexpr static bool SaveAsHistoricalVariable
Definition: compute_nodal_normal_divergence_process.h:56
constexpr static bool SaveAsNonHistoricalVariable
Definition: compute_nodal_normal_divergence_process.h:57