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> 12*49aac155SJeremy L Thompson #include <petscdm.h> 13*49aac155SJeremy L Thompson #include <petscsnes.h> 142b730f8bSJeremy L Thompson 155754ecacSJeremy L Thompson #include "../include/structs.h" 165754ecacSJeremy L Thompson 175754ecacSJeremy L Thompson // ----------------------------------------------------------------------------- 185754ecacSJeremy L Thompson // Context setup 195754ecacSJeremy L Thompson // ----------------------------------------------------------------------------- 205754ecacSJeremy L Thompson // Setup context data for Jacobian evaluation 212b730f8bSJeremy 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, 222b730f8bSJeremy L Thompson CeedQFunctionContext ctx_phys_smoother, UserMult jacobian_ctx); 235754ecacSJeremy L Thompson 245754ecacSJeremy L Thompson // Setup context data for prolongation and restriction operators 252b730f8bSJeremy 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, 262b730f8bSJeremy L Thompson CeedData ceed_data_f, Ceed ceed, UserMultProlongRestr prolong_restr_ctx); 275754ecacSJeremy L Thompson 285754ecacSJeremy L Thompson // ----------------------------------------------------------------------------- 295754ecacSJeremy L Thompson // Jacobian setup 305754ecacSJeremy L Thompson // ----------------------------------------------------------------------------- 315754ecacSJeremy L Thompson PetscErrorCode FormJacobian(SNES snes, Vec U, Mat J, Mat J_pre, void *ctx); 325754ecacSJeremy L Thompson 335754ecacSJeremy L Thompson // ----------------------------------------------------------------------------- 345754ecacSJeremy L Thompson // Solution output 355754ecacSJeremy L Thompson // ----------------------------------------------------------------------------- 362b730f8bSJeremy L Thompson PetscErrorCode ViewSolution(MPI_Comm comm, AppCtx app_ctx, Vec U, PetscInt increment, PetscScalar load_increment); 375754ecacSJeremy L Thompson 382b730f8bSJeremy L Thompson PetscErrorCode ViewDiagnosticQuantities(MPI_Comm comm, DM dm_U, UserMult user, AppCtx app_ctx, Vec U, CeedElemRestriction elem_restr_diagnostic); 395754ecacSJeremy L Thompson 405754ecacSJeremy L Thompson // ----------------------------------------------------------------------------- 415754ecacSJeremy L Thompson // Regression testing 425754ecacSJeremy L Thompson // ----------------------------------------------------------------------------- 435754ecacSJeremy L Thompson PetscErrorCode RegressionTests_solids(AppCtx app_ctx, PetscReal energy); 445754ecacSJeremy L Thompson 45b7c563b6SJeremy L Thompson #endif // libceed_solids_examples_misc_h 46