diff --git a/TurTLE/TEST.py b/TurTLE/TEST.py index 4d74a97958a9517eb2fc9f7b17806e98c34b10f2..4db3dc15f6a9ecec036a11b36ce1c61de65a3f42 100644 --- a/TurTLE/TEST.py +++ b/TurTLE/TEST.py @@ -130,11 +130,12 @@ class TEST(_code): pars['tracers0_neighbours'] = int(1) pars['tracers0_smoothness'] = int(1) if dns_type == 'Gauss_field_test': - pars['histogram_bins'] = 129 - pars['max_velocity_estimate'] = 8. - pars['spectrum_slope'] = 1. - pars['spectrum_k_cutoff'] = 16. - pars['spectrum_coefficient'] = 1. + pars['histogram_bins'] = int(129) + pars['max_velocity_estimate'] = float(8) + pars['spectrum_slope'] = float(-5./3) + pars['spectrum_k_cutoff'] = float(16) + pars['spectrum_coefficient'] = float(1) + pars['random_seed'] = int(1) return pars def get_kspace(self): kspace = {} diff --git a/cpp/full_code/Gauss_field_test.cpp b/cpp/full_code/Gauss_field_test.cpp index f1d5531bd93a7ec8ae897281ad49629d2f8b828d..606d6069f028df43ea99812e1e83d7672b7976a3 100644 --- a/cpp/full_code/Gauss_field_test.cpp +++ b/cpp/full_code/Gauss_field_test.cpp @@ -151,7 +151,11 @@ int Gauss_field_test<rnumber>::read_parameters() (this->simname + std::string(".h5")).c_str(), H5F_ACC_RDONLY, H5P_DEFAULT); - this->filter_length = hdf5_tools::read_value<double>(parameter_file, "/parameters/filter_length"); + this->max_velocity_estimate = hdf5_tools::read_value<double>(parameter_file, "/parameters/max_velocity_estimate"); + this->spectrum_slope = hdf5_tools::read_value<double>(parameter_file, "/parameters/spectrum_slope"); + this->spectrum_k_cutoff = hdf5_tools::read_value<double>(parameter_file, "/parameters/spectrum_k_cutoff"); + this->spectrum_coefficient = hdf5_tools::read_value<double>(parameter_file, "/parameters/spectrum_coefficient"); + this->random_seed = hdf5_tools::read_value<int>(parameter_file, "/parameters/random_seed"); H5Fclose(parameter_file); return EXIT_SUCCESS; } @@ -162,7 +166,13 @@ int Gauss_field_test<rnumber>::do_work(void) TIMEZONE("Gauss_field_test::do_work"); /// initialize vector Gaussian random field - make_gaussian_random_field(this->kk, this->vector_field, 3); + make_gaussian_random_field( + this->kk, + this->vector_field, + this->random_seed, + this->spectrum_slope, + this->spectrum_k_cutoff, + this->spectrum_coefficient); /// impose divergence free condition while maintaining the energy of the field this->kk->template project_divfree<rnumber>(this->vector_field->get_cdata(), true); diff --git a/cpp/full_code/Gauss_field_test.hpp b/cpp/full_code/Gauss_field_test.hpp index 185351ccb863706cc46e28924cca01a9fb7932b5..68b9891809cf0cd016707047ca492827432a5a2c 100644 --- a/cpp/full_code/Gauss_field_test.hpp +++ b/cpp/full_code/Gauss_field_test.hpp @@ -59,7 +59,11 @@ class Gauss_field_test: public test public: /* parameters that are read in read_parameters */ - double filter_length; + double max_velocity_estimate; + double spectrum_slope; + double spectrum_k_cutoff; + double spectrum_coefficient; + int random_seed; /* other stuff */ kspace<FFTW, SMOOTH> *kk;