:orphan: # PetscDrawRegister Adds a method to the graphics package. ## Synopsis ``` #include "petscdraw.h" #include "petscviewer.h" PetscErrorCode PetscDrawRegister(const char *sname, PetscErrorCode (*function)(PetscDraw)) ``` Not Collective ## Input Parameters - ***name_solver -*** name of a new user-defined graphics class - ***routine_create -*** routine to create method context ## Note `PetscDrawRegister()` may be called multiple times to add several user-defined graphics classes ## Sample usage ```none PetscDrawRegister("my_draw_type", MyDrawCreate); ``` Then, your specific graphics package can be chosen with the procedural interface via ```none PetscDrawSetType(ksp, "my_draw_type") ``` or at runtime via the option ```none -draw_type my_draw_type ``` ## See Also `PetscDraw`, `PetscDrawRegisterAll()`, `PetscDrawRegisterDestroy()`, `PetscDrawType`, `PetscDrawSetType()` ## Level developer ## Location src/sys/classes/draw/interface/drawreg.c --- [Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/sys/classes/draw/interface/drawreg.c) [Index of all Draw routines](index.md) [Table of Contents for all manual pages](/manualpages/index.md) [Index of all manual pages](/manualpages/singleindex.md)