1*b7c563b6SJeremy L Thompson #ifndef libceed_solids_examples_misc_h 2*b7c563b6SJeremy L Thompson #define libceed_solids_examples_misc_h 35754ecacSJeremy L Thompson 45754ecacSJeremy L Thompson #include <ceed.h> 55754ecacSJeremy L Thompson #include <petsc.h> 65754ecacSJeremy L Thompson #include "../include/structs.h" 75754ecacSJeremy L Thompson 85754ecacSJeremy L Thompson // ----------------------------------------------------------------------------- 95754ecacSJeremy L Thompson // Context setup 105754ecacSJeremy L Thompson // ----------------------------------------------------------------------------- 115754ecacSJeremy L Thompson // Setup context data for Jacobian evaluation 125754ecacSJeremy L Thompson PetscErrorCode SetupJacobianCtx(MPI_Comm comm, AppCtx app_ctx, DM dm, Vec V, 135754ecacSJeremy L Thompson Vec V_loc, CeedData ceed_data, Ceed ceed, 145754ecacSJeremy L Thompson CeedQFunctionContext ctx_phys, 155754ecacSJeremy L Thompson CeedQFunctionContext ctx_phys_smoother, 165754ecacSJeremy L Thompson UserMult jacobian_ctx); 175754ecacSJeremy L Thompson 185754ecacSJeremy L Thompson // Setup context data for prolongation and restriction operators 195754ecacSJeremy L Thompson PetscErrorCode SetupProlongRestrictCtx(MPI_Comm comm, AppCtx app_ctx, DM dm_c, 205754ecacSJeremy L Thompson DM dm_f, Vec V_f, Vec V_loc_c, Vec V_loc_f, 215754ecacSJeremy L Thompson CeedData ceed_data_c, CeedData ceed_data_f, 225754ecacSJeremy L Thompson Ceed ceed, 235754ecacSJeremy L Thompson UserMultProlongRestr prolong_restr_ctx); 245754ecacSJeremy L Thompson 255754ecacSJeremy L Thompson // ----------------------------------------------------------------------------- 265754ecacSJeremy L Thompson // Jacobian setup 275754ecacSJeremy L Thompson // ----------------------------------------------------------------------------- 285754ecacSJeremy L Thompson PetscErrorCode FormJacobian(SNES snes, Vec U, Mat J, Mat J_pre, void *ctx); 295754ecacSJeremy L Thompson 305754ecacSJeremy L Thompson // ----------------------------------------------------------------------------- 315754ecacSJeremy L Thompson // Solution output 325754ecacSJeremy L Thompson // ----------------------------------------------------------------------------- 335754ecacSJeremy L Thompson PetscErrorCode ViewSolution(MPI_Comm comm, AppCtx app_ctx, Vec U, 345754ecacSJeremy L Thompson PetscInt increment, PetscScalar load_increment); 355754ecacSJeremy L Thompson 365754ecacSJeremy L Thompson PetscErrorCode ViewDiagnosticQuantities(MPI_Comm comm, DM dm_U, 375754ecacSJeremy L Thompson UserMult user, AppCtx app_ctx, Vec U, 385754ecacSJeremy L Thompson 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 45*b7c563b6SJeremy L Thompson #endif // libceed_solids_examples_misc_h 46