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 - the DMDA
  • s - a MatStencil that provides (i,j,k)

Output Parameter:

  • cell - the local cell or vertext number

Level: developer

See also: DM, DMDA, DMDAGetGhostCorners()

External Links

source
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 the DMDA object

Output Parameter:

  • da - the DMDA object

Level: advanced

See also: DM, DMDA, DMSetUp(), DMDASetSizes(), DMClone(), DMDACreate1d(), DMDACreate2d(), DMDACreate3d()

External Links

source
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 communicator
  • bx - 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 node
  • s - stencil width
  • lx - 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 - Calls DMView() at the conclusion of DMDACreate1d()
  • -da_grid_x nx - number of grid points in the x direction
  • -da_refine_x rx - refinement factor
  • -da_refine n - refine the DMDA n times 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

source
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 communicator
  • bx - type of ghost nodes the x array have. Use one of DM_BOUNDARY_NONE, DM_BOUNDARY_GHOSTED, DM_BOUNDARY_PERIODIC.
  • by - type of ghost nodes the y array have. Use one of DM_BOUNDARY_NONE, DM_BOUNDARY_GHOSTED, DM_BOUNDARY_PERIODIC.
  • stencil_type - stencil type. Use either DMDA_STENCIL_BOX or DMDA_STENCIL_STAR.
  • M - global dimension in the x direction of the array
  • N - global dimension in the y direction of the array
  • m - corresponding number of processors in the x dimension (or PETSC_DECIDE to have calculated)
  • n - corresponding number of processors in the y dimension (or PETSC_DECIDE to have calculated)
  • dof - number of degrees of freedom per node
  • s - stencil width
  • lx - arrays containing the number of nodes in each cell along the x coordinates, or NULL.
  • ly - arrays containing the number of nodes in each cell along the y coordinates, or NULL.

Output Parameter:

  • da - the resulting distributed array object

Options Database Keys:

  • -dm_view - Calls DMView() at the conclusion of DMDACreate2d()
  • -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 the DMDA n times 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

source
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 communicator
  • bx - type of x ghost nodes the array have.

Use one of DM_BOUNDARY_NONE, DM_BOUNDARY_GHOSTED, DM_BOUNDARY_PERIODIC.

  • by - type of y ghost nodes the array have.

Use one of DM_BOUNDARY_NONE, DM_BOUNDARY_GHOSTED, DM_BOUNDARY_PERIODIC.

  • bz - type of z ghost nodes the array have.

Use one of DM_BOUNDARY_NONE, DM_BOUNDARY_GHOSTED, DM_BOUNDARY_PERIODIC.

  • stencil_type - Type of stencil (DMDA_STENCIL_STAR or DMDA_STENCIL_BOX)
  • M - global dimension in the x direction of the array
  • N - global dimension in the y direction of the array
  • P - global dimension in the z direction of the array
  • m - corresponding number of processors in the x dimension (or PETSC_DECIDE to have calculated)
  • n - corresponding number of processors in the y dimension (or PETSC_DECIDE to have calculated)
  • p - corresponding number of processors in the z dimension (or PETSC_DECIDE to have calculated)
  • dof - number of degrees of freedom per node
  • s - stencil width
  • lx - arrays containing the number of nodes in each cell along the x coordinates, or NULL.
  • ly - arrays containing the number of nodes in each cell along the y coordinates, or NULL.
  • lz - arrays containing the number of nodes in each cell along the z coordinates, or NULL.

Output Parameter:

  • da - the resulting distributed array object

Options Database Keys:

  • -dm_view - Calls DMView() at the conclusion of DMDACreate3d()
  • -da_grid_x nx - number of grid points in the x direction
  • -da_grid_y ny - number of grid points in the y direction
  • -da_grid_z nz - number of grid points in the z direction
  • -da_processors_x MX - number of processors in the x direction
  • -da_processors_y MY - number of processors in the y direction
  • -da_processors_z MZ - number of processors in the z direction
  • -da_bd_x bx - boundary type in the x direction
  • -da_bd_y by - boundary type in the y direction
  • -da_bd_z bz - boundary type in the z direction
  • -da_bd_all bt - boundary type in all directions
  • -da_refine_x rx - refinement ratio in the x direction
  • -da_refine_y ry - refinement ratio in the y direction
  • -da_refine_z rz - refinement ratio in the z direction
  • -da_refine n - refine the DMDA n times before creating it

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

source
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 grid DMDA
  • daf - the fine grid DMDA

Output Parameter:

  • rest - the restriction matrix (transpose of the projection matrix)

Level: intermediate

See also: DMRefine(), DMCreateInjection(), DMCreateInterpolation()

External Links

source
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 - the DMDA
  • nfields - number of fields in new DMDA

Output Parameter:

  • nda - the new DMDA

Level: intermediate

See also: DM, DMDA, DMDAGetGhostCorners(), DMSetCoordinates(), DMDASetUniformCoordinates(), DMGetCoordinates(), DMDAGetGhostedCoordinates(), DMStagCreateCompatibleDMStag()

External Links

source
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 - the DMDA

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

source
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

source
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 - the DMDA
  • lower - a MatStencil with i, j and k entries corresponding to the lower corner of the patch
  • upper - a MatStencil with i, j and k entries corresponding to the upper corner of the patch
  • offproc - indicate whether the returned IS will contain off process indices

Output Parameter:

  • is - the IS corresponding to the patch

