Actual source code: petscdmdatypes.h

petsc-3.4.5 2014-06-29
  1: #if !defined(_PETSCDMDATYPES_H)
  2: #define _PETSCDMDATYPES_H

  4: #include <petscdmtypes.h>

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

 10:    Level: beginner

 12: .seealso: DMDACreate1d(), DMDACreate2d(), DMDACreate3d(), DMDACreate(), DMDASetStencilType()
 13: E*/
 14: typedef enum { DMDA_STENCIL_STAR,DMDA_STENCIL_BOX } DMDAStencilType;

 16: /*E
 17:     DMDABoundaryType - Describes the choice for fill of ghost cells on physical domain boundaries.

 19:    Level: beginner

 21:    A boundary may be of type DMDA_BOUNDARY_NONE (no ghost nodes), DMDA_BOUNDARY_GHOST (ghost nodes
 22:    exist but aren't filled, you can put values into them and then apply a stencil that uses those ghost locations),
 23:    DMDA_BOUNDARY_MIRROR (not yet implemented for 3d), or DMDA_BOUNDARY_PERIODIC
 24:    (ghost nodes filled by the opposite edge of the domain).

 26:    Note: This is information for the boundary of the __PHYSICAL__ domain. It has nothing to do with boundaries between
 27:      processes, that width is always determined by the stencil width, see DMDASetStencilWidth().

 29: .seealso: DMDASetBoundaryType(), DMDACreate1d(), DMDACreate2d(), DMDACreate3d(), DMDACreate()
 30: E*/
 31: typedef enum { DMDA_BOUNDARY_NONE, DMDA_BOUNDARY_GHOSTED, DMDA_BOUNDARY_MIRROR, DMDA_BOUNDARY_PERIODIC } DMDABoundaryType;

 33: /*E
 34:     DMDAInterpolationType - Defines the type of interpolation that will be returned by
 35:        DMCreateInterpolation.

 37:    Level: beginner

 39: .seealso: DMDACreate1d(), DMDACreate2d(), DMDACreate3d(), DMCreateInterpolation(), DMDASetInterpolationType(), DMDACreate()
 40: E*/
 41: typedef enum { DMDA_Q0, DMDA_Q1 } DMDAInterpolationType;

 43: /*E
 44:     DMDAElementType - Defines the type of elements that will be returned by
 45:        DMDAGetElements()

 47:    Level: beginner

 49: .seealso: DMDACreate1d(), DMDACreate2d(), DMDACreate3d(), DMCreateInterpolation(), DMDASetInterpolationType(),
 50:           DMDASetElementType(), DMDAGetElements(), DMDARestoreElements(), DMDACreate()
 51: E*/
 52: typedef enum { DMDA_ELEMENT_P1, DMDA_ELEMENT_Q1 } DMDAElementType;

 54: /*S
 55:      DMDALocalInfo - C struct that contains information about a structured grid and a processors logical
 56:               location in it.

 58:    Level: beginner

 60:   Concepts: distributed array

 62:   Developer note: Then entries in this struct are int instead of PetscInt so that the elements may
 63:                   be extracted in Fortran as if from an integer array

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

 79: #endif