xref: /libCEED/examples/solids/include/setup-libceed.h (revision 2b730f8b5a9c809740a0b3b302db43a719c636b1)
13d8e8822SJeremy L Thompson // Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and other CEED contributors.
23d8e8822SJeremy L Thompson // All Rights Reserved. See the top-level LICENSE and NOTICE files for details.
33d8e8822SJeremy L Thompson //
43d8e8822SJeremy L Thompson // SPDX-License-Identifier: BSD-2-Clause
53d8e8822SJeremy L Thompson //
63d8e8822SJeremy L Thompson // This file is part of CEED:  http://github.com/ceed
73d8e8822SJeremy L Thompson 
8b7c563b6SJeremy L Thompson #ifndef libceed_solids_examples_setup_libceed_h
9b7c563b6SJeremy L Thompson #define libceed_solids_examples_setup_libceed_h
105754ecacSJeremy L Thompson 
115754ecacSJeremy L Thompson #include <ceed.h>
125754ecacSJeremy L Thompson #include <petsc.h>
13*2b730f8bSJeremy L Thompson 
145754ecacSJeremy L Thompson #include "../include/structs.h"
155754ecacSJeremy L Thompson 
165754ecacSJeremy L Thompson // -----------------------------------------------------------------------------
175754ecacSJeremy L Thompson // libCEED Functions
185754ecacSJeremy L Thompson // -----------------------------------------------------------------------------
195754ecacSJeremy L Thompson // Destroy libCEED objects
205754ecacSJeremy L Thompson PetscErrorCode CeedDataDestroy(CeedInt level, CeedData data);
215754ecacSJeremy L Thompson 
225754ecacSJeremy L Thompson // Utility function - essential BC dofs are encoded in closure indices as -(i+1)
235754ecacSJeremy L Thompson PetscInt Involute(PetscInt i);
245754ecacSJeremy L Thompson 
255754ecacSJeremy L Thompson // Utility function to create local CEED restriction from DMPlex
26*2b730f8bSJeremy L Thompson PetscErrorCode CreateRestrictionFromPlex(Ceed ceed, DM dm, CeedInt height, DMLabel domain_label, CeedInt value, CeedElemRestriction *elem_restr);
275754ecacSJeremy L Thompson 
285754ecacSJeremy L Thompson // Utility function to get Ceed Restriction for each domain
29*2b730f8bSJeremy L Thompson PetscErrorCode GetRestrictionForDomain(Ceed ceed, DM dm, CeedInt height, DMLabel domain_label, PetscInt value, CeedInt Q, CeedInt q_data_size,
30*2b730f8bSJeremy L Thompson                                        CeedElemRestriction *elem_restr_q, CeedElemRestriction *elem_restr_x, CeedElemRestriction *elem_restr_qd_i);
315754ecacSJeremy L Thompson 
325754ecacSJeremy L Thompson // Set up libCEED for a given degree
33*2b730f8bSJeremy L Thompson PetscErrorCode SetupLibceedFineLevel(DM dm, DM dm_energy, DM dm_diagnostic, Ceed ceed, AppCtx app_ctx, CeedQFunctionContext phys_ctx,
34*2b730f8bSJeremy L Thompson                                      ProblemData problem_data, PetscInt fine_level, PetscInt num_comp_u, PetscInt U_g_size, PetscInt U_loc_size,
35*2b730f8bSJeremy L Thompson                                      CeedVector force_ceed, CeedVector neumann_ceed, CeedData *data);
365754ecacSJeremy L Thompson 
375754ecacSJeremy L Thompson // Set up libCEED multigrid level for a given degree
38*2b730f8bSJeremy L Thompson PetscErrorCode SetupLibceedLevel(DM dm, Ceed ceed, AppCtx app_ctx, ProblemData problem_data, PetscInt level, PetscInt num_comp_u, PetscInt U_g_size,
39*2b730f8bSJeremy L Thompson                                  PetscInt U_loc_size, CeedVector fine_mult, CeedData *data);
405754ecacSJeremy L Thompson 
41b7c563b6SJeremy L Thompson #endif  // libceed_solids_examples_setup_libceed_h
42