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.
reorder_consecutive_model_part_io.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: Pooyan Dadvand
11 //
12 
13 #if !defined(KRATOS_REORDER_CONSECUTIVE_MODEL_PART_IO_H_INCLUDED )
14 #define KRATOS_REORDER_CONSECUTIVE_MODEL_PART_IO_H_INCLUDED
15 
16 // System includes
17 
18 // External includes
19 
20 // Project includes
21 #include "includes/model_part_io.h"
22 
23 
24 namespace Kratos
25 {
26 
29 
33 
37 
41 
45 
47 
49 class KRATOS_API(KRATOS_CORE) ReorderConsecutiveModelPartIO : public ModelPartIO
50 {
51 public:
54 
57 
59 
61 
63 
65 
67 
69 
71 
73 
74  typedef BaseType::OutputFilesContainerType OutputFilesContainerType;
75 
76  typedef std::map<SizeType, SizeType> IdMapType;
77 
78  typedef std::size_t SizeType;
79 
83 
84  // inherit constructors of baseclass
86 
87  // this (inherited) constructor cannot be used with this class
90  const Flags Options) = delete;
91 
95 
96 
100 
101 
102 protected:
105 
106 
109  SizeType mNumberOfNodes = 0;
110  SizeType mNumberOfElements = 0;
111  SizeType mNumberOfConditions = 0;
113 
114 
118 
119 
123 
124 
125  SizeType ReorderedNodeId(ModelPartIO::SizeType NodeId) override;
126  SizeType ReorderedElementId(ModelPartIO::SizeType ElementId) override;
127  SizeType ReorderedConditionId(ModelPartIO::SizeType ConditionId) override;
128 
132 
133 
137 
138 
142 
143 
145 
146 private:
147 
150 
151  IdMapType mNodeIdMap = {};
152  IdMapType mElementIdMap = {};
153  IdMapType mConditionIdMap = {};
154 
158 
159 
163 
164 
168 
170 
171 }; // Class ReorderConsecutiveModelPartIO
172 
174 
177 
178 
182 
183 
184 // /// input stream function
185 // inline std::istream& operator >> (std::istream& rIStream,
186 // ReorderConsecutiveModelPartIO& rThis);
187 
188 // /// output stream function
189 // inline std::ostream& operator << (std::ostream& rOStream,
190 // const ReorderConsecutiveModelPartIO& rThis)
191 // {
192 // rThis.PrintInfo(rOStream);
193 // rOStream << std::endl;
194 // rThis.PrintData(rOStream);
195 
196 // return rOStream;
197 // }
198 // ///@}
199 
200 
201 } // namespace Kratos.
202 
203 #endif // KRATOS_REORDER_CONSECUTIVE_MODEL_PART_IO_H_INCLUDED defined
Definition: flags.h:58
std::vector< std::vector< std::size_t > > ConnectivitiesContainerType
Definition: io.h:91
std::size_t SizeType
Definition: io.h:97
Mesh is the second level of abstraction in the data structure which hold Nodes, Elements and Conditio...
Definition: mesh.h:69
An IO class for reading and writing a modelpart.
Definition: model_part_io.h:56
std::size_t SizeType
Definition: model_part_io.h:75
ModelPartIO(std::filesystem::path const &Filename, const Flags Options=IO::READ|IO::IGNORE_VARIABLES_ERROR.AsFalse()|IO::SKIP_TIMER)
Constructor with filename.
Definition: model_part_io.cpp:32
This class defines the node.
Definition: node.h:65
A sorted associative container similar to an STL set, but uses a vector to store pointers to its data...
Definition: pointer_vector_set.h:72
An IO class for reading and writing a modelpart.
Definition: reorder_consecutive_model_part_io.h:50
ReorderConsecutiveModelPartIO(Kratos::shared_ptr< std::iostream > Stream, const Flags Options)=delete
ModelPartIO BaseType
Definition: reorder_consecutive_model_part_io.h:58
BaseType::OutputFilesContainerType OutputFilesContainerType
Definition: reorder_consecutive_model_part_io.h:74
BaseType::NodesContainerType NodesContainerType
Definition: reorder_consecutive_model_part_io.h:64
BaseType::MeshType MeshType
Definition: reorder_consecutive_model_part_io.h:62
std::map< SizeType, SizeType > IdMapType
Definition: reorder_consecutive_model_part_io.h:76
KRATOS_CLASS_POINTER_DEFINITION(ReorderConsecutiveModelPartIO)
Pointer definition of ReorderConsecutiveModelPartIO.
BaseType::ElementsContainerType ElementsContainerType
Definition: reorder_consecutive_model_part_io.h:68
BaseType::NodeType NodeType
Definition: reorder_consecutive_model_part_io.h:60
BaseType::ConnectivitiesContainerType ConnectivitiesContainerType
Definition: reorder_consecutive_model_part_io.h:72
std::size_t SizeType
Definition: reorder_consecutive_model_part_io.h:78
BaseType::ConditionsContainerType ConditionsContainerType
Definition: reorder_consecutive_model_part_io.h:70
BaseType::PropertiesContainerType PropertiesContainerType
Definition: reorder_consecutive_model_part_io.h:66
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
std::shared_ptr< T > shared_ptr
Definition: smart_pointers.h:27