1f97fa5f8SBarry Smith /* 23e3e4676SBarry Smith mathematical function module. 3f97fa5f8SBarry Smith */ 4*26bd1501SBarry Smith #if !defined(PETSCPF_H) 5*26bd1501SBarry Smith #define PETSCPF_H 62c8e378dSBarry Smith #include <petscvec.h> 7f97fa5f8SBarry Smith 8f97fa5f8SBarry Smith /* 937e93019SBarry Smith PFList contains the list of mathematical functions currently registered 10bdf89e91SBarry Smith These are added with PFRegister() 11f97fa5f8SBarry Smith */ 1237e93019SBarry Smith PETSC_EXTERN PetscFunctionList PFList; 13f97fa5f8SBarry Smith 1476bdecfbSBarry Smith /*J 15b9617806SBarry Smith PFType - Type of PETSc mathematical function, a string name 16b9617806SBarry Smith 17b9617806SBarry Smith Level: beginner 18b9617806SBarry Smith 19b9617806SBarry Smith .seealso: PFSetType(), PF 2076bdecfbSBarry Smith J*/ 2119fd82e9SBarry Smith typedef const char* PFType; 223e3e4676SBarry Smith #define PFCONSTANT "constant" 233e3e4676SBarry Smith #define PFMAT "mat" 243eda8832SBarry Smith #define PFSTRING "string" 253eda8832SBarry Smith #define PFQUICK "quick" 2674637425SBarry Smith #define PFIDENTITY "identity" 2774637425SBarry Smith #define PFMATLAB "matlab" 28f97fa5f8SBarry Smith 29b9617806SBarry Smith /*S 30b9617806SBarry Smith PF - Abstract PETSc mathematical function 31f97fa5f8SBarry Smith 32b9617806SBarry Smith Level: beginner 33b9617806SBarry Smith 34b9617806SBarry Smith Concepts: functions 35b9617806SBarry Smith 36b9617806SBarry Smith .seealso: PFCreate(), PFDestroy(), PFSetType(), PFApply(), PFApplyVec(), PFSet(), PFType 37b9617806SBarry Smith S*/ 38b9617806SBarry Smith typedef struct _p_PF* PF; 39b9617806SBarry Smith 40014dd563SJed Brown PETSC_EXTERN PetscClassId PF_CLASSID; 41f97fa5f8SBarry Smith 42014dd563SJed Brown PETSC_EXTERN PetscErrorCode PFCreate(MPI_Comm,PetscInt,PetscInt,PF*); 4319fd82e9SBarry Smith PETSC_EXTERN PetscErrorCode PFSetType(PF,PFType,void*); 44014dd563SJed Brown PETSC_EXTERN PetscErrorCode PFSet(PF,PetscErrorCode(*)(void*,PetscInt,const PetscScalar*,PetscScalar*),PetscErrorCode(*)(void*,Vec,Vec),PetscErrorCode(*)(void*,PetscViewer),PetscErrorCode(*)(void*),void*); 45014dd563SJed Brown PETSC_EXTERN PetscErrorCode PFApply(PF,PetscInt,const PetscScalar*,PetscScalar*); 46014dd563SJed Brown PETSC_EXTERN PetscErrorCode PFApplyVec(PF,Vec,Vec); 47f97fa5f8SBarry Smith 48607a6623SBarry Smith PETSC_EXTERN PetscErrorCode PFInitializePackage(void); 49f97fa5f8SBarry Smith 50bdf89e91SBarry Smith PETSC_EXTERN PetscErrorCode PFRegister(const char[],PetscErrorCode (*)(PF,void*)); 51f97fa5f8SBarry Smith 52014dd563SJed Brown PETSC_EXTERN PetscErrorCode PFDestroy(PF*); 53014dd563SJed Brown PETSC_EXTERN PetscErrorCode PFSetFromOptions(PF); 5419fd82e9SBarry Smith PETSC_EXTERN PetscErrorCode PFGetType(PF,PFType*); 55f97fa5f8SBarry Smith 56014dd563SJed Brown PETSC_EXTERN PetscErrorCode PFView(PF,PetscViewer); 57685405a1SBarry Smith PETSC_STATIC_INLINE PetscErrorCode PFViewFromOptions(PF A,PetscObject obj,const char name[]) {return PetscObjectViewFromOptions((PetscObject)A,obj,name);} 58f97fa5f8SBarry Smith 593eda8832SBarry Smith #define PFSetOptionsPrefix(a,s) PetscObjectSetOptionsPrefix((PetscObject)(a),s) 60e9fa29b7SSatish Balay 61f97fa5f8SBarry Smith #endif 62