15aed82e4SJeremy L Thompson // Copyright (c) 2017-2024, 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 7*509d4af6SJeremy L Thompson #pragma once 85754ecacSJeremy L Thompson 95754ecacSJeremy L Thompson #include <ceed.h> 105754ecacSJeremy L Thompson #include <petsc.h> 112b730f8bSJeremy L Thompson 125754ecacSJeremy L Thompson #include "../problems/cl-problems.h" 135754ecacSJeremy L Thompson #include "../problems/mooney-rivlin.h" 142b730f8bSJeremy L Thompson #include "../problems/neo-hookean.h" 155754ecacSJeremy L Thompson 165754ecacSJeremy L Thompson // Physics options 175754ecacSJeremy L Thompson #define SOLIDS_PROBLEM_REGISTER(list, name, fname, physics) \ 182b730f8bSJeremy L Thompson PetscCall(PetscFunctionListAdd(&list->setupPhysics, name, PhysicsContext_##physics)); \ 192b730f8bSJeremy L Thompson PetscCall(PetscFunctionListAdd(&list->setupSmootherPhysics, name, PhysicsSmootherContext_##physics)); \ 202b730f8bSJeremy L Thompson PetscCall(PetscFunctionListAdd(&list->setupLibceedFineLevel, name, SetupLibceedFineLevel_##fname)); \ 212b730f8bSJeremy L Thompson PetscCall(PetscFunctionListAdd(&list->setupLibceedLevel, name, SetupLibceedLevel_##fname)); 225754ecacSJeremy L Thompson 235754ecacSJeremy L Thompson typedef struct ProblemFunctions_ *ProblemFunctions; 245754ecacSJeremy L Thompson struct ProblemFunctions_ { 252b730f8bSJeremy L Thompson PetscFunctionList setupPhysics, setupSmootherPhysics, setupLibceedFineLevel, setupLibceedLevel; 265754ecacSJeremy L Thompson }; 275754ecacSJeremy L Thompson 285754ecacSJeremy L Thompson PetscErrorCode RegisterProblems(ProblemFunctions problem_functions); 295754ecacSJeremy L Thompson 305754ecacSJeremy L Thompson #define SOLIDS_PROBLEM(name) \ 312b730f8bSJeremy L Thompson PetscErrorCode SetupLibceedFineLevel_##name(DM dm, DM dm_energy, DM dm_diagnostic, Ceed ceed, AppCtx app_ctx, CeedQFunctionContext phys_ctx, \ 322b730f8bSJeremy L Thompson PetscInt fine_level, PetscInt num_comp_u, PetscInt U_g_size, PetscInt U_loc_size, \ 332b730f8bSJeremy L Thompson CeedVector force_ceed, CeedVector neumann_ceed, CeedData *data); \ 342b730f8bSJeremy L Thompson PetscErrorCode SetupLibceedLevel_##name(DM dm, Ceed ceed, AppCtx app_ctx, PetscInt level, PetscInt num_comp_u, PetscInt U_g_size, \ 352b730f8bSJeremy L Thompson PetscInt u_loc_size, CeedVector fine_mult, CeedData *data); 365754ecacSJeremy L Thompson 375754ecacSJeremy L Thompson SOLIDS_PROBLEM(ElasLinear); 385754ecacSJeremy L Thompson SOLIDS_PROBLEM(ElasSSNH); 395754ecacSJeremy L Thompson SOLIDS_PROBLEM(ElasFSCurrentNH1); 405754ecacSJeremy L Thompson SOLIDS_PROBLEM(ElasFSCurrentNH2); 415754ecacSJeremy L Thompson SOLIDS_PROBLEM(ElasFSInitialNH1); 425754ecacSJeremy L Thompson SOLIDS_PROBLEM(ElasFSInitialNH2); 435754ecacSJeremy L Thompson SOLIDS_PROBLEM(ElasFSInitialMR1); 44