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