xref: /petsc/include/petscpf.h (revision 2fc52814d27bf1f4e71021c1c3ebb532b583ed60)
1 /* $Id: petscpf.h,v 1.12 2001/08/06 21:19:07 bsmith Exp $ */
2 
3 /*
4       mathematical function module.
5 */
6 #if !defined(__PETSCPF_H)
7 #define __PETSCPF_H
8 #include "petscvec.h"
9 PETSC_EXTERN_CXX_BEGIN
10 
11 /*
12     PPetscFList contains the list of preconditioners currently registered
13    These are added with the PFRegisterDynamic() macro
14 */
15 extern PetscFList PPetscFList;
16 
17 /*E
18     PFType - Type of PETSc mathematical function, a string name
19 
20    Level: beginner
21 
22 .seealso: PFSetType(), PF
23 E*/
24 #define PFType char*
25 #define PFCONSTANT      "constant"
26 #define PFMAT           "mat"
27 #define PFSTRING        "string"
28 #define PFQUICK         "quick"
29 #define PFIDENTITY      "identity"
30 #define PFMATLAB        "matlab"
31 
32 /*S
33      PF - Abstract PETSc mathematical function
34 
35    Level: beginner
36 
37   Concepts: functions
38 
39 .seealso:  PFCreate(), PFDestroy(), PFSetType(), PFApply(), PFApplyVec(), PFSet(), PFType
40 S*/
41 typedef struct _p_PF* PF;
42 
43 extern int PF_COOKIE;
44 
45 EXTERN int PFCreate(MPI_Comm,int,int,PF*);
46 EXTERN int PFSetType(PF,const PFType,void*);
47 EXTERN int PFSet(PF,int(*)(void*,int,PetscScalar*,PetscScalar*),int(*)(void*,Vec,Vec),int(*)(void*,PetscViewer),int(*)(void*),void*);
48 EXTERN int PFApply(PF,int,PetscScalar*,PetscScalar*);
49 EXTERN int PFApplyVec(PF,Vec,Vec);
50 
51 EXTERN int        PFRegisterDestroy(void);
52 EXTERN int        PFRegisterAll(const char[]);
53 extern PetscTruth PFRegisterAllCalled;
54 
55 EXTERN int PFRegister(const char[],const char[],const char[],int(*)(PF,void*));
56 #if defined(PETSC_USE_DYNAMIC_LIBRARIES)
57 #define PFRegisterDynamic(a,b,c,d) PFRegister(a,b,c,0)
58 #else
59 #define PFRegisterDynamic(a,b,c,d) PFRegister(a,b,c,d)
60 #endif
61 
62 EXTERN int PFDestroy(PF);
63 EXTERN int PFSetFromOptions(PF);
64 EXTERN int PFGetType(PF,PFType*);
65 
66 EXTERN int PFView(PF,PetscViewer);
67 
68 #define PFSetOptionsPrefix(a,s) PetscObjectSetOptionsPrefix((PetscObject)(a),s)
69 
70 PETSC_EXTERN_CXX_END
71 #endif
72