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_vertex_container_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: Máté Kelemen
11 //
12 
13 #ifndef KRATOS_HDF5APPLICATION_VERTEX_CONTAINER_IO_H
14 #define KRATOS_HDF5APPLICATION_VERTEX_CONTAINER_IO_H
15 
16 // Application includes
19 
20 
21 namespace Kratos
22 {
23 namespace HDF5
24 {
25 
26 
37 class KRATOS_API(HDF5_APPLICATION) VertexContainerIO : protected ContainerComponentIO<Detail::VertexContainerType,
38  Detail::Vertex,
39  Variable<array_1d<double, 3>>,
40  Variable<double>,
41  Variable<int>,
42  Variable<Vector<double>>,
43  Variable<Matrix<double>>>
44 {
45 public:
48 
51 
55 
56  VertexContainerIO(Parameters parameters, File::Pointer pFile);
57 
58  virtual ~VertexContainerIO() {}
59 
63 
64  virtual void Write(const Detail::VertexContainerType& rVertices) = 0;
65 
67 private:
75 
76  static Parameters GetDefaultParameters();
77 
78  static Parameters FormatParameters(Parameters parameters);
79 
80  static std::string GetPath(Parameters parameters);
81 
82 }; // class VertexContainerIO
83 
84 
85 
86 
101 class KRATOS_API(HDF5_APPLICATION) VertexContainerCoordinateIO final : public VertexContainerIO
102 {
103 public:
106 
109 
113 
114  VertexContainerCoordinateIO(Parameters parameters, File::Pointer pFile);
115 
119 
120  virtual void Write(const Detail::VertexContainerType& rVertices) override;
121 
123 
124 private:
127 
128  void WriteWithoutIDs(const Detail::VertexContainerType& rVertices);
129 
130  void WriteWithIDs(const Detail::VertexContainerType& rVertices);
131 
132  // Format input parameters for initializing the base class
133  static Parameters FormatParameters(Parameters parameters);
134 
135  static Parameters GetDefaultParameters();
136 
140 
141  bool mWriteIDs;
142 
144 }; // class VertexContainerCoordinateIO
145 
146 
147 
148 
161 class KRATOS_API(HDF5_APPLICATION) VertexContainerVariableIO final : public VertexContainerIO
162 {
163 public:
166 
169 
173 
175 
179 
180  virtual void Write(const Detail::VertexContainerType& rVertices) override;
181 
183 
184 private:
185  static Parameters GetDefaultParameters();
186 }; // class VertexContainerVariableIO
187 
188 
189 
190 
191 } // namespace HDF5
192 } // namespace Kratos
193 
194 
195 #endif
A class for IO of element data in HDF5.
Definition: hdf5_container_component_io.h:45
Definition: hdf5_vertex_container_io.h:102
KRATOS_CLASS_POINTER_DEFINITION(VertexContainerCoordinateIO)
Pointer definition.
Definition: hdf5_vertex_container_io.h:44
virtual ~VertexContainerIO()
Definition: hdf5_vertex_container_io.h:58
virtual void Write(const Detail::VertexContainerType &rVertices)=0
VertexContainerIO(Parameters parameters, File::Pointer pFile)
Definition: hdf5_vertex_container_io.cpp:23
KRATOS_CLASS_POINTER_DEFINITION(VertexContainerIO)
Pointer definition.
Definition: hdf5_vertex_container_io.h:162
KRATOS_CLASS_POINTER_DEFINITION(VertexContainerVariableIO)
Pointer definition.
This class provides to Kratos a data structure for I/O based on the standard of JSON.
Definition: kratos_parameters.h:59
PointerVector is a container like stl vector but using a vector to store pointers to its data.
Definition: pointer_vector.h:72
Variable class contains all information needed to store and retrive data from a data container.
Definition: variable.h:63
PointerVector< Vertex, Vertex::Pointer, std::vector< Vertex::Pointer > > VertexContainerType
Definition: vertex.h:111
Detail::Vertex Vertex
Definition: hdf5_container_component_io.cpp:18
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
parameters
Definition: fluid_chimera_analysis.py:35