Actual source code: pgname.c

petsc-3.8.4 2018-03-24
Report Typos and Errors

  2:  #include <petsc/private/petscimpl.h>

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

  7:    Not Collective unless object has not been named yet

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

 15:    Level: intermediate

 17:    Concepts: object name

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

 28:   PetscObjectName(obj);
 29:   *name = obj->name;
 30:   return(0);
 31: }