petsc-3.4.5 2014-06-29


Creates a PETSc object of a particular class, indicated by tp


#define PetscHeaderCreate(h,tp,pops,classid,class_name,descr,mansec,com,des,vie) \
  (PetscNew(struct tp,&(h)) ||                                                  \
   PetscNew(PetscOps,&(((PetscObject)(h))->bops)) ||                            \
   PetscNew(pops,&((h)->ops)) ||                                                \
   PetscHeaderCreate_Private((PetscObject)h,classid,class_name,descr,mansec,com,(PetscObjectFunction)des,(PetscObjectViewerFunction)vie) || \
   PetscLogObjectCreate(h) ||                                                   \
   PetscLogObjectMemory(h, sizeof(struct tp) + sizeof(PetscOps) + sizeof(pops)))

PETSC_EXTERN PetscErrorCode PetscComposedQuantitiesDestroy(PetscObject obj);
PETSC_EXTERN PetscErrorCode PetscHeaderCreate_Private(PetscObject,PetscClassId,const char[],const char[],const char[],MPI_Comm,PetscErrorCode (*)(PetscObject*),PetscErrorCode (*)(PetscObject,PetscViewer));

    PetscHeaderDestroy - Final step in destroying a PetscObject

    Input Parameters:
.   h - the header created with PetscHeaderCreate()


   Developer Note: This currently is a CPP macro because it accesses (*h)->ops which is a field in the derived class but not the PetscObject base class

.seealso: PetscHeaderCreate()
#define PetscHeaderDestroy(h)                         \
  (PetscHeaderDestroy_Private((PetscObject)(*h)) ||   \
   PetscFree((*h)->ops) ||                            \

PETSC_EXTERN PetscErrorCode PetscHeaderDestroy_Private(PetscObject);
PETSC_EXTERN PetscErrorCode PetscObjectCopyFortranFunctionPointers(PetscObject,PetscObject);
PETSC_EXTERN PetscErrorCode PetscObjectSetFortranCallback(PetscObject,PetscFortranCallbackType,PetscFortranCallbackId*,void(*)(void),void *ctx);
PETSC_EXTERN PetscErrorCode PetscObjectGetFortranCallback(PetscObject,PetscFortranCallbackType,PetscFortranCallbackId,void(**)(void),void **ctx);

PETSC_INTERN PetscErrorCode PetscOptionsFindPair_Private(const char[],const char[],char**,PetscBool*);

PETSC_EXTERN PetscBool PetscCheckPointer(const void*,PetscDataType);

    Macros to test if a PETSc object is valid and if pointers are valid
#if !defined(PETSC_USE_DEBUG)

#define PetscValidHeaderSpecific(h,ck,arg) do

Input Parameters

tp - the data structure type of the object (for example _p_Vec)
pops - the data structure type of the objects operations (for example VecOps)
classid - the classid associated with this object (for example VEC_CLASSID)
class_name - string name of class; should be static (for example "Vec")
com - the MPI Communicator
des - the destroy routine for this object (for example VecDestroy())
vie - the view routine for this object (for example VecView())

Output Parameter

h -the newly created object

Developer Note: This currently is a CPP macro because it takes the types (for example _p_Vec and VecOps) as arguments

See Also

PetscHeaderDestroy(), PetscClassIdRegister()

Index of all Sys routines
Table of Contents for all manual pages
Index of all manual pages