35#ifndef NEKTAR_LIB_UTILITIES_BASIC_UTILS_FIELDIOHDF5_H
36#define NEKTAR_LIB_UTILITIES_BASIC_UTILS_FIELDIOHDF5_H
59 :
doc(H5::File::Open(fn, H5F_ACC_RDONLY, parallelProps))
108 void v_SetAttr(
const std::string &key,
const std::string &val)
override
110 m_Group->SetAttribute(key, val);
215 bool sharedFilesystem);
223 const std::string &outFile,
224 std::vector<FieldDefinitionsSharedPtr> &fielddefs,
225 std::vector<std::vector<NekDouble>> &fielddata,
227 const bool backup =
false)
override;
230 const std::string &infilename,
231 std::vector<FieldDefinitionsSharedPtr> &fielddefs,
232 std::vector<std::vector<NekDouble>> &fielddata =
264 std::vector<uint64_t> &decomps, uint64_t decomp,
OffsetHelper offset,
#define LIB_UTILITIES_EXPORT
static const unsigned int ELEM_CNT_IDX
A helper for FieldIOHdf5::v_Write. Describes the position of the number of elements in the cnt array.
static FieldIOSharedPtr create(LibUtilities::CommSharedPtr pComm, bool sharedFilesystem)
Creates an instance of this class.
static const unsigned int MAX_CNTS
A helper for FieldIOHdf5::v_Write. Describes the maximum number of items in the cnt array per field d...
DataSourceSharedPtr v_ImportFieldMetaData(const std::string &filename, FieldMetaDataMap &fieldmetadatamap) override
Import field metadata from filename and return the data source which wraps filename.
const std::string & v_GetClassName() const override
Get class name.
void v_Write(const std::string &outFile, std::vector< FieldDefinitionsSharedPtr > &fielddefs, std::vector< std::vector< NekDouble > > &fielddata, const FieldMetaDataMap &fieldinfomap=NullFieldMetaDataMap, const bool backup=false) override
Write a HDF5 file to outFile given the field definitions fielddefs, field data fielddata and metadata...
static const unsigned int HOMY_CNT_IDX
A helper for FieldIOHdf5::v_Write. Describes the position of the number of homogeneous y-planes in th...
static std::string className
Name of class.
static const unsigned int ORDER_DCMP_IDX
A helper for FieldIOHdf5::v_Write and FieldIOHdf5::v_Import. Describes the position of the number of ...
static const unsigned int HOMZ_CNT_IDX
A helper for FieldIOHdf5::v_Write. Describes the position of the number of homogeneous z-planes in th...
static const unsigned int FORMAT_VERSION
Version of the Nektar++ HDF5 format, which is embedded into the main NEKTAR group as an attribute.
static const unsigned int HASH_DCMP_IDX
The hash of the field definition information, which defines the name of the attribute containing the ...
static const unsigned int HOMS_CNT_IDX
A helper for FieldIOHdf5::v_Write. Describes the position of the number of homogeneous strips in the ...
static const unsigned int VAL_CNT_IDX
A helper for FieldIOHdf5::v_Write. Describes the position of the number of data points in the cnt arr...
static const unsigned int IDS_IDX_IDX
A helper for FieldIOHdf5::v_Write. Describes the position of the element IDs within the indexing set.
static const unsigned int HOMS_DCMP_IDX
A helper for FieldIOHdf5::v_Write and FieldIOHdf5::v_Import. Describes the position of the number of ...
static const unsigned int ELEM_DCMP_IDX
A helper for FieldIOHdf5::v_Write and FieldIOHdf5::v_Import. Describes the position of the number of ...
static const unsigned int ORDER_CNT_IDX
A helper for FieldIOHdf5::v_Write. Describes the position of the number of order points in the cnt ar...
void ImportFieldDef(H5::PListSharedPtr readPL, H5::GroupSharedPtr root, std::vector< uint64_t > &decomps, uint64_t decomp, OffsetHelper offset, std::string group, FieldDefinitionsSharedPtr def)
Import field definitions from a HDF5 document.
static const unsigned int ORDER_IDX_IDX
A helper for FieldIOHdf5::v_Write. Describes the position of the element order within the indexing se...
static const unsigned int HOMZ_DCMP_IDX
A helper for FieldIOHdf5::v_Write and FieldIOHdf5::v_Import. Describes the position of the number of ...
static const unsigned int MAX_DCMPS
A helper for FieldIOHdf5::v_Write. Describes the maximum number of items in the decomposition per fie...
FieldIOHdf5(LibUtilities::CommSharedPtr pComm, bool sharedFilesystem)
Construct the FieldIO object for HDF5 output.
static const unsigned int MAX_IDXS
A helper for FieldIOHdf5::v_Write. Describes the maximum number of items in the indexing set.
void v_Import(const std::string &infilename, std::vector< FieldDefinitionsSharedPtr > &fielddefs, std::vector< std::vector< NekDouble > > &fielddata=NullVectorNekDoubleVector, FieldMetaDataMap &fieldinfomap=NullFieldMetaDataMap, const Array< OneD, int > &ElementIDs=NullInt1DArray) override
Import a HDF5 format file.
static const unsigned int VAL_DCMP_IDX
A helper for FieldIOHdf5::v_Write and FieldIOHdf5::v_Import. Describes the position of the number of ...
static const unsigned int DATA_IDX_IDX
A helper for FieldIOHdf5::v_Write. Describes the position of the data size within the indexing set.
void ImportHDF5FieldMetaData(DataSourceSharedPtr dataSource, FieldMetaDataMap &fieldmetadatamap)
Import field metadata from dataSource.
static const unsigned int HOMS_IDX_IDX
A helper for FieldIOHdf5::v_Write. Describes the position of the number of homogeneous strips within ...
static const unsigned int HOMY_DCMP_IDX
A helper for FieldIOHdf5::v_Write and FieldIOHdf5::v_Import. Describes the position of the number of ...
static const unsigned int HOMZ_IDX_IDX
A helper for FieldIOHdf5::v_Write. Describes the position of the number of z-planes within the indexi...
static const unsigned int HOMY_IDX_IDX
A helper for FieldIOHdf5::v_Write. Describes the position of the number of y-planes within the indexi...
Class for operating on Nektar++ input/output files.
H5DataSource(const std::string &fn, H5::PListSharedPtr parallelProps)
Constructor based on filename.
const H5::FileSharedPtr Get() const
Get H5::FileSharedPtr reference to file.
H5::FileSharedPtr Get()
Get H5::FileSharedPtr reference to file.
H5::FileSharedPtr doc
HDF5 document.
static DataSourceSharedPtr create(const std::string &fn, H5::PListSharedPtr parallelProps)
Static constructor for this data source.
TagWriterSharedPtr v_AddChild(const std::string &name) override
Add a child node.
H5::GroupSharedPtr m_Group
HDF5 group for this tag.
void v_SetAttr(const std::string &key, const std::string &val) override
Set an attribute key/value pair on this tag.
H5TagWriter(H5::GroupSharedPtr grp)
Default constructor.
Base class for writing hierarchical data (XML or HDF5).
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.
std::shared_ptr< PList > PListSharedPtr
std::shared_ptr< File > FileSharedPtr
std::shared_ptr< Group > GroupSharedPtr
std::shared_ptr< H5TagWriter > H5TagWriterSharedPtr
std::shared_ptr< TagWriter > TagWriterSharedPtr
std::shared_ptr< H5DataSource > H5DataSourceSharedPtr
std::shared_ptr< FieldIO > FieldIOSharedPtr
std::shared_ptr< DataSource > DataSourceSharedPtr
std::map< std::string, std::string > FieldMetaDataMap
static FieldMetaDataMap NullFieldMetaDataMap
static std::vector< std::vector< NekDouble > > NullVectorNekDoubleVector
std::shared_ptr< FieldDefinitions > FieldDefinitionsSharedPtr
std::shared_ptr< Comm > CommSharedPtr
Pointer to a Communicator object.
static Array< OneD, int > NullInt1DArray
OffsetHelper & operator=(const OffsetHelper &in)=default
OffsetHelper(const OffsetHelper &in)