xref: /libCEED/examples/solids/include/matops.h (revision 5cd6c1fb67d52eb6a42b887bb79c183682dd86ca)
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 <petscdm.h>
13 #include <petscsnes.h>
14 
15 #include "../include/structs.h"
16 
17 // This function uses libCEED to compute the local action of an operator
18 PetscErrorCode ApplyLocalCeedOp(Vec X, Vec Y, UserMult user);
19 
20 // This function uses libCEED to compute the non-linear residual
21 PetscErrorCode FormResidual_Ceed(SNES snes, Vec X, Vec Y, void *ctx);
22 
23 // This function uses libCEED to apply the Jacobian for assembly via a SNES
24 PetscErrorCode ApplyJacobianCoarse_Ceed(SNES snes, Vec X, Vec Y, void *ctx);
25 
26 // This function uses libCEED to compute the action of the Jacobian
27 PetscErrorCode ApplyJacobian_Ceed(Mat A, Vec X, Vec Y);
28 
29 // This function uses libCEED to compute the action of the prolongation operator
30 PetscErrorCode Prolong_Ceed(Mat A, Vec X, Vec Y);
31 
32 // This function uses libCEED to compute the action of the restriction operator
33 PetscErrorCode Restrict_Ceed(Mat A, Vec X, Vec Y);
34 
35 // This function returns the computed diagonal of the operator
36 PetscErrorCode GetDiag_Ceed(Mat A, Vec D);
37 
38 // This function calculates the strain energy in the final solution
39 PetscErrorCode ComputeStrainEnergy(DM dm_energy, UserMult user, CeedOperator op_energy, Vec X, 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