xref: /libCEED/examples/solids/include/setup-libceed.h (revision 13964f0727a62e5421e6d3b433e838b96a9ce891)
1 #ifndef libceed_solids_examples_setup_libceed_h
2 #define libceed_solids_examples_setup_libceed_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 height,
19     DMLabel domain_label, CeedInt value, CeedElemRestriction *elem_restr);
20 
21 // Utility function to get Ceed Restriction for each domain
22 PetscErrorCode GetRestrictionForDomain(Ceed ceed, DM dm, CeedInt height,
23                                        DMLabel domain_label, PetscInt value,
24                                        CeedInt Q, CeedInt q_data_size,
25                                        CeedElemRestriction *elem_restr_q,
26                                        CeedElemRestriction *elem_restr_x,
27                                        CeedElemRestriction *elem_restr_qd_i);
28 
29 // Set up libCEED for a given degree
30 PetscErrorCode SetupLibceedFineLevel(DM dm, DM dm_energy, DM dm_diagnostic,
31                                      Ceed ceed, AppCtx app_ctx,
32                                      CeedQFunctionContext phys_ctx,
33                                      ProblemData problem_data,
34                                      PetscInt fine_level, PetscInt num_comp_u,
35                                      PetscInt U_g_size, PetscInt U_loc_size,
36                                      CeedVector force_ceed,
37                                      CeedVector neumann_ceed, CeedData *data);
38 
39 // Set up libCEED multigrid level for a given degree
40 PetscErrorCode SetupLibceedLevel(DM dm, Ceed ceed, AppCtx app_ctx,
41                                  ProblemData problem_data, PetscInt level,
42                                  PetscInt num_comp_u, PetscInt U_g_size,
43                                  PetscInt U_loc_size, CeedVector fine_mult,
44                                  CeedData *data);
45 
46 #endif // libceed_solids_examples_setup_libceed_h
47