1 #ifndef libceed_petsc_examples_utils_h 2 #define libceed_petsc_examples_utils_h 3 4 #include <ceed.h> 5 #include <petsc.h> 6 7 #include "structs.h" 8 #if PETSC_VERSION_LT(3, 21, 0) 9 #define DMSetCoordinateDisc(a, b, c) DMProjectCoordinates(a, b) 10 #endif 11 12 CeedMemType MemTypeP2C(PetscMemType mtype); 13 PetscErrorCode Kershaw(DM dm_orig, PetscScalar eps); 14 PetscErrorCode SetupDMByDegree(DM dm, PetscInt p_degree, PetscInt q_extra, PetscInt num_comp_u, PetscInt topo_dim, bool enforce_bc); 15 PetscErrorCode CreateRestrictionFromPlex(Ceed ceed, DM dm, CeedInt height, DMLabel domain_label, CeedInt value, CeedElemRestriction *elem_restr); 16 CeedElemTopology ElemTopologyP2C(DMPolytopeType cell_type); 17 PetscErrorCode DMFieldToDSField(DM dm, DMLabel domain_label, PetscInt dm_field, PetscInt *ds_field); 18 PetscErrorCode BasisCreateFromTabulation(Ceed ceed, DM dm, DMLabel domain_label, PetscInt label_value, PetscInt height, PetscInt face, PetscFE fe, 19 PetscTabulation basis_tabulation, PetscQuadrature quadrature, CeedBasis *basis); 20 PetscErrorCode CreateBasisFromPlex(Ceed ceed, DM dm, DMLabel domain_label, CeedInt label_value, CeedInt height, CeedInt dm_field, BPData bp_data, 21 CeedBasis *basis); 22 PetscErrorCode CreateDistributedDM(RunParams rp, DM *dm); 23 24 #endif // libceed_petsc_examples_utils_h 25