20 #ifndef GEOS_DATAREPOSITORY_CONDUITRESTART_HPP_
21 #define GEOS_DATAREPOSITORY_CONDUITRESTART_HPP_
28 #include <conduit.hpp>
35 #define CONDUIT_TYPE_INFO( T, CONDUIT_TYPE ) \
37 struct conduitTypeInfo< T > \
39 using type = CONDUIT_TYPE; \
40 static constexpr int id = CONDUIT_TYPE ## _ID; \
41 static constexpr int sizeOfConduitType = sizeof( type ); \
42 static constexpr int numConduitValues = sizeof( T ) / sizeOfConduitType; \
43 static_assert( sizeof( T ) % sizeOfConduitType == 0, #T " cannot be made made up of " #CONDUIT_TYPE "." ); \
48 namespace dataRepository
54 template<
typename T,
typename ENABLE =
void >
55 struct conduitTypeInfo
59 CONDUIT_TYPE_INFO(
char, CONDUIT_NATIVE_CHAR );
60 CONDUIT_TYPE_INFO(
signed char, CONDUIT_NATIVE_SIGNED_CHAR );
61 CONDUIT_TYPE_INFO(
unsigned char, CONDUIT_NATIVE_UNSIGNED_CHAR );
63 CONDUIT_TYPE_INFO(
short, CONDUIT_NATIVE_SHORT );
64 CONDUIT_TYPE_INFO(
int, CONDUIT_NATIVE_INT );
65 CONDUIT_TYPE_INFO(
long, CONDUIT_NATIVE_LONG );
66 CONDUIT_TYPE_INFO(
long long, CONDUIT_NATIVE_LONG_LONG );
68 CONDUIT_TYPE_INFO(
unsigned short, CONDUIT_NATIVE_UNSIGNED_SHORT );
69 CONDUIT_TYPE_INFO(
unsigned int, CONDUIT_NATIVE_UNSIGNED_INT );
70 CONDUIT_TYPE_INFO(
unsigned long, CONDUIT_NATIVE_UNSIGNED_LONG );
71 CONDUIT_TYPE_INFO(
unsigned long long, CONDUIT_NATIVE_UNSIGNED_LONG_LONG );
74 CONDUIT_TYPE_INFO(
float, CONDUIT_NATIVE_FLOAT );
75 CONDUIT_TYPE_INFO(
double, CONDUIT_NATIVE_DOUBLE );
78 template<
typename T >
79 struct conduitTypeInfo< T, std::enable_if_t< std::is_enum< T >::value > > :
public conduitTypeInfo< std::underlying_type_t< T > >
83 CONDUIT_TYPE_INFO(
R1Tensor, CONDUIT_NATIVE_DOUBLE );
84 CONDUIT_TYPE_INFO(
R1Tensor32, CONDUIT_NATIVE_FLOAT );
85 CONDUIT_TYPE_INFO(
R2SymTensor, CONDUIT_NATIVE_DOUBLE );
89 template<
typename T >
90 using conduitTypeInfo = internal::conduitTypeInfo< std::remove_const_t< std::remove_pointer_t< T > > >;
92 string writeRootFile( conduit::Node & root,
string const & rootPath );
94 void writeTree(
string const & path, conduit::Node & root );
96 void loadTree(
string const & path, conduit::Node & root );
Tensor< real32, 3 > R1Tensor32
Alias for a local (stack-based) rank-1 tensor type using 32 bits integers.
Tensor< real64, 3 > R1Tensor
Alias for a local (stack-based) rank-1 tensor type.
Tensor< real64, 6 > R2SymTensor
Alias for a local (stack-based) rank-2 Voigt tensor type.