DMDA (Structured Grids)
DMDA manages structured grids with regular topology in 1D, 2D, and 3D. It's designed for finite difference and finite volume methods on Cartesian grids.
Overview
DMDA provides:
- Regular grid topology in 1D, 2D, or 3D
- Efficient stencil-based communication
- Natural ordering and ghost point management
- Support for multiple degrees of freedom per grid point
- Boundary type specification (periodic, ghosted, none)
Basic Usage Pattern
using PETSc, MPI
petsclib = PETSc.petsclibs[1]
PETSc.initialize(petsclib)
# Get PETSc types
PetscInt = petsclib.PetscInt
# Create a 2D structured grid: 10x10 global size, 1 dof per point
dm = LibPETSc.DMDACreate2d(
petsclib,
MPI.COMM_WORLD,
LibPETSc.DM_BOUNDARY_NONE, # x boundary
LibPETSc.DM_BOUNDARY_NONE, # y boundary
LibPETSc.DMDA_STENCIL_STAR, # stencil type
PetscInt(10), PetscInt(10), # global dimensions
PetscInt(LibPETSc.PETSC_DECIDE), # processes in x
PetscInt(LibPETSc.PETSC_DECIDE), # processes in y
PetscInt(1), # dof per node
PetscInt(1), # stencil width
C_NULL, C_NULL # nodes per process
)
# Set up and use
LibPETSc.DMSetFromOptions(petsclib, dm)
LibPETSc.DMSetUp(petsclib, dm)
# Get local vector with ghost points
local_vec = LibPETSc.DMCreateLocalVector(petsclib, dm)
# Get global vector
global_vec = LibPETSc.DMCreateGlobalVector(petsclib, dm)
# Cleanup
LibPETSc.VecDestroy(petsclib, local_vec)
LibPETSc.VecDestroy(petsclib, global_vec)
LibPETSc.DMDestroy(petsclib, dm)DMDA Functions
PETSc.LibPETSc.DMDAConvertToCell — Method
cell::PetscInt = DMDAConvertToCell(petsclib::PetscLibType, dm::AbstractPetscDM, s::MatStencil)Convert a (i,j,k) location in a DMDA to its local cell or vertex number
Not Collective
Input Parameters:
dm- theDMDAs- aMatStencilthat provides (i,j,k)
Output Parameter:
cell- the local cell or vertext number
Level: developer
See also: DM, DMDA, DMDAGetGhostCorners()
External Links
- PETSc Manual:
DMDA/DMDAConvertToCell
PETSc.LibPETSc.DMDACreate — Method
da::PetscDM = DMDACreate(petsclib::PetscLibType, comm::MPI_Comm)Creates a DMDA object for managing structured grids.
Collective
Input Parameter:
comm- The communicator for theDMDAobject
Output Parameter:
da- theDMDAobject
Level: advanced
See also: DM, DMDA, DMSetUp(), DMDASetSizes(), DMClone(), DMDACreate1d(), DMDACreate2d(), DMDACreate3d()
External Links
- PETSc Manual:
DMDA/DMDACreate
PETSc.LibPETSc.DMDACreate1d — Method
da::PetscDM = DMDACreate1d(petsclib::PetscLibType, comm::MPI_Comm, bx::DMBoundaryType, M::PetscInt, dof::PetscInt, s::PetscInt, lx::Union{Ptr, Vector{PetscInt}})Creates an object that will manage the communication of one-dimensional regular array data that is distributed across one or mpre MPI processes.
Collective
Input Parameters:
comm- MPI communicatorbx- type of ghost cells at the boundary the array should have, if any. Use
DM_BOUNDARY_NONE, DM_BOUNDARY_GHOSTED, or DM_BOUNDARY_PERIODIC.
M- global dimension of the array (that is the number of grid points)dof- number of degrees of freedom per nodes- stencil widthlx- array containing number of nodes in the X direction on each processor,
or NULL. If non-null, must be of length as the number of processes in the MPI_Comm. The sum of these entries must equal M
Output Parameter:
da- the resulting distributed array object
Options Database Keys:
-dm_view- CallsDMView()at the conclusion ofDMDACreate1d()-da_grid_x nx- number of grid points in the x direction-da_refine_x rx- refinement factor-da_refine n- refine theDMDAntimes before creating it
Level: beginner
See also: DMDA, DM, DMDestroy(), DMView(), DMDACreate2d(), DMDACreate3d(), DMGlobalToLocalBegin(), DMDASetRefinementFactor(), DMGlobalToLocalEnd(), DMLocalToGlobalBegin(), DMLocalToLocalBegin(), DMLocalToLocalEnd(), DMDAGetRefinementFactor(), DMDAGetInfo(), DMCreateGlobalVector(), DMCreateLocalVector(), DMDACreateNaturalVector(), DMLoad(), DMDAGetOwnershipRanges(), DMStagCreate1d(), DMBoundaryType
External Links
- PETSc Manual:
DMDA/DMDACreate1d
PETSc.LibPETSc.DMDACreate2d — Method
da::PetscDM = DMDACreate2d(petsclib::PetscLibType, comm::MPI_Comm, bx::DMBoundaryType, by::DMBoundaryType, stencil_type::DMDAStencilType, M::PetscInt, N::PetscInt, M_m::PetscInt, M_n::PetscInt, dof::PetscInt, s::PetscInt, lx::Union{Ptr, Vector{PetscInt}}, ly::Union{Ptr, Vector{PetscInt}})Creates an object that will manage the communication of two-dimensional regular array data that is distributed across one or more MPI processes.
Collective
Input Parameters:
comm- MPI communicatorbx- type of ghost nodes the x array have. Use one ofDM_BOUNDARY_NONE,DM_BOUNDARY_GHOSTED,DM_BOUNDARY_PERIODIC.by- type of ghost nodes the y array have. Use one ofDM_BOUNDARY_NONE,DM_BOUNDARY_GHOSTED,DM_BOUNDARY_PERIODIC.stencil_type- stencil type. Use eitherDMDA_STENCIL_BOXorDMDA_STENCIL_STAR.M- global dimension in the x direction of the arrayN- global dimension in the y direction of the arraym- corresponding number of processors in the x dimension (orPETSC_DECIDEto have calculated)n- corresponding number of processors in the y dimension (orPETSC_DECIDEto have calculated)dof- number of degrees of freedom per nodes- stencil widthlx- arrays containing the number of nodes in each cell along the x coordinates, orNULL.ly- arrays containing the number of nodes in each cell along the y coordinates, orNULL.
Output Parameter:
da- the resulting distributed array object
Options Database Keys:
-dm_view- CallsDMView()at the conclusion ofDMDACreate2d()-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_processors_x nx- number of processors in the x direction-da_processors_y ny- number of processors in the y direction-da_bd_x bx- boundary type in the x direction-da_bd_y by- boundary type in the y 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 n- refine theDMDAntimes before creating
Level: beginner
See also: DM, DMDA, DMDestroy(), DMView(), DMDACreate1d(), DMDACreate3d(), DMGlobalToLocalBegin(), DMDAGetRefinementFactor(), DMGlobalToLocalEnd(), DMLocalToGlobalBegin(), DMLocalToLocalBegin(), DMLocalToLocalEnd(), DMDASetRefinementFactor(), DMDAGetInfo(), DMCreateGlobalVector(), DMCreateLocalVector(), DMDACreateNaturalVector(), DMLoad(), DMDAGetOwnershipRanges(), DMStagCreate2d(), DMBoundaryType
External Links
- PETSc Manual:
DMDA/DMDACreate2d
PETSc.LibPETSc.DMDACreate3d — Method
da::PetscDM = DMDACreate3d(petsclib::PetscLibType, comm::MPI_Comm, bx::DMBoundaryType, by::DMBoundaryType, bz::DMBoundaryType, stencil_type::DMDAStencilType, M::PetscInt, N::PetscInt, P::PetscInt, M_m::PetscInt, M_n::PetscInt, M_p::PetscInt, dof::PetscInt, s::PetscInt, lx::Union{Ptr, Vector{PetscInt}}, ly::Union{Ptr, Vector{PetscInt}}, lz::Union{Ptr, Vector{PetscInt}})Creates an object that will manage the communication of three-dimensional regular array data that is distributed across one or more MPI processes.
Collective
Input Parameters:
comm- MPI communicatorbx- 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_STARorDMDA_STENCIL_BOX)M- global dimension in the x direction of the arrayN- global dimension in the y direction of the arrayP- global dimension in the z direction of the arraym- corresponding number of processors in the x dimension (orPETSC_DECIDEto have calculated)n- corresponding number of processors in the y dimension (orPETSC_DECIDEto have calculated)p- corresponding number of processors in the z dimension (orPETSC_DECIDEto have calculated)dof- number of degrees of freedom per nodes- stencil widthlx- arrays containing the number of nodes in each cell along the x coordinates, orNULL.ly- arrays containing the number of nodes in each cell along the y coordinates, orNULL.lz- arrays containing the number of nodes in each cell along the z coordinates, orNULL.
Output Parameter:
da- the resulting distributed array object
Options Database Keys:
-dm_view- CallsDMView()at the conclusion ofDMDACreate3d()-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 theDMDAntimes before creating it
Level: beginner
See also: DM, DMDA, DMDestroy(), DMView(), DMDACreate1d(), DMDACreate2d(), DMGlobalToLocalBegin(), DMDAGetRefinementFactor(), DMGlobalToLocalEnd(), DMLocalToGlobalBegin(), DMLocalToLocalBegin(), DMLocalToLocalEnd(), DMDASetRefinementFactor(), DMDAGetInfo(), DMCreateGlobalVector(), DMCreateLocalVector(), DMDACreateNaturalVector(), DMLoad(), DMDAGetOwnershipRanges(), DMStagCreate3d(), DMBoundaryType
External Links
- PETSc Manual:
DMDA/DMDACreate3d
PETSc.LibPETSc.DMDACreateAggregates — Method
rest::PetscMat = DMDACreateAggregates(petsclib::PetscLibType, dac::AbstractPetscDM, daf::AbstractPetscDM)Gets the aggregates that map between grids associated with two DMDA
Collective
Input Parameters:
dac- the coarse gridDMDAdaf- the fine gridDMDA
Output Parameter:
rest- the restriction matrix (transpose of the projection matrix)
Level: intermediate
See also: DMRefine(), DMCreateInjection(), DMCreateInterpolation()
External Links
- PETSc Manual:
DMDA/DMDACreateAggregates
PETSc.LibPETSc.DMDACreateCompatibleDMDA — Method
nda::PetscDM = DMDACreateCompatibleDMDA(petsclib::PetscLibType, da::AbstractPetscDM, nfields::PetscInt)Creates a DMDA with the same layout as given DMDA but with fewer or more fields
Collective
Input Parameters:
da- theDMDAnfields- number of fields in newDMDA
Output Parameter:
nda- the newDMDA
Level: intermediate
See also: DM, DMDA, DMDAGetGhostCorners(), DMSetCoordinates(), DMDASetUniformCoordinates(), DMGetCoordinates(), DMDAGetGhostedCoordinates(), DMStagCreateCompatibleDMStag()
External Links
- PETSc Manual:
DMDA/DMDACreateCompatibleDMDA
PETSc.LibPETSc.DMDACreateNaturalVector — Method
g::PetscVec = DMDACreateNaturalVector(petsclib::PetscLibType, da::AbstractPetscDM)Creates a parallel PETSc vector that will hold vector values in the natural numbering, rather than in the PETSc parallel numbering associated with the DMDA.
Collective
Input Parameter:
da- theDMDA
Output Parameter:
g- the distributed global vector
Level: advanced
See also: DM, DMDA, DMDAGlobalToNaturalBegin(), DMDAGlobalToNaturalEnd(), DMDANaturalToGlobalBegin(), DMDANaturalToGlobalEnd(), DMCreateLocalVector(), VecDuplicate(), VecDuplicateVecs(), DMDACreate1d(), DMDACreate2d(), DMDACreate3d(), DMGlobalToLocalBegin(), DMGlobalToLocalEnd(), DMLocalToGlobalBegin()
External Links
- PETSc Manual:
DMDA/DMDACreateNaturalVector
PETSc.LibPETSc.DMDACreatePF — Method
pf::PF = DMDACreatePF(petsclib::PetscLibType, da::AbstractPetscDM)Creates an appropriately dimensioned PF mathematical function object from a DMDA.
Collective; No Fortran Support
Input Parameter:
da- initial distributed array
Output Parameter:
pf- the mathematical function object
Level: advanced
See also: DM, PF, DMDA, DMDACreate1d(), DMDACreate2d(), DMDACreate3d(), DMDestroy(), DMCreateGlobalVector()
External Links
- PETSc Manual:
DMDA/DMDACreatePF
PETSc.LibPETSc.DMDACreatePatchIS — Method
is::IS = DMDACreatePatchIS(petsclib::PetscLibType, da::AbstractPetscDM, lower::Vector{MatStencil}, upper::Vector{MatStencil}, offproc::PetscBool)Creates an index set corresponding to a logically rectangular patch of the DMDA.
Collective
Input Parameters:
da- theDMDAlower- aMatStencilwith i, j and k entries corresponding to the lower corner of the patchupper- aMatStencilwith i, j and k entries corresponding to the upper corner of the patchoffproc- indicate whether the returnedISwill contain off process indices
Output Parameter:
is- theIScorresponding to the patch
Level: developer
See also: DM, DMDA, DMCreateDomainDecomposition(), DMCreateDomainDecompositionScatters()
External Links
- PETSc Manual:
DMDA/DMDACreatePatchIS
PETSc.LibPETSc.DMDAGetAO — Method
ao::AO = DMDAGetAO(petsclib::PetscLibType, da::AbstractPetscDM)Gets the application ordering context for a distributed array.
Collective
Input Parameter:
da- theDMDA
Output Parameter:
ao- the application ordering context forDMDA
Level: intermediate
See also: DM, DMDA, DMDACreate2d(), DMDASetAOType(), DMDAGetGhostCorners(), DMDAGetCorners(), DMLocalToGlobal(), DMGlobalToLocalBegin(), DMGlobalToLocalEnd(), DMLocalToLocalBegin(), DMLocalToLocalEnd(), DMDAGetOwnershipRanges(), AO, AOPetscToApplication(), AOApplicationToPetsc()
External Links
- PETSc Manual:
DMDA/DMDAGetAO
PETSc.LibPETSc.DMDAGetArray — Method
vptr::Ptr{Cvoid} = DMDAGetArray(petsclib::PetscLibType, da::AbstractPetscDM, ghosted::PetscBool)Gets a work array for a DMDA
Input Parameters:
da- aDMDAghosted- do you want arrays for the ghosted or nonghosted patch
Output Parameter:
vptr- array data structured
Level: advanced
See also: DM, DMDA, DMDARestoreArray()
External Links
- PETSc Manual:
DMDA/DMDAGetArray
PETSc.LibPETSc.DMDAGetBoundaryType — Method
bx::DMBoundaryType,by::DMBoundaryType,bz::DMBoundaryType = DMDAGetBoundaryType(petsclib::PetscLibType, da::AbstractPetscDM)Gets the type of ghost nodes on domain boundaries.
Not Collective
Input Parameter:
da- TheDMDA
Output Parameters:
bx- x boundary type, one ofDM_BOUNDARY_NONE,DM_BOUNDARY_GHOSTED,DM_BOUNDARY_PERIODICby- y boundary type, one ofDM_BOUNDARY_NONE,DM_BOUNDARY_GHOSTED,DM_BOUNDARY_PERIODICbz- z boundary type, one ofDM_BOUNDARY_NONE,DM_BOUNDARY_GHOSTED,DM_BOUNDARY_PERIODIC
Level: intermediate
See also: DMDASetBoundaryType(), DM, DMDA, DMDACreate(), DMDestroy(), DMBoundaryType, DM_BOUNDARY_NONE, DM_BOUNDARY_GHOSTED, DM_BOUNDARY_PERIODIC
External Links
- PETSc Manual:
DMDA/DMDAGetBoundaryType
PETSc.LibPETSc.DMDAGetCellPoint — Method
point::PetscInt = DMDAGetCellPoint(petsclib::PetscLibType, dm::AbstractPetscDM, i::PetscInt, j::PetscInt, k::PetscInt)Get the DM point corresponding to the tuple (i, j, k) in the DMDA
Input Parameters:
dm- TheDMDAobjecti- The global x index for the cellj- The global y index for the cellk- The global z index for the cell
Output Parameter:
point- The localDMpoint
Level: developer
See also: DM, DMDA, DMDAGetNumCells()
External Links
- PETSc Manual:
DMDA/DMDAGetCellPoint
PETSc.LibPETSc.DMDAGetCoordinateArray — Method
xc::Ptr{Cvoid} = DMDAGetCoordinateArray(petsclib::PetscLibType, dm::AbstractPetscDM)Gets an array containing the coordinates of the DMDA
Not Collective; No Fortran Support
Input Parameter:
dm- theDMDA
Output Parameter:
xc- the coordinates
Level: intermediate
See also: DM, DMDA, DMDASetCoordinateName(), DMDASetFieldName(), DMDAGetFieldName(), DMDARestoreCoordinateArray()
External Links
- PETSc Manual:
DMDA/DMDAGetCoordinateArray
PETSc.LibPETSc.DMDAGetCoordinateName — Method
name::String = DMDAGetCoordinateName(petsclib::PetscLibType, dm::AbstractPetscDM, nf::PetscInt)Gets the name of a coordinate direction associated with a DMDA.
Not Collective; name will contain a common value; No Fortran Support
Input Parameters:
dm- theDMDAnf- number for theDMDA(0, 1, ... dim-1)
Output Parameter:
name- the name of the coordinate direction
Level: intermediate
See also: DM, DMDA, DMDASetCoordinateName(), DMDASetFieldName(), DMDAGetFieldName(), DMSetUp()
External Links
- PETSc Manual:
DMDA/DMDAGetCoordinateName
PETSc.LibPETSc.DMDAGetCorners — Method
x::PetscInt,y::PetscInt,z::PetscInt,m::PetscInt,n::PetscInt,p::PetscInt = DMDAGetCorners(petsclib::PetscLibType, da::AbstractPetscDM)Returns the global (x,y,z) indices of the lower left corner and size of the local region, excluding ghost points.
Not Collective
Input Parameter:
da- theDMDA
Output Parameters:
x- the corner index for the first dimensiony- the corner index for the second dimension (only used in 2D and 3D problems)z- the corner index for the third dimension (only used in 3D problems)m- the width in the first dimensionn- the width in the second dimension (only used in 2D and 3D problems)p- the width in the third dimension (only used in 3D problems)
Level: beginner
See also: DM, DMDA, DMDAGetGhostCorners(), DMDAGetOwnershipRanges(), DMStagGetCorners(), DMSTAG
External Links
- PETSc Manual:
DMDA/DMDAGetCorners
PETSc.LibPETSc.DMDAGetDepthStratum — Method
pStart::PetscInt,pEnd::PetscInt = DMDAGetDepthStratum(petsclib::PetscLibType, dm::AbstractPetscDM, depth::PetscInt)Get the bounds [start, end) for all points at a certain depth.
Not Collective
Input Parameters:
dm- TheDMDAobjectdepth- The requested depth
Output Parameters:
pStart- The first point at thisdepthpEnd- One beyond the last point at thisdepth
Level: developer
See also: DM, DMDA, DMPlexGetDepthStratum(), DMPlexGetHeightStratum(), DMPlexGetCellTypeStratum(), DMPlexGetDepth(), DMPlexGetDepthLabel(), DMPlexGetPointDepth(), DMPlexSymmetrize(), DMPlexInterpolate(), DMDAGetHeightStratum()
External Links
- PETSc Manual:
DMDA/DMDAGetDepthStratum
PETSc.LibPETSc.DMDAGetDof — Method
dof::PetscInt = DMDAGetDof(petsclib::PetscLibType, da::AbstractPetscDM)Gets the number of degrees of freedom per vertex
Not Collective
Input Parameter:
da- TheDMDA
Output Parameter:
dof- Number of degrees of freedom per vertex
Level: intermediate
See also: DM, DMDA, DMDASetDof(), DMDACreate(), DMDestroy()
External Links
- PETSc Manual:
DMDA/DMDAGetDof
PETSc.LibPETSc.DMDAGetElementType — Method
etype::DMDAElementType = DMDAGetElementType(petsclib::PetscLibType, da::AbstractPetscDM)Gets the element type to be returned by DMDAGetElements()
Not Collective
Input Parameter:
da- theDMDAobject
Output Parameter:
etype- the element type, currently eitherDMDA_ELEMENT_P1orDMDA_ELEMENT_Q1
Level: intermediate
See also: DM, DMDA, DMDAElementType, DMDASetElementType(), DMDAGetElements(), DMDARestoreElements(), DMDA_ELEMENT_P1, DMDA_ELEMENT_Q1
External Links
- PETSc Manual:
DMDA/DMDAGetElementType
PETSc.LibPETSc.DMDAGetElements — Method
nel::PetscInt,nen::PetscInt,e::Vector{PetscInt} = DMDAGetElements(petsclib::PetscLibType, dm::AbstractPetscDM)Gets an array containing the indices (in local indexing) of all the local elements
Not Collective
Input Parameter:
dm- theDMDAobject
Output Parameters:
nel- number of local elementsnen- number of nodes in each element (for example in one dimension it is 2, in two dimensions it is 3 (forDMDA_ELEMENT_P1) and 4
(for DMDA_ELEMENT_Q1)
e- the local indices of the elements' vertices, of lengthnel*nen
Level: intermediate
See also: DM, DMDA, DMDAElementType, DMDASetElementType(), VecSetValuesLocal(), MatSetValuesLocal(), DMGlobalToLocalBegin(), DMLocalToGlobalBegin(), DMDARestoreElements(), DMDA_ELEMENT_P1, DMDA_ELEMENT_Q1, DMDAGetElementsSizes(), DMDAGetElementsCorners()
External Links
- PETSc Manual:
DMDA/DMDAGetElements
PETSc.LibPETSc.DMDAGetElementsCorners — Method
gx::PetscInt,gy::PetscInt,gz::PetscInt = DMDAGetElementsCorners(petsclib::PetscLibType, da::AbstractPetscDM)Returns the global (i,j,k) indices of the lower left corner of the non-overlapping decomposition of elements identified by DMDAGetElements()
Not Collective
Input Parameter:
da- theDMDAobject
Output Parameters:
gx- the i indexgy- the j indexgz- the k index
Level: intermediate
See also: DM, DMDA, DMDAElementType, DMDASetElementType(), DMDAGetElements(), DMDAGetCorners(), DMDAGetGhostCorners(), DMDAGetElementsSizes(), DMDAGetElementsCornersIS(), DMDARestoreElementsCornersIS()
External Links
- PETSc Manual:
DMDA/DMDAGetElementsCorners
PETSc.LibPETSc.DMDAGetElementsSizes — Method
mx::PetscInt,my::PetscInt,mz::PetscInt = DMDAGetElementsSizes(petsclib::PetscLibType, da::AbstractPetscDM)Gets the local number of elements per coordinate direction for the non-overlapping decomposition identified by DMDAGetElements()
Not Collective
Input Parameter:
da- theDMDAobject
Output Parameters:
mx- number of local elements in x-directionmy- number of local elements in y-directionmz- number of local elements in z-direction
Level: intermediate
See also: DM, DMDA, DMDAElementType, DMDASetElementType(), DMDAGetElements(), DMDAGetElementsCorners()
External Links
- PETSc Manual:
DMDA/DMDAGetElementsSizes
PETSc.LibPETSc.DMDAGetFieldName — Method
name::String = DMDAGetFieldName(petsclib::PetscLibType, da::AbstractPetscDM, nf::PetscInt)Gets the names of individual field components in multicomponent vectors associated with a DMDA.
Not Collective; name will contain a common value
Input Parameters:
da- theDMDAnf- field number for theDMDA(0, 1, ... dof-1), where dof indicates the
number of degrees of freedom per node within the DMDA
Output Parameter:
name- the name of the field (component)
Level: intermediate
See also: DM, DMDA, DMDASetFieldName(), DMDASetCoordinateName(), DMDAGetCoordinateName(), DMSetUp()
External Links
- PETSc Manual:
DMDA/DMDAGetFieldName
PETSc.LibPETSc.DMDAGetFieldNames — Method
names::String = DMDAGetFieldNames(petsclib::PetscLibType, da::AbstractPetscDM)Gets the name of all the components in the vector associated with the DMDA
Not Collective; names will contain a common value; No Fortran Support
Input Parameter:
da- theDMDAobject
Output Parameter:
names- the names of the components, final string isNULL, will have the same number of entries as the dof used in creating theDMDA
Level: intermediate
See also: DM, DMDA, DMDAGetFieldName(), DMDASetCoordinateName(), DMDAGetCoordinateName(), DMDASetFieldName(), DMDASetFieldNames()
External Links
- PETSc Manual:
DMDA/DMDAGetFieldNames
PETSc.LibPETSc.DMDAGetGhostCorners — Method
x::PetscInt,y::PetscInt,z::PetscInt,m::PetscInt,n::PetscInt,p::PetscInt = DMDAGetGhostCorners(petsclib::PetscLibType, da::AbstractPetscDM)Returns the global (i,j,k) indices of the lower left corner and size of the local region, including ghost points.
Not Collective
Input Parameter:
da- theDMDA
Output Parameters:
x- the corner index for the first dimensiony- the corner index for the second dimension (only used in 2D and 3D problems)z- the corner index for the third dimension (only used in 3D problems)m- the width in the first dimensionn- the width in the second dimension (only used in 2D and 3D problems)p- the width in the third dimension (only used in 3D problems)
Level: beginner
See also: DM, DMDA, DMDAGetCorners(), DMDACreate1d(), DMDACreate2d(), DMDACreate3d(), DMDAGetOwnershipRanges(), DMStagGetGhostCorners(), DMSTAG
External Links
- PETSc Manual:
DMDA/DMDAGetGhostCorners
PETSc.LibPETSc.DMDAGetHeightStratum — Method
pStart::PetscInt,pEnd::PetscInt = DMDAGetHeightStratum(petsclib::PetscLibType, dm::AbstractPetscDM, height::PetscInt)Get the bounds [start, end) for all points at a certain height.
Not Collective
Input Parameters:
dm- TheDMDAobjectheight- The requested height
Output Parameters:
pStart- The first point at thisheightpEnd- One beyond the last point at thisheight
Level: developer
See also: DM, DMDA, DMPlexGetDepthStratum(), DMPlexGetHeightStratum(), DMPlexGetCellTypeStratum(), DMPlexGetDepth(), DMPlexGetDepthLabel(), DMPlexGetPointDepth(), DMPlexSymmetrize(), DMPlexInterpolate(), DMDAGetDepthStratum()
External Links
- PETSc Manual:
DMDA/DMDAGetHeightStratum
PETSc.LibPETSc.DMDAGetInfo — Method
dim::PetscInt,M::PetscInt,N::PetscInt,P::PetscInt,M_m::PetscInt,M_n::PetscInt,M_p::PetscInt,dof::PetscInt,s::PetscInt,bx::DMBoundaryType,by::DMBoundaryType,bz::DMBoundaryType,st::DMDAStencilType = DMDAGetInfo(petsclib::PetscLibType, da::AbstractPetscDM)Gets information about a given distributed array.
Not Collective
Input Parameter:
da- theDMDA
Output Parameters:
dim- dimension of theDMDA(1, 2, or 3)M- global dimension in first direction of the arrayN- global dimension in second direction of the arrayP- global dimension in third direction of the arraym- corresponding number of MPI processes in first dimensionn- corresponding number of MPI processes in second dimensionp- corresponding number of MPI processes in third dimensiondof- number of degrees of freedom per nodes- stencil widthbx- type of ghost nodes at boundary in first dimensionby- type of ghost nodes at boundary in second dimensionbz- type of ghost nodes at boundary in third dimensionst- stencil type, eitherDMDA_STENCIL_STARorDMDA_STENCIL_BOX
Level: beginner
See also: DM, DMDA, DMView(), DMDAGetCorners(), DMDAGetLocalInfo()
External Links
- PETSc Manual:
DMDA/DMDAGetInfo
PETSc.LibPETSc.DMDAGetInterpolationType — Method
ctype::DMDAInterpolationType = DMDAGetInterpolationType(petsclib::PetscLibType, da::AbstractPetscDM)Gets the type of interpolation that will be used by DMCreateInterpolation()
Not Collective
Input Parameter:
da- distributed array
Output Parameter:
ctype- interpolation type (DMDA_Q1andDMDA_Q0are currently the only supported forms)
Level: intermediate
See also: DM, DMDA, DMDAInterpolationType, DMDASetInterpolationType(), DMCreateInterpolation(), DMDA_Q1, DMDA_Q0
External Links
- PETSc Manual:
DMDA/DMDAGetInterpolationType
PETSc.LibPETSc.DMDAGetLocalInfo — Method
da::PetscDM,info::DMDALocalInfo = DMDAGetLocalInfo(petsclib::PetscLibType)Gets information about a given DMDA and this MPI process's location in it
Not Collective
Input Parameter:
da- theDMDA
Output Parameter:
info- structure containing the information
Level: beginner
See also: DM, DMDA, DMDAGetInfo(), DMDAGetCorners(), DMDALocalInfo
External Links
- PETSc Manual:
DMDA/DMDAGetLocalInfo
PETSc.LibPETSc.DMDAGetLogicalCoordinate — Method
II::PetscInt,JJ::PetscInt,KK::PetscInt,M_X::PetscScalar,M_Y::PetscScalar,M_Z::PetscScalar = DMDAGetLogicalCoordinate(petsclib::PetscLibType, da::AbstractPetscDM, x::PetscScalar, y::PetscScalar, z::PetscScalar)Returns a the i,j,k logical coordinate for the closest mesh point to a x, y, z point in the coordinates of the DMDA
Collective
Input Parameters:
da- theDMDAx- the first physical coordinatey- the second physical coordinatez- the third physical coordinate
Output Parameters:
II- the first logical coordinate (-1 on processes that do not contain that point)JJ- the second logical coordinate (-1 on processes that do not contain that point)KK- the third logical coordinate (-1 on processes that do not contain that point)X- (optional) the first coordinate of the located grid pointY- (optional) the second coordinate of the located grid pointZ- (optional) the third coordinate of the located grid point
Level: advanced
See also: DM, DMDA
External Links
- PETSc Manual:
DMDA/DMDAGetLogicalCoordinate
PETSc.LibPETSc.DMDAGetNeighbors — Method
ranks::Ptr{PetscMPIInt} = DMDAGetNeighbors(petsclib::PetscLibType, da::AbstractPetscDM)Gets an array containing the MPI rank of all the current processes neighbors.
Not Collective
Input Parameter:
da- theDMDAobject
Output Parameter:
ranks- the neighbors ranks, stored with the x index increasing most rapidly. The process itself is in the list
Level: intermediate
See also: DMDA, DM
External Links
- PETSc Manual:
DMDA/DMDAGetNeighbors
PETSc.LibPETSc.DMDAGetNonOverlappingRegion — Method
xs::PetscInt,ys::PetscInt,zs::PetscInt,xm::PetscInt,ym::PetscInt,zm::PetscInt = DMDAGetNonOverlappingRegion(petsclib::PetscLibType, da::AbstractPetscDM)Gets the indices of the nonoverlapping region of a subdomain DMDA.
Not Collective
Input Parameter:
da- TheDMDA
Output Parameters:
xs- The start of the region in xys- The start of the region in yzs- The start of the region in zxm- The size of the region in xym- The size of the region in yzm- The size of the region in z
Level: intermediate
See also: DM, DMDA, DMDAGetOffset(), DMDAVecGetArray()
External Links
- PETSc Manual:
DMDA/DMDAGetNonOverlappingRegion
PETSc.LibPETSc.DMDAGetNumCells — Method
numCellsX::PetscInt,numCellsY::PetscInt,numCellsZ::PetscInt,numCells::PetscInt = DMDAGetNumCells(petsclib::PetscLibType, dm::AbstractPetscDM)Get the number of cells (or vertices) in the local piece of the DMDA. This includes ghost cells.
Input Parameter:
dm- TheDMDAobject
Output Parameters:
numCellsX- The number of local cells in the x-directionnumCellsY- The number of local cells in the y-directionnumCellsZ- The number of local cells in the z-directionnumCells- The number of local cells
Level: developer
See also: DM, DMDA, DMDAGetCellPoint()
External Links
- PETSc Manual:
DMDA/DMDAGetNumCells
PETSc.LibPETSc.DMDAGetNumFaces — Method
numXFacesX::PetscInt,numXFaces::PetscInt,numYFacesY::PetscInt,numYFaces::PetscInt,numZFacesZ::PetscInt,numZFaces::PetscInt = DMDAGetNumFaces(petsclib::PetscLibType, dm::AbstractPetscDM)Return the number of local mesh faces of each orientation (including ghost faces) for a DMDA.
Not Collective
Input Parameter:
dm- theDMDA
Output Parameters:
numXFacesX- number of X-normal faces along the x direction, orNULLif not needednumXFaces- total number of X-normal faces, orNULLif not needednumYFacesY- number of Y-normal faces along the y direction, orNULLif not needednumYFaces- total number of Y-normal faces (0for 1D), orNULLif not needednumZFacesZ- number of Z-normal faces along the z direction, orNULLif not needednumZFaces- total number of Z-normal faces (0for 1D/2D), orNULLif not needed
Level: developer
See also: DM, DMDA, DMDAGetNumVertices(), DMDAGetNumCells()
External Links
- PETSc Manual:
DMDA/DMDAGetNumFaces
PETSc.LibPETSc.DMDAGetNumLocalSubDomains — Method
Nsub::PetscInt = DMDAGetNumLocalSubDomains(petsclib::PetscLibType, da::AbstractPetscDM)Gets the number of local subdomains that would be created upon decomposition.
Not Collective
Input Parameter:
da- TheDMDA
Output Parameter:
Nsub- Number of local subdomains created upon decomposition
Level: intermediate
See also: DM, DMDA, DMCreateDomainDecomposition(), DMDASetNumLocalSubDomains()
External Links
- PETSc Manual:
DMDA/DMDAGetNumLocalSubDomains
PETSc.LibPETSc.DMDAGetNumVertices — Method
numVerticesX::PetscInt,numVerticesY::PetscInt,numVerticesZ::PetscInt,numVertices::PetscInt = DMDAGetNumVertices(petsclib::PetscLibType, dm::AbstractPetscDM)Return the number of local vertices (including ghost vertices) of a DMDA in each dimension and in total.
Not Collective
Input Parameter:
dm- theDMDA
Output Parameters:
numVerticesX- number of vertices in the x direction, orNULLif not needednumVerticesY- number of vertices in the y direction (1ifdim < 2), orNULLif not needednumVerticesZ- number of vertices in the z direction (1ifdim < 3), orNULLif not needednumVertices- total number of vertices, orNULLif not needed
Level: developer
See also: DM, DMDA, DMDAGetNumCells(), DMDAGetNumFaces()
External Links
- PETSc Manual:
DMDA/DMDAGetNumVertices
PETSc.LibPETSc.DMDAGetOffset — Method
xo::PetscInt,yo::PetscInt,zo::PetscInt,Mo::PetscInt,No::PetscInt,Po::PetscInt = DMDAGetOffset(petsclib::PetscLibType, da::AbstractPetscDM)Gets the index offset of the DMDA.
Not Collective
Input Parameter:
da- TheDMDA
Output Parameters:
xo- The offset in the x directionyo- The offset in the y directionzo- The offset in the z directionMo- The global size in the x directionNo- The global size in the y directionPo- The global size in the z direction
Level: developer
See also: DM, DMDA, DMDASetOffset(), DMDAVecGetArray()
External Links
- PETSc Manual:
DMDA/DMDAGetOffset
PETSc.LibPETSc.DMDAGetOverlap — Method
x::PetscInt,y::PetscInt,z::PetscInt = DMDAGetOverlap(petsclib::PetscLibType, da::AbstractPetscDM)Gets the size of the per-processor overlap.
Not Collective
Input Parameter:
da- TheDMDA
Output Parameters:
x- Overlap in the x directiony- Overlap in the y directionz- Overlap in the z direction
Level: intermediate
See also: DM, DMDA, DMCreateDomainDecomposition(), DMDASetOverlap()
External Links
- PETSc Manual:
DMDA/DMDAGetOverlap
PETSc.LibPETSc.DMDAGetOwnershipRanges — Method
lx::Vector{PetscInt},ly::Vector{PetscInt},lz::Vector{PetscInt} = DMDAGetOwnershipRanges(petsclib::PetscLibType, da::AbstractPetscDM)Gets the number of indices in the x, y and z direction that are owned by each process in that direction
Not Collective
Input Parameter:
da- theDMDAobject
Output Parameters:
lx- ownership along x direction (optional), its length ismthe number of processes in the x-directionly- ownership along y direction (optional), its length isnthe number of processes in the y-directionlz- ownership along z direction (optional), its length ispthe number of processes in the z-direction
Level: intermediate
See also: DM, DMDA, DMDAGetCorners(), DMDAGetGhostCorners(), DMDACreate(), DMDACreate1d(), DMDACreate2d(), DMDACreate3d(), VecGetOwnershipRanges()
External Links
- PETSc Manual:
DMDA/DMDAGetOwnershipRanges
PETSc.LibPETSc.DMDAGetPreallocationCenterDimension — Method
preallocCenterDim::PetscInt = DMDAGetPreallocationCenterDimension(petsclib::PetscLibType, dm::AbstractPetscDM)Return the topology used to determine adjacency
Input Parameter:
dm- TheDMDAobject
Output Parameter:
preallocCenterDim- The dimension of points which connect adjacent entries
Level: developer
See also: DM, DMDA, DMCreateMatrix(), DMDAPreallocateOperator(), DMDASetPreallocationCenterDimension()
External Links
- PETSc Manual:
DMDA/DMDAGetPreallocationCenterDimension
PETSc.LibPETSc.DMDAGetProcessorSubset — Method
comm::MPI_Comm = DMDAGetProcessorSubset(petsclib::PetscLibType, da::AbstractPetscDM, dir::DMDirection, gp::PetscInt)Returns a communicator consisting only of the processors in a DMDA that own a particular global x, y, or z grid point (corresponding to a logical plane in a 3D grid or a line in a 2D grid).
Collective; No Fortran Support
Input Parameters:
da- theDMDAdir- Cartesian direction, eitherDM_X,DM_Y, orDM_Zgp- global grid point number in this direction
Output Parameter:
comm- new communicator
Level: advanced
See also: DM, DMDA, DMDirection, DM_X, DM_Y, DM_Z, DMDAGetProcessorSubsets()
External Links
- PETSc Manual:
DMDA/DMDAGetProcessorSubset
PETSc.LibPETSc.DMDAGetProcessorSubsets — Method
subcomm::MPI_Comm = DMDAGetProcessorSubsets(petsclib::PetscLibType, da::AbstractPetscDM, dir::DMDirection)Returns communicators consisting only of the processors in a DMDA adjacent in a particular dimension, corresponding to a logical plane in a 3D grid or a line in a 2D grid.
Collective; No Fortran Support
Input Parameters:
da- theDMDAdir- Cartesian direction, eitherDM_X,DM_Y, orDM_Z
Output Parameter:
subcomm- new communicator
Level: advanced
See also: DM, DMDA, DMDirection, DMDAGetProcessorSubset(), DM_X, DM_Y, DM_Z
External Links
- PETSc Manual:
DMDA/DMDAGetProcessorSubsets
PETSc.LibPETSc.DMDAGetRay — Method
newvec::PetscVec,scatter::VecScatter = DMDAGetRay(petsclib::PetscLibType, da::AbstractPetscDM, dir::DMDirection, gp::PetscInt)Returns a vector on process zero that contains a row or column of the values in a DMDA vector
Collective
Input Parameters:
da- theDMDAdir- Cartesian direction, eitherDM_X,DM_Y, orDM_Zgp- global grid point number in this direction
Output Parameters:
newvec- the new vector that can hold the values (size zero on all processes except MPI rank 0)scatter- theVecScatterthat will map from the original vector to the ray
Level: advanced
See also: DM, DMDA, DMDirection, Vec, VecScatter
External Links
- PETSc Manual:
DMDA/DMDAGetRay
PETSc.LibPETSc.DMDAGetRefinementFactor — Method
refine_x::PetscInt,refine_y::PetscInt,refine_z::PetscInt = DMDAGetRefinementFactor(petsclib::PetscLibType, da::AbstractPetscDM)Gets the ratios that the DMDA grid is refined
Not Collective
Input Parameter:
da- theDMDAobject
Output Parameters:
refine_x- ratio of fine grid to coarse in x direction (2 by default)refine_y- ratio of fine grid to coarse in y direction (2 by default)refine_z- ratio of fine grid to coarse in z direction (2 by default)
Level: intermediate
See also: DM, DMDA, DMRefine(), DMDASetRefinementFactor()
External Links
- PETSc Manual:
DMDA/DMDAGetRefinementFactor
PETSc.LibPETSc.DMDAGetScatter — Method
gtol::VecScatter,ltol::VecScatter = DMDAGetScatter(petsclib::PetscLibType, da::AbstractPetscDM)Gets the global-to-local, and local-to-local vector scatter contexts for a DMDA distributed array.
Collective
Input Parameter:
da- theDMDA
Output Parameters:
gtol- global-to-local scatter context (may beNULL)ltol- local-to-local scatter context (may beNULL)
Level: developer
See also: DM, DMDA, DMGlobalToLocalBegin(), DMGlobalToLocalEnd(), DMLocalToGlobalBegin()
External Links
- PETSc Manual:
DMDA/DMDAGetScatter
PETSc.LibPETSc.DMDAGetStencilType — Method
stype::DMDAStencilType = DMDAGetStencilType(petsclib::PetscLibType, da::AbstractPetscDM)Gets the type of the communication stencil
Not Collective
Input Parameter:
da- TheDMDA
Output Parameter:
stype- The stencil type, use eitherDMDA_STENCIL_BOXorDMDA_STENCIL_STAR.
Level: intermediate
See also: DM, DMDA, DMDACreate(), DMDestroy(), DMDAStencilType, DMDA_STENCIL_BOX, DMDA_STENCIL_STAR.
External Links
- PETSc Manual:
DMDA/DMDAGetStencilType
PETSc.LibPETSc.DMDAGetStencilWidth — Method
width::PetscInt = DMDAGetStencilWidth(petsclib::PetscLibType, da::AbstractPetscDM)Gets the width of the communication stencil
Not Collective
Input Parameter:
da- TheDMDA
Output Parameter:
width- The stencil width
Level: intermediate
See also: DM, DMDA, DMDACreate(), DMDestroy(), DMDAStencilType, DMDA_STENCIL_BOX, DMDA_STENCIL_STAR.
External Links
- PETSc Manual:
DMDA/DMDAGetStencilWidth
PETSc.LibPETSc.DMDAGetSubdomainCornersIS — Method
is::IS = DMDAGetSubdomainCornersIS(petsclib::PetscLibType, dm::AbstractPetscDM)Gets an index set containing the corner indices (in local indexing) of the non-overlapping decomposition identified by DMDAGetElements()
Not Collective
Input Parameter:
dm- theDMDAobject
Output Parameter:
is- the index set
Level: intermediate
See also: DM, DMDA, DMDAElementType, DMDASetElementType(), DMDAGetElements(), DMDARestoreElementsCornersIS(), DMDAGetElementsSizes(), DMDAGetElementsCorners()
External Links
- PETSc Manual:
DMDA/DMDAGetSubdomainCornersIS
PETSc.LibPETSc.DMDAGlobalToNaturalAllCreate — Method
scatter::VecScatter = DMDAGlobalToNaturalAllCreate(petsclib::PetscLibType, da::AbstractPetscDM)Creates a scatter context that maps from a global vector, obtained with DMCreateGlobalVector(), to the entire vector to each processor in natural numbering
Collective
Input Parameter:
da- theDMDAcontext
Output Parameter:
scatter- the scatter context
Level: advanced
See also: DM, DMDA, DMDANaturalAllToGlobalCreate(), DMDAGlobalToNaturalEnd(), DMLocalToGlobalBegin(), DMDACreate2d(), DMGlobalToLocalBegin(), DMGlobalToLocalEnd(), DMDACreateNaturalVector()
External Links
- PETSc Manual:
DMDA/DMDAGlobalToNaturalAllCreate
PETSc.LibPETSc.DMDAGlobalToNaturalBegin — Method
DMDAGlobalToNaturalBegin(petsclib::PetscLibType, da::AbstractPetscDM, g::AbstractPetscVec, mode::InsertMode, n::AbstractPetscVec)Maps values from the global vector obtained with DMCreateGlobalVector() to a global vector in the "natural" grid ordering. Must be followed by DMDAGlobalToNaturalEnd() to complete the exchange.
Neighbor-wise Collective
Input Parameters:
da- theDMDAcontextg- the global vector, seeDMCreateGlobalVector()mode- one ofINSERT_VALUESorADD_VALUES
Output Parameter:
n- the natural ordering values, seeDMDACreateNaturalVector()
Level: advanced
See also: DM, DMDA, DMDAGlobalToNaturalEnd(), DMLocalToGlobalBegin(), DMDACreate2d(), DMGlobalToLocalBegin(), DMGlobalToLocalEnd(), DMDACreateNaturalVector()
External Links
- PETSc Manual:
DMDA/DMDAGlobalToNaturalBegin
PETSc.LibPETSc.DMDAGlobalToNaturalEnd — Method
DMDAGlobalToNaturalEnd(petsclib::PetscLibType, da::AbstractPetscDM, g::AbstractPetscVec, mode::InsertMode, n::AbstractPetscVec)Maps values from the global vector obtained with DMCreateGlobalVector() to a global vector in the natural ordering. Must be preceded by DMDAGlobalToNaturalBegin().
Neighbor-wise Collective
Input Parameters:
da- theDMDAcontextg- the global vector, seeDMCreateGlobalVector()mode- one ofINSERT_VALUESorADD_VALUES
Output Parameter:
n- the global values in the natural ordering, seeDMDACreateNaturalVector()
Level: advanced
See also: DM, DMDA, DMDAGlobalToNaturalBegin(), DMLocalToGlobalBegin(), DMDACreate2d(), DMGlobalToLocalBegin(), DMGlobalToLocalEnd(), DMDACreateNaturalVector()
External Links
- PETSc Manual:
DMDA/DMDAGlobalToNaturalEnd
PETSc.LibPETSc.DMDAMapCoordsToPeriodicDomain — Method
x::PetscScalar,y::PetscScalar = DMDAMapCoordsToPeriodicDomain(petsclib::PetscLibType, da::AbstractPetscDM)Maps a (x, y) coordinate pair that lies outside a 2D DMDA domain back into the domain along any periodic boundaries
Not Collective
Input Parameter:
da- the 2DDMDAcontext
Input/Output Parameters:
x- the x coordinate; wrapped in place if the x boundary is periodicy- the y coordinate; wrapped in place if the y boundary is periodic
Level: developer
See also: Characteristic, DMDA, CharacteristicSolve()
External Links
- PETSc Manual:
Characteristic/DMDAMapCoordsToPeriodicDomain
PETSc.LibPETSc.DMDAMapMatStencilToGlobal — Method
DMDAMapMatStencilToGlobal(petsclib::PetscLibType, da::AbstractPetscDM, m::PetscInt, idxm::Vector{MatStencil}, gidxm::Vector{PetscInt})Map a list of MatStencil on a grid to global indices.
Not Collective
Input Parameters:
da- theDMDAobjectm- number ofMatStencilto mapidxm- grid points (and component number when dof > 1)
Output Parameter:
gidxm- global row indices
Level: intermediate
See also: DM, DMDA, MatStencil
External Links
- PETSc Manual:
DMDA/DMDAMapMatStencilToGlobal
PETSc.LibPETSc.DMDANaturalAllToGlobalCreate — Method
scatter::VecScatter = DMDANaturalAllToGlobalCreate(petsclib::PetscLibType, da::AbstractPetscDM)Creates a scatter context that maps from a copy of the entire vector on each processor (in the natural ordering) to its local part in the global vector, obtained with DMCreateGlobalVector().
Collective
Input Parameter:
da- theDMDAcontext
Output Parameter:
scatter- the scatter context
Level: advanced
See also: DM, DMDA, DMDAGlobalToNaturalAllCreate(), DMDAGlobalToNaturalEnd(), DMLocalToGlobalBegin(), DMDACreate2d(), DMGlobalToLocalBegin(), DMGlobalToLocalEnd(), DMDACreateNaturalVector()
External Links
- PETSc Manual:
DMDA/DMDANaturalAllToGlobalCreate
PETSc.LibPETSc.DMDANaturalToGlobalBegin — Method
DMDANaturalToGlobalBegin(petsclib::PetscLibType, da::AbstractPetscDM, n::AbstractPetscVec, mode::InsertMode, g::AbstractPetscVec)Maps values from a global vector in the "natural" ordering to a global vector in the PETSc DMDA grid ordering. Must be followed by DMDANaturalToGlobalEnd() to complete the exchange.
Neighbor-wise Collective
Input Parameters:
da- theDMDAcontextg- the global vector in a natural ordering, seeDMDACreateNaturalVector()mode- one ofINSERT_VALUESorADD_VALUES
Output Parameter:
n- the values in theDMDAordering
Level: advanced
See also: DM, DMDA, DMDAGlobalToNaturalEnd(), DMDAGlobalToNaturalBegin(), DMLocalToGlobalBegin(), DMDACreate2d(), DMGlobalToLocalBegin(), DMGlobalToLocalEnd(), DMDACreateNaturalVector()
External Links
- PETSc Manual:
DMDA/DMDANaturalToGlobalBegin
PETSc.LibPETSc.DMDANaturalToGlobalEnd — Method
DMDANaturalToGlobalEnd(petsclib::PetscLibType, da::AbstractPetscDM, n::AbstractPetscVec, mode::InsertMode, g::AbstractPetscVec)Maps values from the natural ordering global vector to a global vector in the PETSc DMDA ordering. Must be preceded by DMDANaturalToGlobalBegin().
Neighbor-wise Collective
Input Parameters:
da- theDMDAcontextg- the global vector in a natural orderingmode- one ofINSERT_VALUESorADD_VALUES
Output Parameter:
n- the global values in the PETScDMDAordering
Level: advanced
See also: DM, DMDA, DMDAGlobalToNaturalBegin(), DMDAGlobalToNaturalEnd(), DMLocalToGlobalBegin(), DMDACreate2d(), DMGlobalToLocalBegin(), DMGlobalToLocalEnd(), DMDACreateNaturalVector()
External Links
- PETSc Manual:
DMDA/DMDANaturalToGlobalEnd
PETSc.LibPETSc.DMDARestoreArray — Method
DMDARestoreArray(petsclib::PetscLibType, da::AbstractPetscDM, ghosted::PetscBool, vptr::Ptr{Cvoid})Restores an array for a DMDA obtained with DMDAGetArray()
Input Parameters:
da- information about my local patchghosted- do you want arrays for the ghosted or nonghosted patchvptr- array data structured
Level: advanced
See also: DM, DMDA, DMDAGetArray()
External Links
- PETSc Manual:
DMDA/DMDARestoreArray
PETSc.LibPETSc.DMDARestoreCoordinateArray — Method
DMDARestoreCoordinateArray(petsclib::PetscLibType, dm::AbstractPetscDM, xc::Ptr{Cvoid})Returns an array containing the coordinates of the DMDA obtained with DMDAGetCoordinateArray()
Not Collective; No Fortran Support
Input Parameters:
dm- theDMDAxc- the coordinates
Level: intermediate
See also: DM, DMDA, DMDASetCoordinateName(), DMDASetFieldName(), DMDAGetFieldName(), DMDAGetCoordinateArray()
External Links
- PETSc Manual:
DMDA/DMDARestoreCoordinateArray
PETSc.LibPETSc.DMDARestoreElements — Method
DMDARestoreElements(petsclib::PetscLibType, dm::AbstractPetscDM, nel::PetscInt, nen::PetscInt, e::Union{Ptr, AbstractArray{PetscInt}})Restores the array obtained with DMDAGetElements()
Not Collective
Input Parameters:
dm- theDMobjectnel- number of local elementsnen- number of nodes in each elemente- the local indices of the elements' vertices
Level: intermediate
See also: DM, DMDA, DMDAElementType, DMDASetElementType(), DMDAGetElements()
External Links
- PETSc Manual:
DMDA/DMDARestoreElements
PETSc.LibPETSc.DMDARestoreSubdomainCornersIS — Method
DMDARestoreSubdomainCornersIS(petsclib::PetscLibType, dm::AbstractPetscDM, is::AbstractIS)Restores the IS obtained with DMDAGetSubdomainCornersIS()
Not Collective
Input Parameters:
dm- theDMobjectis- the index set
Level: intermediate
See also: DM, DMDA, DMDAElementType, DMDASetElementType(), DMDAGetSubdomainCornersIS()
External Links
- PETSc Manual:
DMDA/DMDARestoreSubdomainCornersIS
PETSc.LibPETSc.DMDASNESSetFunctionLocal — Method
DMDASNESSetFunctionLocal(petsclib::PetscLibType, dm::AbstractPetscDM, imode::InsertMode, func::Ptr{Cvoid}, ctx::Ptr{Cvoid})set a local residual evaluation function for use with DMDA
Logically Collective
Input Parameters:
dm-DMto associate callback withimode-INSERT_VALUESif local function computes owned part,ADD_VALUESif it contributes to ghosted partfunc- local residual evaluationctx- optional context for local residual evaluation
Level: beginner
See also: DMDA, DMDASNESFunctionFn, DMDASNESSetJacobianLocal(), DMSNESSetFunction(), DMDACreate1d(), DMDACreate2d(), DMDACreate3d()
External Links
- PETSc Manual:
SNES/DMDASNESSetFunctionLocal
PETSc.LibPETSc.DMDASNESSetFunctionLocalVec — Method
DMDASNESSetFunctionLocalVec(petsclib::PetscLibType, dm::AbstractPetscDM, imode::InsertMode, func::Ptr{Cvoid}, ctx::Ptr{Cvoid})set a local residual evaluation function that operates on a local vector for DMDA
Logically Collective
Input Parameters:
dm-DMto associate callback withimode-INSERT_VALUESif local function computes owned part,ADD_VALUESif it contributes to ghosted partfunc- local residual evaluationctx- optional context for local residual evaluation
Level: beginner
See also: DMDA, DMDASNESFunctionVecFn, DMDASNESSetFunctionLocal(), DMDASNESSetJacobianLocalVec(), DMSNESSetFunction(), DMDACreate1d(), DMDACreate2d(), DMDACreate3d()
External Links
- PETSc Manual:
SNES/DMDASNESSetFunctionLocalVec
PETSc.LibPETSc.DMDASNESSetJacobianLocal — Method
DMDASNESSetJacobianLocal(petsclib::PetscLibType, dm::AbstractPetscDM, func::Ptr{Cvoid}, ctx::Ptr{Cvoid})set a local Jacobian evaluation function for use with DMDA
Logically Collective
Input Parameters:
dm-DMto associate callback withfunc- local Jacobian evaluation functionctx- optional context for local Jacobian evaluation
Level: beginner
See also: DMDA, DMDASNESJacobianFn, DMDASNESSetFunctionLocal(), DMSNESSetJacobian(), DMDACreate1d(), DMDACreate2d(), DMDACreate3d()
External Links
- PETSc Manual:
SNES/DMDASNESSetJacobianLocal
PETSc.LibPETSc.DMDASNESSetJacobianLocalVec — Method
DMDASNESSetJacobianLocalVec(petsclib::PetscLibType, dm::AbstractPetscDM, func::Ptr{Cvoid}, ctx::Ptr{Cvoid})set a local Jacobian evaluation function that operates on a local vector with DMDA
Logically Collective
Input Parameters:
dm-DMto associate callback withfunc- local Jacobian evaluationctx- optional context for local Jacobian evaluation
Level: beginner
See also: DMDA, DMDASNESJacobianVecFn, DMDASNESSetJacobianLocal(), DMDASNESSetFunctionLocalVec(), DMSNESSetJacobian(), DMDACreate1d(), DMDACreate2d(), DMDACreate3d()
External Links
- PETSc Manual:
SNES/DMDASNESSetJacobianLocalVec
PETSc.LibPETSc.DMDASNESSetObjectiveLocal — Method
DMDASNESSetObjectiveLocal(petsclib::PetscLibType, dm::AbstractPetscDM, func::Ptr{Cvoid}, ctx::Ptr{Cvoid})set a local residual evaluation function to used with a DMDA
Logically Collective
Input Parameters:
dm-DMto associate callback withfunc- local objective evaluation, seeDMDASNESSetObjectiveLocalfor the calling sequencectx- optional context for local residual evaluation
Level: beginner
See also: DMDA, DMDASNESObjectiveFn, DMSNESSetFunction(), DMDASNESSetJacobianLocal(), DMDACreate1d(), DMDACreate2d(), DMDACreate3d(), DMDASNESFunctionFn
External Links
- PETSc Manual:
SNES/DMDASNESSetObjectiveLocal
PETSc.LibPETSc.DMDASNESSetObjectiveLocalVec — Method
DMDASNESSetObjectiveLocalVec(petsclib::PetscLibType, dm::AbstractPetscDM, func::Ptr{Cvoid}, ctx::Ptr{Cvoid})set a local residual evaluation function that operates on a local vector with DMDA
Logically Collective
Input Parameters:
dm-DMto associate callback withfunc- local objective evaluation, seeDMDASNESSetObjectiveLocalVecfor the calling sequencectx- optional context for local residual evaluation
Level: beginner
See also: DMDA, DMDASNESObjectiveVecFn, DMDASNESSetObjectiveLocal(), DMSNESSetFunction(), DMDASNESSetJacobianLocalVec(), DMDACreate1d(), DMDACreate2d(), DMDACreate3d(), DMDASNESObjectiveFn
External Links
- PETSc Manual:
SNES/DMDASNESSetObjectiveLocalVec
PETSc.LibPETSc.DMDASNESSetPicardLocal — Method
DMDASNESSetPicardLocal(petsclib::PetscLibType, dm::AbstractPetscDM, imode::InsertMode, func::Ptr{Cvoid}, jac::Ptr{Cvoid}, ctx::Ptr{Cvoid})set a local right-hand side and matrix evaluation function for Picard iteration with DMDA
Logically Collective
Input Parameters:
dm-DMto associate callback withimode-INSERT_VALUESif local function computes owned part,ADD_VALUESif it contributes to ghosted partfunc- local residual evaluationjac- function to compute Jacobianctx- optional context for local residual evaluation
Level: beginner
See also: SNES, DMDA, DMDASNESFunctionFn, DMDASNESJacobianFn, DMSNESSetFunction(), DMDASNESSetJacobian(), DMDACreate1d(), DMDACreate2d(), DMDACreate3d()
External Links
- PETSc Manual:
SNES/DMDASNESSetPicardLocal
PETSc.LibPETSc.DMDASetAOType — Method
DMDASetAOType(petsclib::PetscLibType, da::AbstractPetscDM, aotype::String)Sets the type of application ordering to create with DMDAGetAO(), for a distributed array.
Collective
Input Parameters:
da- theDMDAaotype- type ofAO.AOTypewhich can beAOBASIC,AOADVANCED,AOMAPPING, orAOMEMORYSCALABLE
Level: intermediate
See also: DM, DMDA, DMDACreate2d(), DMDAGetAO(), DMDAGetGhostCorners(), DMDAGetCorners(), DMLocalToGlobal(), DMGlobalToLocalBegin(), DMGlobalToLocalEnd(), DMLocalToLocalBegin(), DMLocalToLocalEnd(), DMDAGetGlobalIndices(), DMDAGetOwnershipRanges(), AO, AOPetscToApplication(), AOApplicationToPetsc(), AOType, AOBASIC, AOADVANCED, AOMAPPING, AOMEMORYSCALABLE
External Links
- PETSc Manual:
DMDA/DMDASetAOType
PETSc.LibPETSc.DMDASetBlockFills — Method
DMDASetBlockFills(petsclib::PetscLibType, da::AbstractPetscDM, dfill::Vector{PetscInt}, ofill::Vector{PetscInt})Sets the fill pattern in each block for a multi-component problem of the matrix returned by DMCreateMatrix().
Logically Collective
Input Parameters:
da- theDMDAdfill- the fill pattern in the diagonal block (may beNULL, means use dense block)ofill- the fill pattern in the off-diagonal blocks
Level: developer
See also: DM, DMDA, DMCreateMatrix(), DMDASetGetMatrix(), DMSetMatrixPreallocateOnly(), DMDASetBlockFillsSparse()
External Links
- PETSc Manual:
DMDA/DMDASetBlockFills
PETSc.LibPETSc.DMDASetBlockFillsSparse — Method
DMDASetBlockFillsSparse(petsclib::PetscLibType, da::AbstractPetscDM, dfillsparse::Vector{PetscInt}, ofillsparse::Vector{PetscInt})Sets the fill pattern in each block for a multi-component problem of the matrix returned by DMCreateMatrix(), using sparse representations of fill patterns.
Logically Collective
Input Parameters:
da- theDMDAdfillsparse- the sparse fill pattern in the diagonal block (may beNULL, means use dense block)ofillsparse- the sparse fill pattern in the off-diagonal blocks
Level: developer
See also: DM, DMDA, DMDASetBlockFills(), DMCreateMatrix(), DMDASetGetMatrix(), DMSetMatrixPreallocateOnly()
External Links
- PETSc Manual:
DMDA/DMDASetBlockFillsSparse
PETSc.LibPETSc.DMDASetBoundaryType — Method
DMDASetBoundaryType(petsclib::PetscLibType, da::AbstractPetscDM, bx::DMBoundaryType, by::DMBoundaryType, bz::DMBoundaryType)Sets the type of ghost nodes on domain boundaries for a DMDA object.
Not Collective
Input Parameters:
da- TheDMDAbx- x boundary type, one ofDM_BOUNDARY_NONE,DM_BOUNDARY_GHOSTED,DM_BOUNDARY_PERIODICby- y boundary type, one ofDM_BOUNDARY_NONE,DM_BOUNDARY_GHOSTED,DM_BOUNDARY_PERIODICbz- z boundary type, one ofDM_BOUNDARY_NONE,DM_BOUNDARY_GHOSTED,DM_BOUNDARY_PERIODIC
Level: intermediate
See also: DMDAGetBoundaryType(), DM, DMDA, DMDACreate(), DMDestroy(), DMBoundaryType, DM_BOUNDARY_NONE, DM_BOUNDARY_GHOSTED, DM_BOUNDARY_PERIODIC
External Links
- PETSc Manual:
DMDA/DMDASetBoundaryType
PETSc.LibPETSc.DMDASetCoordinateName — Method
DMDASetCoordinateName(petsclib::PetscLibType, dm::AbstractPetscDM, nf::PetscInt, name::String)Sets the name of the coordinate directions associated with a DMDA, for example "x" or "y"
Logically Collective; name must contain a common value; No Fortran Support
Input Parameters:
dm- theDMDAnf- coordinate number for theDMDA(0, 1, ... dim-1),name- the name of the coordinate
Level: intermediate
See also: DM, DMDA, DMDAGetCoordinateName(), DMDASetFieldName(), DMDAGetFieldName(), DMSetUp()
External Links
- PETSc Manual:
DMDA/DMDASetCoordinateName
PETSc.LibPETSc.DMDASetDof — Method
DMDASetDof(petsclib::PetscLibType, da::AbstractPetscDM, dof::PetscInt)Sets the number of degrees of freedom per vertex
Not Collective
Input Parameters:
da- TheDMDAdof- Number of degrees of freedom per vertex
Level: intermediate
See also: DM, DMDA, DMDAGetDof(), DMDACreate(), DMDestroy()
External Links
- PETSc Manual:
DMDA/DMDASetDof
PETSc.LibPETSc.DMDASetElementType — Method
DMDASetElementType(petsclib::PetscLibType, da::AbstractPetscDM, etype::DMDAElementType)Sets the element type to be returned by DMDAGetElements()
Not Collective
Input Parameter:
da- theDMDAobject
Output Parameter:
etype- the element type, currently eitherDMDA_ELEMENT_P1orDMDA_ELEMENT_Q1
Level: intermediate
See also: DM, DMDA, DMDAElementType, DMDAGetElementType(), DMDAGetElements(), DMDARestoreElements(), DMDA_ELEMENT_P1, DMDA_ELEMENT_Q1
External Links
- PETSc Manual:
DMDA/DMDASetElementType
PETSc.LibPETSc.DMDASetFieldName — Method
DMDASetFieldName(petsclib::PetscLibType, da::AbstractPetscDM, nf::PetscInt, name::String)Sets the names of individual field components in multicomponent vectors associated with a DMDA.
Logically Collective; name must contain a common value
Input Parameters:
da- theDMDAnf- field number for theDMDA(0, 1, ... dof-1), where dof indicates the
number of degrees of freedom per node within the DMDA
name- the name of the field (component)
Level: intermediate
See also: DM, DMDA, DMDAGetFieldName(), DMDASetCoordinateName(), DMDAGetCoordinateName(), DMDASetFieldNames(), DMSetUp()
External Links
- PETSc Manual:
DMDA/DMDASetFieldName
PETSc.LibPETSc.DMDASetFieldNames — Method
DMDASetFieldNames(petsclib::PetscLibType, da::AbstractPetscDM, names::String)Sets the name of each component in the vector associated with the DMDA
Logically Collective; names must contain a common value; No Fortran Support
Input Parameters:
da- theDMDAobjectnames- the names of the components, final string must beNULL, must have the same number of entries as the dof used in creating theDMDA
Level: intermediate
See also: DM, DMDA, DMDAGetFieldName(), DMDASetCoordinateName(), DMDAGetCoordinateName(), DMDASetFieldName(), DMSetUp()
External Links
- PETSc Manual:
DMDA/DMDASetFieldNames
PETSc.LibPETSc.DMDASetGLLCoordinates — Method
nodes::PetscReal = DMDASetGLLCoordinates(petsclib::PetscLibType, da::AbstractPetscDM, n::PetscInt)Sets the global coordinates from -1 to 1 to the GLL points of as many GLL elements that fit the number of grid points
Collective
Input Parameters:
da- theDMDAobjectn- the number of GLL nodesnodes- the GLL nodes
Level: advanced
See also: DM, DMDA, DMDACreate(), PetscDTGaussLobattoLegendreQuadrature(), DMGetCoordinates()
External Links
- PETSc Manual:
DMDA/DMDASetGLLCoordinates
PETSc.LibPETSc.DMDASetGetMatrix — Method
DMDASetGetMatrix(petsclib::PetscLibType, da::AbstractPetscDM, f::external)Sets the routine used by the DMDA to allocate a matrix.
Logically Collective; No Fortran Support
Input Parameters:
da- theDMDAobjectf- the function that allocates the matrix for that specificDMDA
Calling sequence of f:
da- theDMDAobjectA- the created matrix
Level: developer
See also: DM, DMDA, DMCreateMatrix(), DMDASetBlockFills()
External Links
- PETSc Manual:
DMDA/DMDASetGetMatrix
PETSc.LibPETSc.DMDASetInterpolationType — Method
DMDASetInterpolationType(petsclib::PetscLibType, da::AbstractPetscDM, ctype::DMDAInterpolationType)Sets the type of interpolation that will be returned by DMCreateInterpolation()
Logically Collective
Input Parameters:
da- initial distributed arrayctype-DMDA_Q1andDMDA_Q0are currently the only supported forms
Level: intermediate
See also: DM, DMDA, DMDACreate1d(), DMDACreate2d(), DMDACreate3d(), DMDestroy(), DMDAInterpolationType, DMDA_Q1, DMDA_Q0
External Links
- PETSc Manual:
DMDA/DMDASetInterpolationType
PETSc.LibPETSc.DMDASetNonOverlappingRegion — Method
DMDASetNonOverlappingRegion(petsclib::PetscLibType, da::AbstractPetscDM, xs::PetscInt, ys::PetscInt, zs::PetscInt, xm::PetscInt, ym::PetscInt, zm::PetscInt)Sets the indices of the nonoverlapping region of a subdomain DMDA.
Collective
Input Parameters:
da- TheDMDAxs- The start of the region in xys- The start of the region in yzs- The start of the region in zxm- The size of the region in xym- The size of the region in yzm- The size of the region in z
Level: intermediate
See also: DM, DMDA, DMDAGetOffset(), DMDAVecGetArray()
External Links
- PETSc Manual:
DMDA/DMDASetNonOverlappingRegion
PETSc.LibPETSc.DMDASetNumLocalSubDomains — Method
DMDASetNumLocalSubDomains(petsclib::PetscLibType, da::AbstractPetscDM, Nsub::PetscInt)Sets the number of local subdomains to create when decomposing with DMCreateDomainDecomposition()
Not Collective
Input Parameters:
da- TheDMDANsub- The number of local subdomains requested
Level: intermediate
See also: DM, DMDA, DMCreateDomainDecomposition(), DMDAGetNumLocalSubDomains()
External Links
- PETSc Manual:
DMDA/DMDASetNumLocalSubDomains
PETSc.LibPETSc.DMDASetNumProcs — Method
DMDASetNumProcs(petsclib::PetscLibType, da::AbstractPetscDM, m::PetscInt, n::PetscInt, p::PetscInt)Sets the number of processes in each dimension
Logically Collective
Input Parameters:
da- theDMDAm- the number of X processes (orPETSC_DECIDE)n- the number of Y processes (orPETSC_DECIDE)p- the number of Z processes (orPETSC_DECIDE)
Level: intermediate
See also: DM, DMDA, DMDASetSizes(), PetscSplitOwnership()
External Links
- PETSc Manual:
DMDA/DMDASetNumProcs
PETSc.LibPETSc.DMDASetOffset — Method
DMDASetOffset(petsclib::PetscLibType, da::AbstractPetscDM, xo::PetscInt, yo::PetscInt, zo::PetscInt, Mo::PetscInt, No::PetscInt, Po::PetscInt)Sets the index offset of the DMDA.
Collective
Input Parameters:
da- TheDMDAxo- The offset in the x directionyo- The offset in the y directionzo- The offset in the z directionMo- The problem offset in the x directionNo- The problem offset in the y directionPo- The problem offset in the z direction
Level: developer
See also: DM, DMDA, DMDAGetOffset(), DMDAVecGetArray()
External Links
- PETSc Manual:
DMDA/DMDASetOffset
PETSc.LibPETSc.DMDASetOverlap — Method
DMDASetOverlap(petsclib::PetscLibType, da::AbstractPetscDM, x::PetscInt, y::PetscInt, z::PetscInt)Sets the size of the per-processor overlap.
Not Collective
Input Parameters:
da- TheDMDAx- Overlap in the x directiony- Overlap in the y directionz- Overlap in the z direction
Level: intermediate
See also: DM, DMDA, DMCreateDomainDecomposition(), DMDAGetOverlap()
External Links
- PETSc Manual:
DMDA/DMDASetOverlap
PETSc.LibPETSc.DMDASetOwnershipRanges — Method
DMDASetOwnershipRanges(petsclib::PetscLibType, da::AbstractPetscDM, lx::Vector{PetscInt}, ly::Vector{PetscInt}, lz::Vector{PetscInt})Sets the number of nodes in each direction on each process
Logically Collective
Input Parameters:
da- TheDMDAlx- array containing number of nodes in the X direction on each process, orNULL. If non-null, must be of length da->mly- array containing number of nodes in the Y direction on each process, orNULL. If non-null, must be of length da->nlz- array containing number of nodes in the Z direction on each process, orNULL. If non-null, must be of length da->p.
Level: intermediate
See also: DM, DMDA, DMDACreate(), DMDestroy()
External Links
- PETSc Manual:
DMDA/DMDASetOwnershipRanges
PETSc.LibPETSc.DMDASetPreallocationCenterDimension — Method
DMDASetPreallocationCenterDimension(petsclib::PetscLibType, dm::AbstractPetscDM, preallocCenterDim::PetscInt)Determine the topology used to determine adjacency
Input Parameters:
dm- TheDMDAobjectpreallocCenterDim- The dimension of points which connect adjacent entries
Level: developer
See also: DM, DMDA, DMCreateMatrix(), DMDAPreallocateOperator()
External Links
- PETSc Manual:
DMDA/DMDASetPreallocationCenterDimension
PETSc.LibPETSc.DMDASetRefinementFactor — Method
DMDASetRefinementFactor(petsclib::PetscLibType, da::AbstractPetscDM, refine_x::PetscInt, refine_y::PetscInt, refine_z::PetscInt)Set the ratios that the DMDA grid is refined
Logically Collective
Input Parameters:
da- theDMDAobjectrefine_x- ratio of fine grid to coarse in the x direction (2 by default)refine_y- ratio of fine grid to coarse in the y direction (2 by default)refine_z- ratio of fine grid to coarse in the z direction (2 by default)
Options Database Keys:
-da_refine_x refine_x- refinement ratio in the x direction-da_refine_y rafine_y- refinement ratio in the y direction-da_refine_z refine_z- refinement ratio in the z direction-da_refine n- refine theDMDAobjectntimes when it is created.
Level: intermediate
See also: DM, DMDA, DMRefine(), DMDAGetRefinementFactor()
External Links
- PETSc Manual:
DMDA/DMDASetRefinementFactor
PETSc.LibPETSc.DMDASetSizes — Method
DMDASetSizes(petsclib::PetscLibType, da::AbstractPetscDM, M::PetscInt, N::PetscInt, P::PetscInt)Sets the number of grid points in the three dimensional directions
Logically Collective
Input Parameters:
da- theDMDAM- the global X sizeN- the global Y sizeP- the global Z size
Level: intermediate
See also: DM, DMDA, PetscSplitOwnership()
External Links
- PETSc Manual:
DMDA/DMDASetSizes
PETSc.LibPETSc.DMDASetStencilType — Method
DMDASetStencilType(petsclib::PetscLibType, da::AbstractPetscDM, stype::DMDAStencilType)Sets the type of the communication stencil
Logically Collective
Input Parameters:
da- TheDMDAstype- The stencil type, use eitherDMDA_STENCIL_BOXorDMDA_STENCIL_STAR.
Level: intermediate
See also: DM, DMDA, DMDACreate(), DMDestroy(), DMDAStencilType, DMDA_STENCIL_BOX, DMDA_STENCIL_STAR.
External Links
- PETSc Manual:
DMDA/DMDASetStencilType
PETSc.LibPETSc.DMDASetStencilWidth — Method
DMDASetStencilWidth(petsclib::PetscLibType, da::AbstractPetscDM, width::PetscInt)Sets the width of the communication stencil
Logically Collective
Input Parameters:
da- TheDMDAwidth- The stencil width
Level: intermediate
See also: DM, DMDA, DMDACreate(), DMDestroy(), DMDAStencilType, DMDA_STENCIL_BOX, DMDA_STENCIL_STAR.
External Links
- PETSc Manual:
DMDA/DMDASetStencilWidth
PETSc.LibPETSc.DMDASetUniformCoordinates — Method
DMDASetUniformCoordinates(petsclib::PetscLibType, da::AbstractPetscDM, xmin::PetscReal, xmax::PetscReal, ymin::PetscReal, ymax::PetscReal, zmin::PetscReal, zmax::PetscReal)Sets a DMDA coordinates to be a uniform grid
Collective
Input Parameters:
da- theDMDAobjectxmin- min extreme in the x directionxmax- max extreme in the x directionymin- min extreme in the y direction (value ignored for 1 dimensional problems)ymax- max extreme in the y direction (value ignored for 1 dimensional problems)zmin- min extreme in the z direction (value ignored for 1 or 2 dimensional problems)zmax- max extreme in the z direction (value ignored for 1 or 2 dimensional problems)
Level: beginner
See also: DM, DMDA, DMSetCoordinates(), DMGetCoordinates(), DMDACreate1d(), DMDACreate2d(), DMDACreate3d(), DMStagSetUniformCoordinates()
External Links
- PETSc Manual:
DMDA/DMDASetUniformCoordinates
PETSc.LibPETSc.DMDASetVertexCoordinates — Method
DMDASetVertexCoordinates(petsclib::PetscLibType, dm::AbstractPetscDM, xl::PetscReal, xu::PetscReal, yl::PetscReal, yu::PetscReal, zl::PetscReal, zu::PetscReal)Sets the lower and upper coordinates for a DMDA
Logically Collective
Input Parameters:
dm- TheDMDAobjectxl- the lower x coordinatexu- the upper x coordinateyl- the lower y coordinateyu- the upper y coordinatezl- the lower z coordinatezu- the upper z coordinate
Level: intermediate
See also: DM, DMDA
External Links
- PETSc Manual:
DMDA/DMDASetVertexCoordinates
PETSc.LibPETSc.DMDATSSetIFunctionLocal — Method
DMDATSSetIFunctionLocal(petsclib::PetscLibType, dm::AbstractPetscDM, imode::InsertMode, func::Ptr{Cvoid}, ctx::Ptr{Cvoid})set a local residual evaluation function for use with DMDA
Logically Collective
Input Parameters:
dm-DMto associate callback withimode- the insert mode of the functionfunc- local residual evaluation, seeDMDATSIFunctionLocalFnfor the calling sequencectx- optional context for local residual evaluation
Level: beginner
See also: DMDA, DMDATSIFunctionLocalFn, DMTSSetIFunction(), DMDATSSetIJacobianLocal(), DMDASNESSetFunctionLocal()
External Links
- PETSc Manual:
TS/DMDATSSetIFunctionLocal
PETSc.LibPETSc.DMDATSSetIJacobianLocal — Method
DMDATSSetIJacobianLocal(petsclib::PetscLibType, dm::AbstractPetscDM, func::Ptr{Cvoid}, ctx::Ptr{Cvoid})set a local residual evaluation function for use with DMDA
Logically Collective
Input Parameters:
dm-DMto associate callback withfunc- local residual evaluation, seeDMDATSIJacobianLocalFnfor the calling sequencectx- optional context for local residual evaluation
Level: beginner
See also: DMDA, DMDATSIJacobianLocalFn, DMTSSetIJacobian(), DMDATSSetIFunctionLocal(), DMDASNESSetJacobianLocal()
External Links
- PETSc Manual:
TS/DMDATSSetIJacobianLocal
PETSc.LibPETSc.DMDATSSetRHSFunctionLocal — Method
DMDATSSetRHSFunctionLocal(petsclib::PetscLibType, dm::AbstractPetscDM, imode::InsertMode, func::Ptr{Cvoid}, ctx::Ptr{Cvoid})set a local residual evaluation function for use with DMDA
Logically Collective
Input Parameters:
dm-DMto associate callback withimode- insert mode for the residualfunc- local residual evaluation, seeDMDATSRHSFunctionLocalFnfor the calling sequencectx- optional context for local residual evaluation
Level: beginner
See also: DMDA, DMDATSRHSFunctionLocalFn, TS, TSSetRHSFunction(), DMTSSetRHSFunction(), DMDATSSetRHSJacobianLocal(), DMDASNESSetFunctionLocal()
External Links
- PETSc Manual:
TS/DMDATSSetRHSFunctionLocal
PETSc.LibPETSc.DMDATSSetRHSJacobianLocal — Method
DMDATSSetRHSJacobianLocal(petsclib::PetscLibType, dm::AbstractPetscDM, func::Ptr{Cvoid}, ctx::Ptr{Cvoid})set a local residual evaluation function for use with DMDA
Logically Collective
Input Parameters:
dm-DMto associate callback withfunc- local RHS Jacobian evaluation routine, seeDMDATSRHSJacobianLocalFnfor the calling sequencectx- optional context for local jacobian evaluation
Level: beginner
See also: DMDA, DMDATSRHSJacobianLocalFn, DMTSSetRHSJacobian(), DMDATSSetRHSFunctionLocal(), DMDASNESSetJacobianLocal()
External Links
- PETSc Manual:
TS/DMDATSSetRHSJacobianLocal
PETSc.LibPETSc.DMDAVTKWriteAll — Method
DMDAVTKWriteAll(petsclib::PetscLibType, odm, viewer::PetscViewer)Write a file containing all the fields that have been provided to the viewer
Collective
Input Parameters:
odm-DMDAspecifying the grid layout, passed as aPetscObjectviewer- viewer of typePETSCVIEWERVTK
Level: developer
See also: DMDA, DM, PETSCVIEWERVTK, DMDASetFieldName()
External Links
- PETSc Manual:
DMDA/DMDAVTKWriteAll
PETSc.LibPETSc.DMDAVecGetArray — Method
array::Ptr{Cvoid} = DMDAVecGetArray(petsclib::PetscLibType, da::AbstractPetscDM, vec::AbstractPetscVec)Returns a multiple dimension array that shares data with the underlying vector and is indexed using the global or local dimensions of a DMDA.
Logically Collective
Input Parameters:
da- theDMDAvec- a vector the same size as one obtained withDMCreateGlobalVector()orDMCreateLocalVector()
Output Parameter:
array- the array
Level: intermediate
See also: DM, DMDA, DMDAGetGhostCorners(), DMDAGetCorners(), VecGetArray(), VecRestoreArray(), DMDAVecRestoreArray(), DMDAVecRestoreArrayDOF(), DMDAVecGetArrayDOF(), DMDAVecGetArrayWrite(), DMDAVecRestoreArrayWrite(), DMDAVecGetArrayRead(), DMDAVecRestoreArrayRead(), DMStagVecGetArray()
External Links
- PETSc Manual:
DMDA/DMDAVecGetArray
PETSc.LibPETSc.DMDAVecGetArrayDOF — Method
array::Ptr{Cvoid} = DMDAVecGetArrayDOF(petsclib::PetscLibType, da::AbstractPetscDM, vec::AbstractPetscVec)Returns a multiple dimension array that shares data with the underlying vector and is indexed using the global or local dimensions of a DMDA
Logically Collective
Input Parameters:
da- theDMDAvec- a vector the same size as one obtained withDMCreateGlobalVector()orDMCreateLocalVector()
Output Parameter:
array- thearraypointer
Level: intermediate
See also: DM, DMDA, DMDAGetGhostCorners(), DMDAGetCorners(), VecGetArray(), VecRestoreArray(), DMDAVecRestoreArray(), DMDAVecGetArray(), DMDAVecRestoreArrayDOF(), DMDAVecGetArrayWrite(), DMDAVecRestoreArrayWrite(), DMDAVecGetArrayRead(), DMDAVecRestoreArrayRead(), DMDAVecGetArrayDOFRead()
External Links
- PETSc Manual:
DMDA/DMDAVecGetArrayDOF
PETSc.LibPETSc.DMDAVecGetArrayDOFRead — Method
array::Ptr{Cvoid} = DMDAVecGetArrayDOFRead(petsclib::PetscLibType, da::AbstractPetscDM, vec::AbstractPetscVec)Returns a multiple dimension array that shares data with the underlying vector and is indexed using the global or local dimensions of a DMDA
Not Collective
Input Parameters:
da- theDMDAvec- a vector the same size as one obtained withDMCreateGlobalVector()orDMCreateLocalVector()
Output Parameter:
array- the array
Level: intermediate
See also: DM, DMDA, DMDAGetGhostCorners(), DMDAGetCorners(), VecGetArray(), VecRestoreArray(), DMDAVecRestoreArray(), DMDAVecGetArray(), DMDAVecGetArrayDOF(), DMDAVecGetArrayWrite(), DMDAVecRestoreArrayWrite(), DMDAVecGetArrayRead(), DMDAVecRestoreArrayRead()
External Links
- PETSc Manual:
DMDA/DMDAVecGetArrayDOFRead
PETSc.LibPETSc.DMDAVecGetArrayDOFWrite — Method
array::Ptr{Cvoid} = DMDAVecGetArrayDOFWrite(petsclib::PetscLibType, da::AbstractPetscDM, vec::AbstractPetscVec)Returns a multiple dimension array that shares data with the underlying vector and is indexed using the global or local dimensions of a DMDA
Not Collective
Input Parameters:
da- theDMDAvec- a vector the same size as one obtained withDMCreateGlobalVector()orDMCreateLocalVector()
Output Parameter:
array- the array
Level: intermediate
See also: DM, DMDA, DMDAGetGhostCorners(), DMDAGetCorners(), VecGetArray(), VecRestoreArray(), DMDAVecRestoreArray(), DMDAVecGetArray(), DMDAVecGetArrayDOF(), DMDAVecGetArrayWrite(), DMDAVecRestoreArrayWrite()
External Links
- PETSc Manual:
DMDA/DMDAVecGetArrayDOFWrite
PETSc.LibPETSc.DMDAVecGetArrayRead — Method
array::Ptr{Cvoid} = DMDAVecGetArrayRead(petsclib::PetscLibType, da::AbstractPetscDM, vec::AbstractPetscVec)Returns a multiple dimension array that shares data with the underlying vector and is indexed using the global or local dimensions of a DMDA.
Not Collective
Input Parameters:
da- theDMDAvec- a vector the same size as one obtained withDMCreateGlobalVector()orDMCreateLocalVector()
Output Parameter:
array- the array
Level: intermediate
See also: DM, DMDA, DMDAGetGhostCorners(), DMDAGetCorners(), VecGetArray(), VecRestoreArray(), DMDAVecRestoreArrayRead(), DMDAVecRestoreArrayDOF(), DMDAVecGetArrayDOF(), DMDAVecGetArray(), DMDAVecRestoreArray(), DMStagVecGetArrayRead()
External Links
- PETSc Manual:
DMDA/DMDAVecGetArrayRead
PETSc.LibPETSc.DMDAVecGetArrayWrite — Method
array::Ptr{Cvoid} = DMDAVecGetArrayWrite(petsclib::PetscLibType, da::AbstractPetscDM, vec::AbstractPetscVec)Returns a multiple dimension array that shares data with the underlying vector and is indexed using the global or local dimensions of a DMDA.
Logically Collective
Input Parameters:
da- theDMDAvec- a vector the same size as one obtained withDMCreateGlobalVector()orDMCreateLocalVector()
Output Parameter:
array- the array
Level: intermediate
See also: DM, DMDA, DMDAGetGhostCorners(), DMDAGetCorners(), VecGetArray(), VecRestoreArray(), DMDAVecRestoreArrayWrite(), DMDAVecRestoreArrayDOF(), DMDAVecGetArrayDOF(), DMDAVecGetArray(), DMDAVecRestoreArray(), DMDAVecGetArrayRead(), DMDAVecRestoreArrayRead()
External Links
- PETSc Manual:
DMDA/DMDAVecGetArrayWrite
PETSc.LibPETSc.DMDAVecRestoreArray — Method
DMDAVecRestoreArray(petsclib::PetscLibType, da::AbstractPetscDM, vec::AbstractPetscVec, array::Ptr{Cvoid})Restores a multiple dimension array obtained with DMDAVecGetArray()
Logically Collective
Input Parameters:
da- theDMDAvec- a vector the same size as one obtained withDMCreateGlobalVector()orDMCreateLocalVector()array- thearraypointer
Level: intermediate
See also: DM, DMDA, DMDAGetGhostCorners(), DMDAGetCorners(), VecGetArray(), VecRestoreArray(), DMDAVecGetArray(), DMDAVecGetArrayWrite(), DMDAVecRestoreArrayWrite(), DMDAVecGetArrayRead(), DMDAVecRestoreArrayRead(), DMStagVecRestoreArray()
External Links
- PETSc Manual:
DMDA/DMDAVecRestoreArray
PETSc.LibPETSc.DMDAVecRestoreArrayDOF — Method
DMDAVecRestoreArrayDOF(petsclib::PetscLibType, da::AbstractPetscDM, vec::AbstractPetscVec, array::Ptr{Cvoid})Restores a multiple dimension array obtained with DMDAVecGetArrayDOF()
Logically Collective
Input Parameters:
da- theDMDAvec- vector the same size as one obtained withDMCreateGlobalVector()orDMCreateLocalVector()array- thearraypoint
Level: intermediate
See also: DM, DMDA, DMDAGetGhostCorners(), DMDAGetCorners(), VecGetArray(), VecRestoreArray(), DMDAVecGetArray(), DMDAVecGetArrayDOF(), DMDAVecGetArrayWrite(), DMDAVecRestoreArrayWrite(), DMDAVecGetArrayRead(), DMDAVecRestoreArrayRead()
External Links
- PETSc Manual:
DMDA/DMDAVecRestoreArrayDOF
PETSc.LibPETSc.DMDAVecRestoreArrayDOFRead — Method
DMDAVecRestoreArrayDOFRead(petsclib::PetscLibType, da::AbstractPetscDM, vec::AbstractPetscVec, array::Ptr{Cvoid})Restores a multiple dimension array obtained with DMDAVecGetArrayDOFRead()
Not Collective
Input Parameters:
da- theDMDAvec- a vector the same size as one obtained withDMCreateGlobalVector()orDMCreateLocalVector()array- thearraypointer
Level: intermediate
See also: DM, DMDA, DMDAGetGhostCorners(), DMDAGetCorners(), VecGetArray(), VecRestoreArray(), DMDAVecGetArray(), DMDAVecGetArrayDOF(), DMDAVecRestoreArrayDOF(), DMDAVecGetArrayWrite(), DMDAVecRestoreArrayWrite(), DMDAVecGetArrayRead(), DMDAVecRestoreArrayRead()
External Links
- PETSc Manual:
DMDA/DMDAVecRestoreArrayDOFRead
PETSc.LibPETSc.DMDAVecRestoreArrayDOFWrite — Method
DMDAVecRestoreArrayDOFWrite(petsclib::PetscLibType, da::AbstractPetscDM, vec::AbstractPetscVec, array::Ptr{Cvoid})Restores a multiple dimension array obtained with DMDAVecGetArrayDOFWrite()
Not Collective
Input Parameters:
da- theDMDAvec- a vector the same size as one obtained withDMCreateGlobalVector()orDMCreateLocalVector()array- thearraypointer
Level: intermediate
See also: DM, DMDA, DMDAGetGhostCorners(), DMDAGetCorners(), VecGetArray(), VecRestoreArray(), DMDAVecGetArray(), DMDAVecGetArrayDOF(), DMDAVecRestoreArrayDOF(), DMDAVecGetArrayWrite(), DMDAVecRestoreArrayWrite()
External Links
- PETSc Manual:
DMDA/DMDAVecRestoreArrayDOFWrite
PETSc.LibPETSc.DMDAVecRestoreArrayRead — Method
DMDAVecRestoreArrayRead(petsclib::PetscLibType, da::AbstractPetscDM, vec::AbstractPetscVec, array::Ptr{Cvoid})Restores a multiple dimension array obtained with DMDAVecGetArrayRead()
Not Collective
Input Parameters:
da- theDMDAvec- vector the same size as one obtained withDMCreateGlobalVector()orDMCreateLocalVector()array- thearraypointer
Level: intermediate
See also: DM, DMDA, DMDAGetGhostCorners(), DMDAGetCorners(), VecGetArray(), VecRestoreArray(), DMDAVecGetArrayRead(), DMDAVecGetArray(), DMDAVecRestoreArray(), DMDAVecGetArrayWrite(), DMDAVecRestoreArrayWrite(), DMStagVecRestoreArrayRead()
External Links
- PETSc Manual:
DMDA/DMDAVecRestoreArrayRead
PETSc.LibPETSc.DMDAVecRestoreArrayWrite — Method
DMDAVecRestoreArrayWrite(petsclib::PetscLibType, da::AbstractPetscDM, vec::AbstractPetscVec, array::Ptr{Cvoid})Restores a multiple dimension array obtained with DMDAVecGetArrayWrite()
Logically Collective
Input Parameters:
da- theDMDAvec- a vector the same size as one obtained withDMCreateGlobalVector()orDMCreateLocalVector()array- thearraypointer
Level: intermediate
See also: DM, DMDA, DMDAGetGhostCorners(), DMDAGetCorners(), VecGetArray(), VecRestoreArray(), DMDAVecGetArrayWrite(), DMDAVecGetArray(), DMDAVecRestoreArray(), DMDAVecGetArrayRead(), DMDAVecRestoreArrayRead()
External Links
- PETSc Manual:
DMDA/DMDAVecRestoreArrayWrite