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