xref: /libCEED/examples/solids/include/matops.h (revision daadeac6547c0bce0e170b8a41c931051f52e9a3)
1 // Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and other CEED contributors.
2 // All Rights Reserved. See the top-level LICENSE and NOTICE files for details.
3 //
4 // SPDX-License-Identifier: BSD-2-Clause
5 //
6 // This file is part of CEED:  http://github.com/ceed
7 
8 #ifndef libceed_solids_examples_matops_h
9 #define libceed_solids_examples_matops_h
10 
11 #include <ceed.h>
12 #include <petsc.h>
13 
14 #include "../include/structs.h"
15 
16 // This function uses libCEED to compute the local action of an operator
17 PetscErrorCode ApplyLocalCeedOp(Vec X, Vec Y, UserMult user);
18 
19 // This function uses libCEED to compute the non-linear residual
20 PetscErrorCode FormResidual_Ceed(SNES snes, Vec X, Vec Y, void *ctx);
21 
22 // This function uses libCEED to apply the Jacobian for assembly via a SNES
23 PetscErrorCode ApplyJacobianCoarse_Ceed(SNES snes, Vec X, Vec Y, void *ctx);
24 
25 // This function uses libCEED to compute the action of the Jacobian
26 PetscErrorCode ApplyJacobian_Ceed(Mat A, Vec X, Vec Y);
27 
28 // This function uses libCEED to compute the action of the prolongation operator
29 PetscErrorCode Prolong_Ceed(Mat A, Vec X, Vec Y);
30 
31 // This function uses libCEED to compute the action of the restriction operator
32 PetscErrorCode Restrict_Ceed(Mat A, Vec X, Vec Y);
33 
34 // This function returns the computed diagonal of the operator
35 PetscErrorCode GetDiag_Ceed(Mat A, Vec D);
36 
37 // This function calculates the strain energy in the final solution
38 PetscErrorCode ComputeStrainEnergy(DM dm_energy, UserMult user, CeedOperator op_energy, Vec X, PetscReal *energy);
39 
40 // this function checks to see if the computed energy is close enough to reference file energy.
41 PetscErrorCode RegressionTests_solids(AppCtx app_ctx, PetscReal energy);
42 
43 #endif  // libceed_solids_examples_matopts_h
44