DMStagCreate3d#
Create an object to manage data living on the elements, faces, edges, and vertices of a parallelized regular 3D grid.
Synopsis#
#include "petscdmstag.h"
PetscErrorCode DMStagCreate3d(MPI_Comm comm, DMBoundaryType bndx, DMBoundaryType bndy, DMBoundaryType bndz, PetscInt M, PetscInt N, PetscInt P, PetscInt m, PetscInt n, PetscInt p, PetscInt dof0, PetscInt dof1, PetscInt dof2, PetscInt dof3, DMStagStencilType stencilType, PetscInt stencilWidth, const PetscInt lx[], const PetscInt ly[], const PetscInt lz[], DM *dm)
Collective
Input Parameters#
comm - MPI communicator
bndx - x boundary type,
DM_BOUNDARY_NONE,DM_BOUNDARY_PERIODIC, orDM_BOUNDARY_GHOSTEDbndy - y boundary type,
DM_BOUNDARY_NONE,DM_BOUNDARY_PERIODIC, orDM_BOUNDARY_GHOSTEDbndz - z boundary type,
DM_BOUNDARY_NONE,DM_BOUNDARY_PERIODIC, orDM_BOUNDARY_GHOSTEDM - global number of elements in x direction
N - global number of elements in y direction
P - global number of elements in z direction
m - number of MPI processes in the x direction (may be
PETSC_DECIDE)n - number of MPI processes in the y direction (may be
PETSC_DECIDE)p - number of MPI processes in the z direction (may be
PETSC_DECIDE)dof0 - number of degrees of freedom per vertex/0-cell
dof1 - number of degrees of freedom per edge/1-cell
dof2 - number of degrees of freedom per face/2-cell
dof3 - number of degrees of freedom per element/3-cell
stencilType - ghost/halo region type:
DMSTAG_STENCIL_NONE,DMSTAG_STENCIL_BOX, orDMSTAG_STENCIL_STARstencilWidth - width, in elements, of halo/ghost region
lx - array of local x element counts, of length equal to
m, summing toM, orNULLly - arrays of local y element counts, of length equal to
n, summing toN, orNULLlz - arrays of local z element counts, of length equal to
p, summing toP, orNULL
Output Parameter#
dm - the new
DMSTAGobject
Options Database Keys#
-dm_view viewer_specification - calls
DMView()at the conclusion ofDMSetUp(). SeePetscOptionsCreateViewer()for the format ofviewer_specification-stag_grid_x nx - number of elements in the x direction
-stag_grid_y ny - number of elements in the y direction
-stag_grid_z nz - number of elements in the z direction
-stag_ranks_x rx - number of MPI processes in the x direction
-stag_ranks_y ry - number of MPI processes in the y direction
-stag_ranks_z rz - number of MPI processes in the z direction
-stag_stencil_width width - width of ghost region, in elements
-stag_boundary_type_x (none|ghosted|periodic) -
DMBoundaryTypeto use in x direction-stag_boundary_type_y (none|ghosted|periodic) -
DMBoundaryTypeto use in y direction-stag_boundary_type_z (none|ghosted|periodic) -
DMBoundaryTypeto use in z direction
Notes#
You must call DMSetUp() after this call before using the DM.
If you wish to use the options database (see the keys above) to change values in the DMSTAG, you must call
DMSetFromOptions() after this function but before DMSetUp().
See Also#
DMSTAG: Staggered, Structured Grid, DMSTAG, DMStagCreate1d(), DMStagCreate2d(), DMDestroy(), DMView(), DMCreateGlobalVector(), DMCreateLocalVector(), DMLocalToGlobalBegin(),
DMDACreate3d(), PetscOptionsCreateViewer()
Level#
beginner
Location#
Examples#
src/dm/impls/stag/tutorials/ex3.c
src/dm/impls/stag/tutorials/ex6.c
src/dm/impls/stag/tutorials/ex4.c
Index of all DMStag routines
Table of Contents for all manual pages
Index of all manual pages