xref: /libCEED/examples/petsc/include/petscutils.h (revision de1229c50b0fa287ef0d97965becc5ec55ca5a76)
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>
8*de1229c5Srezgarshakeri #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);
15*de1229c5Srezgarshakeri PetscErrorCode SetupDMByDegree(DM dm, PetscInt p_degree, PetscInt q_extra,
16*de1229c5Srezgarshakeri                                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);
20*de1229c5Srezgarshakeri CeedElemTopology ElemTopologyP2C(DMPolytopeType cell_type);
21129d8736Srezgarshakeri PetscErrorCode CreateBasisFromPlex(Ceed ceed, DM dm, DMLabel domain_label,
22129d8736Srezgarshakeri                                    CeedInt label_value, CeedInt height,
23129d8736Srezgarshakeri                                    CeedInt dm_field, CeedBasis *basis);
24*de1229c5Srezgarshakeri PetscErrorCode CreateDistributedDM(RunParams rp, DM *dm);
25*de1229c5Srezgarshakeri 
26b7c563b6SJeremy L Thompson #endif // libceed_petsc_examples_utils_h
27