1f97fa5f8SBarry Smith /* 23e3e4676SBarry Smith mathematical function module. 3f97fa5f8SBarry Smith */ 40a835dfdSSatish Balay #if !defined(__PETSCPF_H) 50a835dfdSSatish Balay #define __PETSCPF_H 6494233caSMatthew Knepley #include "petscvec.h" 7e9fa29b7SSatish Balay PETSC_EXTERN_CXX_BEGIN 8f97fa5f8SBarry Smith 9f97fa5f8SBarry Smith /* 10b0a32e0cSBarry Smith PPetscFList contains the list of preconditioners currently registered 113e3e4676SBarry Smith These are added with the PFRegisterDynamic() macro 12f97fa5f8SBarry Smith */ 13b0a32e0cSBarry Smith extern PetscFList PPetscFList; 14f97fa5f8SBarry Smith 15b9617806SBarry Smith /*E 16b9617806SBarry Smith PFType - Type of PETSc mathematical function, a string name 17b9617806SBarry Smith 18b9617806SBarry Smith Level: beginner 19b9617806SBarry Smith 20b9617806SBarry Smith .seealso: PFSetType(), PF 21b9617806SBarry Smith E*/ 2249773a63SBarry Smith #define PFType char* 233e3e4676SBarry Smith #define PFCONSTANT "constant" 243e3e4676SBarry Smith #define PFMAT "mat" 253eda8832SBarry Smith #define PFSTRING "string" 263eda8832SBarry Smith #define PFQUICK "quick" 2774637425SBarry Smith #define PFIDENTITY "identity" 2874637425SBarry Smith #define PFMATLAB "matlab" 29f97fa5f8SBarry Smith 30b9617806SBarry Smith /*S 31b9617806SBarry Smith PF - Abstract PETSc mathematical function 32f97fa5f8SBarry Smith 33b9617806SBarry Smith Level: beginner 34b9617806SBarry Smith 35b9617806SBarry Smith Concepts: functions 36b9617806SBarry Smith 37b9617806SBarry Smith .seealso: PFCreate(), PFDestroy(), PFSetType(), PFApply(), PFApplyVec(), PFSet(), PFType 38b9617806SBarry Smith S*/ 39b9617806SBarry Smith typedef struct _p_PF* PF; 40b9617806SBarry Smith 41*6849ba73SBarry Smith extern PetscCookie PF_COOKIE; 42f97fa5f8SBarry Smith 43dfbe8321SBarry Smith EXTERN PetscErrorCode PFCreate(MPI_Comm,int,int,PF*); 44dfbe8321SBarry Smith EXTERN PetscErrorCode PFSetType(PF,const PFType,void*); 45*6849ba73SBarry Smith EXTERN PetscErrorCode PFSet(PF,PetscErrorCode(*)(void*,int,PetscScalar*,PetscScalar*),PetscErrorCode(*)(void*,Vec,Vec),PetscErrorCode(*)(void*,PetscViewer),PetscErrorCode(*)(void*),void*); 46dfbe8321SBarry Smith EXTERN PetscErrorCode PFApply(PF,int,PetscScalar*,PetscScalar*); 47dfbe8321SBarry Smith EXTERN PetscErrorCode PFApplyVec(PF,Vec,Vec); 48f97fa5f8SBarry Smith 49dfbe8321SBarry Smith EXTERN PetscErrorCode PFRegisterDestroy(void); 50dfbe8321SBarry Smith EXTERN PetscErrorCode PFRegisterAll(const char[]); 513eda8832SBarry Smith extern PetscTruth PFRegisterAllCalled; 52f97fa5f8SBarry Smith 53*6849ba73SBarry Smith EXTERN PetscErrorCode PFRegister(const char[],const char[],const char[],PetscErrorCode (*)(PF,void*)); 54f97fa5f8SBarry Smith #if defined(PETSC_USE_DYNAMIC_LIBRARIES) 553e3e4676SBarry Smith #define PFRegisterDynamic(a,b,c,d) PFRegister(a,b,c,0) 56f97fa5f8SBarry Smith #else 573e3e4676SBarry Smith #define PFRegisterDynamic(a,b,c,d) PFRegister(a,b,c,d) 58f97fa5f8SBarry Smith #endif 59f97fa5f8SBarry Smith 60dfbe8321SBarry Smith EXTERN PetscErrorCode PFDestroy(PF); 61dfbe8321SBarry Smith EXTERN PetscErrorCode PFSetFromOptions(PF); 62dfbe8321SBarry Smith EXTERN PetscErrorCode PFGetType(PF,PFType*); 63f97fa5f8SBarry Smith 64dfbe8321SBarry Smith EXTERN PetscErrorCode PFView(PF,PetscViewer); 65f97fa5f8SBarry Smith 663eda8832SBarry Smith #define PFSetOptionsPrefix(a,s) PetscObjectSetOptionsPrefix((PetscObject)(a),s) 67e9fa29b7SSatish Balay 68e9fa29b7SSatish Balay PETSC_EXTERN_CXX_END 69f97fa5f8SBarry Smith #endif 70