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 8b7c563b6SJeremy L Thompson #ifndef libceed_solids_examples_misc_h 9b7c563b6SJeremy L Thompson #define libceed_solids_examples_misc_h 105754ecacSJeremy L Thompson 115754ecacSJeremy L Thompson #include <ceed.h> 125754ecacSJeremy L Thompson #include <petsc.h> 13*2b730f8bSJeremy L Thompson 145754ecacSJeremy L Thompson #include "../include/structs.h" 155754ecacSJeremy L Thompson 165754ecacSJeremy L Thompson // ----------------------------------------------------------------------------- 175754ecacSJeremy L Thompson // Context setup 185754ecacSJeremy L Thompson // ----------------------------------------------------------------------------- 195754ecacSJeremy L Thompson // Setup context data for Jacobian evaluation 20*2b730f8bSJeremy L Thompson PetscErrorCode SetupJacobianCtx(MPI_Comm comm, AppCtx app_ctx, DM dm, Vec V, Vec V_loc, CeedData ceed_data, Ceed ceed, CeedQFunctionContext ctx_phys, 21*2b730f8bSJeremy L Thompson CeedQFunctionContext ctx_phys_smoother, UserMult jacobian_ctx); 225754ecacSJeremy L Thompson 235754ecacSJeremy L Thompson // Setup context data for prolongation and restriction operators 24*2b730f8bSJeremy L Thompson PetscErrorCode SetupProlongRestrictCtx(MPI_Comm comm, AppCtx app_ctx, DM dm_c, DM dm_f, Vec V_f, Vec V_loc_c, Vec V_loc_f, CeedData ceed_data_c, 25*2b730f8bSJeremy L Thompson CeedData ceed_data_f, Ceed ceed, UserMultProlongRestr prolong_restr_ctx); 265754ecacSJeremy L Thompson 275754ecacSJeremy L Thompson // ----------------------------------------------------------------------------- 285754ecacSJeremy L Thompson // Jacobian setup 295754ecacSJeremy L Thompson // ----------------------------------------------------------------------------- 305754ecacSJeremy L Thompson PetscErrorCode FormJacobian(SNES snes, Vec U, Mat J, Mat J_pre, void *ctx); 315754ecacSJeremy L Thompson 325754ecacSJeremy L Thompson // ----------------------------------------------------------------------------- 335754ecacSJeremy L Thompson // Solution output 345754ecacSJeremy L Thompson // ----------------------------------------------------------------------------- 35*2b730f8bSJeremy L Thompson PetscErrorCode ViewSolution(MPI_Comm comm, AppCtx app_ctx, Vec U, PetscInt increment, PetscScalar load_increment); 365754ecacSJeremy L Thompson 37*2b730f8bSJeremy L Thompson PetscErrorCode ViewDiagnosticQuantities(MPI_Comm comm, DM dm_U, UserMult user, AppCtx app_ctx, Vec U, CeedElemRestriction elem_restr_diagnostic); 385754ecacSJeremy L Thompson 395754ecacSJeremy L Thompson // ----------------------------------------------------------------------------- 405754ecacSJeremy L Thompson // Regression testing 415754ecacSJeremy L Thompson // ----------------------------------------------------------------------------- 425754ecacSJeremy L Thompson PetscErrorCode RegressionTests_solids(AppCtx app_ctx, PetscReal energy); 435754ecacSJeremy L Thompson 44b7c563b6SJeremy L Thompson #endif // libceed_solids_examples_misc_h 45