Date: 2022-03-04T17:37:08+00:00

Actual source code: pgname.c

      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:    Notes:
     16:     Calls PetscObjectName() if a name has not yet been provided to the object.

     18:    Level: intermediate

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

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