xref: /libCEED/examples/solids/problems/problems.h (revision 5cd6c1fb67d52eb6a42b887bb79c183682dd86ca)
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 problems_h
9 #define problems_h
10 
11 #include <ceed.h>
12 #include <petsc.h>
13 
14 #include "../problems/cl-problems.h"
15 #include "../problems/mooney-rivlin.h"
16 #include "../problems/neo-hookean.h"
17 
18 // Physics options
19 #define SOLIDS_PROBLEM_REGISTER(list, name, fname, physics)                                             \
20   PetscCall(PetscFunctionListAdd(&list->setupPhysics, name, PhysicsContext_##physics));                 \
21   PetscCall(PetscFunctionListAdd(&list->setupSmootherPhysics, name, PhysicsSmootherContext_##physics)); \
22   PetscCall(PetscFunctionListAdd(&list->setupLibceedFineLevel, name, SetupLibceedFineLevel_##fname));   \
23   PetscCall(PetscFunctionListAdd(&list->setupLibceedLevel, name, SetupLibceedLevel_##fname));
24 
25 typedef struct ProblemFunctions_ *ProblemFunctions;
26 struct ProblemFunctions_ {
27   PetscFunctionList setupPhysics, setupSmootherPhysics, setupLibceedFineLevel, setupLibceedLevel;
28 };
29 
30 PetscErrorCode RegisterProblems(ProblemFunctions problem_functions);
31 
32 #define SOLIDS_PROBLEM(name)                                                                                                                   \
33   PetscErrorCode SetupLibceedFineLevel_##name(DM dm, DM dm_energy, DM dm_diagnostic, Ceed ceed, AppCtx app_ctx, CeedQFunctionContext phys_ctx, \
34                                               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   PetscErrorCode SetupLibceedLevel_##name(DM dm, Ceed ceed, AppCtx app_ctx, PetscInt level, PetscInt num_comp_u, PetscInt U_g_size,            \
37                                           PetscInt u_loc_size, CeedVector fine_mult, CeedData *data);
38 
39 SOLIDS_PROBLEM(ElasLinear);
40 SOLIDS_PROBLEM(ElasSSNH);
41 SOLIDS_PROBLEM(ElasFSCurrentNH1);
42 SOLIDS_PROBLEM(ElasFSCurrentNH2);
43 SOLIDS_PROBLEM(ElasFSInitialNH1);
44 SOLIDS_PROBLEM(ElasFSInitialNH2);
45 SOLIDS_PROBLEM(ElasFSInitialMR1);
46 
47 #endif  // problems_h
48