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