petsc-3.13.6 2020-09-29
Report Typos and Errors

PetscRandomSetFromOptions

Configures the random number generator from the options database.

Synopsis

#include "petscsys.h" 
PetscErrorCode  PetscRandomSetFromOptions(PetscRandom rnd)
Collective on PetscRandom

Input Parameter

rnd -The random number generator context

Options Database

-random_seed <integer> - provide a seed to the random number generater
-random_no_imaginary_part - makes the imaginary part of the random number zero, this is useful when you want the same code to produce the same result when run with real numbers or complex numbers for regression testing purposes

Notes

To see all options, run your program with the -help option. Must be called after PetscRandomCreate() but before the rnd is used.

See Also

PetscRandomCreate(), PetscRandomSetType()

Level

beginner

Location

src/sys/classes/random/interface/randomc.c

Examples

src/sys/classes/random/tutorials/ex1.c.html
src/sys/classes/random/tutorials/ex2.c.html
src/vec/vec/utils/tagger/tutorials/ex1.c.html
src/vec/vec/tutorials/performance.c.html
src/dm/field/tutorials/ex1.c.html
src/ksp/pc/tutorials/ex3.c.html
src/ksp/ksp/tutorials/ex5.c.html
src/ksp/ksp/tutorials/ex11.c.html
src/ksp/ksp/tutorials/ex18.c.html
src/ksp/ksp/tutorials/ex46.c.html
src/ksp/ksp/tutorials/ex52.c.html

Index of all Sys routines
Table of Contents for all manual pages
Index of all manual pages