1 #define PETSC_DLL 2 3 #include "petsc.h" /*I "petsc.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 if (!obj) SETERRQ(PETSC_ERR_ARG_CORRUPT,"Null object"); 30 if (!name) SETERRQ(PETSC_ERR_ARG_BADPTR,"Void location for name"); 31 if (!obj->name) { 32 ierr = PetscObjectName(obj);CHKERRQ(ierr); 33 } 34 *name = obj->name; 35 PetscFunctionReturn(0); 36 } 37 38