xref: /petsc/include/petscsectiontypes.h (revision b0c763681978ca2603055a54b85df49478a76f70)
1a4963045SJacob Faibussowitsch #pragma once
2ea844a1aSMatthew Knepley 
3ac09b921SBarry Smith /* SUBMANSEC = PetscSection */
4ac09b921SBarry Smith 
5ea844a1aSMatthew Knepley /*S
6ea844a1aSMatthew Knepley   PetscSection - Mapping from integers in a designated range to contiguous sets of integers.
7ea844a1aSMatthew Knepley 
820662ed9SBarry Smith   The range of a `PetscSection` is in the space of
9ea844a1aSMatthew Knepley   contiguous sets of integers. These ranges are frequently interpreted as domains of other array-like objects,
1087497f52SBarry Smith   especially other `PetscSection`, `Vec`s, and `IS`s. The domain is set with `PetscSectionSetChart()` and does not need to
1187497f52SBarry Smith   start at 0. For each point in the domain of a `PetscSection`, the output set is represented through an offset and a
1287497f52SBarry Smith   count, which are set using `PetscSectionSetOffset()` and `PetscSectionSetDof()` respectively. Lookup is typically using
1387497f52SBarry Smith   accessors or routines like `VecGetValuesSection()`.
14ea844a1aSMatthew Knepley 
1520662ed9SBarry Smith   The `PetscSection` object and methods are intended to be used in the PETSc `Vec` and `Mat` implementations. The indices returned by the `PetscSection`
1620662ed9SBarry Smith   are appropriate for the kind of `Vec` it is associated with. For example, if the vector being indexed is a local vector, we call the section a
1720662ed9SBarry Smith   local section. If the section indexes a global vector, we call it a global section. For parallel vectors, like global vectors, we use negative
1820662ed9SBarry Smith   indices to indicate dofs owned by other processes.
19db527f05SMatthew G. Knepley 
20ea844a1aSMatthew Knepley   Level: beginner
21ea844a1aSMatthew Knepley 
22*b0c76368SJames Wright .seealso: [PetscSection](ch_petscsection), `PetscSectionCreate()`, `PetscSectionDestroy()`, `PetscSectionSym`
23ea844a1aSMatthew Knepley S*/
24ea844a1aSMatthew Knepley typedef struct _p_PetscSection *PetscSection;
25ea844a1aSMatthew Knepley 
26ea844a1aSMatthew Knepley /*S
2787497f52SBarry Smith   PetscSectionSym - Symmetries of the data referenced by a `PetscSection`.
28ea844a1aSMatthew Knepley 
2987497f52SBarry Smith   Often the order of data index by a `PetscSection` is meaningful, and describes additional structure, such as points on a
30ea844a1aSMatthew Knepley   line, grid, or lattice.  If the data is accessed from a different "orientation", then the image of the data under
3187497f52SBarry Smith   access then undergoes a symmetry transformation.  A `PetscSectionSym` specifies these symmetries.  The types of
32ea844a1aSMatthew Knepley   symmetries that can be specified are of the form R * P, where R is a diagonal matrix of scalars, and P is a permutation.
33ea844a1aSMatthew Knepley 
34ea844a1aSMatthew Knepley   Level: developer
35ea844a1aSMatthew Knepley 
36*b0c76368SJames Wright .seealso: [PetscSection](ch_petscsection), `PetscSection`, `PetscSectionSymCreate()`, `PetscSectionSymDestroy()`, `PetscSectionSetSym()`, `PetscSectionGetSym()`, `PetscSectionSetFieldSym()`,
37db781477SPatrick Sanan           `PetscSectionGetFieldSym()`, `PetscSectionGetSymPoints()`, `PetscSectionSymType`, `PetscSectionSymSetType()`, `PetscSectionSymGetType()`
38ea844a1aSMatthew Knepley S*/
39ea844a1aSMatthew Knepley typedef struct _p_PetscSectionSym *PetscSectionSym;
40ea844a1aSMatthew Knepley 
41ea844a1aSMatthew Knepley /*J
4287497f52SBarry Smith   PetscSectionSymType - String with the name of a `PetscSectionSym` type.
43ea844a1aSMatthew Knepley 
44ea844a1aSMatthew Knepley   Level: developer
45ea844a1aSMatthew Knepley 
4687497f52SBarry Smith   Note:
4787497f52SBarry Smith   `PetscSectionSym` has no default implementation, but is used by `DM` in `PetscSectionSymCreateLabel()`.
48ea844a1aSMatthew Knepley 
49*b0c76368SJames Wright .seealso: [PetscSection](ch_petscsection), `PetscSectionSymSetType()`, `PetscSectionSymGetType()`, `PetscSectionSym`, `PetscSectionSymCreate()`, `PetscSectionSymRegister()`
50ea844a1aSMatthew Knepley J*/
51ea844a1aSMatthew Knepley typedef const char *PetscSectionSymType;
52