Commit fa65db24 authored by Niklas Schnierstein's avatar Niklas Schnierstein Committed by Cristian Lalescu
Browse files

added time variable to seed calculation

parent 41732fc1
......@@ -4,7 +4,7 @@
#include <cassert>
#include "scope_timer.hpp"
#include <algorithm>
#include <chrono>
template <class rnumber,field_backend be>
......@@ -28,7 +28,7 @@ ornstein_uhlenbeck_process<rnumber,be>::ornstein_uhlenbeck_process(
this->ou_field = new field<rnumber,be,THREE>(
nx,ny,nz, MPI_COMM_WORLD, FFTW_PLAN_RIGOR);
*this->ou_field = 0.0;
this->ou_field->dft();
this->ou_field->dft();
this->ou_field_vort = new field<rnumber,be,THREE>(
nx,ny,nz, MPI_COMM_WORLD, FFTW_PLAN_RIGOR);
......@@ -46,19 +46,26 @@ ornstein_uhlenbeck_process<rnumber,be>::ornstein_uhlenbeck_process(
this->ou_energy_amplitude = ou_energy_amplitude;
this->epsilon = pow((this->ou_energy_amplitude/this->kolmogorov_constant), 3./2.);
assert(this->kk->kM2 >= this->ou_kmax_squ);
assert(this->kk->kM2 >= this->ou_kmax_squ);
gen.resize(omp_get_max_threads());
long now;
if (this->ou_field->clayout->myrank == 0){
now = std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::system_clock::now().time_since_epoch()).count();
}
MPI_Bcast(&now,1,MPI_LONG,0,this->ou_field->comm);
for(int thread=0;thread<omp_get_max_threads();thread++)
{
int current_seed =
long current_seed =
this->ou_field->clayout->myrank*omp_get_max_threads() +
thread;
thread+now;
gen[thread].seed(current_seed);
}
this->initialize_B();
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment