Actual source code: gtype.c

  1: /*
  2:      Provides utility routines for manulating any type of PETSc object.
  3: */
 4:  #include petsc.h

  8: /*@C
  9:    PetscObjectGetType - Gets the object type of any PetscObject.

 11:    Not Collective

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

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

 21:    Note: This is being PHASED out; all classes derived from abstract classes instead have a
 22:          type_name

 24:    Level: advanced

 26:    Concepts: object type

 28: @*/
 29: PetscErrorCode PetscObjectGetType(PetscObject obj,int *type)
 30: {
 32:   if (!obj) SETERRQ(PETSC_ERR_ARG_CORRUPT,"Null object");
 33:   *type = obj->type;
 34:   return(0);
 35: }