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.
interface_preprocess.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 #include <iostream>
17 
18 // External includes
19 
20 // Project includes
21 #include "includes/model_part.h"
22 #include "includes/define.h"
24 
25 namespace Kratos
26 {
29 
33 
37 
41 
45 
53 class KRATOS_API(CONTACT_STRUCTURAL_MECHANICS_APPLICATION) InterfacePreprocessCondition
54 {
55 public:
58 
60  using PointType = Point;
63 
65  using IndexType = std::size_t;
66 
68  using SizeType = std::size_t;
69 
74 
77 
81 
83 
89  :mrMainModelPart(rMainModelPrt)
90  {
91  }
92 
94  virtual ~InterfacePreprocessCondition() = default;
95 
99 
103 
109  void GenerateInterfacePart(
110  ModelPart& rInterfacePart,
111  Parameters ThisParameters = Parameters(R"({})")
112  );
113 
114 protected:
117 
121 
125 
129 
133 
137 
142 private:
145 
149 
150  ModelPart& mrMainModelPart;
151 
155 
159 
164  void CheckAndCreateProperties(ModelPart& rInterfacePart);
165 
171  bool CheckOnTheFace(
172  const std::vector<std::size_t>& rIndexVector,
173  GeometryType& rElementGeometry
174  );
175 
181  std::unordered_map<IndexType, Properties::Pointer> CreateNewProperties();
182 
189  template<class TClass>
190  void CopyProperties(
191  Properties::Pointer pOriginalProperty,
192  Properties::Pointer pNewProperty,
193  const Variable<TClass>& rVariable,
194  const bool AssignZero = true
195  )
196  {
197  if(pOriginalProperty->Has(rVariable)) {
198  const TClass& value = pOriginalProperty->GetValue(rVariable);
199  pNewProperty->SetValue(rVariable, value);
200  } else if (AssignZero) {
201  KRATOS_INFO("InterfacePreprocessCondition") << "Property " << rVariable.Name() << " not available. Assigning zero value" << std::endl;
202  pNewProperty->SetValue(rVariable, rVariable.Zero());
203  }
204  }
205 
213  void CreateNewCondition(
214  Properties::Pointer prThisProperties,
215  const GeometryType& rGeometry,
216  const IndexType ConditionId,
217  Condition const& rCondition
218  );
219 
224  void AssignMasterSlaveCondition(Condition::Pointer pCond);
225 
231  void PrintNodesAndConditions(
232  const IndexType NodesCounter,
233  const IndexType rCondCounter
234  );
235 
240  IndexType ReorderConditions();
241 
251  inline void GenerateEdgeCondition(
252  ModelPart& rInterfacePart,
253  Properties::Pointer prThisProperties,
254  const GeometryType& rEdgeGeometry,
255  const bool SimplestGeometry,
256  IndexType& rCondCounter,
257  IndexType& rConditionId
258  );
259 
269  inline void GenerateFaceCondition(
270  ModelPart& rInterfacePart,
271  Properties::Pointer prThisProperties,
272  const GeometryType& rFaceGeometry,
273  const bool SimplestGeometry,
274  IndexType& rCondCounter,
275  IndexType& rConditionId
276  );
277 
282 
286 
290 
294 }; // Class InterfacePreprocessCondition
295 }
Geometry base class.
Definition: geometry.h:71
Creates Model Parts containing the interface.
Definition: interface_preprocess.h:54
std::size_t SizeType
The size type.
Definition: interface_preprocess.h:68
KRATOS_CLASS_POINTER_DEFINITION(InterfacePreprocessCondition)
Pointer definition of ExactMortarIntegrationUtility.
ModelPart::ConditionsContainerType ConditionsArrayType
Definition: interface_preprocess.h:73
std::size_t IndexType
The index type.
Definition: interface_preprocess.h:65
InterfacePreprocessCondition(ModelPart &rMainModelPrt)
Constructor.
Definition: interface_preprocess.h:88
virtual ~InterfacePreprocessCondition()=default
Destructor.
ModelPart::NodesContainerType NodesArrayType
Definition of the entities container.
Definition: interface_preprocess.h:71
ModelPart::ElementsContainerType ElementsArrayType
Definition: interface_preprocess.h:72
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
MeshType::ConditionsContainerType ConditionsContainerType
Condintions container. A vector set of Conditions with their Id's as key.
Definition: model_part.h:183
MeshType::ElementsContainerType ElementsContainerType
Element container. A vector set of Elements with their Id's as key.
Definition: model_part.h:168
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 provides to Kratos a data structure for I/O based on the standard of JSON.
Definition: kratos_parameters.h:59
Point class.
Definition: point.h:59
const std::string & Name() const
Definition: variable_data.h:201
Variable class contains all information needed to store and retrive data from a data container.
Definition: variable.h:63
const TDataType & Zero() const
This method returns the zero value of the variable type.
Definition: variable.h:346
std::size_t IndexType
The definition of the index type.
Definition: key_hash.h:35
#define KRATOS_INFO(label)
Definition: logger.h:250
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
Geometry< Node > GeometryType
The definition of the geometry.
Definition: mortar_classes.h:37