Actual source code: petscsftypes.h
1: #ifndef PETSCSFTYPES_H
2: #define PETSCSFTYPES_H
4: /* SUBMANSEC = PetscSF */
6: /*S
7: PetscSF - PETSc object for setting up and managing the communication of certain entries of arrays and `Vec` between MPI ranks.
9: Level: intermediate
11: `PetscSF` uses the concept of star forests to indicate and determine the communication patterns concisely and efficiently.
12: A star https://en.wikipedia.org/wiki/Star_(graph_theory) forest is simply a collection of trees of height 1. The leave nodes represent
13: "ghost locations" for the root nodes.
15: .seealso: `PetscSFCreate()`, `VecScatter`, `VecScatterCreate()`
16: S*/
17: typedef struct _p_PetscSF *PetscSF;
19: /*J
20: PetscSFType - String with the name of a `PetscSF` type
22: Level: beginner
24: .seealso: `PetscSFSetType()`, `PetscSF`
25: J*/
26: typedef const char *PetscSFType;
28: /*S
29: PetscSFNode - specifier of owner and index
31: Level: beginner
33: Sample Usage:
34: $ PetscSFNode *remote;
35: $ PetscMalloc1(nleaves,&remote);
36: $ for (i=0; i<size; i++) {
37: $ remote[i].rank = i;
38: $ remote[i].index = rank;
39: $ }
41: Sample Fortran Usage:
42: $ type(PetscSFNode) remote(6)
43: $ remote(1)%rank = modulo(rank+size-1,size)
44: $ remote(1)%index = 1 * stride
46: .seealso: `PetscSFSetGraph()`
47: S*/
48: typedef struct {
49: PetscInt rank; /* Rank of owner */
50: PetscInt index; /* Index of node on rank */
51: } PetscSFNode;
53: /*S
54: VecScatter - Object used to manage communication of data
55: between vectors in parallel. Manages both scatters and gathers
57: Level: beginner
59: .seealso: `Vec`, `PetscSF`, `VecScatterCreate()`, `VecScatterBegin()`, `VecScatterEnd()`
60: S*/
61: typedef PetscSF VecScatter;
63: /*J
64: VecScatterType - String with the name of a PETSc vector scatter type
66: Level: beginner
68: .seealso: `PetscSFType`, `VecScatterSetType()`, `VecScatter`, `VecScatterCreate()`, `VecScatterDestroy()`
69: J*/
70: typedef PetscSFType VecScatterType;
71: #endif