xref: /libCEED/examples/solids/include/matops.h (revision 78a9fcb6bae7d7246469592ed2b1811dbe8e744f)
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 #include "../include/structs.h"
14 
15 // This function uses libCEED to compute the local action of an operator
16 PetscErrorCode ApplyLocalCeedOp(Vec X, Vec Y, UserMult user);
17 
18 // This function uses libCEED to compute the non-linear residual
19 PetscErrorCode FormResidual_Ceed(SNES snes, Vec X, Vec Y, void *ctx);
20 
21 // This function uses libCEED to apply the Jacobian for assembly via a SNES
22 PetscErrorCode ApplyJacobianCoarse_Ceed(SNES snes, Vec X, Vec Y, void *ctx);
23 
24 // This function uses libCEED to compute the action of the Jacobian
25 PetscErrorCode ApplyJacobian_Ceed(Mat A, Vec X, Vec Y);
26 
27 // This function uses libCEED to compute the action of the prolongation operator
28 PetscErrorCode Prolong_Ceed(Mat A, Vec X, Vec Y);
29 
30 // This function uses libCEED to compute the action of the restriction operator
31 PetscErrorCode Restrict_Ceed(Mat A, Vec X, Vec Y);
32 
33 // This function returns the computed diagonal of the operator
34 PetscErrorCode GetDiag_Ceed(Mat A, Vec D);
35 
36 // This function calculates the strain energy in the final solution
37 PetscErrorCode ComputeStrainEnergy(DM dm_energy, UserMult user,
38                                    CeedOperator op_energy, Vec X,
39                                    PetscReal *energy);
40 
41 // this function checks to see if the computed energy is close enough to reference file energy.
42 PetscErrorCode RegressionTests_solids(AppCtx app_ctx, PetscReal energy);
43 
44 #endif // libceed_solids_examples_matopts_h
45