Files
karl/include/IO/hdf5_writer.h
T
csendlinger f6aae32288 added basic parallel output for the
string representation of the rng engine state
2024-08-23 16:39:03 +02:00

38 lines
1.4 KiB
C++
Executable File

#ifndef HDF5_WRITER_H
#define HDF5_WRITER_H
#include <string>
#include <vector>
#include "blitz/array.h"
class Hdf5Writer {
public:
Hdf5Writer(std::string directory = "./output",
std::string filename = "output");
void write(const blitz::Array<double, 1>& data, std::string path);
void write(const blitz::Array<double, 2>& data, std::string path);
void write(const blitz::Array<double, 3>& data, std::string path);
void write(const blitz::Array<double, 4>& data, std::string path);
void write(const blitz::Array<long int, 4>& data, std::string path);
void write(const blitz::TinyVector<double, 3>& data, std::string path);
void write(const blitz::TinyVector<int, 3>& data, std::string path);
void write(const std::vector<double>& data, std::string path);
void write(int data, std::string path);
void write(long int data, std::string path);
void write(double data, std::string path);
void write(const std::string& data, std::string path);
void writeRNG(const std::string& data, std::string path_base);
// void writeRNG(const std::string path_base);
private:
// right now from observations of the size of the statestring, whether best choice: uncertain
// also not sure if this length is platform-independent
const size_t stateStringSizeMax_ = 6730;
std::string absolute_filename_;
void createFolder(std::string directory);
void createFile(std::string absolute_filename);
};
#endif /* HDF5_WRITER_H */