Hello,

I use Petsc random number generator. Every time I launch the code I get same random number, the code is like this:

  PetscRandom rnd;
  PetscRandomCreate(PETSC_COMM_WORLD,&rnd);
  PetscRandomSetType(rnd,PETSCRAND);

  PetscScalar r;
  PetscRandomGetValue(rnd,&r);

I would like to ask two questions. How could I get different random number? And what's the difference bewteen PETSCRAND and PETSCRAND48?

Thank you very much!

Feng XING

Reply via email to