xref: /petsc/include/petscpf.h (revision e6e75211d226c622f451867f53ce5d558649ff4f)
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   Concepts: functions
35 
36 .seealso:  PFCreate(), PFDestroy(), PFSetType(), PFApply(), PFApplyVec(), PFSet(), PFType
37 S*/
38 typedef struct _p_PF* PF;
39 
40 PETSC_EXTERN PetscClassId PF_CLASSID;
41 
42 PETSC_EXTERN PetscErrorCode PFCreate(MPI_Comm,PetscInt,PetscInt,PF*);
43 PETSC_EXTERN PetscErrorCode PFSetType(PF,PFType,void*);
44 PETSC_EXTERN PetscErrorCode PFSet(PF,PetscErrorCode(*)(void*,PetscInt,const PetscScalar*,PetscScalar*),PetscErrorCode(*)(void*,Vec,Vec),PetscErrorCode(*)(void*,PetscViewer),PetscErrorCode(*)(void*),void*);
45 PETSC_EXTERN PetscErrorCode PFApply(PF,PetscInt,const PetscScalar*,PetscScalar*);
46 PETSC_EXTERN PetscErrorCode PFApplyVec(PF,Vec,Vec);
47 
48 PETSC_EXTERN PetscErrorCode PFInitializePackage(void);
49 
50 PETSC_EXTERN PetscErrorCode PFRegister(const char[],PetscErrorCode (*)(PF,void*));
51 
52 PETSC_EXTERN PetscErrorCode PFDestroy(PF*);
53 PETSC_EXTERN PetscErrorCode PFSetFromOptions(PF);
54 PETSC_EXTERN PetscErrorCode PFGetType(PF,PFType*);
55 
56 PETSC_EXTERN PetscErrorCode PFView(PF,PetscViewer);
57 PETSC_STATIC_INLINE PetscErrorCode PFViewFromOptions(PF A,PetscObject obj,const char name[]) {return PetscObjectViewFromOptions((PetscObject)A,obj,name);}
58 
59 #define PFSetOptionsPrefix(a,s) PetscObjectSetOptionsPrefix((PetscObject)(a),s)
60 
61 #endif
62