Skip to main content
`Ctrl`+`K`

# PCShellGetContext

Returns the user-provided context associated with a shell `PC` that was provided with `PCShellSetContext()`

## Synopsis

    #include "petscpc.h"
    PetscErrorCode PCShellGetContext(PC pc, PetscCtxRt ctx)

Not Collective

## Input Parameter

- pc - of type `PCSHELL`

## Output Parameter

- ctx - the user provided context

## Note

This routine is intended for use within the various user-provided routines set with, for example, `PCShellSetApply()`

## Fortran Notes

This only works when the context is a Fortran derived type or a `PetscObject`. Define `ctx` with

      type(tUsertype), pointer :: ctx

## See Also

KSP: Linear System Solvers, `PC`, `PCSHELL`, `PCShellSetContext()`, `PCShellSetApply()`, `PCShellSetDestroy()`

## Level

advanced

## Location

src/ksp/pc/impls/shell/shellpc.c

## Examples

src/ksp/ksp/tutorials/ex15.c
src/ksp/pc/tutorials/ex4.c
src/tao/pde_constrained/tutorials/hyperbolic.c
src/ksp/ksp/tutorials/ex60.c
src/tao/pde_constrained/tutorials/parabolic.c

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