diff --git a/cpp/field.cpp b/cpp/field.cpp index deae83aee744bf095e51a9dddd2053885aab9b16..2fd79ce4fe7d25f2f7f8bdae0a500ee40e0a8330 100644 --- a/cpp/field.cpp +++ b/cpp/field.cpp @@ -2119,13 +2119,13 @@ template <typename rnumber, int make_gaussian_random_field( kspace<be, dt> *kk, field<rnumber, be, fc> *output_field, + const int rseed, const double dissipation, const double Lint, const double etaK, const double c_L, const double c_eta, - const double coefficient, - const int rseed) + const double coefficient) { TIMEZONE("make_gaussian_random_field"); // initialize a separate random number generator for each thread @@ -2373,13 +2373,13 @@ template int make_gaussian_random_field< SMOOTH>( kspace<FFTW, SMOOTH> *kk, field<float, FFTW, ONE> *output_field, + const int rseed, const double dissipation, const double Lint, const double etaK, const double c_L, const double c_eta, - const double coefficient, - const int rseed); + const double coefficient); template int make_gaussian_random_field< double, FFTW, @@ -2387,13 +2387,13 @@ template int make_gaussian_random_field< SMOOTH>( kspace<FFTW, SMOOTH> *kk, field<double, FFTW, ONE> *output_field, + const int rseed, const double dissipation, const double Lint, const double etaK, const double c_L, const double c_eta, - const double coefficient, - const int rseed); + const double coefficient); template int make_gaussian_random_field< float, FFTW, @@ -2401,13 +2401,13 @@ template int make_gaussian_random_field< SMOOTH>( kspace<FFTW, SMOOTH> *kk, field<float, FFTW, THREE> *output_field, + const int rseed, const double dissipation, const double Lint, const double etaK, const double c_L, const double c_eta, - const double coefficient, - const int rseed); + const double coefficient); template int make_gaussian_random_field< double, FFTW, @@ -2415,11 +2415,11 @@ template int make_gaussian_random_field< SMOOTH>( kspace<FFTW, SMOOTH> *kk, field<double, FFTW, THREE> *output_field, + const int rseed, const double dissipation, const double Lint, const double etaK, const double c_L, const double c_eta, - const double coefficient, - const int rseed); + const double coefficient); diff --git a/cpp/field.hpp b/cpp/field.hpp index 3c109b29203c0bbd3d6af87313192bc50c3eb406..feb19c804766470197e37f66f8405d8b3bfb9c9f 100644 --- a/cpp/field.hpp +++ b/cpp/field.hpp @@ -430,13 +430,13 @@ template <typename rnumber, int make_gaussian_random_field( kspace<be, dt> *kk, field<rnumber, be, fc> *output_field, - const double dissipation, - const double Lint, - const double etaK, + const int rseed = 0, + const double dissipation = 0.3, + const double Lint = 1., + const double etaK = 0.01, const double c_L = 6.78, const double c_eta = 0.40, - const double coefficient = 1., - const int rseed = 0); + const double coefficient = 1.); #endif//FIELD_HPP diff --git a/cpp/full_code/Gauss_field_test.cpp b/cpp/full_code/Gauss_field_test.cpp index 8365ad2c24a8c3a8f72fb102943403d8bf1f21aa..2a045dfc038a5710c9165fe0e2f892781bfa1a39 100644 --- a/cpp/full_code/Gauss_field_test.cpp +++ b/cpp/full_code/Gauss_field_test.cpp @@ -101,13 +101,14 @@ int Gauss_field_test<rnumber>::do_work(void) make_gaussian_random_field( this->kk, this->vector_field, + this->random_seed, this->spectrum_dissipation, this->spectrum_Lint, this->spectrum_etaK, this->spectrum_large_scale_const, this->spectrum_small_scale_const, - 3./2., //incompressibility projection factor - this->random_seed); + 3./2. //incompressibility projection factor + ); /// impose divergence free condition while maintaining the energy of the field this->kk->template project_divfree<rnumber>(this->vector_field->get_cdata()); diff --git a/cpp/full_code/kraichnan_field.cpp b/cpp/full_code/kraichnan_field.cpp index bac9a4a5789ad362e187f5c1e8748d6040027ebd..b38956cf51e438e7a9d83fc89323cea1ee746b43 100644 --- a/cpp/full_code/kraichnan_field.cpp +++ b/cpp/full_code/kraichnan_field.cpp @@ -124,13 +124,14 @@ int kraichnan_field<rnumber>::generate_random_velocity(void) make_gaussian_random_field( this->kk, this->velocity, + this->field_random_seed + 10*this->iteration, this->spectrum_dissipation, this->spectrum_Lint, this->spectrum_etaK, this->spectrum_large_scale_const, this->spectrum_small_scale_const, - 3./2., // incompressibility projection factor - this->field_random_seed + 10*this->iteration); // not an ideal choice because resulting field sequence depends on MPI/OpenMP configuration. See note below + 3./2.); // incompressibility projection factor + // not an ideal choice because resulting field sequence depends on MPI/OpenMP configuration. See note below // this->velocity is now in Fourier space // project divfree, requires field in Fourier space // Note on the choice of random seed: