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::PetscDM, 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
-seealso: , 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
-seealso: , 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::Vector{PetscInt})Creates an object that will manage the communication of one regular array data that is distributed across one or more MPI processes.
Collective
Input Parameters:
comm- MPI communicatorbx- type of ghost cells at the boundary the array should have, if any. UseDM_BOUNDARY_NONE,DM_BOUNDARY_GHOSTED, orDM_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, orNULL. If non-null, must be of length as the number of processes in the MPI_Comm. The sum of these entries must equalM.
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 x direction-da_refine_x <rx>- refinement factor-da_refine <n>- refine theDMDAn times before creating it
Level: beginner
-seealso: , 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 =petsclib::PetscLibType,comm::MPI_Comm, bx::DMBoundaryType, by::DMBoundaryType, stencil_type::DMDAStencilType, M::PetscInt, N::PetscInt, m::PetscInt, n::PetscInt, dof::PetscInt, s::PetscInt, lx::Vector{PetscInt}, ly::Vector{PetscInt})Creates an object that will manage the communication of two 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 x direction of the arrayN- global dimension in y direction of the arraym- corresponding number of processors in x dimension (orPETSC_DECIDEto have calculated)n- corresponding number of processors in 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 x direction-da_grid_y <ny>- number of grid points in y direction-da_processors_x <nx>- number of processors in x direction-da_processors_y <ny>- number of processors in y direction-da_bd_x <bx>- boundary type in x direction-da_bd_y <by>- boundary type in y direction-da_bd_all <bt>- boundary type in all directions-da_refine_x <rx>- refinement ratio in x direction-da_refine_y <ry>- refinement ratio in y direction-da_refine <n>- refine theDMDAn times before creating
Level: beginner
-seealso: , 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::PetscInt, n::PetscInt, p::PetscInt, dof::PetscInt, s::PetscInt, lx::Vector{PetscInt}, ly::Vector{PetscInt}, lz::Vector{PetscInt})Creates an object that will manage the communication of three 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 ofDM_BOUNDARY_NONE,DM_BOUNDARY_GHOSTED,DM_BOUNDARY_PERIODIC.by- type of y ghost nodes the array have. Use one ofDM_BOUNDARY_NONE,DM_BOUNDARY_GHOSTED,DM_BOUNDARY_PERIODIC.bz- type of z ghost nodes the array have. Use one ofDM_BOUNDARY_NONE,DM_BOUNDARY_GHOSTED,DM_BOUNDARY_PERIODIC.stencil_type- Type of stencil (DMDA_STENCIL_STARorDMDA_STENCIL_BOX)M- global dimension in x direction of the arrayN- global dimension in y direction of the arrayP- global dimension in z direction of the arraym- corresponding number of processors in x dimension (orPETSC_DECIDEto have calculated)n- corresponding number of processors in y dimension (orPETSC_DECIDEto have calculated)p- corresponding number of processors in 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 x direction-da_grid_y <ny>- number of grid points in y direction-da_grid_z <nz>- number of grid points in z direction-da_processors_x <MX>- number of processors in x direction-da_processors_y <MY>- number of processors in y direction-da_processors_z <MZ>- number of processors in z direction-da_bd_x <bx>- boundary type in x direction-da_bd_y <by>- boundary type in y direction-da_bd_z <bz>- boundary type in x direction-da_bd_all <bt>- boundary type in all directions-da_refine_x <rx>- refinement ratio in x direction-da_refine_y <ry>- refinement ratio in y direction-da_refine_z <rz>- refinement ratio in z directio-da_refine <n>- refine theDMDAn times before creating it
Level: beginner
-seealso: , 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::PetscDM, daf::PetscDM)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
-seealso: , DMRefine(), DMCreateInjection(), DMCreateInterpolation()
External Links
- PETSc Manual:
DMDA/DMDACreateAggregates
PETSc.LibPETSc.DMDACreateCompatibleDMDA — Method
nda::PetscDM = DMDACreateCompatibleDMDA(petsclib::PetscLibType,da::PetscDM, 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
-seealso: , DM, DMDA, DMDAGetGhostCorners(), DMSetCoordinates(), DMDASetUniformCoordinates(), DMGetCoordinates(), DMDAGetGhostedCoordinates(), DMStagCreateCompatibleDMStag()
External Links
- PETSc Manual:
DMDA/DMDACreateCompatibleDMDA
PETSc.LibPETSc.DMDACreateNaturalVector — Method
g::PetscVec = DMDACreateNaturalVector(petsclib::PetscLibType,da::PetscDM)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
-seealso: , 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::PetscDM)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
-seealso: DM, PF, DMDA, DMDACreate1d(), DMDACreate2d(), DMDACreate3d(), DMDestroy(), DMCreateGlobalVector()
External Links
- PETSc Manual:
DMDA/DMDACreatePF
PETSc.LibPETSc.DMDACreatePatchIS — Method
is::IS = DMDACreatePatchIS(petsclib::PetscLibType,da::PetscDM, lower::MatStencil, upper::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
-seealso: , DM, DMDA, DMCreateDomainDecomposition(), DMCreateDomainDecompositionScatters()
External Links
- PETSc Manual:
DMDA/DMDACreatePatchIS
PETSc.LibPETSc.DMDAGetAO — Method
DMDAGetAO(petsclib::PetscLibType,da::PetscDM, ao::AO)Gets the application ordering context for a distributed array.
Collective
Input Parameter:
da- theDMDA
Output Parameter:
ao- the application ordering context forDMDA
Level: intermediate
-seealso: , 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
DMDAGetArray(petsclib::PetscLibType,da::PetscDM, ghosted::PetscBool, vptr::Cvoid)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
-seealso: , DM, DMDA, DMDARestoreArray()
External Links
- PETSc Manual:
DMDA/DMDAGetArray
PETSc.LibPETSc.DMDAGetBoundaryType — Method
bx::DMBoundaryType,by::DMBoundaryType,bz::DMBoundaryType = DMDAGetBoundaryType(petsclib::PetscLibType,da::PetscDM)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
-seealso: , 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::PetscDM, 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
-seealso: , DM, DMDA, DMDAGetNumCells()
External Links
- PETSc Manual:
DMDA/DMDAGetCellPoint
PETSc.LibPETSc.DMDAGetCoordinateArray — Method
DMDAGetCoordinateArray(petsclib::PetscLibType,dm::PetscDM, xc::Cvoid)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
-seealso: , DM, DMDA, DMDASetCoordinateName(), DMDASetFieldName(), DMDAGetFieldName(), DMDARestoreCoordinateArray()
External Links
- PETSc Manual:
DMDA/DMDAGetCoordinateArray
PETSc.LibPETSc.DMDAGetCoordinateName — Method
DMDAGetCoordinateName(petsclib::PetscLibType,dm::PetscDM, nf::PetscInt, name::String)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
-seealso: , 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::PetscDM)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
-seealso: , DM, DMDA, DMDAGetGhostCorners(), DMDAGetOwnershipRanges(), DMStagGetCorners(), DMSTAG
External Links
- PETSc Manual:
DMDA/DMDAGetCorners
PETSc.LibPETSc.DMDAGetDepthStratum — Method
pStart::PetscInt,pEnd::PetscInt = DMDAGetDepthStratum(petsclib::PetscLibType,dm::PetscDM, 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
-seealso: , 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::PetscDM)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
-seealso: , DM, DMDA, DMDASetDof(), DMDACreate(), DMDestroy()
External Links
- PETSc Manual:
DMDA/DMDAGetDof
PETSc.LibPETSc.DMDAGetElementType — Method
etype::DMDAElementType = DMDAGetElementType(petsclib::PetscLibType,da::PetscDM)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
-seealso: , 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::PetscDM)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
-seealso: , 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::PetscDM)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
-seealso: , 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::PetscDM)Gets the local number of elements per coordinate direction for the non
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
-seealso: , DM, DMDA, DMDAElementType, DMDASetElementType(), DMDAGetElements(), DMDAGetElementsCorners()
External Links
- PETSc Manual:
DMDA/DMDAGetElementsSizes
PETSc.LibPETSc.DMDAGetFieldName — Method
DMDAGetFieldName(petsclib::PetscLibType,da::PetscDM, nf::PetscInt, name::String)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
-seealso: , DM, DMDA, DMDASetFieldName(), DMDASetCoordinateName(), DMDAGetCoordinateName(), DMSetUp()
External Links
- PETSc Manual:
DMDA/DMDAGetFieldName
PETSc.LibPETSc.DMDAGetFieldNames — Method
DMDAGetFieldNames(petsclib::PetscLibType,da::PetscDM, names::Cchar)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
-seealso: , 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::PetscDM)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
-seealso: , 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::PetscDM, 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
-seealso: , 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::PetscInt,n::PetscInt,p::PetscInt,dof::PetscInt,s::PetscInt, bx::DMBoundaryType, by::DMBoundaryType, bz::DMBoundaryType, st::DMDAStencilType = DMDAGetInfo(petsclib::PetscLibType,da::PetscDM)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
Note: in julia, we return a named
Level: beginner
-seealso: , DM, DMDA, DMView(), DMDAGetCorners(), DMDAGetLocalInfo()
External Links
- PETSc Manual:
DMDA/DMDAGetInfo
PETSc.LibPETSc.DMDAGetInterpolationType — Method
ctype::DMDAInterpolationType = DMDAGetInterpolationType(petsclib::PetscLibType,da::PetscDM)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
-seealso: , DM, DMDA, DMDAInterpolationType, DMDASetInterpolationType(), DMCreateInterpolation(), DMDA_Q1, DMDA_Q0
External Links
- PETSc Manual:
DMDA/DMDAGetInterpolationType
PETSc.LibPETSc.DMDAGetLocalInfo — Method
DMDAGetLocalInfo(petsclib::PetscLibType,da::PetscDM, info::DMDALocalInfo)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
-seealso: , DM, DMDA, DMDAGetInfo(), DMDAGetCorners(), DMDALocalInfo
External Links
- PETSc Manual:
DMDA/DMDAGetLocalInfo
PETSc.LibPETSc.DMDAGetLogicalCoordinate — Method
II::PetscInt,JJ::PetscInt,KK::PetscInt,X::PetscScalar,Y::PetscScalar,Z::PetscScalar = DMDAGetLogicalCoordinate(petsclib::PetscLibType,da::PetscDM, 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
External Links
- PETSc Manual:
DMDA/DMDAGetLogicalCoordinate
PETSc.LibPETSc.DMDAGetNeighbors — Method
DMDAGetNeighbors(petsclib::PetscLibType,da::PetscDM, ranks::Vector{PetscMPIInt})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
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::PetscDM)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
-seealso: , 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::PetscDM)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
-seealso: , 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::PetscDM)External Links
- PETSc Manual:
DMDA/DMDAGetNumFaces
PETSc.LibPETSc.DMDAGetNumLocalSubDomains — Method
Nsub::PetscInt = DMDAGetNumLocalSubDomains(petsclib::PetscLibType,da::PetscDM)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
-seealso: , 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::PetscDM)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::PetscDM)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
-seealso: , DM, DMDA, DMDASetOffset(), DMDAVecGetArray()
External Links
- PETSc Manual:
DMDA/DMDAGetOffset
PETSc.LibPETSc.DMDAGetOverlap — Method
x::PetscInt,y::PetscInt,z::PetscInt = DMDAGetOverlap(petsclib::PetscLibType,da::PetscDM)Gets the size of the per
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
-seealso: , 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::PetscDM)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
-seealso: , 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::PetscDM)Return the topology used to determine adjacency
Input Parameter:
dm- TheDMDAobject
Output Parameter:
preallocCenterDim- The dimension of points which connect adjacent entries
Level: developer
-seealso: , DM, DMDA, DMCreateMatrix(), DMDAPreallocateOperator(), DMDASetPreallocationCenterDimension()
External Links
- PETSc Manual:
DMDA/DMDAGetPreallocationCenterDimension
PETSc.LibPETSc.DMDAGetProcessorSubset — Method
DMDAGetProcessorSubset(petsclib::PetscLibType,da::PetscDM, dir::DMDirection, gp::PetscInt, comm::MPI_Comm)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
-seealso: , DM, DMDA, DMDirection, DM_X, DM_Y, DM_Z, DMDAGetProcessorSubsets()
External Links
- PETSc Manual:
DMDA/DMDAGetProcessorSubset
PETSc.LibPETSc.DMDAGetProcessorSubsets — Method
DMDAGetProcessorSubsets(petsclib::PetscLibType,da::PetscDM, dir::DMDirection, subcomm::MPI_Comm)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
-seealso: , DM, DMDA, DMDirection, DMDAGetProcessorSubset(), DM_X, DM_Y, DM_Z
External Links
- PETSc Manual:
DMDA/DMDAGetProcessorSubsets
PETSc.LibPETSc.DMDAGetRay — Method
DMDAGetRay(petsclib::PetscLibType,da::PetscDM, dir::DMDirection, gp::PetscInt, newvec::PetscVec, scatter::VecScatter)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
-seealso: , 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::PetscDM)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
-seealso: , DM, DMDA, DMRefine(), DMDASetRefinementFactor()
External Links
- PETSc Manual:
DMDA/DMDAGetRefinementFactor
PETSc.LibPETSc.DMDAGetScatter — Method
DMDAGetScatter(petsclib::PetscLibType,da::PetscDM, gtol::VecScatter, ltol::VecScatter)Gets the global 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
-seealso: , DM, DMDA, DMGlobalToLocalBegin(), DMGlobalToLocalEnd(), DMLocalToGlobalBegin()
External Links
- PETSc Manual:
DMDA/DMDAGetScatter
PETSc.LibPETSc.DMDAGetStencilType — Method
stype::DMDAStencilType = DMDAGetStencilType(petsclib::PetscLibType,da::PetscDM)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
-seealso: , 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::PetscDM)Gets the width of the communication stencil
Not Collective
Input Parameter:
da- TheDMDA
Output Parameter:
width- The stencil width
Level: intermediate
-seealso: , DM, DMDA, DMDACreate(), DMDestroy(), DMDAStencilType, DMDA_STENCIL_BOX, DMDA_STENCIL_STAR.
External Links
- PETSc Manual:
DMDA/DMDAGetStencilWidth
PETSc.LibPETSc.DMDAGetSubdomainCornersIS — Method
DMDAGetSubdomainCornersIS(petsclib::PetscLibType,dm::PetscDM, is::IS)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
-seealso: , DM, DMDA, DMDAElementType, DMDASetElementType(), DMDAGetElements(), DMDARestoreElementsCornersIS(), DMDAGetElementsSizes(), DMDAGetElementsCorners()
External Links
- PETSc Manual:
DMDA/DMDAGetSubdomainCornersIS
PETSc.LibPETSc.DMDAGlobalToNaturalAllCreate — Method
scatter::VecScatter = DMDAGlobalToNaturalAllCreate(petsclib::PetscLibType,da::PetscDM)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
-seealso: , DM, DMDA, DMDANaturalAllToGlobalCreate(), DMDAGlobalToNaturalEnd(), DMLocalToGlobalBegin(), DMDACreate2d(), DMGlobalToLocalBegin(), DMGlobalToLocalEnd(), DMDACreateNaturalVector()
External Links
- PETSc Manual:
DMDA/DMDAGlobalToNaturalAllCreate
PETSc.LibPETSc.DMDAGlobalToNaturalBegin — Method
DMDAGlobalToNaturalBegin(petsclib::PetscLibType,da::PetscDM, g::PetscVec, mode::InsertMode, n::PetscVec)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
-seealso: , DM, DMDA, DMDAGlobalToNaturalEnd(), DMLocalToGlobalBegin(), DMDACreate2d(), DMGlobalToLocalBegin(), DMGlobalToLocalEnd(), DMDACreateNaturalVector()
External Links
- PETSc Manual:
DMDA/DMDAGlobalToNaturalBegin
PETSc.LibPETSc.DMDAGlobalToNaturalEnd — Method
DMDAGlobalToNaturalEnd(petsclib::PetscLibType,da::PetscDM, g::PetscVec, mode::InsertMode, n::PetscVec)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
-seealso: , 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::PetscDM)External Links
- PETSc Manual:
Ts/DMDAMapCoordsToPeriodicDomain
PETSc.LibPETSc.DMDAMapMatStencilToGlobal — Method
gidxm::Vector{PetscInt} = DMDAMapMatStencilToGlobal(petsclib::PetscLibType,da::PetscDM, m::PetscInt, idxm::Vector{MatStencil})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
-seealso: , DM, DMDA, MatStencil
External Links
- PETSc Manual:
DMDA/DMDAMapMatStencilToGlobal
PETSc.LibPETSc.DMDANaturalAllToGlobalCreate — Method
scatter::VecScatter = DMDANaturalAllToGlobalCreate(petsclib::PetscLibType,da::PetscDM)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
-seealso: , DM, DMDA, DMDAGlobalToNaturalAllCreate(), DMDAGlobalToNaturalEnd(), DMLocalToGlobalBegin(), DMDACreate2d(), DMGlobalToLocalBegin(), DMGlobalToLocalEnd(), DMDACreateNaturalVector()
External Links
- PETSc Manual:
DMDA/DMDANaturalAllToGlobalCreate
PETSc.LibPETSc.DMDANaturalToGlobalBegin — Method
DMDANaturalToGlobalBegin(petsclib::PetscLibType,da::PetscDM, n::PetscVec, mode::InsertMode, g::PetscVec)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
-seealso: , DM, DMDA, DMDAGlobalToNaturalEnd(), DMDAGlobalToNaturalBegin(), DMLocalToGlobalBegin(), DMDACreate2d(), DMGlobalToLocalBegin(), DMGlobalToLocalEnd(), DMDACreateNaturalVector()
External Links
- PETSc Manual:
DMDA/DMDANaturalToGlobalBegin
PETSc.LibPETSc.DMDANaturalToGlobalEnd — Method
DMDANaturalToGlobalEnd(petsclib::PetscLibType,da::PetscDM, n::PetscVec, mode::InsertMode, g::PetscVec)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
-seealso: , DM, DMDA, DMDAGlobalToNaturalBegin(), DMDAGlobalToNaturalEnd(), DMLocalToGlobalBegin(), DMDACreate2d(), DMGlobalToLocalBegin(), DMGlobalToLocalEnd(), DMDACreateNaturalVector()
External Links
- PETSc Manual:
DMDA/DMDANaturalToGlobalEnd
PETSc.LibPETSc.DMDARestoreArray — Method
DMDARestoreArray(petsclib::PetscLibType,da::PetscDM, ghosted::PetscBool, vptr::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
-seealso: , DM, DMDA, DMDAGetArray()
External Links
- PETSc Manual:
DMDA/DMDARestoreArray
PETSc.LibPETSc.DMDARestoreCoordinateArray — Method
DMDARestoreCoordinateArray(petsclib::PetscLibType,dm::PetscDM, xc::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
-seealso: , DM, DMDA, DMDASetCoordinateName(), DMDASetFieldName(), DMDAGetFieldName(), DMDAGetCoordinateArray()
External Links
- PETSc Manual:
DMDA/DMDARestoreCoordinateArray
PETSc.LibPETSc.DMDARestoreElements — Method
DMDARestoreElements(petsclib::PetscLibType,dm::PetscDM, nel::PetscInt, nen::PetscInt, e::Vector{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
-seealso: , DM, DMDA, DMDAElementType, DMDASetElementType(), DMDAGetElements()
External Links
- PETSc Manual:
DMDA/DMDARestoreElements
PETSc.LibPETSc.DMDARestoreSubdomainCornersIS — Method
DMDARestoreSubdomainCornersIS(petsclib::PetscLibType,dm::PetscDM, is::IS)Restores the IS obtained with DMDAGetSubdomainCornersIS()
Not Collective
Input Parameters:
dm- theDMobjectis- the index set
Level: intermediate
-seealso: , DM, DMDA, DMDAElementType, DMDASetElementType(), DMDAGetSubdomainCornersIS()
External Links
- PETSc Manual:
DMDA/DMDARestoreSubdomainCornersIS
PETSc.LibPETSc.DMDASNESSetFunctionLocal — Method
DMDASNESSetFunctionLocal(petsclib::PetscLibType,dm::PetscDM, imode::InsertMode, func::external, ctx::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
Calling sequence of func:
info-DMDALocalInfodefining the subdomain to evaluate the residual onx- dimensional pointer to state at which to evaluate residual (e.g. PetscScalar *x or **x or ***x)f- dimensional pointer to residual, write the residual here (e.g. PetscScalar *f or **f or ***f)ctx- optional context passed above
Level: beginner
-seealso: , DMDA, DMDASNESSetJacobianLocal(), DMSNESSetFunction(), DMDACreate1d(), DMDACreate2d(), DMDACreate3d()
External Links
- PETSc Manual:
Snes/DMDASNESSetFunctionLocal
PETSc.LibPETSc.DMDASNESSetFunctionLocalVec — Method
DMDASNESSetFunctionLocalVec(petsclib::PetscLibType,dm::PetscDM, imode::InsertMode, func::external, ctx::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
Calling sequence of func:
info-DMDALocalInfodefining the subdomain to evaluate the residual onx- state vector at which to evaluate residualf- residual vectorctx- optional context passed above
Level: beginner
-seealso: , DMDA, DMDASNESSetFunctionLocal(), DMDASNESSetJacobianLocalVec(), DMSNESSetFunction(), DMDACreate1d(), DMDACreate2d(), DMDACreate3d()
External Links
- PETSc Manual:
Snes/DMDASNESSetFunctionLocalVec
PETSc.LibPETSc.DMDASNESSetJacobianLocal — Method
DMDASNESSetJacobianLocal(petsclib::PetscLibType,dm::PetscDM, func::external, ctx::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
Calling sequence of func:
info-DMDALocalInfodefining the subdomain to evaluate the Jacobian atx- dimensional pointer to state at which to evaluate Jacobian (e.g. PetscScalar *x or **x or ***x)J-Matobject for the JacobianM-Matobject used to compute the preconditioner oftenJctx- optional context passed above
Level: beginner
-seealso: , DMDA, DMDASNESSetFunctionLocal(), DMSNESSetJacobian(), DMDACreate1d(), DMDACreate2d(), DMDACreate3d()
External Links
- PETSc Manual:
Snes/DMDASNESSetJacobianLocal
PETSc.LibPETSc.DMDASNESSetJacobianLocalVec — Method
DMDASNESSetJacobianLocalVec(petsclib::PetscLibType,dm::PetscDM, func::external, ctx::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
Calling sequence of func:
info-DMDALocalInfodefining the subdomain to evaluate the Jacobian atx- state vector at which to evaluate JacobianJ- the JacobianM- approximate Jacobian from which the preconditioner will be computed, oftenJctx- optional context passed above
Level: beginner
-seealso: , DMDA, DMDASNESSetJacobianLocal(), DMDASNESSetFunctionLocalVec(), DMSNESSetJacobian(), DMDACreate1d(), DMDACreate2d(), DMDACreate3d()
External Links
- PETSc Manual:
Snes/DMDASNESSetJacobianLocalVec
PETSc.LibPETSc.DMDASNESSetObjectiveLocal — Method
DMDASNESSetObjectiveLocal(petsclib::PetscLibType,dm::PetscDM, func::external, ctx::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
Calling sequence of func:
info-DMDALocalInfodefining the subdomain to evaluate the Jacobian atx- dimensional pointer to state at which to evaluate the objective (e.g. PetscScalar *x or **x or ***x)obj- returned objective value for the local subdomainctx- optional context passed above
Level: beginner
-seealso: , DMDA, DMSNESSetFunction(), DMDASNESSetJacobianLocal(), DMDACreate1d(), DMDACreate2d(), DMDACreate3d(), DMDASNESObjectiveFn
External Links
- PETSc Manual:
Snes/DMDASNESSetObjectiveLocal
PETSc.LibPETSc.DMDASNESSetObjectiveLocalVec — Method
DMDASNESSetObjectiveLocalVec(petsclib::PetscLibType,dm::PetscDM, func::external, ctx::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
Calling sequence of func:
info-DMDALocalInfodefining the subdomain to evaluate the Jacobian atx- state vector at which to evaluate the objectiveobj- returned objective value for the local subdomainctx- optional context passed above
Level: beginner
-seealso: , DMDA, DMDASNESSetObjectiveLocal(), DMSNESSetFunction(), DMDASNESSetJacobianLocalVec(), DMDACreate1d(), DMDACreate2d(), DMDACreate3d(), DMDASNESObjectiveVecFn
External Links
- PETSc Manual:
Snes/DMDASNESSetObjectiveLocalVec
PETSc.LibPETSc.DMDASNESSetPicardLocal — Method
DMDASNESSetPicardLocal(petsclib::PetscLibType,dm::PetscDM, imode::InsertMode, func::external, jac::external, ctx::Cvoid)set a local right
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
Calling sequence of func:
info- defines the subdomain to evaluate the residual onx- dimensional pointer to state at which to evaluate residualf- dimensional pointer to residual, write the residual herectx- optional context passed above
Calling sequence of jac:
info- defines the subdomain to evaluate the residual onx- dimensional pointer to state at which to evaluate residualjac- the JacobianJp- approximation to the Jacobian used to compute the preconditioner, oftenJctx- optional context passed above
Level: beginner
-seealso: , SNES, DMDA, DMSNESSetFunction(), DMDASNESSetJacobian(), DMDACreate1d(), DMDACreate2d(), DMDACreate3d()
External Links
- PETSc Manual:
Snes/DMDASNESSetPicardLocal
PETSc.LibPETSc.DMDASetAOType — Method
DMDASetAOType(petsclib::PetscLibType,da::PetscDM, aotype::AOType)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
-seealso: , 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::PetscDM, dfill::PetscInt, ofill::PetscInt)Sets the fill pattern in each block for a multi 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
-seealso: , DM, DMDA, DMCreateMatrix(), DMDASetGetMatrix(), DMSetMatrixPreallocateOnly(), DMDASetBlockFillsSparse()
External Links
- PETSc Manual:
DMDA/DMDASetBlockFills
PETSc.LibPETSc.DMDASetBlockFillsSparse — Method
DMDASetBlockFillsSparse(petsclib::PetscLibType,da::PetscDM, dfillsparse::PetscInt, ofillsparse::PetscInt)Sets the fill pattern in each block for a multi 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
-seealso: , DM, DMDA, DMDASetBlockFills(), DMCreateMatrix(), DMDASetGetMatrix(), DMSetMatrixPreallocateOnly()
External Links
- PETSc Manual:
DMDA/DMDASetBlockFillsSparse
PETSc.LibPETSc.DMDASetBoundaryType — Method
DMDASetBoundaryType(petsclib::PetscLibType,da::PetscDM, 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
-seealso: , 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::PetscDM, 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
-seealso: , DM, DMDA, DMDAGetCoordinateName(), DMDASetFieldName(), DMDAGetFieldName(), DMSetUp()
External Links
- PETSc Manual:
DMDA/DMDASetCoordinateName
PETSc.LibPETSc.DMDASetDof — Method
DMDASetDof(petsclib::PetscLibType,da::PetscDM, 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
-seealso: , DM, DMDA, DMDAGetDof(), DMDACreate(), DMDestroy()
External Links
- PETSc Manual:
DMDA/DMDASetDof
PETSc.LibPETSc.DMDASetElementType — Method
etype::DMDAElementType = DMDASetElementType(petsclib::PetscLibType,da::PetscDM)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
-seealso: , 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::PetscDM, 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
-seealso: , DM, DMDA, DMDAGetFieldName(), DMDASetCoordinateName(), DMDAGetCoordinateName(), DMDASetFieldNames(), DMSetUp()
External Links
- PETSc Manual:
DMDA/DMDASetFieldName
PETSc.LibPETSc.DMDASetFieldNames — Method
DMDASetFieldNames(petsclib::PetscLibType,da::PetscDM, 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
-seealso: , DM, DMDA, DMDAGetFieldName(), DMDASetCoordinateName(), DMDAGetCoordinateName(), DMDASetFieldName(), DMSetUp()
External Links
- PETSc Manual:
DMDA/DMDASetFieldNames
PETSc.LibPETSc.DMDASetGLLCoordinates — Method
nodes::PetscReal = DMDASetGLLCoordinates(petsclib::PetscLibType,da::PetscDM, n::PetscInt)External Links
- PETSc Manual:
DMDA/DMDASetGLLCoordinates
PETSc.LibPETSc.DMDASetGetMatrix — Method
DMDASetGetMatrix(petsclib::PetscLibType,da::PetscDM, 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
-seealso: , DM, DMDA, DMCreateMatrix(), DMDASetBlockFills()
External Links
- PETSc Manual:
DMDA/DMDASetGetMatrix
PETSc.LibPETSc.DMDASetInterpolationType — Method
DMDASetInterpolationType(petsclib::PetscLibType,da::PetscDM, 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
-seealso: , 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::PetscDM, 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
-seealso: , DM, DMDA, DMDAGetOffset(), DMDAVecGetArray()
External Links
- PETSc Manual:
DMDA/DMDASetNonOverlappingRegion
PETSc.LibPETSc.DMDASetNumLocalSubDomains — Method
DMDASetNumLocalSubDomains(petsclib::PetscLibType,da::PetscDM, 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
-seealso: , DM, DMDA, DMCreateDomainDecomposition(), DMDAGetNumLocalSubDomains()
External Links
- PETSc Manual:
DMDA/DMDASetNumLocalSubDomains
PETSc.LibPETSc.DMDASetNumProcs — Method
DMDASetNumProcs(petsclib::PetscLibType,da::PetscDM, 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
-seealso: , DM, DMDA, DMDASetSizes(), PetscSplitOwnership()
External Links
- PETSc Manual:
DMDA/DMDASetNumProcs
PETSc.LibPETSc.DMDASetOffset — Method
DMDASetOffset(petsclib::PetscLibType,da::PetscDM, 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
-seealso: , DM, DMDA, DMDAGetOffset(), DMDAVecGetArray()
External Links
- PETSc Manual:
DMDA/DMDASetOffset
PETSc.LibPETSc.DMDASetOverlap — Method
DMDASetOverlap(petsclib::PetscLibType,da::PetscDM, x::PetscInt, y::PetscInt, z::PetscInt)Sets the size of the per
Not Collective
Input Parameters:
da- TheDMDAx- Overlap in the x directiony- Overlap in the y directionz- Overlap in the z direction
Level: intermediate
-seealso: , DM, DMDA, DMCreateDomainDecomposition(), DMDAGetOverlap()
External Links
- PETSc Manual:
DMDA/DMDASetOverlap
PETSc.LibPETSc.DMDASetOwnershipRanges — Method
DMDASetOwnershipRanges(petsclib::PetscLibType,da::PetscDM, 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
-seealso: , DM, DMDA, DMDACreate(), DMDestroy()
External Links
- PETSc Manual:
DMDA/DMDASetOwnershipRanges
PETSc.LibPETSc.DMDASetPreallocationCenterDimension — Method
DMDASetPreallocationCenterDimension(petsclib::PetscLibType,dm::PetscDM, preallocCenterDim::PetscInt)Determine the topology used to determine adjacency
Input Parameters:
dm- TheDMDAobjectpreallocCenterDim- The dimension of points which connect adjacent entries
Level: developer
-seealso: , DM, DMDA, DMCreateMatrix(), DMDAPreallocateOperator()
External Links
- PETSc Manual:
DMDA/DMDASetPreallocationCenterDimension
PETSc.LibPETSc.DMDASetRefinementFactor — Method
DMDASetRefinementFactor(petsclib::PetscLibType,da::PetscDM, 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 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)
Options Database Keys:
-da_refine_x refine_x- refinement ratio in x direction-da_refine_y rafine_y- refinement ratio in y direction-da_refine_z refine_z- refinement ratio in z direction-da_refine <n>- refine theDMDAobject n times when it is created.
Level: intermediate
-seealso: , DM, DMDA, DMRefine(), DMDAGetRefinementFactor()
External Links
- PETSc Manual:
DMDA/DMDASetRefinementFactor
PETSc.LibPETSc.DMDASetSizes — Method
DMDASetSizes(petsclib::PetscLibType,da::PetscDM, 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
-seealso: , DM, DMDA, PetscSplitOwnership()
External Links
- PETSc Manual:
DMDA/DMDASetSizes
PETSc.LibPETSc.DMDASetStencilType — Method
DMDASetStencilType(petsclib::PetscLibType,da::PetscDM, 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
-seealso: , 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::PetscDM, width::PetscInt)Sets the width of the communication stencil
Logically Collective
Input Parameters:
da- TheDMDAwidth- The stencil width
Level: intermediate
-seealso: , 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::PetscDM, 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
-seealso: , DM, DMDA, DMSetCoordinates(), DMGetCoordinates(), DMDACreate1d(), DMDACreate2d(), DMDACreate3d(), DMStagSetUniformCoordinates()
External Links
- PETSc Manual:
DMDA/DMDASetUniformCoordinates
PETSc.LibPETSc.DMDASetVertexCoordinates — Method
DMDASetVertexCoordinates(petsclib::PetscLibType,dm::PetscDM, 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
External Links
- PETSc Manual:
DMDA/DMDASetVertexCoordinates
PETSc.LibPETSc.DMDATSSetIFunctionLocal — Method
DMDATSSetIFunctionLocal(petsclib::PetscLibType,dm::PetscDM, imode::InsertMode, func::DMDATSIFunctionLocalFn, ctx::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
-seealso: , DMDA, DMDATSIFunctionLocalFn, DMTSSetIFunction(), DMDATSSetIJacobianLocal(), DMDASNESSetFunctionLocal()
External Links
- PETSc Manual:
Ts/DMDATSSetIFunctionLocal
PETSc.LibPETSc.DMDATSSetIJacobianLocal — Method
DMDATSSetIJacobianLocal(petsclib::PetscLibType,dm::PetscDM, func::DMDATSIJacobianLocalFn, ctx::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
-seealso: , DMDA, DMDATSIJacobianLocalFn, DMTSSetIJacobian(), DMDATSSetIFunctionLocal(), DMDASNESSetJacobianLocal()
External Links
- PETSc Manual:
Ts/DMDATSSetIJacobianLocal
PETSc.LibPETSc.DMDATSSetRHSFunctionLocal — Method
DMDATSSetRHSFunctionLocal(petsclib::PetscLibType,dm::PetscDM, imode::InsertMode, func::DMDATSRHSFunctionLocalFn, ctx::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
-seealso: , DMDA, DMDATSRHSFunctionLocalFn, TS, TSSetRHSFunction(), DMTSSetRHSFunction(), DMDATSSetRHSJacobianLocal(), DMDASNESSetFunctionLocal()
External Links
- PETSc Manual:
Ts/DMDATSSetRHSFunctionLocal
PETSc.LibPETSc.DMDATSSetRHSJacobianLocal — Method
DMDATSSetRHSJacobianLocal(petsclib::PetscLibType,dm::PetscDM, func::DMDATSRHSJacobianLocalFn, ctx::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
-seealso: , DMDA, DMDATSRHSJacobianLocalFn, DMTSSetRHSJacobian(), DMDATSSetRHSFunctionLocal(), DMDASNESSetJacobianLocal()
External Links
- PETSc Manual:
Ts/DMDATSSetRHSJacobianLocal
PETSc.LibPETSc.DMDAVTKWriteAll — Method
DMDAVTKWriteAll(petsclib::PetscLibType,odm::PetscObject, 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
-seealso: , DMDA, DM, PETSCVIEWERVTK, DMDASetFieldName()
External Links
- PETSc Manual:
DMDA/DMDAVTKWriteAll
PETSc.LibPETSc.DMDAVecGetArray — Method
DMDAVecGetArray(petsclib::PetscLibType,da::PetscDM, vec::PetscVec, array::Cvoid)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
-seealso: , , DM, DMDA, DMDAGetGhostCorners(), DMDAGetCorners(), VecGetArray(), VecRestoreArray(), DMDAVecRestoreArray(), DMDAVecRestoreArrayDOF() DMDAVecGetArrayDOF(), DMDAVecGetArrayWrite(), DMDAVecRestoreArrayWrite(), DMDAVecGetArrayRead(), DMDAVecRestoreArrayRead(), DMStagVecGetArray()
External Links
- PETSc Manual:
DMDA/DMDAVecGetArray
PETSc.LibPETSc.DMDAVecGetArrayDOF — Method
DMDAVecGetArrayDOF(petsclib::PetscLibType,da::PetscDM, vec::PetscVec, array::Cvoid)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
-seealso: , , DM, DMDA, DMDAGetGhostCorners(), DMDAGetCorners(), VecGetArray(), VecRestoreArray(), DMDAVecRestoreArray(), DMDAVecGetArray(), DMDAVecRestoreArrayDOF(), DMDAVecGetArrayWrite(), DMDAVecRestoreArrayWrite(), DMDAVecGetArrayRead(), DMDAVecRestoreArrayRead(), DMDAVecGetArrayDOFRead()
External Links
- PETSc Manual:
DMDA/DMDAVecGetArrayDOF
PETSc.LibPETSc.DMDAVecGetArrayDOFRead — Method
DMDAVecGetArrayDOFRead(petsclib::PetscLibType,da::PetscDM, vec::PetscVec, array::Cvoid)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
-seealso: , , DM, DMDA, DMDAGetGhostCorners(), DMDAGetCorners(), VecGetArray(), VecRestoreArray(), DMDAVecRestoreArray(), DMDAVecGetArray(), DMDAVecGetArrayDOF(), DMDAVecGetArrayWrite(), DMDAVecRestoreArrayWrite(), DMDAVecGetArrayRead(), DMDAVecRestoreArrayRead()
External Links
- PETSc Manual:
DMDA/DMDAVecGetArrayDOFRead
PETSc.LibPETSc.DMDAVecGetArrayDOFWrite — Method
DMDAVecGetArrayDOFWrite(petsclib::PetscLibType,da::PetscDM, vec::PetscVec, array::Cvoid)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
-seealso: , , DM, DMDA, DMDAGetGhostCorners(), DMDAGetCorners(), VecGetArray(), VecRestoreArray(), DMDAVecRestoreArray(), DMDAVecGetArray(), DMDAVecGetArrayDOF(), DMDAVecGetArrayWrite(), DMDAVecRestoreArrayWrite()
External Links
- PETSc Manual:
DMDA/DMDAVecGetArrayDOFWrite
PETSc.LibPETSc.DMDAVecGetArrayRead — Method
DMDAVecGetArrayRead(petsclib::PetscLibType,da::PetscDM, vec::PetscVec, array::Cvoid)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
-seealso: , , DM, DMDA, DMDAGetGhostCorners(), DMDAGetCorners(), VecGetArray(), VecRestoreArray(), DMDAVecRestoreArrayRead(), DMDAVecRestoreArrayDOF(), DMDAVecGetArrayDOF(), DMDAVecGetArray(), DMDAVecRestoreArray(), DMStagVecGetArrayRead()
External Links
- PETSc Manual:
DMDA/DMDAVecGetArrayRead
PETSc.LibPETSc.DMDAVecGetArrayWrite — Method
DMDAVecGetArrayWrite(petsclib::PetscLibType,da::PetscDM, vec::PetscVec, array::Cvoid)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
-seealso: , , 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::PetscDM, vec::PetscVec, array::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
-seealso: , , 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::PetscDM, vec::PetscVec, array::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
-seealso: , , 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::PetscDM, vec::PetscVec, array::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
-seealso: , , 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::PetscDM, vec::PetscVec, array::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
-seealso: , , 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::PetscDM, vec::PetscVec, array::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
-seealso: , , 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::PetscDM, vec::PetscVec, array::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
-seealso: , , DM, DMDA, DMDAGetGhostCorners(), DMDAGetCorners(), VecGetArray(), VecRestoreArray(), DMDAVecGetArrayWrite(), DMDAVecGetArray(), DMDAVecRestoreArray(), DMDAVecGetArrayRead(), DMDAVecRestoreArrayRead()
External Links
- PETSc Manual:
DMDA/DMDAVecRestoreArrayWrite