xref: /libCEED/examples/fluids/include/mat-ceed.h (revision 171d97d0be1a6a7597730b8cc2bec09fb6a98aac)
1 #ifndef MAT_CEED_H
2 #define MAT_CEED_H
3 
4 #include <ceed.h>
5 #include <petscdm.h>
6 #include <petscmat.h>
7 
8 #define MATCEED "ceed"
9 
10 #if defined(__clang_analyzer__)
11 #define MATCEED_EXTERN extern
12 #elif defined(__cplusplus)
13 #define MATCEED_EXTERN extern "C"
14 #else
15 #define MATCEED_EXTERN extern
16 #endif
17 
18 #if defined(__clang_analyzer__)
19 #define MATCEED_INTERN
20 #else
21 #define MATCEED_INTERN MATCEED_EXTERN __attribute__((visibility("hidden")))
22 #endif
23 
24 // Context data
25 MATCEED_INTERN PetscErrorCode MatCeedCreate(DM dm_x, DM dm_y, CeedOperator op_mult, CeedOperator op_mult_transpose, Mat *mat);
26 MATCEED_INTERN PetscErrorCode MatCeedCopy(Mat mat_ceed, Mat mat_other);
27 MATCEED_INTERN PetscErrorCode MatCeedAssembleCOO(Mat mat_ceed, Mat mat_coo);
28 MATCEED_INTERN PetscErrorCode MatCeedSetContext(Mat mat, PetscErrorCode (*f)(void *), void *ctx);
29 MATCEED_INTERN PetscErrorCode MatCeedGetContext(Mat mat, void *ctx);
30 MATCEED_INTERN PetscErrorCode MatCeedSetInnerMatType(Mat mat, MatType type);
31 MATCEED_INTERN PetscErrorCode MatCeedGetInnerMatType(Mat mat, MatType *type);
32 MATCEED_INTERN PetscErrorCode MatCeedSetOperation(Mat mat, MatOperation op, void (*g)(void));
33 MATCEED_INTERN PetscErrorCode MatCeedSetLocalVectors(Mat mat, Vec X_loc, Vec Y_loc_transpose);
34 MATCEED_INTERN PetscErrorCode MatCeedGetLocalVectors(Mat mat, Vec *X_loc, Vec *Y_loc_transpose);
35 MATCEED_INTERN PetscErrorCode MatCeedRestoreLocalVectors(Mat mat, Vec *X_loc, Vec *Y_loc_transpose);
36 MATCEED_INTERN PetscErrorCode MatCeedGetCeedOperators(Mat mat, CeedOperator *op_mult, CeedOperator *op_mult_transpose);
37 MATCEED_INTERN PetscErrorCode MatCeedRestoreCeedOperators(Mat mat, CeedOperator *op_mult, CeedOperator *op_mult_transpose);
38 MATCEED_INTERN PetscErrorCode MatCeedSetLogEvents(Mat mat, PetscLogEvent log_event_mult, PetscLogEvent log_event_mult_transpose);
39 MATCEED_INTERN PetscErrorCode MatCeedGetLogEvents(Mat mat, PetscLogEvent *log_event_mult, PetscLogEvent *log_event_mult_transpose);
40 
41 #endif  // MAT_CEED_H
42