1 /* 2 Common tools for constructing discretizations 3 */ 4 #if !defined(__PETSCDT_H) 5 #define __PETSCDT_H 6 7 #include <petscsys.h> 8 9 typedef struct { 10 PetscInt numQuadPoints; /* The number of quadrature points on an element */ 11 const PetscReal *quadPoints; /* The quadrature point coordinates */ 12 const PetscReal *quadWeights; /* The quadrature weights */ 13 PetscInt numBasisFuncs; /* The number of finite element basis functions on an element */ 14 PetscInt numComponents; /* The number of components for each basis function */ 15 const PetscReal *basis; /* The basis functions tabulated at the quadrature points */ 16 const PetscReal *basisDer; /* The basis function derivatives tabulated at the quadrature points */ 17 } PetscQuadrature; 18 19 typedef struct { 20 PetscReal *v0, *n, *J, *invJ, *detJ; 21 } PetscCellGeometry; 22 23 PETSC_EXTERN PetscErrorCode PetscDTLegendreEval(PetscInt,const PetscReal*,PetscInt,const PetscInt*,PetscReal*,PetscReal*,PetscReal*); 24 PETSC_EXTERN PetscErrorCode PetscDTGaussQuadrature(PetscInt,PetscReal,PetscReal,PetscReal*,PetscReal*); 25 PETSC_EXTERN PetscErrorCode PetscDTReconstructPoly(PetscInt,PetscInt,const PetscReal*,PetscInt,const PetscReal*,PetscReal*); 26 PETSC_EXTERN PetscErrorCode PetscDTGaussJacobiQuadrature(PetscInt,PetscInt,PetscReal,PetscReal,PetscQuadrature*); 27 PETSC_EXTERN PetscErrorCode PetscQuadratureDestroy(PetscQuadrature*); 28 29 #endif 30