xref: /libCEED/examples/solids/problems/problems.h (revision 2b730f8b5a9c809740a0b3b302db43a719c636b1)
13d8e8822SJeremy L Thompson // Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and other CEED contributors.
23d8e8822SJeremy L Thompson // All Rights Reserved. See the top-level LICENSE and NOTICE files for details.
33d8e8822SJeremy L Thompson //
43d8e8822SJeremy L Thompson // SPDX-License-Identifier: BSD-2-Clause
53d8e8822SJeremy L Thompson //
63d8e8822SJeremy L Thompson // This file is part of CEED:  http://github.com/ceed
73d8e8822SJeremy L Thompson 
85754ecacSJeremy L Thompson #ifndef problems_h
95754ecacSJeremy L Thompson #define problems_h
105754ecacSJeremy L Thompson 
115754ecacSJeremy L Thompson #include <ceed.h>
125754ecacSJeremy L Thompson #include <petsc.h>
13*2b730f8bSJeremy L Thompson 
145754ecacSJeremy L Thompson #include "../problems/cl-problems.h"
155754ecacSJeremy L Thompson #include "../problems/mooney-rivlin.h"
16*2b730f8bSJeremy L Thompson #include "../problems/neo-hookean.h"
175754ecacSJeremy L Thompson 
185754ecacSJeremy L Thompson // Physics options
195754ecacSJeremy L Thompson #define SOLIDS_PROBLEM_REGISTER(list, name, fname, physics)                                             \
20*2b730f8bSJeremy L Thompson   PetscCall(PetscFunctionListAdd(&list->setupPhysics, name, PhysicsContext_##physics));                 \
21*2b730f8bSJeremy L Thompson   PetscCall(PetscFunctionListAdd(&list->setupSmootherPhysics, name, PhysicsSmootherContext_##physics)); \
22*2b730f8bSJeremy L Thompson   PetscCall(PetscFunctionListAdd(&list->setupLibceedFineLevel, name, SetupLibceedFineLevel_##fname));   \
23*2b730f8bSJeremy L Thompson   PetscCall(PetscFunctionListAdd(&list->setupLibceedLevel, name, SetupLibceedLevel_##fname));
245754ecacSJeremy L Thompson 
255754ecacSJeremy L Thompson typedef struct ProblemFunctions_ *ProblemFunctions;
265754ecacSJeremy L Thompson struct ProblemFunctions_ {
27*2b730f8bSJeremy L Thompson   PetscFunctionList setupPhysics, setupSmootherPhysics, setupLibceedFineLevel, setupLibceedLevel;
285754ecacSJeremy L Thompson };
295754ecacSJeremy L Thompson 
305754ecacSJeremy L Thompson PetscErrorCode RegisterProblems(ProblemFunctions problem_functions);
315754ecacSJeremy L Thompson 
325754ecacSJeremy L Thompson #define SOLIDS_PROBLEM(name)                                                                                                                   \
33*2b730f8bSJeremy L Thompson   PetscErrorCode SetupLibceedFineLevel_##name(DM dm, DM dm_energy, DM dm_diagnostic, Ceed ceed, AppCtx app_ctx, CeedQFunctionContext phys_ctx, \
34*2b730f8bSJeremy L Thompson                                               PetscInt fine_level, PetscInt num_comp_u, PetscInt U_g_size, PetscInt U_loc_size,                \
35*2b730f8bSJeremy L Thompson                                               CeedVector force_ceed, CeedVector neumann_ceed, CeedData *data);                                 \
36*2b730f8bSJeremy L Thompson   PetscErrorCode SetupLibceedLevel_##name(DM dm, Ceed ceed, AppCtx app_ctx, PetscInt level, PetscInt num_comp_u, PetscInt U_g_size,            \
37*2b730f8bSJeremy L Thompson                                           PetscInt u_loc_size, CeedVector fine_mult, CeedData *data);
385754ecacSJeremy L Thompson 
395754ecacSJeremy L Thompson SOLIDS_PROBLEM(ElasLinear);
405754ecacSJeremy L Thompson SOLIDS_PROBLEM(ElasSSNH);
415754ecacSJeremy L Thompson SOLIDS_PROBLEM(ElasFSCurrentNH1);
425754ecacSJeremy L Thompson SOLIDS_PROBLEM(ElasFSCurrentNH2);
435754ecacSJeremy L Thompson SOLIDS_PROBLEM(ElasFSInitialNH1);
445754ecacSJeremy L Thompson SOLIDS_PROBLEM(ElasFSInitialNH2);
455754ecacSJeremy L Thompson SOLIDS_PROBLEM(ElasFSInitialMR1);
465754ecacSJeremy L Thompson 
475754ecacSJeremy L Thompson #endif  // problems_h
48