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

shift order of stats

Code now computes vorticity stats first, and then velocity stats.
This is relied upon in the `NSVEparticles` class later to avoid an FFT.
parent e917e06c
No related branches found
No related tags found
1 merge request!21Bugfix/nansampling
Pipeline #
...@@ -88,6 +88,16 @@ int NSVE<rnumber>::finalize(void) ...@@ -88,6 +88,16 @@ int NSVE<rnumber>::finalize(void)
return EXIT_SUCCESS; return EXIT_SUCCESS;
} }
/** \brief Compute standard statistics for velocity and vorticity fields.
*
* IMPORTANT: at the end of this subroutine, `this->fs->cvelocity` contains
* the Fourier space representation of the velocity field, and
* `this->tmp_vec_field` contains the real space representation of the
* velocity field.
* This behavior is relied upon in the `NSVEparticles` class, so please
* don't break it.
*/
template <typename rnumber> template <typename rnumber>
int NSVE<rnumber>::do_stats() int NSVE<rnumber>::do_stats()
{ {
...@@ -101,22 +111,23 @@ int NSVE<rnumber>::do_stats() ...@@ -101,22 +111,23 @@ int NSVE<rnumber>::do_stats()
H5P_DEFAULT); H5P_DEFAULT);
else else
stat_group = 0; stat_group = 0;
fs->compute_velocity(fs->cvorticity);
*tmp_vec_field = fs->cvelocity->get_cdata(); *tmp_vec_field = fs->cvorticity->get_cdata();
tmp_vec_field->compute_stats( tmp_vec_field->compute_stats(
fs->kk, fs->kk,
stat_group, stat_group,
"velocity", "vorticity",
fs->iteration / niter_stat, fs->iteration / niter_stat,
max_velocity_estimate/sqrt(3)); max_vorticity_estimate/sqrt(3));
*tmp_vec_field = fs->cvorticity->get_cdata(); fs->compute_velocity(fs->cvorticity);
*tmp_vec_field = fs->cvelocity->get_cdata();
tmp_vec_field->compute_stats( tmp_vec_field->compute_stats(
fs->kk, fs->kk,
stat_group, stat_group,
"vorticity", "velocity",
fs->iteration / niter_stat, fs->iteration / niter_stat,
max_vorticity_estimate/sqrt(3)); max_velocity_estimate/sqrt(3));
if (this->myrank == 0) if (this->myrank == 0)
H5Gclose(stat_group); H5Gclose(stat_group);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment