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