:orphan: # DMGetDMKSP get read-only private `DMKSP` context from a `DM` ## Synopsis ``` #include "petscksp.h" PetscErrorCode DMGetDMKSP(DM dm, DMKSP *kspdm) ``` Logically Collective ## Input Parameter - ***dm -*** `DM` used with a `KSP` ## Output Parameter - ***snesdm -*** private `DMKSP` context ## Note Use `DMGetDMKSPWrite()` if write access is needed. The DMKSPSetXXX API should be used wherever possible. ## See Also [](ch_ksp), `DMKSP`, `DM`, `KSP`, `DMGetDMKSPWrite()` ## Level developer ## Location src/ksp/ksp/interface/dmksp.c --- [Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/ksp/ksp/interface/dmksp.c) [Index of all KSP routines](index.md) [Table of Contents for all manual pages](/manualpages/index.md) [Index of all manual pages](/manualpages/singleindex.md)