1 #ifndef ceed_petscutils_h 2 #define ceed_petscutils_h 3 4 #include <ceed.h> 5 #include <petsc.h> 6 #include <petscdmplex.h> 7 #include <petscfe.h> 8 9 CeedMemType MemTypeP2C(PetscMemType mtype); 10 PetscErrorCode ProjectToUnitSphere(DM dm); 11 PetscErrorCode Kershaw(DM dm_orig, PetscScalar eps); 12 typedef PetscErrorCode (*BCFunction)(PetscInt dim, PetscReal time, 13 const PetscReal x[], 14 PetscInt num_comp_u, PetscScalar *u, void *ctx); 15 PetscErrorCode SetupDMByDegree(DM dm, PetscInt degree, PetscInt num_comp_u, 16 PetscInt topo_dim, 17 bool enforce_bc, BCFunction bc_func); 18 PetscErrorCode CreateRestrictionFromPlex(Ceed ceed, DM dm, CeedInt height, 19 DMLabel domain_label, CeedInt value, CeedElemRestriction *elem_restr); 20 21 #endif // petscutils_h 22