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.
calculate_distance_to_path_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: Vicente Mataix Ferrandiz
11 //
12 
13 #pragma once
14 
15 // System includes
16 
17 // External includes
18 
19 // Project includes
20 #include "processes/process.h"
21 #include "containers/model.h"
22 
23 namespace Kratos
24 {
27 
31 
35 
39 
43 
48 {
49  // Defining clearer options
50  constexpr static bool SaveAsHistoricalVariable = true;
51  constexpr static bool SaveAsNonHistoricalVariable = false;
52 };
53 
61 template<bool THistorical = true>
62 class KRATOS_API(KRATOS_CORE) CalculateDistanceToPathProcess
63  : public Process
64 {
65 public:
68 
70  typedef std::size_t IndexType;
71 
73  typedef std::size_t SizeType;
74 
76  typedef Node NodeType;
77 
80 
84 
90  Model& rModel,
91  Parameters ThisParameters
92  );
93 
96  {
97  }
98 
102 
106 
114  Process::Pointer Create(
115  Model& rModel,
116  Parameters ThisParameters
117  ) override
118  {
119  return Kratos::make_shared<CalculateDistanceToPathProcess>(rModel, ThisParameters);
120  }
121 
125  void Execute() override;
126 
130  const Parameters GetDefaultParameters() const override;
131 
135 
139 
143 
145  std::string Info() const override
146  {
147  return "CalculateDistanceToPathProcess";
148  }
149 
151  void PrintInfo(std::ostream& rOStream) const override
152  {
153  rOStream << "CalculateDistanceToPathProcess";
154  }
155 
157  void PrintData(std::ostream& rOStream) const override
158  {
159  }
160 
164 
166 protected:
169 
173 
177 
181 
185 
189 
193 
195 private:
198 
202 
203  Model& mrModel;
204  Parameters mThisParameters;
205  const Variable<double>* mpDistanceVariable;
206 
210 
214 
220  void CalculateDistance(
221  ModelPart& rModelPart,
222  std::vector<Geometry<NodeType>::Pointer>& rVectorSegments
223  );
224 
230  void CalculateDistanceByBruteForce(
231  ModelPart& rModelPart,
232  std::vector<Geometry<NodeType>::Pointer>& rVectorSegments
233  );
234 
238 
242 
246 
249 
251  //CalculateDistanceToPathProcess(CalculateDistanceToPathProcess const& rOther);
252 
254 
255 }; // Class CalculateDistanceToPathProcess
256 
260 
264 
266 template<bool THistorical>
267 inline std::istream& operator >> (std::istream& rIStream,
269 
271 template<bool THistorical>
272 inline std::ostream& operator << (std::ostream& rOStream,
274 {
275  rThis.PrintInfo(rOStream);
276  rOStream << std::endl;
277  rThis.PrintData(rOStream);
278 
279  return rOStream;
280 }
282 
284 } /// namespace Kratos
PeriodicInterfaceProcess & operator=(const PeriodicInterfaceProcess &)=delete
Computes DISTANCE from a path model part to a given model part.
Definition: calculate_distance_to_path_process.h:64
Node NodeType
The definition of the node.
Definition: calculate_distance_to_path_process.h:76
~CalculateDistanceToPathProcess() override
Destructor.
Definition: calculate_distance_to_path_process.h:95
std::size_t IndexType
Index type definition.
Definition: calculate_distance_to_path_process.h:70
void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: calculate_distance_to_path_process.h:151
Process::Pointer Create(Model &rModel, Parameters ThisParameters) override
This method creates an pointer of the process.
Definition: calculate_distance_to_path_process.h:114
std::size_t SizeType
Size type definition.
Definition: calculate_distance_to_path_process.h:73
std::string Info() const override
Turn back information as a string.
Definition: calculate_distance_to_path_process.h:145
void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: calculate_distance_to_path_process.h:157
KRATOS_CLASS_POINTER_DEFINITION(CalculateDistanceToPathProcess)
Pointer definition of CalculateDistanceToPathProcess.
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
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
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
std::istream & operator>>(std::istream &rIStream, LinearMasterSlaveConstraint &rThis)
input stream function
std::ostream & operator<<(std::ostream &rOStream, const LinearMasterSlaveConstraint &rThis)
output stream function
Definition: linear_master_slave_constraint.h:432
This struct is used in order to identify when using the hitorical and non historical variables.
Definition: calculate_distance_to_path_process.h:48
constexpr static bool SaveAsHistoricalVariable
Definition: calculate_distance_to_path_process.h:50
constexpr static bool SaveAsNonHistoricalVariable
Definition: calculate_distance_to_path_process.h:51