xref: /petsc/include/petscpf.h (revision f236b2ad18af65eafb1995156e06d20e80c6f49d)
1f97fa5f8SBarry Smith /*
23e3e4676SBarry Smith       mathematical function module.
3f97fa5f8SBarry Smith */
46524c165SJacob Faibussowitsch #ifndef PETSCPF_H
526bd1501SBarry Smith #define PETSCPF_H
6ac09b921SBarry Smith 
72c8e378dSBarry Smith #include <petscvec.h>
8f97fa5f8SBarry Smith 
9ac09b921SBarry Smith /* SUBMANSEC = PF */
10ac09b921SBarry Smith 
11f97fa5f8SBarry Smith /*
1237e93019SBarry Smith     PFList contains the list of mathematical functions currently registered
13bdf89e91SBarry Smith    These are added with PFRegister()
14f97fa5f8SBarry Smith */
1537e93019SBarry Smith PETSC_EXTERN PetscFunctionList PFList;
16f97fa5f8SBarry Smith 
1776bdecfbSBarry Smith /*J
18b9617806SBarry Smith     PFType - Type of PETSc mathematical function, a string name
19b9617806SBarry Smith 
20b9617806SBarry Smith    Level: beginner
21b9617806SBarry Smith 
22db781477SPatrick Sanan .seealso: `PFSetType()`, `PF`
2376bdecfbSBarry Smith J*/
2419fd82e9SBarry Smith typedef const char *PFType;
253e3e4676SBarry Smith #define PFCONSTANT "constant"
263e3e4676SBarry Smith #define PFMAT      "mat"
273eda8832SBarry Smith #define PFSTRING   "string"
283eda8832SBarry Smith #define PFQUICK    "quick"
2974637425SBarry Smith #define PFIDENTITY "identity"
3074637425SBarry Smith #define PFMATLAB   "matlab"
31f97fa5f8SBarry Smith 
32b9617806SBarry Smith /*S
3387497f52SBarry Smith      PF - Abstract PETSc mathematical function that can be evaluated with `PFApply()` and may be constructed at run time
34f97fa5f8SBarry Smith 
35b9617806SBarry Smith    Level: beginner
36b9617806SBarry Smith 
37db781477SPatrick Sanan .seealso: `PFCreate()`, `PFDestroy()`, `PFSetType()`, `PFApply()`, `PFApplyVec()`, `PFSet()`, `PFType`
38b9617806SBarry Smith S*/
39b9617806SBarry Smith typedef struct _p_PF *PF;
40b9617806SBarry Smith 
41014dd563SJed Brown PETSC_EXTERN PetscClassId PF_CLASSID;
42f97fa5f8SBarry Smith 
43014dd563SJed Brown PETSC_EXTERN PetscErrorCode PFCreate(MPI_Comm, PetscInt, PetscInt, PF *);
4419fd82e9SBarry Smith PETSC_EXTERN PetscErrorCode PFSetType(PF, PFType, void *);
45014dd563SJed Brown PETSC_EXTERN PetscErrorCode PFSet(PF, PetscErrorCode (*)(void *, PetscInt, const PetscScalar *, PetscScalar *), PetscErrorCode (*)(void *, Vec, Vec), PetscErrorCode (*)(void *, PetscViewer), PetscErrorCode (*)(void *), void *);
46014dd563SJed Brown PETSC_EXTERN PetscErrorCode PFApply(PF, PetscInt, const PetscScalar *, PetscScalar *);
47014dd563SJed Brown PETSC_EXTERN PetscErrorCode PFApplyVec(PF, Vec, Vec);
48f97fa5f8SBarry Smith 
49*f236b2adSBarry Smith PETSC_EXTERN PetscErrorCode PFStringSetFunction(PF, const char *);
50*f236b2adSBarry Smith 
51607a6623SBarry Smith PETSC_EXTERN PetscErrorCode PFInitializePackage(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)
63e9fa29b7SSatish Balay 
64f97fa5f8SBarry Smith #endif
65