xref: /petsc/include/petscdmdatypes.h (revision 1e25c2744a56dc779d05d2a7975a7f2272f1aa7b)
1*1e25c274SJed Brown #if !defined(_PETSCDMDATYPES_H)
2*1e25c274SJed Brown #define _PETSCDMDATYPES_H
3*1e25c274SJed Brown 
4*1e25c274SJed Brown #include <petscdmtypes.h>
5*1e25c274SJed Brown 
6*1e25c274SJed Brown /*E
7*1e25c274SJed Brown     DMDAStencilType - Determines if the stencil extends only along the coordinate directions, or also
8*1e25c274SJed Brown       to the northeast, northwest etc
9*1e25c274SJed Brown 
10*1e25c274SJed Brown    Level: beginner
11*1e25c274SJed Brown 
12*1e25c274SJed Brown .seealso: DMDACreate1d(), DMDACreate2d(), DMDACreate3d(), DMDACreate(), DMDASetStencilType()
13*1e25c274SJed Brown E*/
14*1e25c274SJed Brown typedef enum { DMDA_STENCIL_STAR,DMDA_STENCIL_BOX } DMDAStencilType;
15*1e25c274SJed Brown 
16*1e25c274SJed Brown /*E
17*1e25c274SJed Brown     DMDABoundaryType - Describes the choice for fill of ghost cells on physical domain boundaries.
18*1e25c274SJed Brown 
19*1e25c274SJed Brown    Level: beginner
20*1e25c274SJed Brown 
21*1e25c274SJed Brown    A boundary may be of type DMDA_BOUNDARY_NONE (no ghost nodes), DMDA_BOUNDARY_GHOST (ghost nodes
22*1e25c274SJed Brown    exist but aren't filled, you can put values into them and then apply a stencil that uses those ghost locations),
23*1e25c274SJed Brown    DMDA_BOUNDARY_MIRROR (not yet implemented for 3d), or DMDA_BOUNDARY_PERIODIC
24*1e25c274SJed Brown    (ghost nodes filled by the opposite edge of the domain).
25*1e25c274SJed Brown 
26*1e25c274SJed Brown    Note: This is information for the boundary of the __PHYSICAL__ domain. It has nothing to do with boundaries between
27*1e25c274SJed Brown      processes, that width is always determined by the stencil width, see DMDASetStencilWidth().
28*1e25c274SJed Brown 
29*1e25c274SJed Brown .seealso: DMDASetBoundaryType(), DMDACreate1d(), DMDACreate2d(), DMDACreate3d(), DMDACreate()
30*1e25c274SJed Brown E*/
31*1e25c274SJed Brown typedef enum { DMDA_BOUNDARY_NONE, DMDA_BOUNDARY_GHOSTED, DMDA_BOUNDARY_MIRROR, DMDA_BOUNDARY_PERIODIC } DMDABoundaryType;
32*1e25c274SJed Brown 
33*1e25c274SJed Brown /*E
34*1e25c274SJed Brown     DMDAInterpolationType - Defines the type of interpolation that will be returned by
35*1e25c274SJed Brown        DMCreateInterpolation.
36*1e25c274SJed Brown 
37*1e25c274SJed Brown    Level: beginner
38*1e25c274SJed Brown 
39*1e25c274SJed Brown .seealso: DMDACreate1d(), DMDACreate2d(), DMDACreate3d(), DMCreateInterpolation(), DMDASetInterpolationType(), DMDACreate()
40*1e25c274SJed Brown E*/
41*1e25c274SJed Brown typedef enum { DMDA_Q0, DMDA_Q1 } DMDAInterpolationType;
42*1e25c274SJed Brown 
43*1e25c274SJed Brown /*E
44*1e25c274SJed Brown     DMDAElementType - Defines the type of elements that will be returned by
45*1e25c274SJed Brown        DMDAGetElements()
46*1e25c274SJed Brown 
47*1e25c274SJed Brown    Level: beginner
48*1e25c274SJed Brown 
49*1e25c274SJed Brown .seealso: DMDACreate1d(), DMDACreate2d(), DMDACreate3d(), DMCreateInterpolation(), DMDASetInterpolationType(),
50*1e25c274SJed Brown           DMDASetElementType(), DMDAGetElements(), DMDARestoreElements(), DMDACreate()
51*1e25c274SJed Brown E*/
52*1e25c274SJed Brown typedef enum { DMDA_ELEMENT_P1, DMDA_ELEMENT_Q1 } DMDAElementType;
53*1e25c274SJed Brown 
54*1e25c274SJed Brown /*S
55*1e25c274SJed Brown      DMDALocalInfo - C struct that contains information about a structured grid and a processors logical
56*1e25c274SJed Brown               location in it.
57*1e25c274SJed Brown 
58*1e25c274SJed Brown    Level: beginner
59*1e25c274SJed Brown 
60*1e25c274SJed Brown   Concepts: distributed array
61*1e25c274SJed Brown 
62*1e25c274SJed Brown   Developer note: Then entries in this struct are int instead of PetscInt so that the elements may
63*1e25c274SJed Brown                   be extracted in Fortran as if from an integer array
64*1e25c274SJed Brown 
65*1e25c274SJed Brown .seealso:  DMDACreate1d(), DMDACreate2d(), DMDACreate3d(), DMDestroy(), DM, DMDAGetLocalInfo(), DMDAGetInfo()
66*1e25c274SJed Brown S*/
67*1e25c274SJed Brown typedef struct {
68*1e25c274SJed Brown   PetscInt         dim,dof,sw;
69*1e25c274SJed Brown   PetscInt         mx,my,mz;    /* global number of grid points in each direction */
70*1e25c274SJed Brown   PetscInt         xs,ys,zs;    /* starting point of this processor, excluding ghosts */
71*1e25c274SJed Brown   PetscInt         xm,ym,zm;    /* number of grid points on this processor, excluding ghosts */
72*1e25c274SJed Brown   PetscInt         gxs,gys,gzs;    /* starting point of this processor including ghosts */
73*1e25c274SJed Brown   PetscInt         gxm,gym,gzm;    /* number of grid points on this processor including ghosts */
74*1e25c274SJed Brown   DMDABoundaryType bx,by,bz; /* type of ghost nodes at boundary */
75*1e25c274SJed Brown   DMDAStencilType  st;
76*1e25c274SJed Brown   DM               da;
77*1e25c274SJed Brown } DMDALocalInfo;
78*1e25c274SJed Brown 
79*1e25c274SJed Brown #endif
80