1f97fa5f8SBarry Smith /* 23e3e4676SBarry Smith mathematical function module. 3f97fa5f8SBarry Smith */ 426bd1501SBarry Smith #if !defined(PETSCPF_H) 526bd1501SBarry Smith #define PETSCPF_H 62c8e378dSBarry Smith #include <petscvec.h> 7f97fa5f8SBarry Smith 8f97fa5f8SBarry Smith /* 937e93019SBarry Smith PFList contains the list of mathematical functions currently registered 10bdf89e91SBarry Smith These are added with PFRegister() 11f97fa5f8SBarry Smith */ 1237e93019SBarry Smith PETSC_EXTERN PetscFunctionList PFList; 13f97fa5f8SBarry Smith 1476bdecfbSBarry Smith /*J 15b9617806SBarry Smith PFType - Type of PETSc mathematical function, a string name 16b9617806SBarry Smith 17b9617806SBarry Smith Level: beginner 18b9617806SBarry Smith 19b9617806SBarry Smith .seealso: PFSetType(), PF 2076bdecfbSBarry Smith J*/ 2119fd82e9SBarry Smith typedef const char* PFType; 223e3e4676SBarry Smith #define PFCONSTANT "constant" 233e3e4676SBarry Smith #define PFMAT "mat" 243eda8832SBarry Smith #define PFSTRING "string" 253eda8832SBarry Smith #define PFQUICK "quick" 2674637425SBarry Smith #define PFIDENTITY "identity" 2774637425SBarry Smith #define PFMATLAB "matlab" 28f97fa5f8SBarry Smith 29b9617806SBarry Smith /*S 30b9617806SBarry Smith PF - Abstract PETSc mathematical function 31f97fa5f8SBarry Smith 32b9617806SBarry Smith Level: beginner 33b9617806SBarry Smith 34b9617806SBarry Smith .seealso: PFCreate(), PFDestroy(), PFSetType(), PFApply(), PFApplyVec(), PFSet(), PFType 35b9617806SBarry Smith S*/ 36b9617806SBarry Smith typedef struct _p_PF* PF; 37b9617806SBarry Smith 38014dd563SJed Brown PETSC_EXTERN PetscClassId PF_CLASSID; 39f97fa5f8SBarry Smith 40014dd563SJed Brown PETSC_EXTERN PetscErrorCode PFCreate(MPI_Comm,PetscInt,PetscInt,PF*); 4119fd82e9SBarry Smith PETSC_EXTERN PetscErrorCode PFSetType(PF,PFType,void*); 42014dd563SJed Brown PETSC_EXTERN PetscErrorCode PFSet(PF,PetscErrorCode(*)(void*,PetscInt,const PetscScalar*,PetscScalar*),PetscErrorCode(*)(void*,Vec,Vec),PetscErrorCode(*)(void*,PetscViewer),PetscErrorCode(*)(void*),void*); 43014dd563SJed Brown PETSC_EXTERN PetscErrorCode PFApply(PF,PetscInt,const PetscScalar*,PetscScalar*); 44014dd563SJed Brown PETSC_EXTERN PetscErrorCode PFApplyVec(PF,Vec,Vec); 45f97fa5f8SBarry Smith 46607a6623SBarry Smith PETSC_EXTERN PetscErrorCode PFInitializePackage(void); 47f97fa5f8SBarry Smith 48bdf89e91SBarry Smith PETSC_EXTERN PetscErrorCode PFRegister(const char[],PetscErrorCode (*)(PF,void*)); 49f97fa5f8SBarry Smith 50014dd563SJed Brown PETSC_EXTERN PetscErrorCode PFDestroy(PF*); 51014dd563SJed Brown PETSC_EXTERN PetscErrorCode PFSetFromOptions(PF); 5219fd82e9SBarry Smith PETSC_EXTERN PetscErrorCode PFGetType(PF,PFType*); 53f97fa5f8SBarry Smith 54014dd563SJed Brown PETSC_EXTERN PetscErrorCode PFView(PF,PetscViewer); 55*fe2efc57SMark PETSC_EXTERN PetscErrorCode PFViewFromOptions(PF,PetscObject,const char[]); 56f97fa5f8SBarry Smith 573eda8832SBarry Smith #define PFSetOptionsPrefix(a,s) PetscObjectSetOptionsPrefix((PetscObject)(a),s) 58e9fa29b7SSatish Balay 59f97fa5f8SBarry Smith #endif 60