1 // Copyright (c) 2017-2026, 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 "../qfunctions/linear.h"
9
10 #include <ceed.h>
11 #include <petscsys.h>
12
13 #include "../include/setup-libceed.h"
14 #include "../include/structs.h"
15 #include "../problems/neo-hookean.h"
16 #include "../problems/problems.h"
17 #include "../qfunctions/common.h"
18 #include "../qfunctions/manufactured-true.h"
19
20 ProblemData linear_elasticity = {
21 .setup_geo = SetupGeo,
22 .setup_geo_loc = SetupGeo_loc,
23 .q_data_size = 10,
24 .quadrature_mode = CEED_GAUSS,
25 .residual = ElasResidual_Linear,
26 .residual_loc = ElasResidual_Linear_loc,
27 .number_fields_stored = 0,
28 .jacobian = ElasJacobian_Linear,
29 .jacobian_loc = ElasJacobian_Linear_loc,
30 .energy = ElasEnergy_Linear,
31 .energy_loc = ElasEnergy_Linear_loc,
32 .diagnostic = ElasDiagnostic_Linear,
33 .diagnostic_loc = ElasDiagnostic_Linear_loc,
34 .true_soln = MMSTrueSoln,
35 .true_soln_loc = MMSTrueSoln_loc,
36 };
37
SetupLibceedFineLevel_ElasLinear(DM dm,DM dm_energy,DM dm_diagnostic,Ceed ceed,AppCtx app_ctx,CeedQFunctionContext phys_ctx,PetscInt fine_level,PetscInt num_comp_u,PetscInt U_g_size,PetscInt U_loc_size,CeedVector force_ceed,CeedVector neumann_ceed,CeedData * data)38 PetscErrorCode SetupLibceedFineLevel_ElasLinear(DM dm, DM dm_energy, DM dm_diagnostic, Ceed ceed, AppCtx app_ctx, CeedQFunctionContext phys_ctx,
39 PetscInt fine_level, PetscInt num_comp_u, PetscInt U_g_size, PetscInt U_loc_size,
40 CeedVector force_ceed, CeedVector neumann_ceed, CeedData *data) {
41 PetscFunctionBegin;
42
43 PetscCall(SetupLibceedFineLevel(dm, dm_energy, dm_diagnostic, ceed, app_ctx, phys_ctx, linear_elasticity, fine_level, num_comp_u, U_g_size,
44 U_loc_size, force_ceed, neumann_ceed, data));
45
46 PetscFunctionReturn(PETSC_SUCCESS);
47 };
48
SetupLibceedLevel_ElasLinear(DM dm,Ceed ceed,AppCtx app_ctx,PetscInt level,PetscInt num_comp_u,PetscInt U_g_size,PetscInt U_loc_size,CeedVector fine_mult,CeedData * data)49 PetscErrorCode SetupLibceedLevel_ElasLinear(DM dm, Ceed ceed, AppCtx app_ctx, PetscInt level, PetscInt num_comp_u, PetscInt U_g_size,
50 PetscInt U_loc_size, CeedVector fine_mult, CeedData *data) {
51 PetscFunctionBegin;
52
53 PetscCall(SetupLibceedLevel(dm, ceed, app_ctx, linear_elasticity, level, num_comp_u, U_g_size, U_loc_size, fine_mult, data));
54
55 PetscFunctionReturn(PETSC_SUCCESS);
56 };
57