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.
normal_gap_process.h
Go to the documentation of this file.
1 // KRATOS ______ __ __ _____ __ __ __
2 // / ____/___ ____ / /_____ ______/ /_/ ___// /________ _______/ /___ ___________ _/ /
3 // / / / __ \/ __ \/ __/ __ `/ ___/ __/\__ \/ __/ ___/ / / / ___/ __/ / / / ___/ __ `/ /
4 // / /___/ /_/ / / / / /_/ /_/ / /__/ /_ ___/ / /_/ / / /_/ / /__/ /_/ /_/ / / / /_/ / /
5 // \____/\____/_/ /_/\__/\__,_/\___/\__//____/\__/_/ \__,_/\___/\__/\__,_/_/ \__,_/_/ MECHANICS
6 //
7 // License: BSD License
8 // license: ContactStructuralMechanicsApplication/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 "includes/model_part.h"
23 
24 namespace Kratos
25 {
28 
32 
36 
40 
44 
54 template<SizeType TDim, SizeType TNumNodes, SizeType TNumNodesMaster = TNumNodes>
55 class KRATOS_API(CONTACT_STRUCTURAL_MECHANICS_APPLICATION) NormalGapProcess
56  : public Process
57 {
58 public:
61 
64 
67 
69  static constexpr double ZeroTolerance = std::numeric_limits<double>::epsilon();
70 
73 
77 
81 
88  ModelPart& rMasterModelPart,
89  ModelPart& rSlaveModelPart,
90  const bool SearchOrientation = true
91  ) : mrMasterModelPart(rMasterModelPart),
92  mrSlaveModelPart(rSlaveModelPart),
93  mSearchOrientation(SearchOrientation)
94  {
95  }
96 
97  virtual ~NormalGapProcess()= default;;
98 
102 
106 
107  void operator()()
108  {
109  Execute();
110  }
111 
115 
119  void Execute() override;
120 
124 
128 
132 
133  /************************************ GET INFO *************************************/
134  /***********************************************************************************/
135 
136  std::string Info() const override
137  {
138  return "NormalGapProcess";
139  }
140 
141  /************************************ PRINT INFO ***********************************/
142  /***********************************************************************************/
143 
144  void PrintInfo(std::ostream& rOStream) const override
145  {
146  rOStream << Info();
147  }
148 
152 
154 
155 protected:
156 
159 
163 
166  const bool mSearchOrientation;
167 
171 
175 
180  static inline void SwitchFlagNodes(NodesArrayType& rNodes)
181  {
182  block_for_each(rNodes, [&](Node& rNode) {
183  rNode.Flip(SLAVE);
184  rNode.Flip(MASTER);
185  });
186  }
187 
192  void ComputeNormalGap(NodesArrayType& rNodes);
193 
197 
201 
205 
207 
208 private:
211 
215 
219 
223 
227 
231 
235 
237 
238 }; // Class NormalGapProcess
239 
241 
244 
245 
249 
250 /****************************** INPUT STREAM FUNCTION ******************************/
251 /***********************************************************************************/
252 
253 template<SizeType TDim, SizeType TNumNodes, SizeType TNumNodesMaster>
254 inline std::istream& operator >> (std::istream& rIStream,
256 
257 /***************************** OUTPUT STREAM FUNCTION ******************************/
258 /***********************************************************************************/
259 
260 template<SizeType TDim, SizeType TNumNodes, SizeType TNumNodesMaster>
261 inline std::ostream& operator << (std::ostream& rOStream,
263 {
264  return rOStream;
265 }
266 
268 
269 } // namespace Kratos.
std::string Info() const override
Turn back information as a string.
Definition: periodic_interface_process.hpp:93
void Flip(const Flags ThisFlag)
Definition: flags.h:199
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
MeshType::NodesContainerType NodesContainerType
Nodes container. Which is a vector set of nodes with their Id's as key.
Definition: model_part.h:128
This class defines the node.
Definition: node.h:65
This process computes the normal gap.
Definition: normal_gap_process.h:57
ModelPart & mrMasterModelPart
Definition: normal_gap_process.h:164
ModelPart & mrSlaveModelPart
The master model part to be considered.
Definition: normal_gap_process.h:165
KRATOS_CLASS_POINTER_DEFINITION(NormalGapProcess)
Pointer definition of NormalGapProcess.
std::string Info() const override
Turn back information as a string.
Definition: normal_gap_process.h:136
virtual ~NormalGapProcess()=default
const bool mSearchOrientation
The slave model part to be considered.
Definition: normal_gap_process.h:166
void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: normal_gap_process.h:144
static void SwitchFlagNodes(NodesArrayType &rNodes)
This method switchs the flag of an array of nodes.
Definition: normal_gap_process.h:180
void operator()()
Definition: normal_gap_process.h:107
ModelPart::NodesContainerType NodesArrayType
General type definitions.
Definition: normal_gap_process.h:66
NormalGapProcess(ModelPart &rMasterModelPart, ModelPart &rSlaveModelPart, const bool SearchOrientation=true)
The constructor of the normal gap process uses the following inputs:
Definition: normal_gap_process.h:87
The base class for all processes in Kratos.
Definition: process.h:49
This is basic mapper of values between domains using mortar formulation.
Definition: simple_mortar_mapper_process.h:73
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
void block_for_each(TIterator itBegin, TIterator itEnd, TFunction &&rFunction)
Execute a functor on all items of a range in parallel.
Definition: parallel_utilities.h:299
ModelPart::NodesContainerType NodesArrayType
Definition: gid_gauss_point_container.h:42
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