1 #define PETSC_DLL 2 3 #include "petscsys.h" /*I "petscsys.h" I*/ 4 5 #undef __FUNCT__ 6 #define __FUNCT__ "PetscObjectGetName" 7 /*@C 8 PetscObjectGetName - Gets a string name associated with a PETSc object. 9 10 Not Collective 11 12 Input Parameters: 13 + obj - the Petsc variable 14 Thus must be cast with a (PetscObject), for example, 15 PetscObjectGetName((PetscObject)mat,&name); 16 - name - the name associated with obj 17 18 Level: intermediate 19 20 Concepts: object name 21 22 .seealso: PetscObjectSetName() 23 @*/ 24 PetscErrorCode PETSC_DLLEXPORT PetscObjectGetName(PetscObject obj,const char *name[]) 25 { 26 PetscErrorCode ierr; 27 28 PetscFunctionBegin; 29 PetscValidHeader(obj,1); 30 PetscValidPointer(name,2); 31 if (!obj->name) { ierr = PetscObjectName(obj);CHKERRQ(ierr); } 32 *name = obj->name; 33 PetscFunctionReturn(0); 34 } 35 36