1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62
|
/*
mathematical function module.
*/
#pragma once
#include <petscvec.h>
/* SUBMANSEC = PF */
/*
PFList contains the list of mathematical functions currently registered
These are added with PFRegister()
*/
PETSC_EXTERN PetscFunctionList PFList;
/*J
PFType - Type of PETSc mathematical function, a string name
Level: beginner
.seealso: `PFSetType()`, `PF`
J*/
typedef const char *PFType;
#define PFCONSTANT "constant"
#define PFMAT "mat"
#define PFSTRING "string"
#define PFQUICK "quick"
#define PFIDENTITY "identity"
#define PFMATLAB "matlab"
/*S
PF - Abstract PETSc mathematical function that can be evaluated with `PFApply()` and may be constructed at run time (see `PFSTRING`)
Level: beginner
.seealso: `PFCreate()`, `PFDestroy()`, `PFSetType()`, `PFApply()`, `PFApplyVec()`, `PFSet()`, `PFType`
S*/
typedef struct _p_PF *PF;
PETSC_EXTERN PetscClassId PF_CLASSID;
PETSC_EXTERN PetscErrorCode PFCreate(MPI_Comm, PetscInt, PetscInt, PF *);
PETSC_EXTERN PetscErrorCode PFSetType(PF, PFType, void *);
PETSC_EXTERN PetscErrorCode PFSet(PF, PetscErrorCode (*)(void *, PetscInt, const PetscScalar *, PetscScalar *), PetscErrorCode (*)(void *, Vec, Vec), PetscErrorCode (*)(void *, PetscViewer), PetscErrorCode (*)(void *), void *);
PETSC_EXTERN PetscErrorCode PFApply(PF, PetscInt, const PetscScalar *, PetscScalar *);
PETSC_EXTERN PetscErrorCode PFApplyVec(PF, Vec, Vec);
PETSC_EXTERN PetscErrorCode PFStringSetFunction(PF, const char *);
PETSC_EXTERN PetscErrorCode PFInitializePackage(void);
PETSC_EXTERN PetscErrorCode PFFinalizePackage(void);
PETSC_EXTERN PetscErrorCode PFRegister(const char[], PetscErrorCode (*)(PF, void *));
PETSC_EXTERN PetscErrorCode PFDestroy(PF *);
PETSC_EXTERN PetscErrorCode PFSetFromOptions(PF);
PETSC_EXTERN PetscErrorCode PFGetType(PF, PFType *);
PETSC_EXTERN PetscErrorCode PFView(PF, PetscViewer);
PETSC_EXTERN PetscErrorCode PFViewFromOptions(PF, PetscObject, const char[]);
#define PFSetOptionsPrefix(a, s) PetscObjectSetOptionsPrefix((PetscObject)(a), s)
|