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 14 #include "../include/structs.h" 15 16 // ----------------------------------------------------------------------------- 17 // libCEED Functions 18 // ----------------------------------------------------------------------------- 19 // Destroy libCEED objects 20 PetscErrorCode CeedDataDestroy(CeedInt level, CeedData data); 21 22 // Utility function - essential BC dofs are encoded in closure indices as -(i+1) 23 PetscInt Involute(PetscInt i); 24 25 // Utility function to create local CEED restriction from DMPlex 26 PetscErrorCode CreateRestrictionFromPlex(Ceed ceed, DM dm, CeedInt height, 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, DMLabel domain_label, PetscInt value, CeedInt Q, CeedInt q_data_size, 30 CeedElemRestriction *elem_restr_q, CeedElemRestriction *elem_restr_x, CeedElemRestriction *elem_restr_qd_i); 31 32 // Set up libCEED for a given degree 33 PetscErrorCode SetupLibceedFineLevel(DM dm, DM dm_energy, DM dm_diagnostic, Ceed ceed, AppCtx app_ctx, CeedQFunctionContext phys_ctx, 34 ProblemData problem_data, PetscInt fine_level, PetscInt num_comp_u, PetscInt U_g_size, PetscInt U_loc_size, 35 CeedVector force_ceed, CeedVector neumann_ceed, CeedData *data); 36 37 // Set up libCEED multigrid level for a given degree 38 PetscErrorCode SetupLibceedLevel(DM dm, Ceed ceed, AppCtx app_ctx, ProblemData problem_data, PetscInt level, PetscInt num_comp_u, PetscInt U_g_size, 39 PetscInt U_loc_size, CeedVector fine_mult, CeedData *data); 40 41 #endif // libceed_solids_examples_setup_libceed_h 42