1 /* 2 mathematical function module. 3 */ 4 #if !defined(__PETSCPF_H) 5 #define __PETSCPF_H 6 #include "petscvec.h" 7 PETSC_EXTERN_CXX_BEGIN 8 9 /* 10 PFList contains the list of preconditioners currently registered 11 These are added with the PFRegisterDynamic() macro 12 */ 13 extern PetscFList PFList; 14 15 /*J 16 PFType - Type of PETSc mathematical function, a string name 17 18 Level: beginner 19 20 .seealso: PFSetType(), PF 21 J*/ 22 #define PFType char* 23 #define PFCONSTANT "constant" 24 #define PFMAT "mat" 25 #define PFSTRING "string" 26 #define PFQUICK "quick" 27 #define PFIDENTITY "identity" 28 #define PFMATLAB "matlab" 29 30 /*S 31 PF - Abstract PETSc mathematical function 32 33 Level: beginner 34 35 Concepts: functions 36 37 .seealso: PFCreate(), PFDestroy(), PFSetType(), PFApply(), PFApplyVec(), PFSet(), PFType 38 S*/ 39 typedef struct _p_PF* PF; 40 41 extern PetscClassId PF_CLASSID; 42 43 extern PetscErrorCode PFCreate(MPI_Comm,PetscInt,PetscInt,PF*); 44 extern PetscErrorCode PFSetType(PF,const PFType,void*); 45 extern PetscErrorCode PFSet(PF,PetscErrorCode(*)(void*,PetscInt,const PetscScalar*,PetscScalar*),PetscErrorCode(*)(void*,Vec,Vec),PetscErrorCode(*)(void*,PetscViewer),PetscErrorCode(*)(void*),void*); 46 extern PetscErrorCode PFApply(PF,PetscInt,const PetscScalar*,PetscScalar*); 47 extern PetscErrorCode PFApplyVec(PF,Vec,Vec); 48 49 extern PetscErrorCode PFRegisterDestroy(void); 50 extern PetscErrorCode PFRegisterAll(const char[]); 51 extern PetscErrorCode PFInitializePackage(const char[]); 52 extern PetscBool PFRegisterAllCalled; 53 54 extern PetscErrorCode PFRegister(const char[],const char[],const char[],PetscErrorCode (*)(PF,void*)); 55 #if defined(PETSC_USE_DYNAMIC_LIBRARIES) 56 #define PFRegisterDynamic(a,b,c,d) PFRegister(a,b,c,0) 57 #else 58 #define PFRegisterDynamic(a,b,c,d) PFRegister(a,b,c,d) 59 #endif 60 61 extern PetscErrorCode PFDestroy(PF*); 62 extern PetscErrorCode PFSetFromOptions(PF); 63 extern PetscErrorCode PFGetType(PF,const PFType*); 64 65 extern PetscErrorCode PFView(PF,PetscViewer); 66 67 #define PFSetOptionsPrefix(a,s) PetscObjectSetOptionsPrefix((PetscObject)(a),s) 68 69 PETSC_EXTERN_CXX_END 70 #endif 71