1f97fa5f8SBarry Smith /* 23e3e4676SBarry Smith mathematical function module. 3f97fa5f8SBarry Smith */ 4*a4963045SJacob Faibussowitsch #pragma once 5ac09b921SBarry Smith 62c8e378dSBarry Smith #include <petscvec.h> 7f97fa5f8SBarry Smith 8ac09b921SBarry Smith /* SUBMANSEC = PF */ 9ac09b921SBarry Smith 10f97fa5f8SBarry Smith /* 1137e93019SBarry Smith PFList contains the list of mathematical functions currently registered 12bdf89e91SBarry Smith These are added with PFRegister() 13f97fa5f8SBarry Smith */ 1437e93019SBarry Smith PETSC_EXTERN PetscFunctionList PFList; 15f97fa5f8SBarry Smith 1676bdecfbSBarry Smith /*J 17b9617806SBarry Smith PFType - Type of PETSc mathematical function, a string name 18b9617806SBarry Smith 19b9617806SBarry Smith Level: beginner 20b9617806SBarry Smith 21db781477SPatrick Sanan .seealso: `PFSetType()`, `PF` 2276bdecfbSBarry Smith J*/ 2319fd82e9SBarry Smith typedef const char *PFType; 243e3e4676SBarry Smith #define PFCONSTANT "constant" 253e3e4676SBarry Smith #define PFMAT "mat" 263eda8832SBarry Smith #define PFSTRING "string" 273eda8832SBarry Smith #define PFQUICK "quick" 2874637425SBarry Smith #define PFIDENTITY "identity" 2974637425SBarry Smith #define PFMATLAB "matlab" 30f97fa5f8SBarry Smith 31b9617806SBarry Smith /*S 3216a05f60SBarry Smith PF - Abstract PETSc mathematical function that can be evaluated with `PFApply()` and may be constructed at run time (see `PFSTRING`) 33f97fa5f8SBarry Smith 34b9617806SBarry Smith Level: beginner 35b9617806SBarry Smith 36db781477SPatrick Sanan .seealso: `PFCreate()`, `PFDestroy()`, `PFSetType()`, `PFApply()`, `PFApplyVec()`, `PFSet()`, `PFType` 37b9617806SBarry Smith S*/ 38b9617806SBarry Smith typedef struct _p_PF *PF; 39b9617806SBarry Smith 40014dd563SJed Brown PETSC_EXTERN PetscClassId PF_CLASSID; 41f97fa5f8SBarry Smith 42014dd563SJed Brown PETSC_EXTERN PetscErrorCode PFCreate(MPI_Comm, PetscInt, PetscInt, PF *); 4319fd82e9SBarry Smith PETSC_EXTERN PetscErrorCode PFSetType(PF, PFType, void *); 44014dd563SJed Brown PETSC_EXTERN PetscErrorCode PFSet(PF, PetscErrorCode (*)(void *, PetscInt, const PetscScalar *, PetscScalar *), PetscErrorCode (*)(void *, Vec, Vec), PetscErrorCode (*)(void *, PetscViewer), PetscErrorCode (*)(void *), void *); 45014dd563SJed Brown PETSC_EXTERN PetscErrorCode PFApply(PF, PetscInt, const PetscScalar *, PetscScalar *); 46014dd563SJed Brown PETSC_EXTERN PetscErrorCode PFApplyVec(PF, Vec, Vec); 47f97fa5f8SBarry Smith 48f236b2adSBarry Smith PETSC_EXTERN PetscErrorCode PFStringSetFunction(PF, const char *); 49f236b2adSBarry Smith 50607a6623SBarry Smith PETSC_EXTERN PetscErrorCode PFInitializePackage(void); 514bf303faSJacob Faibussowitsch PETSC_EXTERN PetscErrorCode PFFinalizePackage(void); 52f97fa5f8SBarry Smith 53bdf89e91SBarry Smith PETSC_EXTERN PetscErrorCode PFRegister(const char[], PetscErrorCode (*)(PF, void *)); 54f97fa5f8SBarry Smith 55014dd563SJed Brown PETSC_EXTERN PetscErrorCode PFDestroy(PF *); 56014dd563SJed Brown PETSC_EXTERN PetscErrorCode PFSetFromOptions(PF); 5719fd82e9SBarry Smith PETSC_EXTERN PetscErrorCode PFGetType(PF, PFType *); 58f97fa5f8SBarry Smith 59014dd563SJed Brown PETSC_EXTERN PetscErrorCode PFView(PF, PetscViewer); 60fe2efc57SMark PETSC_EXTERN PetscErrorCode PFViewFromOptions(PF, PetscObject, const char[]); 61f97fa5f8SBarry Smith 623eda8832SBarry Smith #define PFSetOptionsPrefix(a, s) PetscObjectSetOptionsPrefix((PetscObject)(a), s) 63