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.
find_neighbour_elements_of_conditions_process.hpp
Go to the documentation of this file.
1 // KRATOS___
2 // // ) )
3 // // ___ ___
4 // // ____ //___) ) // ) )
5 // // / / // // / /
6 // ((____/ / ((____ ((___/ / MECHANICS
7 //
8 // License: geo_mechanics_application/license.txt
9 //
10 // Main authors: Vahid Galavi
11 //
12 
13 
14 #pragma once
15 
16 // Project includes
17 #include "includes/model_part.h"
18 #include "processes/process.h"
19 
20 namespace Kratos
21 {
24  using hashmap = std::unordered_multimap<DenseVector<int>, std::vector<Condition::Pointer>, KeyHasherRange<DenseVector<int>>, KeyComparorRange<DenseVector<int>>>;
25 
29 
36 class KRATOS_API(GEO_MECHANICS_APPLICATION) FindNeighbourElementsOfConditionsProcess
37  : public Process
38 {
39 public:
42 
45 
47  using IndexType = std::size_t;
48 
50  using NodeType = Node;
51 
52  // Definition of the geometry
54 
55 
59 
61 
65  mrModelPart(rModelPart)
66  {
67  }
68 
72 
76 
78  void operator()()
79  {
80  Execute();
81  }
82 
86 
87 
89  void Execute() override;
90 
94 
95 
99 
100 
104 
106  std::string Info() const override
107  {
108  return "FindNeighbourElementsOfConditionsProcess";
109  }
110 
112  void PrintData(std::ostream& rOStream) const override
113  {
114  this->PrintInfo(rOStream);
115  }
116 
117 
119 private:
122  hashmap::iterator FindFaceReorderingTetrahedra3D10(DenseVector<int> FaceIds, hashmap &FacesMap) const;
123  hashmap::iterator FindFaceReorderingTetrahedra3D4(DenseVector<int> FaceIds, hashmap &FacesMap) const;
124  hashmap::iterator FindFaceReorderingHexahedra3D8(DenseVector<int> FaceIds, hashmap &FacesMap) const;
125  hashmap::iterator FindFaceReorderingHexahedra3D20(DenseVector<int> FaceIds, hashmap &FacesMap) const;
126 
127 
131 
132  ModelPart& mrModelPart;
133 
137 
138  bool CheckIfAllConditionsAreVisited() const;
139 
140  void CheckIf1DElementIsNeighbour(hashmap& rFacesMap);
141 
142  static void CheckForMultipleConditionsOnElement(hashmap& rFacesMap, hashmap::iterator& rItFace,
144 
146 }; // Class Process
147 
149 
152 
156 
157 
159 inline std::istream& operator >> (std::istream& rIStream,
161 
163 inline std::ostream& operator << (std::ostream& rOStream,
165 {
166  rThis.PrintInfo(rOStream);
167  rOStream << std::endl;
168  rThis.PrintData(rOStream);
169 
170  return rOStream;
171 }
173 
174 }
Finds list of elements attached to conditions.
Definition: find_neighbour_elements_of_conditions_process.hpp:38
void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: find_neighbour_elements_of_conditions_process.hpp:112
std::string Info() const override
Turn back information as a string.
Definition: find_neighbour_elements_of_conditions_process.hpp:106
void operator()()
This operator is provided to call the process as a function and simply calls the Execute method.
Definition: find_neighbour_elements_of_conditions_process.hpp:78
FindNeighbourElementsOfConditionsProcess(ModelPart &rModelPart)
Constructor for FindNeighbourElementsOfConditionsProcess Process.
Definition: find_neighbour_elements_of_conditions_process.hpp:64
FindNeighbourElementsOfConditionsProcess(const FindNeighbourElementsOfConditionsProcess &)=delete
KRATOS_CLASS_POINTER_DEFINITION(FindNeighbourElementsOfConditionsProcess)
Pointer definition of Process.
FindNeighbourElementsOfConditionsProcess & operator=(const FindNeighbourElementsOfConditionsProcess &)=delete
std::size_t IndexType
Definition: flags.h:74
Geometry base class.
Definition: geometry.h:71
Definition: amatrix_interface.h:41
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
This class defines the node.
Definition: node.h:65
boost::indirect_iterator< typename TContainerType::iterator > iterator
Definition: pointer_vector.h:89
The base class for all processes in Kratos.
Definition: process.h:49
void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: process.h:204
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
std::unordered_multimap< DenseVector< int >, std::vector< Condition::Pointer >, KeyHasherRange< DenseVector< int > >, KeyComparorRange< DenseVector< int > >> hashmap
Definition: find_neighbour_elements_of_conditions_process.hpp:24
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 is a key comparer of general pourpose between two classes.
Definition: key_hash.h:100
This is a hasher of general pourpose.
Definition: key_hash.h:138