Skip to main content
`Ctrl`+`K`

# PetscDSGetContext

Returns the context that was passed by `PetscDSSetContext()`

## Synopsis

    #include "petscds.h"
    PetscErrorCode PetscDSGetContext(PetscDS ds, PetscInt f, PetscCtxRt ctx)

Not Collective

## Input Parameters

- ds - The `PetscDS`

- f - The field number

- ctx - the context

## 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

`PetscDS`, `PetscPointFn`, `PetscDSSetContext()`

## Level

intermediate

## Location

src/dm/dt/interface/dtds.c

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