1 #ifndef petscutils_h 2 #define 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 PetscFECreateByDegree(DM dm, PetscInt dim, PetscInt Nc, 11 PetscBool isSimplex, const char prefix[], 12 PetscInt order, PetscFE *fem); 13 PetscErrorCode ProjectToUnitSphere(DM dm); 14 PetscErrorCode Kershaw(DM dm_orig, PetscScalar eps); 15 typedef PetscErrorCode (*BCFunction)(PetscInt dim, PetscReal time, 16 const PetscReal x[], 17 PetscInt num_comp_u, PetscScalar *u, void *ctx); 18 PetscErrorCode SetupDMByDegree(DM dm, PetscInt degree, PetscInt num_comp_u, 19 PetscInt topo_dim, 20 bool enforce_bc, BCFunction bc_func); 21 PetscErrorCode CreateRestrictionFromPlex(Ceed ceed, DM dm, CeedInt P, 22 CeedInt topo_dim, CeedInt height, DMLabel domain_label, CeedInt value, 23 CeedElemRestriction *elem_restr); 24 25 #endif // petscutils_h 26