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 #include <ceed.h> 9 #include "../include/structs.h" 10 #include "../include/setup-libceed.h" 11 #include "../problems/problems.h" 12 #include "../problems/neo-hookean.h" 13 #include "../qfunctions/common.h" 14 #include "../qfunctions/linear.h" 15 #include "../qfunctions/manufactured-true.h" 16 17 ProblemData linear_elasticity = { 18 .setup_geo = SetupGeo, 19 .setup_geo_loc = SetupGeo_loc, 20 .q_data_size = 10, 21 .quadrature_mode = CEED_GAUSS, 22 .residual = ElasLinearF, 23 .residual_loc = ElasLinearF_loc, 24 .number_fields_stored = 0, 25 .jacobian = ElasLineardF, 26 .jacobian_loc = ElasLineardF_loc, 27 .energy = ElasLinearEnergy, 28 .energy_loc = ElasLinearEnergy_loc, 29 .diagnostic = ElasLinearDiagnostic, 30 .diagnostic_loc = ElasLinearDiagnostic_loc, 31 .true_soln = MMSTrueSoln, 32 .true_soln_loc = MMSTrueSoln_loc, 33 }; 34 35 PetscErrorCode SetupLibceedFineLevel_ElasLinear(DM dm, DM dm_energy, 36 DM dm_diagnostic, Ceed ceed, AppCtx app_ctx, CeedQFunctionContext phys_ctx, 37 PetscInt fine_level, PetscInt num_comp_u, PetscInt U_g_size, 38 PetscInt U_loc_size, CeedVector force_ceed, CeedVector neumann_ceed, 39 CeedData *data) { 40 PetscErrorCode ierr; 41 42 PetscFunctionBegin; 43 44 ierr = SetupLibceedFineLevel(dm, dm_energy, dm_diagnostic, ceed, app_ctx, 45 phys_ctx, linear_elasticity, 46 fine_level, num_comp_u, U_g_size, U_loc_size, 47 force_ceed, neumann_ceed, data); CHKERRQ(ierr); 48 49 PetscFunctionReturn(0); 50 }; 51 52 PetscErrorCode SetupLibceedLevel_ElasLinear(DM dm, Ceed ceed, AppCtx app_ctx, 53 PetscInt level, PetscInt num_comp_u, PetscInt U_g_size, PetscInt U_loc_size, 54 CeedVector fine_mult, CeedData *data) { 55 PetscErrorCode ierr; 56 57 PetscFunctionBegin; 58 59 ierr = SetupLibceedLevel(dm, ceed, app_ctx, linear_elasticity, 60 level, num_comp_u, U_g_size, U_loc_size, fine_mult, data); 61 CHKERRQ(ierr); 62 63 PetscFunctionReturn(0); 64 }; 65