Skip to content
Snippets Groups Projects
Commit edc9be7b authored by Cristian Lalescu's avatar Cristian Lalescu
Browse files

add conversion functionality to bin-to-hdf5 tool

parent b6fd6847
Branches
Tags
1 merge request!21Bugfix/nansampling
Pipeline #
......@@ -12,18 +12,40 @@ int native_binary_to_hdf5<rnumber>::initialize(void)
nx, ny, nz,
this->comm,
DEFAULT_FFTW_FLAG);
this->vec_field->real_space_representation = false;
this->bin_IO = new field_binary_IO<rnumber, COMPLEX, THREE>(
this->vec_field->clayout->sizes,
this->vec_field->clayout->subsizes,
this->vec_field->clayout->starts,
this->vec_field->clayout->comm);
return EXIT_SUCCESS;
}
template <typename rnumber>
int native_binary_to_hdf5<rnumber>::work_on_current_iteration(void)
{
char itername[16];
sprintf(itername, "i%.5x", this->iteration);
std::string native_binary_fname = (
this->simname +
std::string("_cvorticity_") +
std::string(itername));
this->bin_IO->read(
native_binary_fname,
this->vec_field->get_cdata());
this->vec_field->io(
(native_binary_fname +
std::string(".h5")),
"vorticity",
this->iteration,
false);
return EXIT_SUCCESS;
}
template <typename rnumber>
int native_binary_to_hdf5<rnumber>::finalize(void)
{
delete this->bin_IO;
delete this->vec_field;
return EXIT_SUCCESS;
}
......
......
......@@ -33,6 +33,7 @@
#include <vector>
#include "base.hpp"
#include "field.hpp"
#include "field_binary_IO.hpp"
#include "full_code/postprocess.hpp"
template <typename rnumber>
......@@ -41,6 +42,7 @@ class native_binary_to_hdf5: public postprocess
public:
field<rnumber, FFTW, THREE> *vec_field;
field_binary_IO<rnumber, COMPLEX, THREE> *bin_IO;
native_binary_to_hdf5(
const MPI_Comm COMMUNICATOR,
......
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment