DMDACreate3d#

Creates an object that will manage the communication of three-dimensional regular array data that is distributed across one or more MPI processes.

Synopsis#

#include "petscdmda.h"    
PetscErrorCode DMDACreate3d(MPI_Comm comm, DMBoundaryType bx, DMBoundaryType by, DMBoundaryType bz, DMDAStencilType stencil_type, PetscInt M, PetscInt N, PetscInt P, PetscInt m, PetscInt n, PetscInt p, PetscInt dof, PetscInt s, const PetscInt lx[], const PetscInt ly[], const PetscInt lz[], DM *da)

Collective

Input Parameters#

  • comm - MPI communicator

  • bx - type of x ghost nodes the array have. Use one of DM_BOUNDARY_NONE, DM_BOUNDARY_GHOSTED, DM_BOUNDARY_PERIODIC.

  • by - type of y ghost nodes the array have. Use one of DM_BOUNDARY_NONE, DM_BOUNDARY_GHOSTED, DM_BOUNDARY_PERIODIC.

  • bz - type of z ghost nodes the array have. Use one of DM_BOUNDARY_NONE, DM_BOUNDARY_GHOSTED, DM_BOUNDARY_PERIODIC.

  • stencil_type - Type of stencil (DMDA_STENCIL_STAR or DMDA_STENCIL_BOX)

  • M - global dimension in the x direction of the array

  • N - global dimension in the y direction of the array

  • P - global dimension in the z direction of the array

  • m - corresponding number of processors in the x dimension (or PETSC_DECIDE to have calculated)

  • n - corresponding number of processors in the y dimension (or PETSC_DECIDE to have calculated)

  • p - corresponding number of processors in the z dimension (or PETSC_DECIDE to have calculated)

  • dof - number of degrees of freedom per node

  • s - stencil width

  • lx - arrays containing the number of nodes in each cell along the x coordinates, or NULL.

  • ly - arrays containing the number of nodes in each cell along the y coordinates, or NULL.

  • lz - arrays containing the number of nodes in each cell along the z coordinates, or NULL.

Output Parameter#

  • da - the resulting distributed array object

Options Database Keys#

  • -dm_view - Calls DMView() at the conclusion of DMDACreate3d()

  • -da_grid_x nx - number of grid points in the x direction

  • -da_grid_y ny - number of grid points in the y direction

  • -da_grid_z nz - number of grid points in the z direction

  • -da_processors_x MX - number of processors in the x direction

  • -da_processors_y MY - number of processors in the y direction

  • -da_processors_z MZ - number of processors in the z direction

  • -da_bd_x bx - boundary type in the x direction

  • -da_bd_y by - boundary type in the y direction

  • -da_bd_z bz - boundary type in the z direction

  • -da_bd_all bt - boundary type in all directions

  • -da_refine_x rx - refinement ratio in the x direction

  • -da_refine_y ry - refinement ratio in the y direction

  • -da_refine_z rz - refinement ratio in the z direction

  • -da_refine n - refine the DMDA n times before creating it

Notes#

If lx, ly, or lz are 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.

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

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

You must call DMSetUp() after this call before using this DM.

To use the options database to change values in the DMDA call DMSetFromOptions() after this call but before DMSetUp().

See Also#

DMDA - Creating vectors for structured grids, DM, DMDA, DMDestroy(), DMView(), DMDACreate1d(), DMDACreate2d(), DMGlobalToLocalBegin(), DMDAGetRefinementFactor(), DMGlobalToLocalEnd(), DMLocalToGlobalBegin(), DMLocalToLocalBegin(), DMLocalToLocalEnd(), DMDASetRefinementFactor(), DMDAGetInfo(), DMCreateGlobalVector(), DMCreateLocalVector(), DMDACreateNaturalVector(), DMLoad(), DMDAGetOwnershipRanges(), DMStagCreate3d(), DMBoundaryType

Level#

beginner

Location#

src/dm/impls/da/da3.c

Examples#

src/snes/tutorials/ex16.c
src/snes/tutorials/ex48.c
src/ksp/ksp/tutorials/ex71.c
src/ksp/ksp/tutorials/ex59.c
src/ksp/ksp/tutorials/ex42.c
src/ts/tutorials/ex14.c
src/ksp/ksp/tutorials/ex34.c
src/ksp/ksp/tutorials/ex22f.F90
src/snes/tutorials/ex14.c
src/ksp/ksp/tutorials/ex45.c


Index of all DMDA routines
Table of Contents for all manual pages
Index of all manual pages