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