#include "petscsys.h" PetscErrorCode PetscRandomRegister(const char sname[], PetscErrorCode (*function)(PetscRandom))Not Collective
name | - The name of a new user-defined creation routine | |
create_func | - The creation routine itself |
PetscRandomRegister("my_rand", MyPetscRandomtorCreate);
Then, your random type can be chosen with the procedural interface via
PetscRandomCreate(MPI_Comm, PetscRandom *); PetscRandomSetType(PetscRandom,"my_random_name");or at runtime via the option
-random_type my_random_name
Notes: For an example of the code needed to interface your own random number generator see src/sys/random/impls/rand/rand.c
Level:advanced
Location:src/sys/classes/random/interface/randreg.c
Index of all Sys routines
Table of Contents for all manual pages
Index of all manual pages