1: /*$Id: gtype.c,v 1.24 2001/03/23 23:20:38 balay Exp $*/ 2: /* 3: Provides utility routines for manulating any type of PETSc object. 4: */ 5: #include petsc.h 7: #undef __FUNCT__ 9: /*@C 10: PetscObjectGetType - Gets the object type of any PetscObject. 12: Not Collective 14: Input Parameter: 15: . obj - any PETSc object, for example a Vec, Mat or KSP. 16: Thus must be cast with a (PetscObject), for example, 17: PetscObjectGetType((PetscObject)mat,&type); 19: Output Parameter: 20: . type - the object type 22: Level: advanced 24: Concepts: object type 26: @*/ 27: int PetscObjectGetType(PetscObject obj,int *type) 28: { 30: if (!obj) SETERRQ(PETSC_ERR_ARG_CORRUPT,"Null object"); 31: *type = obj->type; 32: return(0); 33: }