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_container_component_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 // Suneth Warnakulasuriya, https://github.com/sunethwarna
12 //
13 
14 #if !defined(KRATOS_HDF5_CONTAINER_COMPONENT_IO_H_INCLUDED)
15 #define KRATOS_HDF5_CONTAINER_COMPONENT_IO_H_INCLUDED
16 
17 // System includes
18 #include <string>
19 #include <vector>
20 
21 // External includes
22 
23 // Project includes
24 #include "includes/define.h"
25 
26 // Application includes
27 #include "custom_io/hdf5_file.h"
29 
30 namespace Kratos
31 {
32 class Parameters;
33 
34 namespace HDF5
35 {
38 
41 
43 template <typename TContainerType, typename TContainerItemType, typename... TComponents>
44 class KRATOS_API(HDF5_APPLICATION) ContainerComponentIO
45 {
46 public:
49 
52 
56 
58  ContainerComponentIO(Parameters Settings, File::Pointer pFile, const std::string& rComponentPath);
59 
63 
65 
66 protected:
69 
70  File::Pointer mpFile;
71 
72  std::vector<std::string> mComponentNames;
73 
74  std::string mComponentPath;
75 
79 
80  void WriteContainerComponents(TContainerType const& rContainerItems);
81 
82  void ReadContainerComponents(TContainerType& rContainerItems, Communicator& rCommunicator);
83 
85 
86 private:
89 
90  template <typename... Targs>
91  void WriteRegisteredComponent(const std::string& rComponentName, Targs&... args);
92 
93  template <typename... Targs>
94  void ReadRegisteredComponent(const std::string& rComponentName, Targs&... args);
95 
97 
98 }; // class ContainerComponentIO.
99 
100 
103 } // namespace HDF5.
104 } // namespace Kratos.
105 
106 #endif // KRATOS_HDF5_CONTAINER_COMPONENT_IO_H_INCLUDED defined
The Commmunicator class manages communication for distributed ModelPart instances.
Definition: communicator.h:67
A class for IO of element data in HDF5.
Definition: hdf5_container_component_io.h:45
File::Pointer mpFile
Definition: hdf5_container_component_io.h:70
KRATOS_CLASS_POINTER_DEFINITION(ContainerComponentIO)
Pointer definition.
std::string mComponentPath
Definition: hdf5_container_component_io.h:74
std::vector< std::string > mComponentNames
Definition: hdf5_container_component_io.h:72
This class provides to Kratos a data structure for I/O based on the standard of JSON.
Definition: kratos_parameters.h:59
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
args
Definition: generate_gid_list_file.py:37