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

adds parameters for Gauss field test

parent fab7b536
No related branches found
No related tags found
No related merge requests found
...@@ -130,11 +130,12 @@ class TEST(_code): ...@@ -130,11 +130,12 @@ class TEST(_code):
pars['tracers0_neighbours'] = int(1) pars['tracers0_neighbours'] = int(1)
pars['tracers0_smoothness'] = int(1) pars['tracers0_smoothness'] = int(1)
if dns_type == 'Gauss_field_test': if dns_type == 'Gauss_field_test':
pars['histogram_bins'] = 129 pars['histogram_bins'] = int(129)
pars['max_velocity_estimate'] = 8. pars['max_velocity_estimate'] = float(8)
pars['spectrum_slope'] = 1. pars['spectrum_slope'] = float(-5./3)
pars['spectrum_k_cutoff'] = 16. pars['spectrum_k_cutoff'] = float(16)
pars['spectrum_coefficient'] = 1. pars['spectrum_coefficient'] = float(1)
pars['random_seed'] = int(1)
return pars return pars
def get_kspace(self): def get_kspace(self):
kspace = {} kspace = {}
......
...@@ -151,7 +151,11 @@ int Gauss_field_test<rnumber>::read_parameters() ...@@ -151,7 +151,11 @@ int Gauss_field_test<rnumber>::read_parameters()
(this->simname + std::string(".h5")).c_str(), (this->simname + std::string(".h5")).c_str(),
H5F_ACC_RDONLY, H5F_ACC_RDONLY,
H5P_DEFAULT); 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); H5Fclose(parameter_file);
return EXIT_SUCCESS; return EXIT_SUCCESS;
} }
...@@ -162,7 +166,13 @@ int Gauss_field_test<rnumber>::do_work(void) ...@@ -162,7 +166,13 @@ int Gauss_field_test<rnumber>::do_work(void)
TIMEZONE("Gauss_field_test::do_work"); TIMEZONE("Gauss_field_test::do_work");
/// initialize vector Gaussian random field /// 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 /// impose divergence free condition while maintaining the energy of the field
this->kk->template project_divfree<rnumber>(this->vector_field->get_cdata(), true); this->kk->template project_divfree<rnumber>(this->vector_field->get_cdata(), true);
......
...@@ -59,7 +59,11 @@ class Gauss_field_test: public test ...@@ -59,7 +59,11 @@ class Gauss_field_test: public test
public: public:
/* parameters that are read in read_parameters */ /* 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 */ /* other stuff */
kspace<FFTW, SMOOTH> *kk; kspace<FFTW, SMOOTH> *kk;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment