Skip to content
Snippets Groups Projects
Commit e9fecfa5 authored by sniklas142's avatar sniklas142
Browse files

added saving of vel moments and histogramm to ou_test

parent 5bcd6bc1
No related branches found
No related tags found
No related merge requests found
...@@ -380,7 +380,13 @@ class TEST(_code): ...@@ -380,7 +380,13 @@ class TEST(_code):
if (self.dns_type == 'ornstein_uhlenbeck_test'): if (self.dns_type == 'ornstein_uhlenbeck_test'):
with h5py.File(os.path.join(self.work_dir, self.simname + '_ou_output.h5'), 'a') as ofile: with h5py.File(os.path.join(self.work_dir, self.simname + '_ou_output.h5'), 'a') as ofile:
ofile.require_group('spectra') ofile.require_group('spectra')
ofile.require_group('moments')
ofile.require_group('histograms')
ofile['spectra'].create_dataset('ou_spectra', (1,300,3,3),dtype=np.float) ofile['spectra'].create_dataset('ou_spectra', (1,300,3,3),dtype=np.float)
ofile['moments'].create_dataset('ou', (1,10,3),dtype=np.float)
ofile['histograms'].create_dataset('ou', (1,128,3),dtype=np.float)
self.run( self.run(
nb_processes = opt.nb_processes, nb_processes = opt.nb_processes,
......
...@@ -4,7 +4,6 @@ ...@@ -4,7 +4,6 @@
#include "scope_timer.hpp" #include "scope_timer.hpp"
template <typename rnumber> template <typename rnumber>
int ornstein_uhlenbeck_test<rnumber>::initialize(void) int ornstein_uhlenbeck_test<rnumber>::initialize(void)
{ {
...@@ -67,19 +66,24 @@ int ornstein_uhlenbeck_test<rnumber>::do_work(void) ...@@ -67,19 +66,24 @@ int ornstein_uhlenbeck_test<rnumber>::do_work(void)
{ {
this->ou->step(1e-3); this->ou->step(1e-3);
} }
hid_t gg; hid_t out_file;
if (this->myrank == 0) { if (this->myrank == 0) {
gg = H5Fopen("test_ou_output.h5", H5F_ACC_RDWR, H5P_DEFAULT); out_file = H5Fopen("test_ou_output.h5", H5F_ACC_RDWR, H5P_DEFAULT);
std::cerr << "peep" << std::endl; //DELETE
} }
// if (this->myrank == 0) gt = H5Fopen((this->simname + std::string(".h5")).c_str(), H5F_ACC_RDWR, H5P_DEFAULT);
// this->ou->kk->store(gt);
this->ou->kk->template cospectrum<rnumber,THREE>( this->ou->kk->template cospectrum<rnumber,THREE>(
this->ou->ou_field->get_cdata(), this->ou->ou_field->get_cdata(),
this->ou->ou_field->get_cdata(), this->ou->ou_field->get_cdata(),
gg,"ou_spectra",0); out_file,"ou_spectra",0);
this->ou->ou_field->ift();
std::vector<double> me;
me.resize(3);
std::fill(me.begin(),me.end(),30);
// this->ou->ou_field->template compute_rspace_stats<rnumber, FFTW, THREE>(out_file, "ou", 0, me);
this->ou->ou_field->compute_rspace_stats(out_file, "ou", 0, me);
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