1 /* $Id: petscpf.h,v 1.12 2001/08/06 21:19:07 bsmith Exp $ */ 2 3 /* 4 mathematical function module. 5 */ 6 #if !defined(__PETSCPF_H) 7 #define __PETSCPF_H 8 #include "petscvec.h" 9 10 /* 11 PPetscFList contains the list of preconditioners currently registered 12 These are added with the PFRegisterDynamic() macro 13 */ 14 extern PetscFList PPetscFList; 15 16 /*E 17 PFType - Type of PETSc mathematical function, a string name 18 19 Level: beginner 20 21 .seealso: PFSetType(), PF 22 E*/ 23 typedef char *PFType; 24 #define PFCONSTANT "constant" 25 #define PFMAT "mat" 26 #define PFSTRING "string" 27 #define PFQUICK "quick" 28 #define PFIDENTITY "identity" 29 #define PFMATLAB "matlab" 30 31 /*S 32 PF - Abstract PETSc mathematical function 33 34 Level: beginner 35 36 Concepts: functions 37 38 .seealso: PFCreate(), PFDestroy(), PFSetType(), PFApply(), PFApplyVec(), PFSet(), PFType 39 S*/ 40 typedef struct _p_PF* PF; 41 42 extern int PF_COOKIE; 43 44 EXTERN int PFCreate(MPI_Comm,int,int,PF*); 45 EXTERN int PFSetType(PF,PFType,void*); 46 EXTERN int PFSet(PF,int(*)(void*,int,PetscScalar*,PetscScalar*),int(*)(void*,Vec,Vec),int(*)(void*,PetscViewer),int(*)(void*),void*); 47 EXTERN int PFApply(PF,int,PetscScalar*,PetscScalar*); 48 EXTERN int PFApplyVec(PF,Vec,Vec); 49 50 EXTERN int PFRegisterDestroy(void); 51 EXTERN int PFRegisterAll(char*); 52 extern PetscTruth PFRegisterAllCalled; 53 54 EXTERN int PFRegister(char*,char*,char*,int(*)(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 int PFDestroy(PF); 62 EXTERN int PFSetFromOptions(PF); 63 EXTERN int PFGetType(PF,PFType*); 64 65 EXTERN int PFView(PF,PetscViewer); 66 67 #define PFSetOptionsPrefix(a,s) PetscObjectSetOptionsPrefix((PetscObject)(a),s) 68 #endif 69 70 71 72 73