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

bugfix: get_rfields should use _post file

parent 01075923
No related branches found
No related tags found
1 merge request!23WIP: Feature/use cmake
Pipeline #
...@@ -674,10 +674,11 @@ class PP(_code): ...@@ -674,10 +674,11 @@ class PP(_code):
group = self.dns_type + '/parameters', group = self.dns_type + '/parameters',
parameters = self.pp_parameters, parameters = self.pp_parameters,
file_name = os.path.join(self.work_dir, self.simname + '_post.h5')) file_name = os.path.join(self.work_dir, self.simname + '_post.h5'))
histogram_bins = opt.histogram_bins if 'histogram_bins' in opt.__dict__.keys():
if (type(histogram_bins) == type(None) and histogram_bins = opt.histogram_bins
'histogram_bins' in self.pp_parameters.keys()): if (type(histogram_bins) == type(None) and
histogram_bins = self.pp_parameters['histogram_bins'] 'histogram_bins' in self.pp_parameters.keys()):
histogram_bins = self.pp_parameters['histogram_bins']
with h5py.File(os.path.join(self.work_dir, self.simname + '_post.h5'), 'r+') as ofile: with h5py.File(os.path.join(self.work_dir, self.simname + '_post.h5'), 'r+') as ofile:
group = ofile[self.dns_type] group = ofile[self.dns_type]
group.require_group('histograms') group.require_group('histograms')
......
...@@ -8,6 +8,7 @@ template <typename rnumber> ...@@ -8,6 +8,7 @@ template <typename rnumber>
int get_rfields<rnumber>::initialize(void) int get_rfields<rnumber>::initialize(void)
{ {
this->NSVE_field_stats<rnumber>::initialize(); this->NSVE_field_stats<rnumber>::initialize();
DEBUG_MSG("after NSVE_field_stats::initialize\n");
this->kk = new kspace<FFTW, SMOOTH>( this->kk = new kspace<FFTW, SMOOTH>(
this->vorticity->clayout, this->dkx, this->dky, this->dkz); this->vorticity->clayout, this->dkx, this->dky, this->dkz);
hid_t parameter_file = H5Fopen( hid_t parameter_file = H5Fopen(
...@@ -25,9 +26,15 @@ int get_rfields<rnumber>::initialize(void) ...@@ -25,9 +26,15 @@ int get_rfields<rnumber>::initialize(void)
} }
else else
this->checkpoints_per_file = 1; this->checkpoints_per_file = 1;
H5Fclose(parameter_file);
parameter_file = H5Fopen(
(this->simname + std::string("_post.h5")).c_str(),
H5F_ACC_RDONLY,
H5P_DEFAULT);
DEBUG_MSG("before read_vector\n");
this->iteration_list = hdf5_tools::read_vector<int>( this->iteration_list = hdf5_tools::read_vector<int>(
parameter_file, parameter_file,
"/get_rfields/iteration_list"); "/get_rfields/parameters/iteration_list");
H5Fclose(parameter_file); H5Fclose(parameter_file);
return EXIT_SUCCESS; return EXIT_SUCCESS;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment