xref: /libCEED/examples/petsc/include/petscutils.h (revision f755c37a38f44d41e63f3bc842c03351ea78dc06)
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>
6e83e87a5Sjeremylt #include <petscdmplex.h>
7e83e87a5Sjeremylt #include <petscfe.h>
8de1229c5Srezgarshakeri #include "structs.h"
9e83e87a5Sjeremylt 
10e83e87a5Sjeremylt CeedMemType MemTypeP2C(PetscMemType mtype);
119b072555Sjeremylt PetscErrorCode Kershaw(DM dm_orig, PetscScalar eps);
12e83e87a5Sjeremylt typedef PetscErrorCode (*BCFunction)(PetscInt dim, PetscReal time,
13e83e87a5Sjeremylt                                      const PetscReal x[],
149b072555Sjeremylt                                      PetscInt num_comp_u, PetscScalar *u, void *ctx);
15de1229c5Srezgarshakeri PetscErrorCode SetupDMByDegree(DM dm, PetscInt p_degree, PetscInt q_extra,
16de1229c5Srezgarshakeri                                PetscInt num_comp_u, PetscInt topo_dim,
179b072555Sjeremylt                                bool enforce_bc,  BCFunction bc_func);
187ed3e4cdSJeremy L Thompson PetscErrorCode CreateRestrictionFromPlex(Ceed ceed, DM dm, CeedInt height,
197ed3e4cdSJeremy L Thompson     DMLabel domain_label, CeedInt value, CeedElemRestriction *elem_restr);
20de1229c5Srezgarshakeri CeedElemTopology ElemTopologyP2C(DMPolytopeType cell_type);
21*f755c37aSrezgarshakeri PetscErrorCode DMFieldToDSField(DM dm, DMLabel domain_label, PetscInt dm_field,
22*f755c37aSrezgarshakeri                                 PetscInt *ds_field);
23*f755c37aSrezgarshakeri PetscErrorCode BasisCreateFromTabulation(Ceed ceed, DM dm, DMLabel domain_label,
24*f755c37aSrezgarshakeri     PetscInt label_value, PetscInt height, PetscInt face,
25*f755c37aSrezgarshakeri     PetscFE fe, PetscTabulation basis_tabulation, PetscQuadrature quadrature,
26*f755c37aSrezgarshakeri     CeedBasis *basis);
27129d8736Srezgarshakeri PetscErrorCode CreateBasisFromPlex(Ceed ceed, DM dm, DMLabel domain_label,
28129d8736Srezgarshakeri                                    CeedInt label_value, CeedInt height,
29129d8736Srezgarshakeri                                    CeedInt dm_field, CeedBasis *basis);
30de1229c5Srezgarshakeri PetscErrorCode CreateDistributedDM(RunParams rp, DM *dm);
31de1229c5Srezgarshakeri 
32b7c563b6SJeremy L Thompson #endif // libceed_petsc_examples_utils_h
33