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_global_nodal_entity_neighbours_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: Riccardo Rossi
11 // Suneth Warnakulasuriya
12 //
13 
14 #pragma once
15 
16 // System includes
17 #include <string>
18 #include <iostream>
19 #include <unordered_map>
20 
21 // External includes
22 
23 // Project includes
24 #include "includes/define.h"
25 #include "containers/model.h"
26 #include "processes/process.h"
28 #include "includes/model_part.h"
30 
31 namespace Kratos
32 {
33 
36 
39 
41 
44 template<class TContainerType>
45 class KRATOS_API(KRATOS_CORE) FindGlobalNodalEntityNeighboursProcess : public Process
46 {
47 public:
50 
51  using IndexType = std::size_t;
52 
54 
55  using EntityType = typename TContainerType::value_type;
56 
58 
59  //contains id vs vector_of_neighbours
60  using NeighbourMapType = std::unordered_map<int, GlobalPointersVector<EntityType>>;
61 
62  using NonLocalMapType = std::unordered_map<int, NeighbourMapType>;
63 
64  using IdMapType = std::unordered_map<int, std::vector<int>>;
65 
68 
72 
75  Model& rModel,
76  Parameters Params);
77 
79  ModelPart& rModelPart);
80 
82  ModelPart& rModelPart,
83  const Variable<GlobalEntityPointersVectorType>& rOutputVariable);
84 
87 
91 
93 
97 
98  void Execute() override;
99 
100  void Clear() override;
101 
102  KRATOS_DEPRECATED_MESSAGE("This is legacy version (use Clear)") void ClearNeighbours() { Clear(); }
103 
104  IdMapType GetNeighbourIds(const ModelPart::NodesContainerType& rNodes);
105 
106  const Parameters GetDefaultParameters() const override;
107 
111 
113  std::string Info() const override
114  {
115  return "FindGlobalNodalEntityNeighboursProcess";
116  }
117 
119  void PrintInfo(std::ostream& rOStream) const override
120  {
121  rOStream << "FindGlobalNodalEntityNeighboursProcess";
122  }
123 
125  void PrintData(std::ostream& rOStream) const override
126  {
127  }
128 
129 
131 private:
134 
135  Model& mrModel;
136 
137  std::string mModelPartName;
138 
139  const Variable<GlobalEntityPointersVectorType>& mrOutputVariable;
140 
144 
145  static TContainerType& GetContainer(ModelPart& rModelPart);
146 
147  static const Variable<GlobalEntityPointersVectorType>& GetDefaultOutputVariable();
148 
150 
151 }; // Class FindGlobalNodalEntityNeighboursProcess
152 
156 
157 
159 template<class TContainerType>
160 inline std::istream& operator >> (std::istream& rIStream,
162 
164 template<class TContainerType>
165 inline std::ostream& operator << (std::ostream& rOStream,
167 {
168  rThis.PrintInfo(rOStream);
169  rOStream << std::endl;
170  rThis.PrintData(rOStream);
171 
172  return rOStream;
173 }
175 
176 } // namespace Kratos.
Short class definition.
Definition: find_global_nodal_entity_neighbours_process.h:46
std::string Info() const override
Turn back information as a string.
Definition: find_global_nodal_entity_neighbours_process.h:113
void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: find_global_nodal_entity_neighbours_process.h:119
void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: find_global_nodal_entity_neighbours_process.h:125
typename TContainerType::value_type EntityType
Definition: find_global_nodal_entity_neighbours_process.h:55
std::unordered_map< int, NeighbourMapType > NonLocalMapType
Definition: find_global_nodal_entity_neighbours_process.h:62
std::unordered_map< int, GlobalPointersVector< EntityType > > NeighbourMapType
Definition: find_global_nodal_entity_neighbours_process.h:60
KRATOS_DEPRECATED_MESSAGE("This is legacy version (use Clear)") void ClearNeighbours()
Definition: find_global_nodal_entity_neighbours_process.h:102
KRATOS_CLASS_POINTER_DEFINITION(FindGlobalNodalEntityNeighboursProcess)
Pointer definition of FindGlobalNodalEntityNeighboursProcess.
FindGlobalNodalEntityNeighboursProcess< EntityType > & operator=(FindGlobalNodalEntityNeighboursProcess< EntityType > const &rOther)=delete
~FindGlobalNodalEntityNeighboursProcess() override=default
Destructor.
FindGlobalNodalEntityNeighboursProcess(ModelPart &rModelPart)
std::unordered_map< int, std::vector< int > > IdMapType
Definition: find_global_nodal_entity_neighbours_process.h:64
std::size_t IndexType
Definition: flags.h:74
This class is a vector which stores global pointers.
Definition: global_pointers_vector.h:61
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
Node NodeType
Definition: model_part.h:117
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 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
Variable class contains all information needed to store and retrive data from a data container.
Definition: variable.h:63
TContainerType & GetContainer(ModelPart::MeshType &rMesh)
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