Actual source code: petscdmdatypes.h

  1: #ifndef PETSCDMDATYPES_H
  2: #define PETSCDMDATYPES_H

  4: #include <petscdmtypes.h>

  6: /* SUBMANSEC = DMDA */

  8: /*E
  9:     DMDAStencilType - Determines if the stencil extends only along the coordinate directions, or also
 10:       to the northeast, northwest etc

 12:    Level: beginner

 14: .seealso: `DMDA`, `DMDACreate1d()`, `DMDACreate2d()`, `DMDACreate3d()`, `DMDACreate()`, `DMDASetStencilType()`
 15: E*/
 16: typedef enum {
 17:   DMDA_STENCIL_STAR,
 18:   DMDA_STENCIL_BOX
 19: } DMDAStencilType;

 21: /*E
 22:     DMDAInterpolationType - Defines the type of interpolation that will be returned by
 23:        `DMCreateInterpolation()`.

 25:    Level: beginner

 27: .seealso: `DMDA`, `DMDACreate1d()`, `DMDACreate2d()`, `DMDACreate3d()`, `DMCreateInterpolation()`, `DMDASetInterpolationType()`, `DMDACreate()`
 28: E*/
 29: typedef enum {
 30:   DMDA_Q0,
 31:   DMDA_Q1
 32: } DMDAInterpolationType;

 34: /*E
 35:     DMDAElementType - Defines the type of elements that will be returned by
 36:        `DMDAGetElements()`

 38:    Level: beginner

 40: .seealso: `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;

 48: /*S
 49:      DMDALocalInfo - C struct that contains information about a structured grid and a processors logical
 50:               location in it.

 52:    Level: beginner

 54:   Fortran Note:
 55:   This should be declared as
 56: $    `DMDALocalInfo` :: info(DMDA_LOCAL_INFO_SIZE)
 57:      and the entries accessed via
 58: .vb
 59:     info(DMDA_LOCAL_INFO_DIM)
 60:     info(DMDA_LOCAL_INFO_DOF) etc.
 61: .ve
 62:    The entries bx,by,bz, st, and da are not accessible from Fortran.

 64: .seealso: `DMDA`, `DMDACreate1d()`, `DMDACreate2d()`, `DMDACreate3d()`, `DMDestroy()`, `DM`, `DMDAGetLocalInfo()`, `DMDAGetInfo()`
 65: S*/
 66: typedef struct {
 67:   PetscInt        dim, dof, sw;
 68:   PetscInt        mx, my, mz;    /* global number of grid points in each direction */
 69:   PetscInt        xs, ys, zs;    /* starting point of this processor, excluding ghosts */
 70:   PetscInt        xm, ym, zm;    /* number of grid points on this processor, excluding ghosts */
 71:   PetscInt        gxs, gys, gzs; /* starting point of this processor including ghosts */
 72:   PetscInt        gxm, gym, gzm; /* number of grid points on this processor including ghosts */
 73:   DMBoundaryType  bx, by, bz;    /* type of ghost nodes at boundary */
 74:   DMDAStencilType st;
 75:   DM              da;
 76: } DMDALocalInfo;

 78: #endif