1*3d8e8822SJeremy L Thompson // Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and other CEED contributors. 2*3d8e8822SJeremy L Thompson // All Rights Reserved. See the top-level LICENSE and NOTICE files for details. 3*3d8e8822SJeremy L Thompson // 4*3d8e8822SJeremy L Thompson // SPDX-License-Identifier: BSD-2-Clause 5*3d8e8822SJeremy L Thompson // 6*3d8e8822SJeremy L Thompson // This file is part of CEED: http://github.com/ceed 7*3d8e8822SJeremy 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> 135754ecacSJeremy L Thompson #include "../include/structs.h" 145754ecacSJeremy L Thompson 155754ecacSJeremy L Thompson // ----------------------------------------------------------------------------- 165754ecacSJeremy L Thompson // libCEED Functions 175754ecacSJeremy L Thompson // ----------------------------------------------------------------------------- 185754ecacSJeremy L Thompson // Destroy libCEED objects 195754ecacSJeremy L Thompson PetscErrorCode CeedDataDestroy(CeedInt level, CeedData data); 205754ecacSJeremy L Thompson 215754ecacSJeremy L Thompson // Utility function - essential BC dofs are encoded in closure indices as -(i+1) 225754ecacSJeremy L Thompson PetscInt Involute(PetscInt i); 235754ecacSJeremy L Thompson 245754ecacSJeremy L Thompson // Utility function to create local CEED restriction from DMPlex 257ed3e4cdSJeremy L Thompson PetscErrorCode CreateRestrictionFromPlex(Ceed ceed, DM dm, CeedInt height, 267ed3e4cdSJeremy L Thompson DMLabel domain_label, CeedInt value, CeedElemRestriction *elem_restr); 275754ecacSJeremy L Thompson 285754ecacSJeremy L Thompson // Utility function to get Ceed Restriction for each domain 295754ecacSJeremy L Thompson PetscErrorCode GetRestrictionForDomain(Ceed ceed, DM dm, CeedInt height, 307ed3e4cdSJeremy L Thompson DMLabel domain_label, PetscInt value, 315754ecacSJeremy L Thompson CeedInt Q, CeedInt q_data_size, 325754ecacSJeremy L Thompson CeedElemRestriction *elem_restr_q, 335754ecacSJeremy L Thompson CeedElemRestriction *elem_restr_x, 345754ecacSJeremy L Thompson CeedElemRestriction *elem_restr_qd_i); 355754ecacSJeremy L Thompson 365754ecacSJeremy L Thompson // Set up libCEED for a given degree 375754ecacSJeremy L Thompson PetscErrorCode SetupLibceedFineLevel(DM dm, DM dm_energy, DM dm_diagnostic, 385754ecacSJeremy L Thompson Ceed ceed, AppCtx app_ctx, 395754ecacSJeremy L Thompson CeedQFunctionContext phys_ctx, 405754ecacSJeremy L Thompson ProblemData problem_data, 415754ecacSJeremy L Thompson PetscInt fine_level, PetscInt num_comp_u, 425754ecacSJeremy L Thompson PetscInt U_g_size, PetscInt U_loc_size, 435754ecacSJeremy L Thompson CeedVector force_ceed, 445754ecacSJeremy L Thompson CeedVector neumann_ceed, CeedData *data); 455754ecacSJeremy L Thompson 465754ecacSJeremy L Thompson // Set up libCEED multigrid level for a given degree 475754ecacSJeremy L Thompson PetscErrorCode SetupLibceedLevel(DM dm, Ceed ceed, AppCtx app_ctx, 485754ecacSJeremy L Thompson ProblemData problem_data, PetscInt level, 495754ecacSJeremy L Thompson PetscInt num_comp_u, PetscInt U_g_size, 505754ecacSJeremy L Thompson PetscInt U_loc_size, CeedVector fine_mult, 515754ecacSJeremy L Thompson CeedData *data); 525754ecacSJeremy L Thompson 53b7c563b6SJeremy L Thompson #endif // libceed_solids_examples_setup_libceed_h 54