Commit 96308ee9 authored by Cristian Lalescu's avatar Cristian Lalescu
Browse files

add fine sampling option for particles

parent 4f907a45
......@@ -145,6 +145,8 @@ class DNS(_code):
# parameters specific to particle version
self.NSVEp_extra_parameters = {}
self.NSVEp_extra_parameters['niter_part'] = int(1)
self.NSVEp_extra_parameters['niter_part_fine_period'] = int(10)
self.NSVEp_extra_parameters['niter_part_fine_duration'] = int(0)
self.NSVEp_extra_parameters['nparticles'] = int(10)
self.NSVEp_extra_parameters['tracers0_integration_steps'] = int(4)
self.NSVEp_extra_parameters['tracers0_neighbours'] = int(1)
......
......@@ -99,7 +99,12 @@ int NSVEparticles<rnumber>::do_stats()
this->NSVE<rnumber>::do_stats();
if (!(this->iteration % this->niter_part == 0))
/// either one of two conditions suffices to compute statistics:
/// 1) current iteration is a multiple of niter_part
/// 2) we are within niter_part_fine_duration/2 of a multiple of niter_part_fine_period
if (!(this->iteration % this->niter_part == 0 ||
((this->iteration + this->niter_part_fine_duration/2) % this->niter_part_fine_period <=
this->niter_part_fine_duration)))
return EXIT_SUCCESS;
// allocate temporary data array
......@@ -167,6 +172,8 @@ int NSVEparticles<rnumber>::read_parameters(void)
this->NSVE<rnumber>::read_parameters();
hid_t parameter_file = H5Fopen((this->simname + ".h5").c_str(), H5F_ACC_RDONLY, H5P_DEFAULT);
this->niter_part = hdf5_tools::read_value<int>(parameter_file, "parameters/niter_part");
this->niter_part_fine_period = hdf5_tools::read_value<int>(parameter_file, "parameters/niter_part_fine_period");
this->niter_part_fine_duration = hdf5_tools::read_value<int>(parameter_file, "parameters/niter_part_fine_duration");
this->nparticles = hdf5_tools::read_value<int>(parameter_file, "parameters/nparticles");
this->tracers0_integration_steps = hdf5_tools::read_value<int>(parameter_file, "parameters/tracers0_integration_steps");
this->tracers0_neighbours = hdf5_tools::read_value<int>(parameter_file, "parameters/tracers0_neighbours");
......
......@@ -51,6 +51,8 @@ class NSVEparticles: public NSVE<rnumber>
/* parameters that are read in read_parameters */
int niter_part;
int niter_part_fine_period;
int niter_part_fine_duration;
int nparticles;
int tracers0_integration_steps;
int tracers0_neighbours;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment