xref: /libCEED/examples/petsc/include/matops.h (revision 1b7492f867164853116dc978bf39f769f48c56d0)
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 /// @file
9 /// Operations for PETSc MatShell
10 
11 #ifndef libceed_petsc_examples_matops_h
12 #define libceed_petsc_examples_matops_h
13 
14 #include <ceed.h>
15 #include <petsc.h>
16 
17 #include "structs.h"
18 
19 PetscErrorCode SetupApplyOperatorCtx(MPI_Comm comm, DM dm, Ceed ceed, CeedData ceed_data, Vec X_loc, OperatorApplyContext op_apply_ctx);
20 PetscErrorCode SetupErrorOperatorCtx(MPI_Comm comm, DM dm, Ceed ceed, CeedData ceed_data, Vec X_loc, CeedOperator op_error,
21                                      OperatorApplyContext op_error_ctx);
22 PetscErrorCode MatGetDiag(Mat A, Vec D);
23 PetscErrorCode ApplyLocal_Ceed(Vec X, Vec Y, OperatorApplyContext op_apply_ctx);
24 PetscErrorCode MatMult_Ceed(Mat A, Vec X, Vec Y);
25 PetscErrorCode FormResidual_Ceed(SNES snes, Vec X, Vec Y, void *ctx);
26 PetscErrorCode MatMult_Prolong(Mat A, Vec X, Vec Y);
27 PetscErrorCode MatMult_Restrict(Mat A, Vec X, Vec Y);
28 PetscErrorCode ComputeL2Error(Vec X, PetscScalar *l2_error, OperatorApplyContext op_error_ctx);
29 
30 #endif  // libceed_petsc_examples_matops_h
31