xref: /petsc/include/petscdmdatypes.h (revision 0e02354e4efb6ae7920bb0e7d191735ccbbd1e1e)
1 #if !defined(PETSCDMDATYPES_H)
2 #define PETSCDMDATYPES_H
3 
4 #include <petscdmtypes.h>
5 
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: `DMDACreate1d()`, `DMDACreate2d()`, `DMDACreate3d()`, `DMDACreate()`, `DMDASetStencilType()`
15 E*/
16 typedef enum { DMDA_STENCIL_STAR,DMDA_STENCIL_BOX } DMDAStencilType;
17 
18 /*E
19     DMDAInterpolationType - Defines the type of interpolation that will be returned by
20        DMCreateInterpolation.
21 
22    Level: beginner
23 
24 .seealso: `DMDACreate1d()`, `DMDACreate2d()`, `DMDACreate3d()`, `DMCreateInterpolation()`, `DMDASetInterpolationType()`, `DMDACreate()`
25 E*/
26 typedef enum { DMDA_Q0, DMDA_Q1 } DMDAInterpolationType;
27 
28 /*E
29     DMDAElementType - Defines the type of elements that will be returned by
30        DMDAGetElements()
31 
32    Level: beginner
33 
34 .seealso: `DMDACreate1d()`, `DMDACreate2d()`, `DMDACreate3d()`, `DMCreateInterpolation()`, `DMDASetInterpolationType()`,
35           `DMDASetElementType()`, `DMDAGetElements()`, `DMDARestoreElements()`, `DMDACreate()`
36 E*/
37 typedef enum { DMDA_ELEMENT_P1, DMDA_ELEMENT_Q1 } DMDAElementType;
38 
39 /*S
40      DMDALocalInfo - C struct that contains information about a structured grid and a processors logical
41               location in it.
42 
43    Level: beginner
44 
45   Fortran Notes - This should be declared as
46 $    DMDALocalInfo :: info(DMDA_LOCAL_INFO_SIZE)
47      and the entries accessed via
48 $    info(DMDA_LOCAL_INFO_DIM)
49 $    info(DMDA_LOCAL_INFO_DOF) etc.
50    The entries bx,by,bz, st, and da are not accessible from Fortran.
51 
52 .seealso: `DMDACreate1d()`, `DMDACreate2d()`, `DMDACreate3d()`, `DMDestroy()`, `DM`, `DMDAGetLocalInfo()`, `DMDAGetInfo()`
53 S*/
54 typedef struct {
55   PetscInt         dim,dof,sw;
56   PetscInt         mx,my,mz;    /* global number of grid points in each direction */
57   PetscInt         xs,ys,zs;    /* starting point of this processor, excluding ghosts */
58   PetscInt         xm,ym,zm;    /* number of grid points on this processor, excluding ghosts */
59   PetscInt         gxs,gys,gzs;    /* starting point of this processor including ghosts */
60   PetscInt         gxm,gym,gzm;    /* number of grid points on this processor including ghosts */
61   DMBoundaryType   bx,by,bz; /* type of ghost nodes at boundary */
62   DMDAStencilType  st;
63   DM               da;
64 } DMDALocalInfo;
65 
66 #endif
67