xref: /libCEED/examples/petsc/include/petscutils.h (revision 49a40c8a2d720db341b0b117b89656b473cbebfb)
1b7c563b6SJeremy L Thompson #ifndef libceed_petsc_examples_utils_h
2b7c563b6SJeremy L Thompson #define libceed_petsc_examples_utils_h
3e83e87a5Sjeremylt 
4e83e87a5Sjeremylt #include <ceed.h>
5e83e87a5Sjeremylt #include <petsc.h>
62b730f8bSJeremy L Thompson 
7de1229c5Srezgarshakeri #include "structs.h"
8*49a40c8aSKenneth E. Jansen #if PETSC_VERSION_LT(3, 21, 0)
9*49a40c8aSKenneth E. Jansen #define DMSetCoordinateDisc(a, b, c) DMProjectCoordinates(a, b)
10*49a40c8aSKenneth E. Jansen #endif
11e83e87a5Sjeremylt 
12e83e87a5Sjeremylt CeedMemType      MemTypeP2C(PetscMemType mtype);
139b072555Sjeremylt PetscErrorCode   Kershaw(DM dm_orig, PetscScalar eps);
142b730f8bSJeremy L Thompson PetscErrorCode   SetupDMByDegree(DM dm, PetscInt p_degree, PetscInt q_extra, PetscInt num_comp_u, PetscInt topo_dim, bool enforce_bc);
152b730f8bSJeremy L Thompson PetscErrorCode   CreateRestrictionFromPlex(Ceed ceed, DM dm, CeedInt height, DMLabel domain_label, CeedInt value, CeedElemRestriction *elem_restr);
16de1229c5Srezgarshakeri CeedElemTopology ElemTopologyP2C(DMPolytopeType cell_type);
172b730f8bSJeremy L Thompson PetscErrorCode   DMFieldToDSField(DM dm, DMLabel domain_label, PetscInt dm_field, PetscInt *ds_field);
182b730f8bSJeremy L Thompson PetscErrorCode   BasisCreateFromTabulation(Ceed ceed, DM dm, DMLabel domain_label, PetscInt label_value, PetscInt height, PetscInt face, PetscFE fe,
192b730f8bSJeremy L Thompson                                            PetscTabulation basis_tabulation, PetscQuadrature quadrature, CeedBasis *basis);
202b730f8bSJeremy L Thompson PetscErrorCode   CreateBasisFromPlex(Ceed ceed, DM dm, DMLabel domain_label, CeedInt label_value, CeedInt height, CeedInt dm_field, BPData bp_data,
21f755c37aSrezgarshakeri                                      CeedBasis *basis);
22de1229c5Srezgarshakeri PetscErrorCode   CreateDistributedDM(RunParams rp, DM *dm);
23de1229c5Srezgarshakeri 
24b7c563b6SJeremy L Thompson #endif  // libceed_petsc_examples_utils_h
25