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 dim; /* The spatial dimension */ 11 PetscInt numPoints; /* The number of quadrature points on an element */ 12 const PetscReal *points; /* The quadrature point coordinates */ 13 const PetscReal *weights; /* The quadrature weights */ 14 } PetscQuadrature; 15 16 typedef struct { 17 PetscReal *v0, *n, *J, *invJ, *detJ; 18 } PetscCellGeometry; 19 20 PETSC_EXTERN PetscErrorCode PetscDTLegendreEval(PetscInt,const PetscReal*,PetscInt,const PetscInt*,PetscReal*,PetscReal*,PetscReal*); 21 PETSC_EXTERN PetscErrorCode PetscDTGaussQuadrature(PetscInt,PetscReal,PetscReal,PetscReal*,PetscReal*); 22 PETSC_EXTERN PetscErrorCode PetscDTReconstructPoly(PetscInt,PetscInt,const PetscReal*,PetscInt,const PetscReal*,PetscReal*); 23 PETSC_EXTERN PetscErrorCode PetscDTGaussJacobiQuadrature(PetscInt,PetscInt,PetscReal,PetscReal,PetscQuadrature*); 24 PETSC_EXTERN PetscErrorCode PetscQuadratureView(PetscQuadrature,PetscViewer); 25 PETSC_EXTERN PetscErrorCode PetscQuadratureDestroy(PetscQuadrature*); 26 27 #endif 28