When I was trying to generate a bunch of randomfields, I observed that the randomfield command was generating the same field again and again.
As it turned out, the seed for random numbers was set to default 1. The quick fix for that is as follows:
Get the current seconds as integers, feed that time as a seed to randomfield:
It happens that I am currently experiencing some troubles linked to this topic.
I would like to use specific values of the seed for use of the FlowField::addPerturbations function (as used in randomfield.cpp or perturbfield.cpp) for a parallelized flow field.
I observed that certain values of the seed (depending on the number of MPI tasksâŠ) made the addPerturbations function unable to end. I believe this is due to an MPI communication issue, but I am not able to fix it for the moment.
The problem appeared for both available addPerturbations functions :
void FlowField::addPerturbations(int Kx, int Kz, Real mag, Real decay, bool meanflow)
void FlowField::addPerturbations(Real mag, Real decay, bool meanflow)
Have you ever experienced this type of issues?
I would be happy to discuss if you have time.
Thank you in advance