xref: /libCEED/examples/petsc/include/petscutils.h (revision d4d455536df293f3f9ba6a974c8a4079393bc3b8)
1 #ifndef libceed_petsc_examples_utils_h
2 #define libceed_petsc_examples_utils_h
3 
4 #include <ceed.h>
5 #include <petsc.h>
6 #include <petscdmplex.h>
7 #include <petscfe.h>
8 #include "structs.h"
9 
10 CeedMemType MemTypeP2C(PetscMemType mtype);
11 PetscErrorCode Kershaw(DM dm_orig, PetscScalar eps);
12 typedef PetscErrorCode (*BCFunction)(PetscInt dim, PetscReal time,
13                                      const PetscReal x[],
14                                      PetscInt num_comp_u, PetscScalar *u, void *ctx);
15 PetscErrorCode SetupDMByDegree(DM dm, PetscInt p_degree, PetscInt q_extra,
16                                PetscInt num_comp_u, PetscInt topo_dim,
17                                bool enforce_bc,  BCFunction bc_func);
18 PetscErrorCode CreateRestrictionFromPlex(Ceed ceed, DM dm, CeedInt height,
19     DMLabel domain_label, CeedInt value, CeedElemRestriction *elem_restr);
20 CeedElemTopology ElemTopologyP2C(DMPolytopeType cell_type);
21 PetscErrorCode DMFieldToDSField(DM dm, DMLabel domain_label, PetscInt dm_field,
22                                 PetscInt *ds_field);
23 PetscErrorCode BasisCreateFromTabulation(Ceed ceed, DM dm, DMLabel domain_label,
24     PetscInt label_value, PetscInt height, PetscInt face,
25     PetscFE fe, PetscTabulation basis_tabulation, PetscQuadrature quadrature,
26     CeedBasis *basis);
27 PetscErrorCode CreateBasisFromPlex(Ceed ceed, DM dm, DMLabel domain_label,
28                                    CeedInt label_value, CeedInt height,
29                                    CeedInt dm_field, BPData bp_data, CeedBasis *basis);
30 PetscErrorCode CreateDistributedDM(RunParams rp, DM *dm);
31 
32 #endif // libceed_petsc_examples_utils_h
33