DACreate3d

Creates an object that will manage the communication of three-dimensional regular array data that is distributed across some processors.

Synopsis

#include "petscda.h"    
int DACreate3d(MPI_Comm comm,DAPeriodicType wrap,DAStencilType stencil_type,int M,
               int N,int P,int m,int n,int p,int dof,int s,int *lx,int *ly,int *lz,DA *inra)
Collective on MPI_Comm

Input Parameters

comm - MPI communicator
wrap - type of periodicity the array should have, if any. Use one of DA_NONPERIODIC, DA_XPERIODIC, DA_YPERIODIC, DA_XYPERIODIC, DA_XYZPERIODIC, DA_XZPERIODIC, or DA_YZPERIODIC.
stencil_type - Type of stencil (DA_STENCIL_STAR or DA_STENCIL_BOX)
M,N,P - global dimension in each direction of the array
m,n,p - corresponding number of processors in each dimension (or PETSC_DECIDE to have calculated)
dof - number of degrees of freedom per node
lx, ly, lz - arrays containing the number of nodes in each cell along the x, y, and z coordinates, or PETSC_NULL. If non-null, these must be of length as m,n,p and the corresponding m,n, or p cannot be PETSC_DECIDE. Sum of the lx[] entries must be M, sum of the ly[] must n, sum of the lz[] must be P
s - stencil width

Output Parameter

inra -the resulting distributed array object

Options Database Key

-da_view - Calls DAView() at the conclusion of DACreate3d()
-da_grid_x <nx> - number of grid points in x direction, if M < 0
-da_grid_y <ny> - number of grid points in y direction, if N < 0
-da_grid_z <nz> - number of grid points in z direction, if P < 0

Notes

The stencil type DA_STENCIL_STAR with width 1 corresponds to the standard 7-pt stencil, while DA_STENCIL_BOX with width 1 denotes the standard 27-pt stencil.

The array data itself is NOT stored in the DA, it is stored in Vec objects; The appropriate vector objects can be obtained with calls to DACreateGlobalVector() and DACreateLocalVector() and calls to VecDuplicate() if more are needed.

Keywords

distributed array, create, three-dimensional

See Also

DADestroy(), DAView(), DACreate1d(), DACreate2d(), DAGlobalToLocalBegin(),
DAGlobalToLocalEnd(), DALocalToGlobal(), DALocalToLocalBegin(), DALocalToLocalEnd(), DAGetInfo(), DACreateGlobalVector(), DACreateLocalVector(), DACreateNaturalVector(), DALoad(), DAView()

Level:beginner
Location:
src/dm/da/src/da3.c
Index of all DA routines
Table of Contents for all manual pages
Index of all manual pages

Examples

src/sles/examples/tutorials/ex22.c.html
src/snes/examples/tutorials/ex14.c.html
src/snes/examples/tutorials/ex20.c.html