xref: /libCEED/examples/solids/include/setup-libceed.h (revision acf255f533f9b196990ab212a71b6493b7e4ca3c)
1 #ifndef setuplibceed_h
2 #define setuplibceed_h
3 
4 #include <ceed.h>
5 #include <petsc.h>
6 #include "../include/structs.h"
7 
8 // -----------------------------------------------------------------------------
9 // libCEED Functions
10 // -----------------------------------------------------------------------------
11 // Destroy libCEED objects
12 PetscErrorCode CeedDataDestroy(CeedInt level, CeedData data);
13 
14 // Utility function - essential BC dofs are encoded in closure indices as -(i+1)
15 PetscInt Involute(PetscInt i);
16 
17 // Utility function to create local CEED restriction from DMPlex
18 PetscErrorCode CreateRestrictionFromPlex(Ceed ceed, DM dm, CeedInt P,
19     CeedInt height, DMLabel domain_label, CeedInt value,
20     CeedElemRestriction *elem_restr);
21 
22 // Utility function to get Ceed Restriction for each domain
23 PetscErrorCode GetRestrictionForDomain(Ceed ceed, DM dm, CeedInt height,
24                                        DMLabel domain_label, PetscInt value, CeedInt P,
25                                        CeedInt Q, CeedInt q_data_size,
26                                        CeedElemRestriction *elem_restr_q,
27                                        CeedElemRestriction *elem_restr_x,
28                                        CeedElemRestriction *elem_restr_qd_i);
29 
30 // Set up libCEED for a given degree
31 PetscErrorCode SetupLibceedFineLevel(DM dm, DM dm_energy, DM dm_diagnostic,
32                                      Ceed ceed, AppCtx app_ctx,
33                                      CeedQFunctionContext phys_ctx,
34                                      ProblemData problem_data,
35                                      PetscInt fine_level, PetscInt num_comp_u,
36                                      PetscInt U_g_size, PetscInt U_loc_size,
37                                      CeedVector force_ceed,
38                                      CeedVector neumann_ceed, CeedData *data);
39 
40 // Set up libCEED multigrid level for a given degree
41 PetscErrorCode SetupLibceedLevel(DM dm, Ceed ceed, AppCtx app_ctx,
42                                  ProblemData problem_data, PetscInt level,
43                                  PetscInt num_comp_u, PetscInt U_g_size,
44                                  PetscInt U_loc_size, CeedVector fine_mult,
45                                  CeedData *data);
46 
47 #endif // setuplibceed_h
48