Actual source code: petsc-isimpl.h
petsc-3.3-p7 2013-05-11
1: /*
2: Index sets for scatter-gather type operations in vectors
3: and matrices.
5: */
7: #if !defined(_IS_H)
8: #define _IS_H
10: #include <petscis.h>
12: struct _ISOps {
13: PetscErrorCode (*getsize)(IS,PetscInt*);
14: PetscErrorCode (*getlocalsize)(IS,PetscInt*);
15: PetscErrorCode (*getindices)(IS,const PetscInt*[]);
16: PetscErrorCode (*restoreindices)(IS,const PetscInt*[]);
17: PetscErrorCode (*invertpermutation)(IS,PetscInt,IS*);
18: PetscErrorCode (*sort)(IS);
19: PetscErrorCode (*sorted)(IS,PetscBool*);
20: PetscErrorCode (*duplicate)(IS,IS*);
21: PetscErrorCode (*destroy)(IS);
22: PetscErrorCode (*view)(IS,PetscViewer);
23: PetscErrorCode (*identity)(IS,PetscBool*);
24: PetscErrorCode (*copy)(IS,IS);
25: PetscErrorCode (*togeneral)(IS);
26: PetscErrorCode (*oncomm)(IS,MPI_Comm,PetscCopyMode,IS*);
27: PetscErrorCode (*setblocksize)(IS,PetscInt);
28: PetscErrorCode (*contiguous)(IS,PetscInt,PetscInt,PetscInt*,PetscBool*);
29: };
31: struct _p_IS {
32: PETSCHEADER(struct _ISOps);
33: PetscBool isperm; /* if is a permutation */
34: PetscInt max,min; /* range of possible values */
35: PetscInt bs; /* block size */
36: void *data;
37: PetscBool isidentity;
38: PetscInt *total, *nonlocal; /* local representation of ALL indices across the comm as well as the nonlocal part. */
39: PetscInt local_offset; /* offset to the local part within the total index set */
40: IS complement; /* IS wrapping nonlocal indices. */
41: };
44: #endif