1 /* 2 mathematical function module. 3 */ 4 #if !defined(PETSCPF_H) 5 #define PETSCPF_H 6 7 #include <petscvec.h> 8 9 /* SUBMANSEC = PF */ 10 11 /* 12 PFList contains the list of mathematical functions currently registered 13 These are added with PFRegister() 14 */ 15 PETSC_EXTERN PetscFunctionList PFList; 16 17 /*J 18 PFType - Type of PETSc mathematical function, a string name 19 20 Level: beginner 21 22 .seealso: `PFSetType()`, `PF` 23 J*/ 24 typedef const char *PFType; 25 #define PFCONSTANT "constant" 26 #define PFMAT "mat" 27 #define PFSTRING "string" 28 #define PFQUICK "quick" 29 #define PFIDENTITY "identity" 30 #define PFMATLAB "matlab" 31 32 /*S 33 PF - Abstract PETSc mathematical function that can be evaluated with `PFApply()` and may be constructed at run time 34 35 Level: beginner 36 37 .seealso: `PFCreate()`, `PFDestroy()`, `PFSetType()`, `PFApply()`, `PFApplyVec()`, `PFSet()`, `PFType` 38 S*/ 39 typedef struct _p_PF *PF; 40 41 PETSC_EXTERN PetscClassId PF_CLASSID; 42 43 PETSC_EXTERN PetscErrorCode PFCreate(MPI_Comm, PetscInt, PetscInt, PF *); 44 PETSC_EXTERN PetscErrorCode PFSetType(PF, PFType, void *); 45 PETSC_EXTERN PetscErrorCode PFSet(PF, PetscErrorCode (*)(void *, PetscInt, const PetscScalar *, PetscScalar *), PetscErrorCode (*)(void *, Vec, Vec), PetscErrorCode (*)(void *, PetscViewer), PetscErrorCode (*)(void *), void *); 46 PETSC_EXTERN PetscErrorCode PFApply(PF, PetscInt, const PetscScalar *, PetscScalar *); 47 PETSC_EXTERN PetscErrorCode PFApplyVec(PF, Vec, Vec); 48 49 PETSC_EXTERN PetscErrorCode PFInitializePackage(void); 50 51 PETSC_EXTERN PetscErrorCode PFRegister(const char[], PetscErrorCode (*)(PF, void *)); 52 53 PETSC_EXTERN PetscErrorCode PFDestroy(PF *); 54 PETSC_EXTERN PetscErrorCode PFSetFromOptions(PF); 55 PETSC_EXTERN PetscErrorCode PFGetType(PF, PFType *); 56 57 PETSC_EXTERN PetscErrorCode PFView(PF, PetscViewer); 58 PETSC_EXTERN PetscErrorCode PFViewFromOptions(PF, PetscObject, const char[]); 59 60 #define PFSetOptionsPrefix(a, s) PetscObjectSetOptionsPrefix((PetscObject)(a), s) 61 62 #endif 63