xref: /petsc/include/petscdmdatypes.h (revision 6d8694c4fbab79f9439f1ad13c0386ba7ee1ca4b)
1 #pragma once
2 
3 #include <petscdmtypes.h>
4 
5 /* MANSEC = DM */
6 /* SUBMANSEC = DMDA */
7 
8 /*E
9     DMDAStencilType - Determines if the stencil extends only along the coordinate directions, or also
10                       to the northeast, northwest etc
11 
12    Level: beginner
13 
14 .seealso: [](ch_dmbase), `DMDA`, `DMDA_STENCIL_BOX`, `DMDA_STENCIL_STAR`,`DMDACreate1d()`, `DMDACreate2d()`, `DMDACreate3d()`, `DMDACreate()`, `DMDASetStencilType()`
15 E*/
16 typedef enum {
17   DMDA_STENCIL_STAR,
18   DMDA_STENCIL_BOX
19 } DMDAStencilType;
20 
21 /*E
22     DMDAInterpolationType - Defines the type of interpolation that will be returned by
23                             `DMCreateInterpolation()`.
24 
25    Level: beginner
26 
27 .seealso: [](ch_dmbase), `DMDA`, `DMDACreate1d()`, `DMDACreate2d()`, `DMDACreate3d()`, `DMCreateInterpolation()`, `DMDASetInterpolationType()`, `DMDACreate()`
28 E*/
29 typedef enum {
30   DMDA_Q0,
31   DMDA_Q1
32 } DMDAInterpolationType;
33 
34 /*E
35    DMDAElementType - Defines the type of elements that will be returned by
36                      `DMDAGetElements()`
37 
38    Level: beginner
39 
40 .seealso: [](ch_dmbase), `DMDA`, `DMDACreate1d()`, `DMDACreate2d()`, `DMDACreate3d()`, `DMCreateInterpolation()`, `DMDASetInterpolationType()`,
41           `DMDASetElementType()`, `DMDAGetElements()`, `DMDARestoreElements()`, `DMDACreate()`
42 E*/
43 typedef enum {
44   DMDA_ELEMENT_P1,
45   DMDA_ELEMENT_Q1
46 } DMDAElementType;
47 
48 /*S
49   DMDALocalInfo - C struct that contains information about a structured grid and a processes logical location in it.
50 
51   Level: beginner
52 
53   Fortran Note:
54   This is a derived type whose entries can be directly accessed
55 
56 .seealso: [](ch_dmbase), `DMDA`, `DMDACreate1d()`, `DMDACreate2d()`, `DMDACreate3d()`, `DMDestroy()`, `DM`, `DMDAGetLocalInfo()`, `DMDAGetInfo()`
57 S*/
58 typedef struct {
59   DM              da;
60   PetscInt        dim, dof, sw;
61   PetscInt        mx, my, mz;    /* global number of grid points in each direction */
62   PetscInt        xs, ys, zs;    /* starting point of this processor, excluding ghosts */
63   PetscInt        xm, ym, zm;    /* number of grid points on this processor, excluding ghosts */
64   PetscInt        gxs, gys, gzs; /* starting point of this processor including ghosts */
65   PetscInt        gxm, gym, gzm; /* number of grid points on this processor including ghosts */
66   DMBoundaryType  bx, by, bz;    /* type of ghost nodes at boundary */
67   DMDAStencilType st;
68 } DMDALocalInfo;
69