Actual source code: gtype.c

  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: /*@C
  8:    PetscObjectGetType - Gets the object type of any PetscObject.

 10:    Not Collective

 12:    Input Parameter:
 13: .  obj - any PETSc object, for example a Vec, Mat or KSP.
 14:          Thus must be cast with a (PetscObject), for example, 
 15:          PetscObjectGetType((PetscObject)mat,&type);

 17:    Output Parameter:
 18: .  type - the object type

 20:    Level: advanced

 22:    Concepts: object type

 24: @*/
 25: int PetscObjectGetType(PetscObject obj,int *type)
 26: {
 28:   if (!obj) SETERRQ(PETSC_ERR_ARG_CORRUPT,"Null object");
 29:   *type = obj->type;
 30:   return(0);
 31: }