Level: developer

See also: DM, DMDA, DMCreateDomainDecomposition(), DMCreateDomainDecompositionScatters()

External Links

source
PETSc.LibPETSc.DMDAGetAO — Method
ao::AO = DMDAGetAO(petsclib::PetscLibType, da::AbstractPetscDM)

Gets the application ordering context for a distributed array.

Collective

Input Parameter:

  • da - the DMDA

Output Parameter:

  • ao - the application ordering context for DMDA

Level: intermediate

See also: DM, DMDA, DMDACreate2d(), DMDASetAOType(), DMDAGetGhostCorners(), DMDAGetCorners(), DMLocalToGlobal(), DMGlobalToLocalBegin(), DMGlobalToLocalEnd(), DMLocalToLocalBegin(), DMLocalToLocalEnd(), DMDAGetOwnershipRanges(), AO, AOPetscToApplication(), AOApplicationToPetsc()

External Links

source
PETSc.LibPETSc.DMDAGetArray — Method
vptr::Ptr{Cvoid} = DMDAGetArray(petsclib::PetscLibType, da::AbstractPetscDM, ghosted::PetscBool)

Gets a work array for a DMDA

Input Parameters:

  • da - a DMDA
  • ghosted - 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

source
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 - The DMDA

Output Parameters:

  • bx - x boundary type, one of DM_BOUNDARY_NONE, DM_BOUNDARY_GHOSTED, DM_BOUNDARY_PERIODIC
  • by - y boundary type, one of DM_BOUNDARY_NONE, DM_BOUNDARY_GHOSTED, DM_BOUNDARY_PERIODIC
  • bz - z boundary type, one of DM_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

source
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 - The DMDA object
  • i - The global x index for the cell
  • j - The global y index for the cell
  • k - The global z index for the cell

Output Parameter:

  • point - The local DM point

Level: developer

See also: DM, DMDA, DMDAGetNumCells()

External Links

source
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 - the DMDA

Output Parameter:

  • xc - the coordinates

Level: intermediate

See also: DM, DMDA, DMDASetCoordinateName(), DMDASetFieldName(), DMDAGetFieldName(), DMDARestoreCoordinateArray()

External Links

