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.
hdf5_partitioned_model_part_io.h
Go to the documentation of this file.
1 // | / |
2 // ' / __| _` | __| _ \ __|
3 // . \ | ( | | ( |\__ `
4 // _|\_\_| \__,_|\__|\___/ ____/
5 // Multi-Physics
6 //
7 // License: BSD License
8 // license: HDF5Application/license.txt
9 //
10 // Main author: Michael Andre, https://github.com/msandre
11 //
12 
13 #if !defined(KRATOS_HDF5_PARTITIONED_MODEL_PART_IO_H_INCLUDED)
14 #define KRATOS_HDF5_PARTITIONED_MODEL_PART_IO_H_INCLUDED
15 
16 // System includes
17 
18 // External includes
19 
20 // Project includes
21 #include "includes/define.h"
22 
23 // Application includes
26 
27 namespace Kratos
28 {
29 namespace HDF5
30 {
35 
38 {
39 public:
42 
45 
47 
51 
53  PartitionedModelPartIO(File::Pointer pFile, std::string const& rPrefix);
54 
58  bool ReadNodes(NodesContainerType& rNodes) override;
59 
60  void WriteNodes(NodesContainerType const& rNodes) override;
61 
62  void ReadModelPart(ModelPart& rModelPart) override;
63 
65 
66 protected:
69 
70  void Check();
71 
72  std::tuple<unsigned, unsigned> StartIndexAndBlockSize(std::string const& rPath) const override;
73 
74  void StoreWriteInfo(std::string const& rPath, WriteInfo const& rInfo) override;
75 
77 
78 private:
81 
83 
86  void WritePartitionIndex(const std::string& rPath, NodesContainerType const& rGhostNodes);
87 
88  void ReadAndAssignPartitionIndex(const std::string& rPath, ModelPart& rModelPart) const;
90 };
91 
94 } // namespace HDF5.
95 } // namespace Kratos.
96 
97 #endif // KRATOS_PARTITIONED_HDF5_MODEL_PART_IO_H_INCLUDED defined
A class for serial IO of a model part in HDF5.
Definition: hdf5_model_part_io.h:41
A class for partitioned IO of a model part in HDF5.
Definition: hdf5_partitioned_model_part_io.h:38
void StoreWriteInfo(std::string const &rPath, WriteInfo const &rInfo) override
Definition: hdf5_partitioned_model_part_io.cpp:163
bool ReadNodes(NodesContainerType &rNodes) override
This method reads the nodes from an array of nodes.
Definition: hdf5_partitioned_model_part_io.cpp:23
void WriteNodes(NodesContainerType const &rNodes) override
This method writes the nodes from an array of nodes.
Definition: hdf5_partitioned_model_part_io.cpp:41
void ReadModelPart(ModelPart &rModelPart) override
This method reads the model part.
Definition: hdf5_partitioned_model_part_io.cpp:77
ModelPartIO BaseType
Definition: hdf5_partitioned_model_part_io.h:46
std::tuple< unsigned, unsigned > StartIndexAndBlockSize(std::string const &rPath) const override
Definition: hdf5_partitioned_model_part_io.cpp:154
KRATOS_CLASS_POINTER_DEFINITION(PartitionedModelPartIO)
Pointer definition.
PartitionedModelPartIO(File::Pointer pFile, std::string const &rPrefix)
Constructor.
Definition: hdf5_partitioned_model_part_io.cpp:13
void Check()
Definition: hdf5_partitioned_model_part_io.cpp:87
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
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
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
Stores information about a dataset written to HDF5.
Definition: hdf5_file.h:44