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`. 13 Thus must be cast with a (`PetscObject`), for example, 14 `PetscObjectGetType`((`PetscObject`)mat,&type); 15 16 Output Parameter: 17 . type - the object type, for example, `MATSEQAIJ` 18 19 Level: advanced 20 21 .seealso: `PetscObject`, `PetscClassId`, `PetscObjectGetClassName()`, `PetscObjectGetClassId()` 22 @*/ 23 PetscErrorCode PetscObjectGetType(PetscObject obj, const char *type[]) 24 { 25 PetscFunctionBegin; 26 PetscValidHeader(obj, 1); 27 PetscAssertPointer(type, 2); 28 *type = obj->type_name; 29 PetscFunctionReturn(PETSC_SUCCESS); 30 } 31