File: petscsftypes.h

package info (click to toggle)
petsc 3.10.3%2Bdfsg1-5
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 209,064 kB
  • sloc: ansic: 587,333; python: 29,696; makefile: 12,445; fortran: 11,626; f90: 9,677; cpp: 8,768; sh: 1,027; xml: 621; objc: 445; csh: 194; java: 13
file content (46 lines) | stat: -rw-r--r-- 1,291 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#if !defined(_PETSCSFTYPES_H)
#define _PETSCSFTYPES_H

/*S
   PetscSF - PETSc object for setting up and managing the communication of certain entries of arrays and Vecs between MPI processes.

   Level: intermediate

  Concepts: star forest

       PetscSF uses the concept of star forests to indicate and determine the communication patterns concisely and efficiently.
  A star  http://en.wikipedia.org/wiki/Star_(graph_theory) forest is simply a collection of trees of height 1. The leave nodes represent
  "ghost locations" for the root nodes.

.seealso: PetscSFCreate(), VecScatter, VecScatterCreate()
S*/
typedef struct _p_PetscSF* PetscSF;

/*S
   PetscSFNode - specifier of owner and index

   Level: beginner

  Concepts: indexing, stride, distribution

  Sample Usage:
$      PetscSFNode    *remote;
$    ierr = PetscMalloc1(nleaves,&remote);CHKERRQ(ierr);
$    for (i=0; i<size; i++) {
$      remote[i].rank = i;
$      remote[i].index = rank;
$    }

  Sample Fortran Usage:
$     type(PetscSFNode) remote(6)
$      remote(1)%rank  = modulo(rank+size-1,size)
$      remote(1)%index = 1 * stride

.seealso: PetscSFSetGraph()
S*/
typedef struct {
  PetscInt rank;                /* Rank of owner */
  PetscInt index;               /* Index of node on rank */
} PetscSFNode;

#endif