xref: /libCEED/examples/solids/include/setup-libceed.h (revision df9b1082f3fea590280bb79ace83362d3424df46)
1 // Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and other CEED contributors.
2 // All Rights Reserved. See the top-level LICENSE and NOTICE files for details.
3 //
4 // SPDX-License-Identifier: BSD-2-Clause
5 //
6 // This file is part of CEED:  http://github.com/ceed
7 
8 #ifndef libceed_solids_examples_setup_libceed_h
9 #define libceed_solids_examples_setup_libceed_h
10 
11 #include <ceed.h>
12 #include <petsc.h>
13 #include "../include/structs.h"
14 
15 // -----------------------------------------------------------------------------
16 // libCEED Functions
17 // -----------------------------------------------------------------------------
18 // Destroy libCEED objects
19 PetscErrorCode CeedDataDestroy(CeedInt level, CeedData data);
20 
21 // Utility function - essential BC dofs are encoded in closure indices as -(i+1)
22 PetscInt Involute(PetscInt i);
23 
24 // Utility function to create local CEED restriction from DMPlex
25 PetscErrorCode CreateRestrictionFromPlex(Ceed ceed, DM dm, CeedInt height,
26     DMLabel domain_label, CeedInt value, CeedElemRestriction *elem_restr);
27 
28 // Utility function to get Ceed Restriction for each domain
29 PetscErrorCode GetRestrictionForDomain(Ceed ceed, DM dm, CeedInt height,
30                                        DMLabel domain_label, PetscInt value,
31                                        CeedInt Q, CeedInt q_data_size,
32                                        CeedElemRestriction *elem_restr_q,
33                                        CeedElemRestriction *elem_restr_x,
34                                        CeedElemRestriction *elem_restr_qd_i);
35 
36 // Set up libCEED for a given degree
37 PetscErrorCode SetupLibceedFineLevel(DM dm, DM dm_energy, DM dm_diagnostic,
38                                      Ceed ceed, AppCtx app_ctx,
39                                      CeedQFunctionContext phys_ctx,
40                                      ProblemData problem_data,
41                                      PetscInt fine_level, PetscInt num_comp_u,
42                                      PetscInt U_g_size, PetscInt U_loc_size,
43                                      CeedVector force_ceed,
44                                      CeedVector neumann_ceed, CeedData *data);
45 
46 // Set up libCEED multigrid level for a given degree
47 PetscErrorCode SetupLibceedLevel(DM dm, Ceed ceed, AppCtx app_ctx,
48                                  ProblemData problem_data, PetscInt level,
49                                  PetscInt num_comp_u, PetscInt U_g_size,
50                                  PetscInt U_loc_size, CeedVector fine_mult,
51                                  CeedData *data);
52 
53 #endif // libceed_solids_examples_setup_libceed_h
54