diff --git a/cpp/full_code/kraichnan_field.cpp b/cpp/full_code/kraichnan_field.cpp index 212ba9b8184019b0ab24b45336ac15f7e5cf66d5..fcfcee106eda04558cc8fdf4e6904e0690ec6fde 100644 --- a/cpp/full_code/kraichnan_field.cpp +++ b/cpp/full_code/kraichnan_field.cpp @@ -136,12 +136,19 @@ int kraichnan_field<rnumber>::generate_random_velocity(void) make_gaussian_random_field( this->kk, this->velocity, - this->iteration, // not an ideal choice because resulting field sequence depends on MPI/OpenMP configuration + this->iteration, // not an ideal choice because resulting field sequence depends on MPI/OpenMP configuration. See note below this->spectrum_slope, this->spectrum_k_cutoff, this->spectrum_coefficient * 3./2.); // incompressibility projection factor // this->velocity is now in Fourier space // project divfree, requires field in Fourier space + // Note on the choice of random seed: + // If in the future the simulation will continue with a smaller number of total threads (number of processes times number of threads per process), + // then during that run some of the threads will be seeded with a seed that has already been used for a previous iteration. + // So some sequences of Fourier modes will be identical to sequences of Fourier modes that occured in the past. + // Also see implementation of "make_gaussian_random_field". + // One work-around would be to multiply "this->iteration" with 10 or so --- + // it is unlikely the simulation will be continued with less than 0.1 of the initial total number of threads. DEBUG_MSG("L2Norm before: %g\n", this->velocity->L2norm(this->kk)); this->kk->template project_divfree<rnumber>(this->velocity->get_cdata());