Actual source code: petscpf.h

  1: /*
  2:       mathematical function module.
  3: */
  4: #pragma once

  6: #include <petscvec.h>

  8: /* SUBMANSEC = PF */

 10: /*
 11:     PFList contains the list of mathematical functions currently registered
 12:    These are added with PFRegister()
 13: */
 14: PETSC_EXTERN PetscFunctionList PFList;

 16: /*J
 17:     PFType - Type of PETSc mathematical function, a string name

 19:    Level: beginner

 21: .seealso: `PFSetType()`, `PF`
 22: J*/
 23: typedef const char *PFType;
 24: #define PFCONSTANT "constant"
 25: #define PFMAT      "mat"
 26: #define PFSTRING   "string"
 27: #define PFQUICK    "quick"
 28: #define PFIDENTITY "identity"
 29: #define PFMATLAB   "matlab"

 31: /*S
 32:      PF - Abstract PETSc mathematical function that can be evaluated with `PFApply()` and may be constructed at run time (see `PFSTRING`)

 34:    Level: beginner

 36: .seealso: `PFCreate()`, `PFDestroy()`, `PFSetType()`, `PFApply()`, `PFApplyVec()`, `PFSet()`, `PFType`
 37: S*/
 38: typedef struct _p_PF *PF;

 40: PETSC_EXTERN PetscClassId PF_CLASSID;

 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);

 48: PETSC_EXTERN PetscErrorCode PFStringSetFunction(PF, const char *);

 50: PETSC_EXTERN PetscErrorCode PFInitializePackage(void);
 51: PETSC_EXTERN PetscErrorCode PFFinalizePackage(void);

 53: PETSC_EXTERN PetscErrorCode PFRegister(const char[], PetscErrorCode (*)(PF, void *));

 55: PETSC_EXTERN PetscErrorCode PFDestroy(PF *);
 56: PETSC_EXTERN PetscErrorCode PFSetFromOptions(PF);
 57: PETSC_EXTERN PetscErrorCode PFGetType(PF, PFType *);

 59: PETSC_EXTERN PetscErrorCode PFView(PF, PetscViewer);
 60: PETSC_EXTERN PetscErrorCode PFViewFromOptions(PF, PetscObject, const char[]);

 62: #define PFSetOptionsPrefix(a, s) PetscObjectSetOptionsPrefix((PetscObject)(a), s)