xref: /petsc/include/petscdmdatypes.h (revision af27ebaa0199971c43fd2e2e162251afd1bcda49)
1a4963045SJacob Faibussowitsch #pragma once
21e25c274SJed Brown 
31e25c274SJed Brown #include <petscdmtypes.h>
41e25c274SJed Brown 
5ac09b921SBarry Smith /* SUBMANSEC = DMDA */
6ac09b921SBarry Smith 
71e25c274SJed Brown /*E
81e25c274SJed Brown     DMDAStencilType - Determines if the stencil extends only along the coordinate directions, or also
91e25c274SJed Brown                       to the northeast, northwest etc
101e25c274SJed Brown 
111e25c274SJed Brown    Level: beginner
121e25c274SJed Brown 
13*af27ebaaSBarry Smith .seealso: [](ch_dmbase), `DMDA`, `DMDA_STENCIL_BOX`, `DMDA_STENCIL_STAR`,`DMDACreate1d()`, `DMDACreate2d()`, `DMDACreate3d()`, `DMDACreate()`, `DMDASetStencilType()`
141e25c274SJed Brown E*/
159371c9d4SSatish Balay typedef enum {
169371c9d4SSatish Balay   DMDA_STENCIL_STAR,
179371c9d4SSatish Balay   DMDA_STENCIL_BOX
189371c9d4SSatish Balay } DMDAStencilType;
191e25c274SJed Brown 
201e25c274SJed Brown /*E
211e25c274SJed Brown     DMDAInterpolationType - Defines the type of interpolation that will be returned by
2287497f52SBarry Smith                             `DMCreateInterpolation()`.
231e25c274SJed Brown 
241e25c274SJed Brown    Level: beginner
251e25c274SJed Brown 
26*af27ebaaSBarry Smith .seealso: [](ch_dmbase), `DMDA`, `DMDACreate1d()`, `DMDACreate2d()`, `DMDACreate3d()`, `DMCreateInterpolation()`, `DMDASetInterpolationType()`, `DMDACreate()`
271e25c274SJed Brown E*/
289371c9d4SSatish Balay typedef enum {
299371c9d4SSatish Balay   DMDA_Q0,
309371c9d4SSatish Balay   DMDA_Q1
319371c9d4SSatish Balay } DMDAInterpolationType;
321e25c274SJed Brown 
331e25c274SJed Brown /*E
341e25c274SJed Brown    DMDAElementType - Defines the type of elements that will be returned by
3587497f52SBarry Smith                      `DMDAGetElements()`
361e25c274SJed Brown 
371e25c274SJed Brown    Level: beginner
381e25c274SJed Brown 
39*af27ebaaSBarry Smith .seealso: [](ch_dmbase), `DMDA`, `DMDACreate1d()`, `DMDACreate2d()`, `DMDACreate3d()`, `DMCreateInterpolation()`, `DMDASetInterpolationType()`,
40db781477SPatrick Sanan           `DMDASetElementType()`, `DMDAGetElements()`, `DMDARestoreElements()`, `DMDACreate()`
411e25c274SJed Brown E*/
429371c9d4SSatish Balay typedef enum {
439371c9d4SSatish Balay   DMDA_ELEMENT_P1,
449371c9d4SSatish Balay   DMDA_ELEMENT_Q1
459371c9d4SSatish Balay } DMDAElementType;
461e25c274SJed Brown 
471e25c274SJed Brown /*S
48*af27ebaaSBarry Smith   DMDALocalInfo - C struct that contains information about a structured grid and a processes logical
491e25c274SJed Brown                   location in it.
501e25c274SJed Brown 
511e25c274SJed Brown   Level: beginner
521e25c274SJed Brown 
5316a05f60SBarry Smith   Fortran Note:
5416a05f60SBarry Smith   This should be declared as
5587497f52SBarry Smith $    `DMDALocalInfo` :: info(DMDA_LOCAL_INFO_SIZE)
56d3187782SBarry Smith      and the entries accessed via
5720f4b53cSBarry Smith .vb
5820f4b53cSBarry Smith     info(DMDA_LOCAL_INFO_DIM)
5920f4b53cSBarry Smith     info(DMDA_LOCAL_INFO_DOF) etc.
6020f4b53cSBarry Smith .ve
61d3187782SBarry Smith    The entries bx,by,bz, st, and da are not accessible from Fortran.
621e25c274SJed Brown 
63*af27ebaaSBarry Smith .seealso: [](ch_dmbase), `DMDA`, `DMDACreate1d()`, `DMDACreate2d()`, `DMDACreate3d()`, `DMDestroy()`, `DM`, `DMDAGetLocalInfo()`, `DMDAGetInfo()`
641e25c274SJed Brown S*/
651e25c274SJed Brown typedef struct {
661e25c274SJed Brown   PetscInt        dim, dof, sw;
671e25c274SJed Brown   PetscInt        mx, my, mz;    /* global number of grid points in each direction */
681e25c274SJed Brown   PetscInt        xs, ys, zs;    /* starting point of this processor, excluding ghosts */
691e25c274SJed Brown   PetscInt        xm, ym, zm;    /* number of grid points on this processor, excluding ghosts */
701e25c274SJed Brown   PetscInt        gxs, gys, gzs; /* starting point of this processor including ghosts */
711e25c274SJed Brown   PetscInt        gxm, gym, gzm; /* number of grid points on this processor including ghosts */
72bff4a2f0SMatthew G. Knepley   DMBoundaryType  bx, by, bz;    /* type of ghost nodes at boundary */
731e25c274SJed Brown   DMDAStencilType st;
741e25c274SJed Brown   DM              da;
751e25c274SJed Brown } DMDALocalInfo;
76