36 #ifndef NEKTAR_LIB_UTILITIES_BASIC_UTILS_FIELDIOHDF5_H
37 #define NEKTAR_LIB_UTILITIES_BASIC_UTILS_FIELDIOHDF5_H
45 namespace LibUtilities
62 :
doc(H5::File::Open(fn, H5F_ACC_RDONLY, parallelProps))
108 void SetAttr(
const std::string &key,
const std::string &val)
110 m_Group->SetAttribute(key, val);
216 bool sharedFilesystem);
241 const std::string &outFile,
242 std::vector<FieldDefinitionsSharedPtr> &fielddefs,
243 std::vector<std::vector<NekDouble> > &fielddata,
245 const bool backup =
false);
248 const std::string &infilename,
249 std::vector<FieldDefinitionsSharedPtr> &fielddefs,
250 std::vector<std::vector<NekDouble> > &fielddata =
264 std::vector<uint64_t> &decomps,
275 std::vector<uint64_t> &decomps,
278 std::vector<NekDouble> &fielddata);
boost::shared_ptr< H5DataSource > H5DataSourceSharedPtr
H5::GroupSharedPtr m_Group
HDF5 group for this tag.
const H5::FileSharedPtr Get() const
Get H5::FileSharedPtr reference to file.
boost::shared_ptr< Group > GroupSharedPtr
boost::shared_ptr< H5TagWriter > H5TagWriterSharedPtr
FieldIOHdf5(LibUtilities::CommSharedPtr pComm, bool sharedFilesystem)
Construct the FieldIO object for HDF5 output.
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 boost::shared_ptr< DataType > AllocateSharedPtr()
Allocate a shared pointer from the memory pool.
H5::FileSharedPtr doc
HDF5 document.
virtual 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)
Write a HDF5 file to outFile given the field definitions fielddefs, field data fielddata and metadata...
H5TagWriter(H5::GroupSharedPtr grp)
Default constructor.
static const unsigned int MAX_DCMPS
A helper for FieldIOHdf5::v_Write. Describes the maximum number of items in the decomposition per fie...
static const unsigned int HOMS_IDX_IDX
A helper for FieldIOHdf5::v_Write. Describes the position of the number of homogeneous strips within ...
boost::shared_ptr< FieldDefinitions > FieldDefinitionsSharedPtr
static const unsigned int ORDER_IDX_IDX
A helper for FieldIOHdf5::v_Write. Describes the position of the element order within the indexing se...
boost::shared_ptr< DataSet > DataSetSharedPtr
void ImportHDF5FieldMetaData(DataSourceSharedPtr dataSource, FieldMetaDataMap &fieldmetadatamap)
Import field metadata from dataSource.
boost::shared_ptr< File > FileSharedPtr
boost::shared_ptr< PList > PListSharedPtr
std::map< std::string, std::string > FieldMetaDataMap
boost::shared_ptr< DataSource > DataSourceSharedPtr
static const unsigned int HASH_DCMP_IDX
The hash of the field definition information, which defines the name of the attribute containing the ...
Base class for writing hierarchical data (XML or HDF5).
static DataSourceSharedPtr create(const std::string &fn, H5::PListSharedPtr parallelProps)
Static constructor for this data source.
boost::shared_ptr< Comm > CommSharedPtr
Pointer to a Communicator object.
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 FORMAT_VERSION
Version of the Nektar++ HDF5 format, which is embedded into the main NEKTAR group as an attribute...
boost::shared_ptr< DataSpace > DataSpaceSharedPtr
H5DataSource(const std::string &fn, H5::PListSharedPtr parallelProps)
Constructor based on filename.
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...
#define LIB_UTILITIES_EXPORT
static const unsigned int MAX_IDXS
A helper for FieldIOHdf5::v_Write. Describes the maximum number of items in the indexing set...
static std::vector< std::vector< NekDouble > > NullVectorNekDoubleVector
OffsetHelper(const OffsetHelper &in)
boost::shared_ptr< FieldIO > FieldIOSharedPtr
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 VAL_DCMP_IDX
A helper for FieldIOHdf5::v_Write and FieldIOHdf5::v_Import. Describes the position of the number of ...
static const unsigned int IDS_IDX_IDX
A helper for FieldIOHdf5::v_Write. Describes the position of the element IDs within the indexing set...
void SetAttr(const std::string &key, const std::string &val)
Set an attribute key/value pair on this tag.
static std::string className
Name of class.
virtual 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)
Import a HDF5 format file.
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...
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 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...
TagWriterSharedPtr AddChild(const std::string &name)
Add a child node.
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 DATA_IDX_IDX
A helper for FieldIOHdf5::v_Write. Describes the position of the data size within the indexing set...
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 HOMZ_DCMP_IDX
A helper for FieldIOHdf5::v_Write and FieldIOHdf5::v_Import. Describes the position of the number of ...
virtual const std::string & GetClassName() const
Get class name.
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 HOMZ_IDX_IDX
A helper for FieldIOHdf5::v_Write. Describes the position of the number of z-planes within the indexi...
void ImportFieldData(H5::PListSharedPtr readPL, H5::DataSetSharedPtr data_dset, H5::DataSpaceSharedPtr data_fspace, uint64_t data_i, std::vector< uint64_t > &decomps, uint64_t decomp, const FieldDefinitionsSharedPtr fielddef, std::vector< NekDouble > &fielddata)
Import the field data from the HDF5 document.
Class for operating on Nektar++ input/output files.
H5::FileSharedPtr Get()
Get H5::FileSharedPtr reference to file.
boost::shared_ptr< TagWriter > TagWriterSharedPtr
static FieldIOSharedPtr create(LibUtilities::CommSharedPtr pComm, bool sharedFilesystem)
Creates an instance of this class.
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 Array< OneD, int > NullInt1DArray
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 FieldMetaDataMap NullFieldMetaDataMap
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...
virtual DataSourceSharedPtr v_ImportFieldMetaData(const std::string &filename, FieldMetaDataMap &fieldmetadatamap)
Import field metadata from filename and return the data source which wraps filename.