1*5754ecacSJeremy L Thompson #ifndef matops_h 2*5754ecacSJeremy L Thompson #define matops_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 // This function uses libCEED to compute the local action of an operator 9*5754ecacSJeremy L Thompson PetscErrorCode ApplyLocalCeedOp(Vec X, Vec Y, UserMult user); 10*5754ecacSJeremy L Thompson 11*5754ecacSJeremy L Thompson // This function uses libCEED to compute the non-linear residual 12*5754ecacSJeremy L Thompson PetscErrorCode FormResidual_Ceed(SNES snes, Vec X, Vec Y, void *ctx); 13*5754ecacSJeremy L Thompson 14*5754ecacSJeremy L Thompson // This function uses libCEED to apply the Jacobian for assembly via a SNES 15*5754ecacSJeremy L Thompson PetscErrorCode ApplyJacobianCoarse_Ceed(SNES snes, Vec X, Vec Y, void *ctx); 16*5754ecacSJeremy L Thompson 17*5754ecacSJeremy L Thompson // This function uses libCEED to compute the action of the Jacobian 18*5754ecacSJeremy L Thompson PetscErrorCode ApplyJacobian_Ceed(Mat A, Vec X, Vec Y); 19*5754ecacSJeremy L Thompson 20*5754ecacSJeremy L Thompson // This function uses libCEED to compute the action of the prolongation operator 21*5754ecacSJeremy L Thompson PetscErrorCode Prolong_Ceed(Mat A, Vec X, Vec Y); 22*5754ecacSJeremy L Thompson 23*5754ecacSJeremy L Thompson // This function uses libCEED to compute the action of the restriction operator 24*5754ecacSJeremy L Thompson PetscErrorCode Restrict_Ceed(Mat A, Vec X, Vec Y); 25*5754ecacSJeremy L Thompson 26*5754ecacSJeremy L Thompson // This function returns the computed diagonal of the operator 27*5754ecacSJeremy L Thompson PetscErrorCode GetDiag_Ceed(Mat A, Vec D); 28*5754ecacSJeremy L Thompson 29*5754ecacSJeremy L Thompson // This function calculates the strain energy in the final solution 30*5754ecacSJeremy L Thompson PetscErrorCode ComputeStrainEnergy(DM dm_energy, UserMult user, 31*5754ecacSJeremy L Thompson CeedOperator op_energy, Vec X, 32*5754ecacSJeremy L Thompson PetscReal *energy); 33*5754ecacSJeremy L Thompson 34*5754ecacSJeremy L Thompson // this function checks to see if the computed energy is close enough to reference file energy. 35*5754ecacSJeremy L Thompson PetscErrorCode RegressionTests_solids(AppCtx app_ctx, PetscReal energy); 36*5754ecacSJeremy L Thompson 37*5754ecacSJeremy L Thompson #endif // matopts_h 38