1 /* 2 Provides utility routines for manulating any type of PETSc object. 3 */ 4 #include <petsc/private/petscimpl.h> /*I "petscsys.h" I*/ 5 6 /*@C 7 PetscObjectGetType - Gets the object type of any `PetscObject`. 8 9 Not Collective 10 11 Input Parameter: 12 . obj - any PETSc object, for example a `Vec`, `Mat` or `KSP`. It must be cast with a (`PetscObject`), for example, 13 `PetscObjectGetType`((`PetscObject`)mat,&type); 14 15 Output Parameter: 16 . type - the object type, for example, `MATSEQAIJ` 17 18 Level: advanced 19 20 .seealso: `PetscObject`, `PetscClassId`, `PetscObjectGetClassName()`, `PetscObjectGetClassId()` 21 @*/ 22 PetscErrorCode PetscObjectGetType(PetscObject obj, const char *type[]) 23 { 24 PetscFunctionBegin; 25 PetscValidHeader(obj, 1); 26 PetscAssertPointer(type, 2); 27 *type = obj->type_name; 28 PetscFunctionReturn(PETSC_SUCCESS); 29 } 30