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/finite-strain-mooney-rivlin.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/mooney-rivlin.h"
16 #include "../problems/problems.h"
17 #include "../qfunctions/common.h"
18
19 static const char *const field_names[] = {"gradu"};
20 static CeedInt field_sizes[] = {9};
21
22 ProblemData finite_strain_Mooney_Rivlin = {
23 .setup_geo = SetupGeo,
24 .setup_geo_loc = SetupGeo_loc,
25 .q_data_size = 10,
26 .quadrature_mode = CEED_GAUSS,
27 .residual = ElasFSResidual_MR,
28 .residual_loc = ElasFSResidual_MR_loc,
29 .number_fields_stored = 1,
30 .field_names = field_names,
31 .field_sizes = field_sizes,
32 .jacobian = ElasFSJacobian_MR,
33 .jacobian_loc = ElasFSJacobian_MR_loc,
34 .energy = ElasFSEnergy_MR,
35 .energy_loc = ElasFSEnergy_MR_loc,
36 .diagnostic = ElasFSDiagnostic_MR,
37 .diagnostic_loc = ElasFSDiagnostic_MR_loc,
38 };
39
SetupLibceedFineLevel_ElasFSMR(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)40 PetscErrorCode SetupLibceedFineLevel_ElasFSMR(DM dm, DM dm_energy, DM dm_diagnostic, Ceed ceed, AppCtx app_ctx, CeedQFunctionContext phys_ctx,
41 PetscInt fine_level, PetscInt num_comp_u, PetscInt U_g_size, PetscInt U_loc_size, CeedVector force_ceed,
42 CeedVector neumann_ceed, CeedData *data) {
43 PetscFunctionBegin;
44
45 PetscCall(SetupLibceedFineLevel(dm, dm_energy, dm_diagnostic, ceed, app_ctx, phys_ctx, finite_strain_Mooney_Rivlin, fine_level, num_comp_u,
46 U_g_size, U_loc_size, force_ceed, neumann_ceed, data));
47
48 PetscFunctionReturn(PETSC_SUCCESS);
49 };
50
SetupLibceedLevel_ElasFSMR(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)51 PetscErrorCode SetupLibceedLevel_ElasFSMR(DM dm, Ceed ceed, AppCtx app_ctx, PetscInt level, PetscInt num_comp_u, PetscInt U_g_size,
52 PetscInt U_loc_size, CeedVector fine_mult, CeedData *data) {
53 PetscFunctionBegin;
54
55 PetscCall(SetupLibceedLevel(dm, ceed, app_ctx, finite_strain_Mooney_Rivlin, level, num_comp_u, U_g_size, U_loc_size, fine_mult, data));
56
57 PetscFunctionReturn(PETSC_SUCCESS);
58 };
59