source
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 - the DMDA
  • nf - number for the DMDA (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

source
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 - the DMDA

Output Parameters:

  • x - the corner index for the first dimension
  • y - 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 dimension
  • n - 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

source
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 - The DMDA object
  • depth - The requested depth

Output Parameters:

  • pStart - The first point at this depth
  • pEnd - One beyond the last point at this depth

Level: developer

See also: DM, DMDA, DMPlexGetDepthStratum(), DMPlexGetHeightStratum(), DMPlexGetCellTypeStratum(), DMPlexGetDepth(), DMPlexGetDepthLabel(), DMPlexGetPointDepth(), DMPlexSymmetrize(), DMPlexInterpolate(), DMDAGetHeightStratum()

External Links

source
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 - The DMDA

Output Parameter:

  • dof - Number of degrees of freedom per vertex

Level: intermediate

See also: DM, DMDA, DMDASetDof(), DMDACreate(), DMDestroy()

External Links

source
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 - the DMDA object

Output Parameter:

  • etype - the element type, currently either DMDA_ELEMENT_P1 or DMDA_ELEMENT_Q1

Level: intermediate

See also: DM, DMDA, DMDAElementType, DMDASetElementType(), DMDAGetElements(), DMDARestoreElements(), DMDA_ELEMENT_P1, DMDA_ELEMENT_Q1

External Links

source
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 - the DMDA object

Output Parameters:

  • nel - number of local elements
  • nen - number of nodes in each element (for example in one dimension it is 2, in two dimensions it is 3 (for DMDA_ELEMENT_P1) and 4

(for DMDA_ELEMENT_Q1)

  • e - the local indices of the elements' vertices, of length nel * nen

Level: intermediate

See also: DM, DMDA, DMDAElementType, DMDASetElementType(), VecSetValuesLocal(), MatSetValuesLocal(), DMGlobalToLocalBegin(), DMLocalToGlobalBegin(), DMDARestoreElements(), DMDA_ELEMENT_P1, DMDA_ELEMENT_Q1, DMDAGetElementsSizes(), DMDAGetElementsCorners()

External Links

source
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 - the DMDA object

Output Parameters:

  • gx - the i index
  • gy - the j index
  • gz - the k index

Level: intermediate

See also: DM, DMDA, DMDAElementType, DMDASetElementType(), DMDAGetElements(), DMDAGetCorners(), DMDAGetGhostCorners(), DMDAGetElementsSizes(), DMDAGetElementsCornersIS(), DMDARestoreElementsCornersIS()

External Links

source
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 - the DMDA object

Output Parameters:

  • mx - number of local elements in x-direction
  • my - number of local elements in y-direction
  • mz - number of local elements in z-direction

Level: intermediate

See also: DM, DMDA, DMDAElementType, DMDASetElementType(), DMDAGetElements(), DMDAGetElementsCorners()

External Links

source
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 - the DMDA
  • nf - field number for the DMDA (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

source
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 - the DMDA object

Output Parameter:

  • names - the names of the components, final string is NULL, will have the same number of entries as the dof used in creating the DMDA

Level: intermediate

See also: DM, DMDA, DMDAGetFieldName(), DMDASetCoordinateName(), DMDAGetCoordinateName(), DMDASetFieldName(), DMDASetFieldNames()

External Links

source
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 - the DMDA

Output Parameters:

  • x - the corner index for the first dimension
  • y - 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 dimension
  • n - 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

source
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 - The DMDA object
  • height - The requested height

Output Parameters:

  • pStart - The first point at this height
  • pEnd - One beyond the last point at this height

Level: developer

See also: DM, DMDA, DMPlexGetDepthStratum(), DMPlexGetHeightStratum(), DMPlexGetCellTypeStratum(), DMPlexGetDepth(), DMPlexGetDepthLabel(), DMPlexGetPointDepth(), DMPlexSymmetrize(), DMPlexInterpolate(), DMDAGetDepthStratum()

External Links

source
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 - the DMDA

Output Parameters:

  • dim - dimension of the DMDA (1, 2, or 3)
  • M - global dimension in first direction of the array
  • N - global dimension in second direction of the array
  • P - global dimension in third direction of the array
  • m - corresponding number of MPI processes in first dimension
  • n - corresponding number of MPI processes in second dimension
  • p - corresponding number of MPI processes in third dimension
  • dof - number of degrees of freedom per node
  • s - stencil width
  • bx - type of ghost nodes at boundary in first dimension
  • by - type of ghost nodes at boundary in second dimension
  • bz - type of ghost nodes at boundary in third dimension
  • st - stencil type, either DMDA_STENCIL_STAR or DMDA_STENCIL_BOX

Level: beginner

See also: DM, DMDA, DMView(), DMDAGetCorners(), DMDAGetLocalInfo()

External Links

source
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_Q1 and DMDA_Q0 are currently the only supported forms)

Level: intermediate

See also: DM, DMDA, DMDAInterpolationType, DMDASetInterpolationType(), DMCreateInterpolation(), DMDA_Q1, DMDA_Q0

External Links

source
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 - the DMDA

Output Parameter:

  • info - structure containing the information

Level: beginner

See also: DM, DMDA, DMDAGetInfo(), DMDAGetCorners(), DMDALocalInfo

External Links

source
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 - the DMDA
  • x - the first physical coordinate
  • y - the second physical coordinate
  • z - 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 point
  • Y - (optional) the second coordinate of the located grid point
  • Z - (optional) the third coordinate of the located grid point

Level: advanced

See also: DM, DMDA

External Links

source
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 - the DMDA object

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

source
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 - The DMDA

Output Parameters:

  • xs - The start of the region in x
  • ys - The start of the region in y
  • zs - The start of the region in z
  • xm - The size of the region in x
  • ym - The size of the region in y
  • zm - The size of the region in z

Level: intermediate

See also: DM, DMDA, DMDAGetOffset(), DMDAVecGetArray()

External Links

source
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 - The DMDA object

Output Parameters:

  • numCellsX - The number of local cells in the x-direction
  • numCellsY - The number of local cells in the y-direction
  • numCellsZ - The number of local cells in the z-direction
  • numCells - The number of local cells

Level: developer

See also: DM, DMDA, DMDAGetCellPoint()

External Links

source
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 - the DMDA

Output Parameters:

  • numXFacesX - number of X-normal faces along the x direction, or NULL if not needed
  • numXFaces - total number of X-normal faces, or NULL if not needed
  • numYFacesY - number of Y-normal faces along the y direction, or NULL if not needed
  • numYFaces - total number of Y-normal faces (0 for 1D), or NULL if not needed
  • numZFacesZ - number of Z-normal faces along the z direction, or NULL if not needed
  • numZFaces - total number of Z-normal faces (0 for 1D/2D), or NULL if not needed

Level: developer

See also: DM, DMDA, DMDAGetNumVertices(), DMDAGetNumCells()

External Links

source
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 - The DMDA

Output Parameter:

  • Nsub - Number of local subdomains created upon decomposition

Level: intermediate

See also: DM, DMDA, DMCreateDomainDecomposition(), DMDASetNumLocalSubDomains()

External Links

source
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 - the DMDA

Output Parameters:

  • numVerticesX - number of vertices in the x direction, or NULL if not needed
  • numVerticesY - number of vertices in the y direction (1 if dim < 2), or NULL if not needed
  • numVerticesZ - number of vertices in the z direction (1 if dim < 3), or NULL if not needed
  • numVertices - total number of vertices, or NULL if not needed

Level: developer

See also: DM, DMDA, DMDAGetNumCells(), DMDAGetNumFaces()

External Links

source
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 - The DMDA

Output Parameters:

  • xo - The offset in the x direction
  • yo - The offset in the y direction
  • zo - The offset in the z direction
  • Mo - The global size in the x direction
  • No - The global size in the y direction
  • Po - The global size in the z direction

Level: developer

See also: DM, DMDA, DMDASetOffset(), DMDAVecGetArray()

External Links

source
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 - The DMDA

Output Parameters:

  • x - Overlap in the x direction
  • y - Overlap in the y direction
  • z - Overlap in the z direction

Level: intermediate

See also: DM, DMDA, DMCreateDomainDecomposition(), DMDASetOverlap()

External Links

source
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 - the DMDA object

Output Parameters:

  • lx - ownership along x direction (optional), its length is m the number of processes in the x-direction
  • ly - ownership along y direction (optional), its length is n the number of processes in the y-direction
  • lz - ownership along z direction (optional), its length is p the number of processes in the z-direction

Level: intermediate

See also: DM, DMDA, DMDAGetCorners(), DMDAGetGhostCorners(), DMDACreate(), DMDACreate1d(), DMDACreate2d(), DMDACreate3d(), VecGetOwnershipRanges()

External Links

source
PETSc.LibPETSc.DMDAGetPreallocationCenterDimension — Method
preallocCenterDim::PetscInt = DMDAGetPreallocationCenterDimension(petsclib::PetscLibType, dm::AbstractPetscDM)

Return the topology used to determine adjacency

Input Parameter:

  • dm - The DMDA object

Output Parameter:

  • preallocCenterDim - The dimension of points which connect adjacent entries

Level: developer

See also: DM, DMDA, DMCreateMatrix(), DMDAPreallocateOperator(), DMDASetPreallocationCenterDimension()

External Links

source
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 - the DMDA
  • dir - Cartesian direction, either DM_X, DM_Y, or DM_Z
  • gp - 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

source
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 - the DMDA
  • dir - Cartesian direction, either DM_X, DM_Y, or DM_Z

Output Parameter:

  • subcomm - new communicator

Level: advanced

See also: DM, DMDA, DMDirection, DMDAGetProcessorSubset(), DM_X, DM_Y, DM_Z

External Links

source
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 - the DMDA
  • dir - Cartesian direction, either DM_X, DM_Y, or DM_Z
  • gp - 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 - the VecScatter that will map from the original vector to the ray

Level: advanced

See also: DM, DMDA, DMDirection, Vec, VecScatter

External Links

source
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 - the DMDA object

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

source
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 - the DMDA

Output Parameters:

  • gtol - global-to-local scatter context (may be NULL)
  • ltol - local-to-local scatter context (may be NULL)

Level: developer

See also: DM, DMDA, DMGlobalToLocalBegin(), DMGlobalToLocalEnd(), DMLocalToGlobalBegin()

External Links

source
PETSc.LibPETSc.DMDAGetStencilType — Method
stype::DMDAStencilType = DMDAGetStencilType(petsclib::PetscLibType, da::AbstractPetscDM)

Gets the type of the communication stencil

Not Collective

Input Parameter:

  • da - The DMDA

Output Parameter:

  • stype - The stencil type, use either DMDA_STENCIL_BOX or DMDA_STENCIL_STAR.

Level: intermediate

See also: DM, DMDA, DMDACreate(), DMDestroy(), DMDAStencilType, DMDA_STENCIL_BOX, DMDA_STENCIL_STAR.

External Links

source
PETSc.LibPETSc.DMDAGetStencilWidth — Method
width::PetscInt = DMDAGetStencilWidth(petsclib::PetscLibType, da::AbstractPetscDM)

Gets the width of the communication stencil

Not Collective

Input Parameter:

  • da - The DMDA

Output Parameter:

  • width - The stencil width

Level: intermediate

See also: DM, DMDA, DMDACreate(), DMDestroy(), DMDAStencilType, DMDA_STENCIL_BOX, DMDA_STENCIL_STAR.

External Links

source
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 - the DMDA object

Output Parameter:

  • is - the index set

Level: intermediate

See also: DM, DMDA, DMDAElementType, DMDASetElementType(), DMDAGetElements(), DMDARestoreElementsCornersIS(), DMDAGetElementsSizes(), DMDAGetElementsCorners()

External Links

source
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 - the DMDA context

Output Parameter:

  • scatter - the scatter context

Level: advanced

See also: DM, DMDA, DMDANaturalAllToGlobalCreate(), DMDAGlobalToNaturalEnd(), DMLocalToGlobalBegin(), DMDACreate2d(), DMGlobalToLocalBegin(), DMGlobalToLocalEnd(), DMDACreateNaturalVector()

External Links

source
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 - the DMDA context
  • g - the global vector, see DMCreateGlobalVector()
  • mode - one of INSERT_VALUES or ADD_VALUES

Output Parameter:

  • n - the natural ordering values, see DMDACreateNaturalVector()

Level: advanced

See also: DM, DMDA, DMDAGlobalToNaturalEnd(), DMLocalToGlobalBegin(), DMDACreate2d(), DMGlobalToLocalBegin(), DMGlobalToLocalEnd(), DMDACreateNaturalVector()

External Links

source
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 - the DMDA context
  • g - the global vector, see DMCreateGlobalVector()
  • mode - one of INSERT_VALUES or ADD_VALUES

Output Parameter:

  • n - the global values in the natural ordering, see DMDACreateNaturalVector()

Level: advanced

See also: DM, DMDA, DMDAGlobalToNaturalBegin(), DMLocalToGlobalBegin(), DMDACreate2d(), DMGlobalToLocalBegin(), DMGlobalToLocalEnd(), DMDACreateNaturalVector()

External Links

source
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 2D DMDA context

Input/Output Parameters:

  • x - the x coordinate; wrapped in place if the x boundary is periodic
  • y - the y coordinate; wrapped in place if the y boundary is periodic

Level: developer

See also: Characteristic, DMDA, CharacteristicSolve()

External Links

source
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 - the DMDA object
  • m - number of MatStencil to map
  • idxm - grid points (and component number when dof > 1)

Output Parameter:

  • gidxm - global row indices

Level: intermediate

See also: DM, DMDA, MatStencil

External Links

source
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 - the DMDA context

Output Parameter:

  • scatter - the scatter context

Level: advanced

See also: DM, DMDA, DMDAGlobalToNaturalAllCreate(), DMDAGlobalToNaturalEnd(), DMLocalToGlobalBegin(), DMDACreate2d(), DMGlobalToLocalBegin(), DMGlobalToLocalEnd(), DMDACreateNaturalVector()

External Links

source
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 - the DMDA context
  • g - the global vector in a natural ordering, see DMDACreateNaturalVector()
  • mode - one of INSERT_VALUES or ADD_VALUES

Output Parameter:

  • n - the values in the DMDA ordering

Level: advanced

See also: DM, DMDA, DMDAGlobalToNaturalEnd(), DMDAGlobalToNaturalBegin(), DMLocalToGlobalBegin(), DMDACreate2d(), DMGlobalToLocalBegin(), DMGlobalToLocalEnd(), DMDACreateNaturalVector()

External Links

source
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 - the DMDA context
  • g - the global vector in a natural ordering
  • mode - one of INSERT_VALUES or ADD_VALUES

Output Parameter:

  • n - the global values in the PETSc DMDA ordering

Level: advanced

See also: DM, DMDA, DMDAGlobalToNaturalBegin(), DMDAGlobalToNaturalEnd(), DMLocalToGlobalBegin(), DMDACreate2d(), DMGlobalToLocalBegin(), DMGlobalToLocalEnd(), DMDACreateNaturalVector()

External Links

source
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 patch
  • ghosted - do you want arrays for the ghosted or nonghosted patch
  • vptr - array data structured

Level: advanced

See also: DM, DMDA, DMDAGetArray()

External Links

source
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 - the DMDA
  • xc - the coordinates

Level: intermediate

See also: DM, DMDA, DMDASetCoordinateName(), DMDASetFieldName(), DMDAGetFieldName(), DMDAGetCoordinateArray()

External Links

source
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 - the DM object
  • nel - number of local elements
  • nen - number of nodes in each element
  • e - the local indices of the elements' vertices

Level: intermediate

See also: DM, DMDA, DMDAElementType, DMDASetElementType(), DMDAGetElements()

External Links

source
PETSc.LibPETSc.DMDARestoreSubdomainCornersIS — Method
DMDARestoreSubdomainCornersIS(petsclib::PetscLibType, dm::AbstractPetscDM, is::AbstractIS)

Restores the IS obtained with DMDAGetSubdomainCornersIS()

Not Collective

Input Parameters:

  • dm - the DM object
  • is - the index set

Level: intermediate

See also: DM, DMDA, DMDAElementType, DMDASetElementType(), DMDAGetSubdomainCornersIS()

External Links

source
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 - DM to associate callback with
  • imode - INSERT_VALUES if local function computes owned part, ADD_VALUES if it contributes to ghosted part
  • func - local residual evaluation
  • ctx - optional context for local residual evaluation

Level: beginner

See also: DMDA, DMDASNESFunctionFn, DMDASNESSetJacobianLocal(), DMSNESSetFunction(), DMDACreate1d(), DMDACreate2d(), DMDACreate3d()

External Links

source
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 - DM to associate callback with
  • imode - INSERT_VALUES if local function computes owned part, ADD_VALUES if it contributes to ghosted part
  • func - local residual evaluation
  • ctx - optional context for local residual evaluation

Level: beginner

See also: DMDA, DMDASNESFunctionVecFn, DMDASNESSetFunctionLocal(), DMDASNESSetJacobianLocalVec(), DMSNESSetFunction(), DMDACreate1d(), DMDACreate2d(), DMDACreate3d()

External Links

source
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 - DM to associate callback with
  • func - local Jacobian evaluation function
  • ctx - optional context for local Jacobian evaluation

Level: beginner

See also: DMDA, DMDASNESJacobianFn, DMDASNESSetFunctionLocal(), DMSNESSetJacobian(), DMDACreate1d(), DMDACreate2d(), DMDACreate3d()

External Links

source
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 - DM to associate callback with
  • func - local Jacobian evaluation
  • ctx - optional context for local Jacobian evaluation

Level: beginner

See also: DMDA, DMDASNESJacobianVecFn, DMDASNESSetJacobianLocal(), DMDASNESSetFunctionLocalVec(), DMSNESSetJacobian(), DMDACreate1d(), DMDACreate2d(), DMDACreate3d()

External Links

source
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 - DM to associate callback with
  • func - local objective evaluation, see DMDASNESSetObjectiveLocal for the calling sequence
  • ctx - optional context for local residual evaluation

Level: beginner

See also: DMDA, DMDASNESObjectiveFn, DMSNESSetFunction(), DMDASNESSetJacobianLocal(), DMDACreate1d(), DMDACreate2d(), DMDACreate3d(), DMDASNESFunctionFn

External Links

source
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 - DM to associate callback with
  • func - local objective evaluation, see DMDASNESSetObjectiveLocalVec for the calling sequence
  • ctx - optional context for local residual evaluation

Level: beginner

See also: DMDA, DMDASNESObjectiveVecFn, DMDASNESSetObjectiveLocal(), DMSNESSetFunction(), DMDASNESSetJacobianLocalVec(), DMDACreate1d(), DMDACreate2d(), DMDACreate3d(), DMDASNESObjectiveFn

External Links

source
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 - DM to associate callback with
  • imode - INSERT_VALUES if local function computes owned part, ADD_VALUES if it contributes to ghosted part
  • func - local residual evaluation
  • jac - function to compute Jacobian
  • ctx - optional context for local residual evaluation

Level: beginner

See also: SNES, DMDA, DMDASNESFunctionFn, DMDASNESJacobianFn, DMSNESSetFunction(), DMDASNESSetJacobian(), DMDACreate1d(), DMDACreate2d(), DMDACreate3d()

External Links

source
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 - the DMDA
  • aotype - type of AO. AOType which can be AOBASIC, AOADVANCED, AOMAPPING, or AOMEMORYSCALABLE

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

source
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 - the DMDA
  • dfill - the fill pattern in the diagonal block (may be NULL, 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

source
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 - the DMDA
  • dfillsparse - the sparse fill pattern in the diagonal block (may be NULL, 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

source
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 - The DMDA
  • bx - x boundary type, one of DM_BOUNDARY_NONE, DM_BOUNDARY_GHOSTED, DM_BOUNDARY_PERIODIC
  • by - y boundary type, one of DM_BOUNDARY_NONE, DM_BOUNDARY_GHOSTED, DM_BOUNDARY_PERIODIC
  • bz - z boundary type, one of DM_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

source
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 - the DMDA
  • nf - coordinate number for the DMDA (0, 1, ... dim-1),
  • name - the name of the coordinate

Level: intermediate

See also: DM, DMDA, DMDAGetCoordinateName(), DMDASetFieldName(), DMDAGetFieldName(), DMSetUp()

External Links

source
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 - The DMDA
  • dof - Number of degrees of freedom per vertex

Level: intermediate

See also: DM, DMDA, DMDAGetDof(), DMDACreate(), DMDestroy()

External Links

source
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 - the DMDA object

Output Parameter:

  • etype - the element type, currently either DMDA_ELEMENT_P1 or DMDA_ELEMENT_Q1

Level: intermediate

See also: DM, DMDA, DMDAElementType, DMDAGetElementType(), DMDAGetElements(), DMDARestoreElements(), DMDA_ELEMENT_P1, DMDA_ELEMENT_Q1

External Links

source
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 - the DMDA
  • nf - field number for the DMDA (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

source
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 - the DMDA object
  • names - the names of the components, final string must be NULL, must have the same number of entries as the dof used in creating the DMDA

Level: intermediate

See also: DM, DMDA, DMDAGetFieldName(), DMDASetCoordinateName(), DMDAGetCoordinateName(), DMDASetFieldName(), DMSetUp()

External Links

source
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 - the DMDA object
  • n - the number of GLL nodes
  • nodes - the GLL nodes

Level: advanced

See also: DM, DMDA, DMDACreate(), PetscDTGaussLobattoLegendreQuadrature(), DMGetCoordinates()

External Links

source
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 - the DMDA object
  • f - the function that allocates the matrix for that specific DMDA

Calling sequence of f:

  • da - the DMDA object
  • A - the created matrix

Level: developer

See also: DM, DMDA, DMCreateMatrix(), DMDASetBlockFills()

External Links

source
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 array
  • ctype - DMDA_Q1 and DMDA_Q0 are currently the only supported forms

Level: intermediate

See also: DM, DMDA, DMDACreate1d(), DMDACreate2d(), DMDACreate3d(), DMDestroy(), DMDAInterpolationType, DMDA_Q1, DMDA_Q0

External Links

source
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 - The DMDA
  • xs - The start of the region in x
  • ys - The start of the region in y
  • zs - The start of the region in z
  • xm - The size of the region in x
  • ym - The size of the region in y
  • zm - The size of the region in z

Level: intermediate

See also: DM, DMDA, DMDAGetOffset(), DMDAVecGetArray()

External Links

source
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 - The DMDA
  • Nsub - The number of local subdomains requested

Level: intermediate

See also: DM, DMDA, DMCreateDomainDecomposition(), DMDAGetNumLocalSubDomains()

External Links

source
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 - the DMDA
  • m - the number of X processes (or PETSC_DECIDE)
  • n - the number of Y processes (or PETSC_DECIDE)
  • p - the number of Z processes (or PETSC_DECIDE)

Level: intermediate

See also: DM, DMDA, DMDASetSizes(), PetscSplitOwnership()

External Links

source
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 - The DMDA
  • xo - The offset in the x direction
  • yo - The offset in the y direction
  • zo - The offset in the z direction
  • Mo - The problem offset in the x direction
  • No - The problem offset in the y direction
  • Po - The problem offset in the z direction

Level: developer

See also: DM, DMDA, DMDAGetOffset(), DMDAVecGetArray()

External Links

source
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 - The DMDA
  • x - Overlap in the x direction
  • y - Overlap in the y direction
  • z - Overlap in the z direction

Level: intermediate

See also: DM, DMDA, DMCreateDomainDecomposition(), DMDAGetOverlap()

External Links

source
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 - The DMDA
  • lx - array containing number of nodes in the X direction on each process, or NULL. If non-null, must be of length da->m
  • ly - array containing number of nodes in the Y direction on each process, or NULL. If non-null, must be of length da->n
  • lz - array containing number of nodes in the Z direction on each process, or NULL. If non-null, must be of length da->p.

Level: intermediate

See also: DM, DMDA, DMDACreate(), DMDestroy()

External Links

source
PETSc.LibPETSc.DMDASetPreallocationCenterDimension — Method
DMDASetPreallocationCenterDimension(petsclib::PetscLibType, dm::AbstractPetscDM, preallocCenterDim::PetscInt)

Determine the topology used to determine adjacency

Input Parameters:

  • dm - The DMDA object
  • preallocCenterDim - The dimension of points which connect adjacent entries

Level: developer

See also: DM, DMDA, DMCreateMatrix(), DMDAPreallocateOperator()

External Links

source
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 - the DMDA object
  • refine_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 the DMDA object n times when it is created.

Level: intermediate

See also: DM, DMDA, DMRefine(), DMDAGetRefinementFactor()

External Links

source
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 - the DMDA
  • M - the global X size
  • N - the global Y size
  • P - the global Z size

Level: intermediate

See also: DM, DMDA, PetscSplitOwnership()

External Links

source
PETSc.LibPETSc.DMDASetStencilType — Method
DMDASetStencilType(petsclib::PetscLibType, da::AbstractPetscDM, stype::DMDAStencilType)

Sets the type of the communication stencil

Logically Collective

Input Parameters:

  • da - The DMDA
  • stype - The stencil type, use either DMDA_STENCIL_BOX or DMDA_STENCIL_STAR.

Level: intermediate

See also: DM, DMDA, DMDACreate(), DMDestroy(), DMDAStencilType, DMDA_STENCIL_BOX, DMDA_STENCIL_STAR.

External Links

source
PETSc.LibPETSc.DMDASetStencilWidth — Method
DMDASetStencilWidth(petsclib::PetscLibType, da::AbstractPetscDM, width::PetscInt)

Sets the width of the communication stencil

Logically Collective

Input Parameters:

  • da - The DMDA
  • width - The stencil width

Level: intermediate

See also: DM, DMDA, DMDACreate(), DMDestroy(), DMDAStencilType, DMDA_STENCIL_BOX, DMDA_STENCIL_STAR.

External Links

source
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 - the DMDA object
  • xmin - min extreme in the x direction
  • xmax - max extreme in the x direction
  • ymin - 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

source
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 - The DMDA object
  • xl - the lower x coordinate
  • xu - the upper x coordinate
  • yl - the lower y coordinate
  • yu - the upper y coordinate
  • zl - the lower z coordinate
  • zu - the upper z coordinate

Level: intermediate

See also: DM, DMDA

External Links

source
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 - DM to associate callback with
  • imode - the insert mode of the function
  • func - local residual evaluation, see DMDATSIFunctionLocalFn for the calling sequence
  • ctx - optional context for local residual evaluation

Level: beginner

See also: DMDA, DMDATSIFunctionLocalFn, DMTSSetIFunction(), DMDATSSetIJacobianLocal(), DMDASNESSetFunctionLocal()

External Links

source
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 - DM to associate callback with
  • func - local residual evaluation, see DMDATSIJacobianLocalFn for the calling sequence
  • ctx - optional context for local residual evaluation

Level: beginner

See also: DMDA, DMDATSIJacobianLocalFn, DMTSSetIJacobian(), DMDATSSetIFunctionLocal(), DMDASNESSetJacobianLocal()

External Links

source
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 - DM to associate callback with
  • imode - insert mode for the residual
  • func - local residual evaluation, see DMDATSRHSFunctionLocalFn for the calling sequence
  • ctx - optional context for local residual evaluation

Level: beginner

See also: DMDA, DMDATSRHSFunctionLocalFn, TS, TSSetRHSFunction(), DMTSSetRHSFunction(), DMDATSSetRHSJacobianLocal(), DMDASNESSetFunctionLocal()

External Links

source
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 - DM to associate callback with
  • func - local RHS Jacobian evaluation routine, see DMDATSRHSJacobianLocalFn for the calling sequence
  • ctx - optional context for local jacobian evaluation

Level: beginner

See also: DMDA, DMDATSRHSJacobianLocalFn, DMTSSetRHSJacobian(), DMDATSSetRHSFunctionLocal(), DMDASNESSetJacobianLocal()

External Links

source
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 - DMDA specifying the grid layout, passed as a PetscObject
  • viewer - viewer of type PETSCVIEWERVTK

Level: developer

See also: DMDA, DM, PETSCVIEWERVTK, DMDASetFieldName()

External Links

source
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 - the DMDA
  • vec - a vector the same size as one obtained with DMCreateGlobalVector() or DMCreateLocalVector()

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

source
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 - the DMDA
  • vec - a vector the same size as one obtained with DMCreateGlobalVector() or DMCreateLocalVector()

Output Parameter:

  • array - the array pointer

Level: intermediate

See also: DM, DMDA, DMDAGetGhostCorners(), DMDAGetCorners(), VecGetArray(), VecRestoreArray(), DMDAVecRestoreArray(), DMDAVecGetArray(), DMDAVecRestoreArrayDOF(), DMDAVecGetArrayWrite(), DMDAVecRestoreArrayWrite(), DMDAVecGetArrayRead(), DMDAVecRestoreArrayRead(), DMDAVecGetArrayDOFRead()

External Links

source
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 - the DMDA
  • vec - a vector the same size as one obtained with DMCreateGlobalVector() or DMCreateLocalVector()

Output Parameter:

  • array - the array

Level: intermediate

See also: DM, DMDA, DMDAGetGhostCorners(), DMDAGetCorners(), VecGetArray(), VecRestoreArray(), DMDAVecRestoreArray(), DMDAVecGetArray(), DMDAVecGetArrayDOF(), DMDAVecGetArrayWrite(), DMDAVecRestoreArrayWrite(), DMDAVecGetArrayRead(), DMDAVecRestoreArrayRead()

External Links

source
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 - the DMDA
  • vec - a vector the same size as one obtained with DMCreateGlobalVector() or DMCreateLocalVector()

Output Parameter:

  • array - the array

Level: intermediate

See also: DM, DMDA, DMDAGetGhostCorners(), DMDAGetCorners(), VecGetArray(), VecRestoreArray(), DMDAVecRestoreArray(), DMDAVecGetArray(), DMDAVecGetArrayDOF(), DMDAVecGetArrayWrite(), DMDAVecRestoreArrayWrite()

External Links

source
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 - the DMDA
  • vec - a vector the same size as one obtained with DMCreateGlobalVector() or DMCreateLocalVector()

Output Parameter:

  • array - the array

Level: intermediate

See also: DM, DMDA, DMDAGetGhostCorners(), DMDAGetCorners(), VecGetArray(), VecRestoreArray(), DMDAVecRestoreArrayRead(), DMDAVecRestoreArrayDOF(), DMDAVecGetArrayDOF(), DMDAVecGetArray(), DMDAVecRestoreArray(), DMStagVecGetArrayRead()

External Links

source
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 - the DMDA
  • vec - a vector the same size as one obtained with DMCreateGlobalVector() or DMCreateLocalVector()

Output Parameter:

  • array - the array

Level: intermediate

See also: DM, DMDA, DMDAGetGhostCorners(), DMDAGetCorners(), VecGetArray(), VecRestoreArray(), DMDAVecRestoreArrayWrite(), DMDAVecRestoreArrayDOF(), DMDAVecGetArrayDOF(), DMDAVecGetArray(), DMDAVecRestoreArray(), DMDAVecGetArrayRead(), DMDAVecRestoreArrayRead()

External Links

source
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 - the DMDA
  • vec - a vector the same size as one obtained with DMCreateGlobalVector() or DMCreateLocalVector()
  • array - the array pointer

Level: intermediate

See also: DM, DMDA, DMDAGetGhostCorners(), DMDAGetCorners(), VecGetArray(), VecRestoreArray(), DMDAVecGetArray(), DMDAVecGetArrayWrite(), DMDAVecRestoreArrayWrite(), DMDAVecGetArrayRead(), DMDAVecRestoreArrayRead(), DMStagVecRestoreArray()

External Links

source
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 - the DMDA
  • vec - vector the same size as one obtained with DMCreateGlobalVector() or DMCreateLocalVector()
  • array - the array point

Level: intermediate

See also: DM, DMDA, DMDAGetGhostCorners(), DMDAGetCorners(), VecGetArray(), VecRestoreArray(), DMDAVecGetArray(), DMDAVecGetArrayDOF(), DMDAVecGetArrayWrite(), DMDAVecRestoreArrayWrite(), DMDAVecGetArrayRead(), DMDAVecRestoreArrayRead()

External Links

source
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 - the DMDA
  • vec - a vector the same size as one obtained with DMCreateGlobalVector() or DMCreateLocalVector()
  • array - the array pointer

Level: intermediate

See also: DM, DMDA, DMDAGetGhostCorners(), DMDAGetCorners(), VecGetArray(), VecRestoreArray(), DMDAVecGetArray(), DMDAVecGetArrayDOF(), DMDAVecRestoreArrayDOF(), DMDAVecGetArrayWrite(), DMDAVecRestoreArrayWrite(), DMDAVecGetArrayRead(), DMDAVecRestoreArrayRead()

External Links

source
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 - the DMDA
  • vec - a vector the same size as one obtained with DMCreateGlobalVector() or DMCreateLocalVector()
  • array - the array pointer

Level: intermediate

See also: DM, DMDA, DMDAGetGhostCorners(), DMDAGetCorners(), VecGetArray(), VecRestoreArray(), DMDAVecGetArray(), DMDAVecGetArrayDOF(), DMDAVecRestoreArrayDOF(), DMDAVecGetArrayWrite(), DMDAVecRestoreArrayWrite()

External Links

source
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 - the DMDA
  • vec - vector the same size as one obtained with DMCreateGlobalVector() or DMCreateLocalVector()
  • array - the array pointer

Level: intermediate

See also: DM, DMDA, DMDAGetGhostCorners(), DMDAGetCorners(), VecGetArray(), VecRestoreArray(), DMDAVecGetArrayRead(), DMDAVecGetArray(), DMDAVecRestoreArray(), DMDAVecGetArrayWrite(), DMDAVecRestoreArrayWrite(), DMStagVecRestoreArrayRead()

External Links

source
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 - the DMDA
  • vec - a vector the same size as one obtained with DMCreateGlobalVector() or DMCreateLocalVector()
  • array - the array pointer

Level: intermediate

See also: DM, DMDA, DMDAGetGhostCorners(), DMDAGetCorners(), VecGetArray(), VecRestoreArray(), DMDAVecGetArrayWrite(), DMDAVecGetArray(), DMDAVecRestoreArray(), DMDAVecGetArrayRead(), DMDAVecRestoreArrayRead()

External Links

source