1 #ifndef libceed_solids_examples_misc_h 2 #define libceed_solids_examples_misc_h 3 4 #include <ceed.h> 5 #include <petsc.h> 6 #include "../include/structs.h" 7 8 // ----------------------------------------------------------------------------- 9 // Context setup 10 // ----------------------------------------------------------------------------- 11 // Setup context data for Jacobian evaluation 12 PetscErrorCode SetupJacobianCtx(MPI_Comm comm, AppCtx app_ctx, DM dm, Vec V, 13 Vec V_loc, CeedData ceed_data, Ceed ceed, 14 CeedQFunctionContext ctx_phys, 15 CeedQFunctionContext ctx_phys_smoother, 16 UserMult jacobian_ctx); 17 18 // Setup context data for prolongation and restriction operators 19 PetscErrorCode SetupProlongRestrictCtx(MPI_Comm comm, AppCtx app_ctx, DM dm_c, 20 DM dm_f, Vec V_f, Vec V_loc_c, Vec V_loc_f, 21 CeedData ceed_data_c, CeedData ceed_data_f, 22 Ceed ceed, 23 UserMultProlongRestr prolong_restr_ctx); 24 25 // ----------------------------------------------------------------------------- 26 // Jacobian setup 27 // ----------------------------------------------------------------------------- 28 PetscErrorCode FormJacobian(SNES snes, Vec U, Mat J, Mat J_pre, void *ctx); 29 30 // ----------------------------------------------------------------------------- 31 // Solution output 32 // ----------------------------------------------------------------------------- 33 PetscErrorCode ViewSolution(MPI_Comm comm, AppCtx app_ctx, Vec U, 34 PetscInt increment, PetscScalar load_increment); 35 36 PetscErrorCode ViewDiagnosticQuantities(MPI_Comm comm, DM dm_U, 37 UserMult user, AppCtx app_ctx, Vec U, 38 CeedElemRestriction elem_restr_diagnostic); 39 40 // ----------------------------------------------------------------------------- 41 // Regression testing 42 // ----------------------------------------------------------------------------- 43 PetscErrorCode RegressionTests_solids(AppCtx app_ctx, PetscReal energy); 44 45 #endif // libceed_solids_examples_misc_h 46