xref: /petsc/src/vec/is/ao/aoimpl.h (revision df4cd43f92eaa320656440c40edb1046daee8f75) !
1 /*
2    This private file should not be included in users' code.
3 */
4 
5 #ifndef PETSC_AOIMPL_H
6 #define PETSC_AOIMPL_H
7 
8 #include <petscao.h>
9 #include <petsc/private/petscimpl.h>
10 #include <petscviewer.h>
11 
12 PETSC_EXTERN PetscBool      AORegisterAllCalled;
13 PETSC_EXTERN PetscErrorCode AORegisterAll(void);
14 
15 /*
16     Defines the abstract AO operations
17 */
18 typedef struct _AOOps *AOOps;
19 struct _AOOps {
20   /* Generic Operations */
21   PetscErrorCode (*view)(AO, PetscViewer);
22   PetscErrorCode (*destroy)(AO);
23   /* AO-Specific Operations */
24   PetscErrorCode (*petsctoapplication)(AO, PetscInt, PetscInt[]);
25   PetscErrorCode (*applicationtopetsc)(AO, PetscInt, PetscInt[]);
26   PetscErrorCode (*petsctoapplicationpermuteint)(AO, PetscInt, PetscInt[]);
27   PetscErrorCode (*applicationtopetscpermuteint)(AO, PetscInt, PetscInt[]);
28   PetscErrorCode (*petsctoapplicationpermutereal)(AO, PetscInt, PetscReal[]);
29   PetscErrorCode (*applicationtopetscpermutereal)(AO, PetscInt, PetscReal[]);
30 };
31 
32 struct _p_AO {
33   PETSCHEADER(struct _AOOps);
34   PetscInt N, n;    /* global, local ao size */
35   IS       isapp;   /* index set that defines an application ordering provided by user */
36   IS       ispetsc; /* index set that defines petsc ordering provided by user */
37   void    *data;    /* implementation-specific data */
38 };
39 
40 extern PetscLogEvent AO_PetscToApplication, AO_ApplicationToPetsc;
41 
42 #endif // PETSC_AOIMPL_H
43