Actual source code: gcookie.c
petsc-3.7.3 2016-08-01
2: /*
3: Provides utility routines for manulating any type of PETSc object.
4: */
5: #include <petsc/private/petscimpl.h> /*I "petscsys.h" I*/
9: /*@C
10: PetscObjectGetClassId - Gets the classid for any PetscObject
12: Not Collective
14: Input Parameter:
15: . obj - any PETSc object, for example a Vec, Mat or KSP.
16: Thus must be cast with a (PetscObject), for example,
17: PetscObjectGetClassId((PetscObject)mat,&classid);
19: Output Parameter:
20: . classid - the classid
22: Level: developer
24: @*/
25: PetscErrorCode PetscObjectGetClassId(PetscObject obj,PetscClassId *classid)
26: {
29: *classid = obj->classid;
30: return(0);
31: }
35: /*@C
36: PetscObjectGetClassName - Gets the class name for any PetscObject
38: Not Collective
40: Input Parameter:
41: . obj - any PETSc object, for example a Vec, Mat or KSP.
42: Thus must be cast with a (PetscObject), for example,
43: PetscObjectGetClassName((PetscObject)mat,&classname);
45: Output Parameter:
46: . classname - the class name
48: Level: developer
50: @*/
51: PetscErrorCode PetscObjectGetClassName(PetscObject obj, const char *classname[])
52: {
56: *classname = obj->class_name;
57: return(0);
58: }