xref: /libCEED/examples/solids/include/matops.h (revision b7c563b6b45e71aa3f6ac850cef50b83565081a6)
1*b7c563b6SJeremy L Thompson #ifndef libceed_solids_examples_matops_h
2*b7c563b6SJeremy L Thompson #define libceed_solids_examples_matops_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 // This function uses libCEED to compute the local action of an operator
95754ecacSJeremy L Thompson PetscErrorCode ApplyLocalCeedOp(Vec X, Vec Y, UserMult user);
105754ecacSJeremy L Thompson 
115754ecacSJeremy L Thompson // This function uses libCEED to compute the non-linear residual
125754ecacSJeremy L Thompson PetscErrorCode FormResidual_Ceed(SNES snes, Vec X, Vec Y, void *ctx);
135754ecacSJeremy L Thompson 
145754ecacSJeremy L Thompson // This function uses libCEED to apply the Jacobian for assembly via a SNES
155754ecacSJeremy L Thompson PetscErrorCode ApplyJacobianCoarse_Ceed(SNES snes, Vec X, Vec Y, void *ctx);
165754ecacSJeremy L Thompson 
175754ecacSJeremy L Thompson // This function uses libCEED to compute the action of the Jacobian
185754ecacSJeremy L Thompson PetscErrorCode ApplyJacobian_Ceed(Mat A, Vec X, Vec Y);
195754ecacSJeremy L Thompson 
205754ecacSJeremy L Thompson // This function uses libCEED to compute the action of the prolongation operator
215754ecacSJeremy L Thompson PetscErrorCode Prolong_Ceed(Mat A, Vec X, Vec Y);
225754ecacSJeremy L Thompson 
235754ecacSJeremy L Thompson // This function uses libCEED to compute the action of the restriction operator
245754ecacSJeremy L Thompson PetscErrorCode Restrict_Ceed(Mat A, Vec X, Vec Y);
255754ecacSJeremy L Thompson 
265754ecacSJeremy L Thompson // This function returns the computed diagonal of the operator
275754ecacSJeremy L Thompson PetscErrorCode GetDiag_Ceed(Mat A, Vec D);
285754ecacSJeremy L Thompson 
295754ecacSJeremy L Thompson // This function calculates the strain energy in the final solution
305754ecacSJeremy L Thompson PetscErrorCode ComputeStrainEnergy(DM dm_energy, UserMult user,
315754ecacSJeremy L Thompson                                    CeedOperator op_energy, Vec X,
325754ecacSJeremy L Thompson                                    PetscReal *energy);
335754ecacSJeremy L Thompson 
345754ecacSJeremy L Thompson // this function checks to see if the computed energy is close enough to reference file energy.
355754ecacSJeremy L Thompson PetscErrorCode RegressionTests_solids(AppCtx app_ctx, PetscReal energy);
365754ecacSJeremy L Thompson 
37*b7c563b6SJeremy L Thompson #endif // libceed_solids_examples_matopts_h
38