-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Working implementation for HDF5 writer
- Developed a singular interface for IO writers - Wrappers for HDF5 library based on the interface - Defined wavefield format - working implementation for HDF5 format
- Loading branch information
1 parent
b3def59
commit 304ba07
Showing
8 changed files
with
147 additions
and
199 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
#ifndef SPECFEM_IO_HDF5_IMPL_NATIVE_TYPE_TPP | ||
#define SPECFEM_IO_HDF5_IMPL_NATIVE_TYPE_TPP | ||
|
||
#include "H5Cpp.h" | ||
#include "native_type.hpp" | ||
#include <iostream> | ||
|
||
template <> struct specfem::IO::impl::HDF5::native_type<int> { | ||
static H5::IntType& type() { | ||
static H5::IntType type(H5::PredType::NATIVE_INT); | ||
type.setOrder(H5T_ORDER_LE); | ||
return type; | ||
} | ||
}; | ||
|
||
template <> struct specfem::IO::impl::HDF5::native_type<float> { | ||
static H5::FloatType& type() { | ||
static H5::FloatType type(H5::PredType::NATIVE_FLOAT); | ||
type.setOrder(H5T_ORDER_LE); | ||
return type; | ||
} | ||
}; | ||
|
||
template <> struct specfem::IO::impl::HDF5::native_type<double> { | ||
static H5::FloatType& type() { | ||
static H5::FloatType type(H5::PredType::NATIVE_DOUBLE); | ||
type.setOrder(H5T_ORDER_LE); | ||
return type; | ||
} | ||
}; | ||
|
||
template <> struct specfem::IO::impl::HDF5::native_type<long> { | ||
static H5::IntType& type() { | ||
static H5::IntType type(H5::PredType::NATIVE_LONG); | ||
type.setOrder(H5T_ORDER_LE); | ||
return type; | ||
} | ||
}; | ||
|
||
template <> struct specfem::IO::impl::HDF5::native_type<long long> { | ||
static H5::IntType& type() { | ||
static H5::IntType type(H5::PredType::NATIVE_LLONG); | ||
type.setOrder(H5T_ORDER_LE); | ||
return type; | ||
} | ||
}; | ||
|
||
template <> struct specfem::IO::impl::HDF5::native_type<unsigned int> { | ||
static H5::IntType& type() { | ||
static H5::IntType type(H5::PredType::NATIVE_UINT); | ||
type.setOrder(H5T_ORDER_LE); | ||
return type; | ||
} | ||
}; | ||
|
||
template <> struct specfem::IO::impl::HDF5::native_type<unsigned long> { | ||
static H5::IntType& type() { | ||
static H5::IntType type(H5::PredType::NATIVE_ULONG); | ||
type.setOrder(H5T_ORDER_LE); | ||
return type; | ||
} | ||
}; | ||
|
||
template <> struct specfem::IO::impl::HDF5::native_type<unsigned long long> { | ||
static H5::IntType& type() { | ||
static H5::IntType type(H5::PredType::NATIVE_ULLONG); | ||
type.setOrder(H5T_ORDER_LE); | ||
return type; | ||
} | ||
}; | ||
|
||
template <> struct specfem::IO::impl::HDF5::native_type<unsigned char> { | ||
static H5::IntType& type() { | ||
static H5::IntType type(H5::PredType::NATIVE_UCHAR); | ||
type.setOrder(H5T_ORDER_LE); | ||
return type; | ||
} | ||
}; | ||
|
||
template <> struct specfem::IO::impl::HDF5::native_type<char> { | ||
static H5::IntType& type() { | ||
static H5::IntType type(H5::PredType::NATIVE_CHAR); | ||
type.setOrder(H5T_ORDER_LE); | ||
return type; | ||
} | ||
}; | ||
|
||
template <> struct specfem::IO::impl::HDF5::native_type<short> { | ||
static H5::IntType& type() { | ||
static H5::IntType type(H5::PredType::NATIVE_SHORT); | ||
type.setOrder(H5T_ORDER_LE); | ||
return type; | ||
} | ||
}; | ||
|
||
template <> struct specfem::IO::impl::HDF5::native_type<unsigned short> { | ||
static H5::IntType& type() { | ||
static H5::IntType type(H5::PredType::NATIVE_USHORT); | ||
type.setOrder(H5T_ORDER_LE); | ||
return type; | ||
} | ||
}; | ||
|
||
template <> struct specfem::IO::impl::HDF5::native_type<bool> { | ||
static H5::IntType& type() { | ||
static H5::IntType type(H5::PredType::NATIVE_HBOOL); | ||
type.setOrder(H5T_ORDER_LE); | ||
return type; | ||
} | ||
}; | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,55 +1,31 @@ | ||
#include "IO/HDF5/impl/native_type.hpp" | ||
#include "H5Cpp.h" | ||
#include "IO/HDF5/impl/native_type.tpp" | ||
|
||
template <> | ||
const H5::PredType specfem::IO::impl::HDF5::native_type<float>::type = | ||
H5::PredType::NATIVE_FLOAT; | ||
// Explicit instantiation | ||
|
||
template <> | ||
const H5::PredType specfem::IO::impl::HDF5::native_type<double>::type = | ||
H5::PredType::NATIVE_DOUBLE; | ||
template struct specfem::IO::impl::HDF5::native_type<float>; | ||
|
||
template <> | ||
const H5::PredType specfem::IO::impl::HDF5::native_type<int>::type = | ||
H5::PredType::NATIVE_INT; | ||
template struct specfem::IO::impl::HDF5::native_type<double>; | ||
|
||
template <> | ||
const H5::PredType specfem::IO::impl::HDF5::native_type<long>::type = | ||
H5::PredType::NATIVE_LONG; | ||
template struct specfem::IO::impl::HDF5::native_type<int>; | ||
|
||
template <> | ||
const H5::PredType specfem::IO::impl::HDF5::native_type<long long>::type = | ||
H5::PredType::NATIVE_LLONG; | ||
template struct specfem::IO::impl::HDF5::native_type<long>; | ||
|
||
template <> | ||
const H5::PredType specfem::IO::impl::HDF5::native_type<unsigned int>::type = | ||
H5::PredType::NATIVE_UINT; | ||
template struct specfem::IO::impl::HDF5::native_type<long long>; | ||
|
||
template <> | ||
const H5::PredType specfem::IO::impl::HDF5::native_type<unsigned long>::type = | ||
H5::PredType::NATIVE_ULONG; | ||
template struct specfem::IO::impl::HDF5::native_type<unsigned int>; | ||
|
||
template <> | ||
const H5::PredType | ||
specfem::IO::impl::HDF5::native_type<unsigned long long>::type = | ||
H5::PredType::NATIVE_ULLONG; | ||
template struct specfem::IO::impl::HDF5::native_type<unsigned long>; | ||
|
||
template <> | ||
const H5::PredType specfem::IO::impl::HDF5::native_type<short>::type = | ||
H5::PredType::NATIVE_SHORT; | ||
template struct specfem::IO::impl::HDF5::native_type<unsigned long long>; | ||
|
||
template <> | ||
const H5::PredType specfem::IO::impl::HDF5::native_type<unsigned short>::type = | ||
H5::PredType::NATIVE_USHORT; | ||
template struct specfem::IO::impl::HDF5::native_type<short>; | ||
|
||
template <> | ||
const H5::PredType specfem::IO::impl::HDF5::native_type<char>::type = | ||
H5::PredType::NATIVE_CHAR; | ||
template struct specfem::IO::impl::HDF5::native_type<unsigned short>; | ||
|
||
template <> | ||
const H5::PredType specfem::IO::impl::HDF5::native_type<unsigned char>::type = | ||
H5::PredType::NATIVE_UCHAR; | ||
template struct specfem::IO::impl::HDF5::native_type<char>; | ||
|
||
template <> | ||
const H5::PredType specfem::IO::impl::HDF5::native_type<bool>::type = | ||
H5::PredType::NATIVE_HBOOL; | ||
template struct specfem::IO::impl::HDF5::native_type<unsigned char>; | ||
|
||
template struct specfem::IO::impl::HDF5::native_type<bool>; |
Oops, something went wrong.