Actual source code: pgname.c

 2:  #include petsc.h

  6: /*@C
  7:    PetscObjectGetName - Gets a string name associated with a PETSc object.

  9:    Not Collective

 11:    Input Parameters:
 12: +  obj - the Petsc variable
 13:          Thus must be cast with a (PetscObject), for example, 
 14:          PetscObjectGetName((PetscObject)mat,&name);
 15: -  name - the name associated with obj

 17:    Level: intermediate

 19:    Concepts: object name

 21: .seealso: PetscObjectSetName()
 22: @*/
 23: PetscErrorCode PetscObjectGetName(PetscObject obj,char *name[])
 24: {

 28:   if (!obj) SETERRQ(PETSC_ERR_ARG_CORRUPT,"Null object");
 29:   if (!name) SETERRQ(PETSC_ERR_ARG_BADPTR,"Void location for name");
 30:   if (!obj->name) {
 31:     PetscObjectName(obj);
 32:   }
 33:   *name = obj->name;
 34:   return(0);
 35: }