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_connectivities_data.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_CONNECTIVITIES_DATA_H_INCLUDED)
14 #define KRATOS_HDF5_CONNECTIVITIES_DATA_H_INCLUDED
15 
16 // System includes
17 #include <string>
18 
19 // External includes
20 
21 // Project includes
22 #include "includes/define.h"
23 
24 // Application includes
26 
27 namespace Kratos
28 {
29 namespace HDF5
30 {
31 
32 class File;
33 struct WriteInfo;
34 
35 namespace Internals
36 {
41 
43 
47 {
48 public:
53 
60  inline std::string const& Name() const
61  {
62  return mName;
63  }
64 
65  inline unsigned size() const
66  {
67  return mIds.size();
68  }
69 
71 
75  void ReadData(File& rFile, const std::string& rPath, unsigned StartIndex, unsigned BlockSize);
76 
78  void WriteData(File& rFile, const std::string& rPath, WriteInfo& rInfo);
79 
80  // Create and append new elements to the container.
82  PropertiesContainerType& rProperties,
83  ElementsContainerType& rElements) const;
84 
85  // Create and append new conditions to the container.
87  PropertiesContainerType& rProperties,
88  ConditionsContainerType& rConditions) const;
89 
90  // Fill data from elements of a single element type.
94  void SetData(ElementsContainerType const& rElements);
95 
96  // Fill data from elements of a single element type.
101  void SetData(const std::string& rName, ElementsContainerType const& rElements);
102 
103  // Fill data from conditions of a single condition type.
107  void SetData(ConditionsContainerType const& rConditions);
108 
109  // Fill data from conditions of a single condition type.
114  void SetData(const std::string& rName, ConditionsContainerType const& rConditions);
115 
116  void Clear();
118 private:
121  std::string mName;
122  Vector<int> mIds;
123  Vector<int> mPropertiesIds;
124  Matrix<int> mConnectivities;
126 }; // class ConnectivitiesData
127 
130 } // namespace Internals.
131 } // namespace HDF5.
132 } // namespace Kratos.
133 
134 #endif // KRATOS_HDF5_CONNECTIVITIES_DATA_H_INCLUDED defined
A base class for reading and writing an HDF5 file.
Definition: hdf5_file.h:57
Represents connectivities information of a single element or condition type in a mesh.
Definition: hdf5_connectivities_data.h:47
void Clear()
Definition: hdf5_connectivities_data.cpp:248
std::string const & Name() const
Definition: hdf5_connectivities_data.h:60
KRATOS_CLASS_POINTER_DEFINITION(ConnectivitiesData)
unsigned size() const
Definition: hdf5_connectivities_data.h:65
void WriteData(File &rFile, const std::string &rPath, WriteInfo &rInfo)
Write data to a file.
Definition: hdf5_connectivities_data.cpp:43
void SetData(ConditionsContainerType const &rConditions)
void ReadData(File &rFile, const std::string &rPath, unsigned StartIndex, unsigned BlockSize)
Read data from a file.
Definition: hdf5_connectivities_data.cpp:14
void CreateEntities(NodesContainerType &rNodes, PropertiesContainerType &rProperties, ConditionsContainerType &rConditions) const
void SetData(ElementsContainerType const &rElements)
Definition: hdf5_connectivities_data.cpp:127
void CreateEntities(NodesContainerType &rNodes, PropertiesContainerType &rProperties, ElementsContainerType &rElements) const
Definition: hdf5_connectivities_data.cpp:69
void SetData(const std::string &rName, ConditionsContainerType const &rConditions)
Definition: amatrix_interface.h:41
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