xref: /petsc/include/petscpf.h (revision 76bdecfb13ff6dcb09bbf73e6c929f447c427e71)
1f97fa5f8SBarry Smith /*
23e3e4676SBarry Smith       mathematical function module.
3f97fa5f8SBarry Smith */
40a835dfdSSatish Balay #if !defined(__PETSCPF_H)
50a835dfdSSatish Balay #define __PETSCPF_H
6494233caSMatthew Knepley #include "petscvec.h"
7e9fa29b7SSatish Balay PETSC_EXTERN_CXX_BEGIN
8f97fa5f8SBarry Smith 
9f97fa5f8SBarry Smith /*
101d280d73SBarry Smith     PFList contains the list of preconditioners currently registered
113e3e4676SBarry Smith    These are added with the PFRegisterDynamic() macro
12f97fa5f8SBarry Smith */
131d280d73SBarry Smith extern PetscFList PFList;
14f97fa5f8SBarry Smith 
15*76bdecfbSBarry Smith /*J
16b9617806SBarry Smith     PFType - Type of PETSc mathematical function, a string name
17b9617806SBarry Smith 
18b9617806SBarry Smith    Level: beginner
19b9617806SBarry Smith 
20b9617806SBarry Smith .seealso: PFSetType(), PF
21*76bdecfbSBarry Smith J*/
22a313700dSBarry Smith #define PFType char*
233e3e4676SBarry Smith #define PFCONSTANT      "constant"
243e3e4676SBarry Smith #define PFMAT           "mat"
253eda8832SBarry Smith #define PFSTRING        "string"
263eda8832SBarry Smith #define PFQUICK         "quick"
2774637425SBarry Smith #define PFIDENTITY      "identity"
2874637425SBarry Smith #define PFMATLAB        "matlab"
29f97fa5f8SBarry Smith 
30b9617806SBarry Smith /*S
31b9617806SBarry Smith      PF - Abstract PETSc mathematical function
32f97fa5f8SBarry Smith 
33b9617806SBarry Smith    Level: beginner
34b9617806SBarry Smith 
35b9617806SBarry Smith   Concepts: functions
36b9617806SBarry Smith 
37b9617806SBarry Smith .seealso:  PFCreate(), PFDestroy(), PFSetType(), PFApply(), PFApplyVec(), PFSet(), PFType
38b9617806SBarry Smith S*/
39b9617806SBarry Smith typedef struct _p_PF* PF;
40b9617806SBarry Smith 
410700a824SBarry Smith extern PetscClassId PF_CLASSID;
42f97fa5f8SBarry Smith 
437087cfbeSBarry Smith extern PetscErrorCode  PFCreate(MPI_Comm,PetscInt,PetscInt,PF*);
447087cfbeSBarry Smith extern PetscErrorCode  PFSetType(PF,const PFType,void*);
457087cfbeSBarry Smith extern PetscErrorCode  PFSet(PF,PetscErrorCode(*)(void*,PetscInt,const PetscScalar*,PetscScalar*),PetscErrorCode(*)(void*,Vec,Vec),PetscErrorCode(*)(void*,PetscViewer),PetscErrorCode(*)(void*),void*);
467087cfbeSBarry Smith extern PetscErrorCode  PFApply(PF,PetscInt,const PetscScalar*,PetscScalar*);
477087cfbeSBarry Smith extern PetscErrorCode  PFApplyVec(PF,Vec,Vec);
48f97fa5f8SBarry Smith 
497087cfbeSBarry Smith extern PetscErrorCode  PFRegisterDestroy(void);
507087cfbeSBarry Smith extern PetscErrorCode  PFRegisterAll(const char[]);
517087cfbeSBarry Smith extern PetscErrorCode  PFInitializePackage(const char[]);
52ace3abfcSBarry Smith extern PetscBool  PFRegisterAllCalled;
53f97fa5f8SBarry Smith 
547087cfbeSBarry Smith extern PetscErrorCode  PFRegister(const char[],const char[],const char[],PetscErrorCode (*)(PF,void*));
55f97fa5f8SBarry Smith #if defined(PETSC_USE_DYNAMIC_LIBRARIES)
563e3e4676SBarry Smith #define PFRegisterDynamic(a,b,c,d) PFRegister(a,b,c,0)
57f97fa5f8SBarry Smith #else
583e3e4676SBarry Smith #define PFRegisterDynamic(a,b,c,d) PFRegister(a,b,c,d)
59f97fa5f8SBarry Smith #endif
60f97fa5f8SBarry Smith 
616bf464f9SBarry Smith extern PetscErrorCode  PFDestroy(PF*);
627087cfbeSBarry Smith extern PetscErrorCode  PFSetFromOptions(PF);
637087cfbeSBarry Smith extern PetscErrorCode  PFGetType(PF,const PFType*);
64f97fa5f8SBarry Smith 
657087cfbeSBarry Smith extern PetscErrorCode  PFView(PF,PetscViewer);
66f97fa5f8SBarry Smith 
673eda8832SBarry Smith #define PFSetOptionsPrefix(a,s) PetscObjectSetOptionsPrefix((PetscObject)(a),s)
68e9fa29b7SSatish Balay 
69e9fa29b7SSatish Balay PETSC_EXTERN_CXX_END
70f97fa5f8SBarry Smith #endif
71