xref: /libCEED/examples/solids/include/setup-libceed.h (revision 7ed3e4cde27d28430628eaa24b22da48dc51cc32)
15754ecacSJeremy L Thompson #ifndef setuplibceed_h
25754ecacSJeremy L Thompson #define setuplibceed_h
35754ecacSJeremy L Thompson 
45754ecacSJeremy L Thompson #include <ceed.h>
55754ecacSJeremy L Thompson #include <petsc.h>
65754ecacSJeremy L Thompson #include "../include/structs.h"
75754ecacSJeremy L Thompson 
85754ecacSJeremy L Thompson // -----------------------------------------------------------------------------
95754ecacSJeremy L Thompson // libCEED Functions
105754ecacSJeremy L Thompson // -----------------------------------------------------------------------------
115754ecacSJeremy L Thompson // Destroy libCEED objects
125754ecacSJeremy L Thompson PetscErrorCode CeedDataDestroy(CeedInt level, CeedData data);
135754ecacSJeremy L Thompson 
145754ecacSJeremy L Thompson // Utility function - essential BC dofs are encoded in closure indices as -(i+1)
155754ecacSJeremy L Thompson PetscInt Involute(PetscInt i);
165754ecacSJeremy L Thompson 
175754ecacSJeremy L Thompson // Utility function to create local CEED restriction from DMPlex
18*7ed3e4cdSJeremy L Thompson PetscErrorCode CreateRestrictionFromPlex(Ceed ceed, DM dm, CeedInt height,
19*7ed3e4cdSJeremy L Thompson     DMLabel domain_label, CeedInt value, CeedElemRestriction *elem_restr);
205754ecacSJeremy L Thompson 
215754ecacSJeremy L Thompson // Utility function to get Ceed Restriction for each domain
225754ecacSJeremy L Thompson PetscErrorCode GetRestrictionForDomain(Ceed ceed, DM dm, CeedInt height,
23*7ed3e4cdSJeremy L Thompson                                        DMLabel domain_label, PetscInt value,
245754ecacSJeremy L Thompson                                        CeedInt Q, CeedInt q_data_size,
255754ecacSJeremy L Thompson                                        CeedElemRestriction *elem_restr_q,
265754ecacSJeremy L Thompson                                        CeedElemRestriction *elem_restr_x,
275754ecacSJeremy L Thompson                                        CeedElemRestriction *elem_restr_qd_i);
285754ecacSJeremy L Thompson 
295754ecacSJeremy L Thompson // Set up libCEED for a given degree
305754ecacSJeremy L Thompson PetscErrorCode SetupLibceedFineLevel(DM dm, DM dm_energy, DM dm_diagnostic,
315754ecacSJeremy L Thompson                                      Ceed ceed, AppCtx app_ctx,
325754ecacSJeremy L Thompson                                      CeedQFunctionContext phys_ctx,
335754ecacSJeremy L Thompson                                      ProblemData problem_data,
345754ecacSJeremy L Thompson                                      PetscInt fine_level, PetscInt num_comp_u,
355754ecacSJeremy L Thompson                                      PetscInt U_g_size, PetscInt U_loc_size,
365754ecacSJeremy L Thompson                                      CeedVector force_ceed,
375754ecacSJeremy L Thompson                                      CeedVector neumann_ceed, CeedData *data);
385754ecacSJeremy L Thompson 
395754ecacSJeremy L Thompson // Set up libCEED multigrid level for a given degree
405754ecacSJeremy L Thompson PetscErrorCode SetupLibceedLevel(DM dm, Ceed ceed, AppCtx app_ctx,
415754ecacSJeremy L Thompson                                  ProblemData problem_data, PetscInt level,
425754ecacSJeremy L Thompson                                  PetscInt num_comp_u, PetscInt U_g_size,
435754ecacSJeremy L Thompson                                  PetscInt U_loc_size, CeedVector fine_mult,
445754ecacSJeremy L Thompson                                  CeedData *data);
455754ecacSJeremy L Thompson 
465754ecacSJeremy L Thompson #endif // setuplibceed_h
47