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

Output Parameter:

  • cell - the local cell or vertext number

Level: developer

-seealso: , DM, DMDA, DMDAGetGhostCorners()

External Links

source
PETSc.LibPETSc.DMDACreateMethod
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

-seealso: , DM, DMDA, DMSetUp(), DMDASetSizes(), DMClone(), DMDACreate1d(), DMDACreate2d(), DMDACreate3d()

External Links

source
PETSc.LibPETSc.DMDACreate1dMethod
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 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 x direction
  • -da_refine_x <rx> - refinement factor
  • -da_refine <n> - refine the DMDA n 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

source
PETSc.LibPETSc.DMDACreate2dMethod
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 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 x direction of the array
  • N - global dimension in y direction of the array
  • m - corresponding number of processors in x dimension (or PETSC_DECIDE to have calculated)
  • n - corresponding number of processors in 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 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 the DMDA n 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

source
PETSc.LibPETSc.DMDACreate3dMethod
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 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 x direction of the array
  • N - global dimension in y direction of the array
  • P - global dimension in z direction of the array
  • m - corresponding number of processors in x dimension (or PETSC_DECIDE to have calculated)
  • n - corresponding number of processors in y dimension (or PETSC_DECIDE to have calculated)
  • p - corresponding number of processors in 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 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 the DMDA n 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

source
PETSc.LibPETSc.DMDACreateAggregatesMethod
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 grid DMDA
  • daf - the fine grid DMDA

Output Parameter:

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

Level: intermediate

-seealso: , DMRefine(), DMCreateInjection(), DMCreateInterpolation()

External Links

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

Output Parameter:

  • nda - the new DMDA

Level: intermediate

-seealso: , DM, DMDA, DMDAGetGhostCorners(), DMSetCoordinates(), DMDASetUniformCoordinates(), DMGetCoordinates(), DMDAGetGhostedCoordinates(), DMStagCreateCompatibleDMStag()

External Links

source
PETSc.LibPETSc.DMDACreateNaturalVectorMethod
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 - the DMDA

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

source
PETSc.LibPETSc.DMDACreatePFMethod
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

source
PETSc.LibPETSc.DMDACreatePatchISMethod
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 - 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

-seealso: , DM, DMDA, DMCreateDomainDecomposition(), DMCreateDomainDecompositionScatters()

External Links

source
PETSc.LibPETSc.DMDAGetAOMethod
DMDAGetAO(petsclib::PetscLibType,da::PetscDM, ao::AO)

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

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

External Links

source
PETSc.LibPETSc.DMDAGetArrayMethod
DMDAGetArray(petsclib::PetscLibType,da::PetscDM, ghosted::PetscBool, vptr::Cvoid)

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

-seealso: , DM, DMDA, DMDARestoreArray()

External Links

source
PETSc.LibPETSc.DMDAGetBoundaryTypeMethod
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 - 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

-seealso: , DMDASetBoundaryType(), DM, DMDA, DMDACreate(), DMDestroy(), DMBoundaryType, DM_BOUNDARY_NONE, DM_BOUNDARY_GHOSTED, DM_BOUNDARY_PERIODIC

External Links

source
PETSc.LibPETSc.DMDAGetCellPointMethod
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 - 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

-seealso: , DM, DMDA, DMDAGetNumCells()

External Links

source
PETSc.LibPETSc.DMDAGetCoordinateArrayMethod
DMDAGetCoordinateArray(petsclib::PetscLibType,dm::PetscDM, xc::Cvoid)

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

-seealso: , DM, DMDA, DMDASetCoordinateName(), DMDASetFieldName(), DMDAGetFieldName(), DMDARestoreCoordinateArray()

External Links

source
PETSc.LibPETSc.DMDAGetCoordinateNameMethod
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 - the DMDA
  • nf - number for the DMDA (0, 1, ... dim-1)

Output Parameter:

  • name - the name of the coordinate direction

Level: intermediate

-seealso: , DM, DMDA, DMDASetCoordinateName(), DMDASetFieldName(), DMDAGetFieldName(), DMSetUp()

External Links

source
PETSc.LibPETSc.DMDAGetCornersMethod
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 - 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

-seealso: , DM, DMDA, DMDAGetGhostCorners(), DMDAGetOwnershipRanges(), DMStagGetCorners(), DMSTAG

External Links

source
PETSc.LibPETSc.DMDAGetDepthStratumMethod
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 - 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

-seealso: , DM, DMDA, DMPlexGetDepthStratum(), DMPlexGetHeightStratum(), DMPlexGetCellTypeStratum(), DMPlexGetDepth(), DMPlexGetDepthLabel(), DMPlexGetPointDepth(), DMPlexSymmetrize(), DMPlexInterpolate(), DMDAGetHeightStratum()

External Links

source
PETSc.LibPETSc.DMDAGetDofMethod
dof::PetscInt = DMDAGetDof(petsclib::PetscLibType,da::PetscDM)

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

-seealso: , DM, DMDA, DMDASetDof(), DMDACreate(), DMDestroy()

External Links

source
PETSc.LibPETSc.DMDAGetElementTypeMethod
etype::DMDAElementType = DMDAGetElementType(petsclib::PetscLibType,da::PetscDM)

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

-seealso: , DM, DMDA, DMDAElementType, DMDASetElementType(), DMDAGetElements(), DMDARestoreElements(), DMDA_ELEMENT_P1, DMDA_ELEMENT_Q1

External Links

source
PETSc.LibPETSc.DMDAGetElementsMethod
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 - 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

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

External Links

source
PETSc.LibPETSc.DMDAGetElementsCornersMethod
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 - the DMDA object

Output Parameters:

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

Level: intermediate

-seealso: , DM, DMDA, DMDAElementType, DMDASetElementType(), DMDAGetElements(), DMDAGetCorners(), DMDAGetGhostCorners(), DMDAGetElementsSizes(), DMDAGetElementsCornersIS(), DMDARestoreElementsCornersIS()

External Links

source
PETSc.LibPETSc.DMDAGetElementsSizesMethod
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 - 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

-seealso: , DM, DMDA, DMDAElementType, DMDASetElementType(), DMDAGetElements(), DMDAGetElementsCorners()

External Links

source
PETSc.LibPETSc.DMDAGetFieldNameMethod
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 - 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

-seealso: , DM, DMDA, DMDASetFieldName(), DMDASetCoordinateName(), DMDAGetCoordinateName(), DMSetUp()

External Links

source
PETSc.LibPETSc.DMDAGetFieldNamesMethod
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 - 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

-seealso: , DM, DMDA, DMDAGetFieldName(), DMDASetCoordinateName(), DMDAGetCoordinateName(), DMDASetFieldName(), DMDASetFieldNames()

External Links

source
PETSc.LibPETSc.DMDAGetGhostCornersMethod
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 - 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

-seealso: , DM, DMDA, DMDAGetCorners(), DMDACreate1d(), DMDACreate2d(), DMDACreate3d(), DMDAGetOwnershipRanges(), DMStagGetGhostCorners(), DMSTAG

External Links

source
PETSc.LibPETSc.DMDAGetHeightStratumMethod
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 - 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

-seealso: , DM, DMDA, DMPlexGetDepthStratum(), DMPlexGetHeightStratum(), DMPlexGetCellTypeStratum(), DMPlexGetDepth(), DMPlexGetDepthLabel(), DMPlexGetPointDepth(), DMPlexSymmetrize(), DMPlexInterpolate(), DMDAGetDepthStratum()

External Links

source
PETSc.LibPETSc.DMDAGetInfoMethod
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 - 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

Note: in julia, we return a named

Level: beginner

-seealso: , DM, DMDA, DMView(), DMDAGetCorners(), DMDAGetLocalInfo()

External Links

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

Level: intermediate

-seealso: , DM, DMDA, DMDAInterpolationType, DMDASetInterpolationType(), DMCreateInterpolation(), DMDA_Q1, DMDA_Q0

External Links

source
PETSc.LibPETSc.DMDAGetLocalInfoMethod
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 - the DMDA

Output Parameter:

  • info - structure containing the information

Level: beginner

-seealso: , DM, DMDA, DMDAGetInfo(), DMDAGetCorners(), DMDALocalInfo

External Links

source
PETSc.LibPETSc.DMDAGetLogicalCoordinateMethod
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 - 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

-seealso: , DM, DMDA

External Links

source
PETSc.LibPETSc.DMDAGetNeighborsMethod
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 - 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

-seealso: , DMDA, DM

External Links

source
PETSc.LibPETSc.DMDAGetNonOverlappingRegionMethod
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 - 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

-seealso: , DM, DMDA, DMDAGetOffset(), DMDAVecGetArray()

External Links

source
PETSc.LibPETSc.DMDAGetNumCellsMethod
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 - 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

-seealso: , DM, DMDA, DMDAGetCellPoint()

External Links

source
PETSc.LibPETSc.DMDAGetNumLocalSubDomainsMethod
Nsub::PetscInt = DMDAGetNumLocalSubDomains(petsclib::PetscLibType,da::PetscDM)

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

-seealso: , DM, DMDA, DMCreateDomainDecomposition(), DMDASetNumLocalSubDomains()

External Links

source
PETSc.LibPETSc.DMDAGetOffsetMethod
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 - 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

-seealso: , DM, DMDA, DMDASetOffset(), DMDAVecGetArray()

External Links

source
PETSc.LibPETSc.DMDAGetOverlapMethod
x::PetscInt,y::PetscInt,z::PetscInt = DMDAGetOverlap(petsclib::PetscLibType,da::PetscDM)

Gets the size of the per

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

-seealso: , DM, DMDA, DMCreateDomainDecomposition(), DMDASetOverlap()

External Links

source
PETSc.LibPETSc.DMDAGetOwnershipRangesMethod
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 - 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

-seealso: , DM, DMDA, DMDAGetCorners(), DMDAGetGhostCorners(), DMDACreate(), DMDACreate1d(), DMDACreate2d(), DMDACreate3d(), VecGetOwnershipRanges()

External Links

source
PETSc.LibPETSc.DMDAGetPreallocationCenterDimensionMethod
preallocCenterDim::PetscInt = DMDAGetPreallocationCenterDimension(petsclib::PetscLibType,dm::PetscDM)

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

-seealso: , DM, DMDA, DMCreateMatrix(), DMDAPreallocateOperator(), DMDASetPreallocationCenterDimension()

External Links

source
PETSc.LibPETSc.DMDAGetProcessorSubsetMethod
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 - 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

-seealso: , DM, DMDA, DMDirection, DM_X, DM_Y, DM_Z, DMDAGetProcessorSubsets()

External Links

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

Output Parameter:

  • subcomm - new communicator

Level: advanced

-seealso: , DM, DMDA, DMDirection, DMDAGetProcessorSubset(), DM_X, DM_Y, DM_Z

External Links

source
PETSc.LibPETSc.DMDAGetRayMethod
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 - 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

-seealso: , DM, DMDA, DMDirection, Vec, VecScatter

External Links

source
PETSc.LibPETSc.DMDAGetRefinementFactorMethod
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 - 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

-seealso: , DM, DMDA, DMRefine(), DMDASetRefinementFactor()

External Links

source
PETSc.LibPETSc.DMDAGetScatterMethod
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 - the DMDA

Output Parameters:

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

Level: developer

-seealso: , DM, DMDA, DMGlobalToLocalBegin(), DMGlobalToLocalEnd(), DMLocalToGlobalBegin()

External Links

source
PETSc.LibPETSc.DMDAGetStencilTypeMethod
stype::DMDAStencilType = DMDAGetStencilType(petsclib::PetscLibType,da::PetscDM)

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

-seealso: , DM, DMDA, DMDACreate(), DMDestroy(), DMDAStencilType, DMDA_STENCIL_BOX, DMDA_STENCIL_STAR.

External Links

source
PETSc.LibPETSc.DMDAGetStencilWidthMethod
width::PetscInt = DMDAGetStencilWidth(petsclib::PetscLibType,da::PetscDM)

Gets the width of the communication stencil

Not Collective

Input Parameter:

  • da - The DMDA

Output Parameter:

  • width - The stencil width

Level: intermediate

-seealso: , DM, DMDA, DMDACreate(), DMDestroy(), DMDAStencilType, DMDA_STENCIL_BOX, DMDA_STENCIL_STAR.

External Links

source
PETSc.LibPETSc.DMDAGetSubdomainCornersISMethod
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 - the DMDA object

Output Parameter:

  • is - the index set

Level: intermediate

-seealso: , DM, DMDA, DMDAElementType, DMDASetElementType(), DMDAGetElements(), DMDARestoreElementsCornersIS(), DMDAGetElementsSizes(), DMDAGetElementsCorners()

External Links

source
PETSc.LibPETSc.DMDAGlobalToNaturalAllCreateMethod
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 - the DMDA context

Output Parameter:

  • scatter - the scatter context

Level: advanced

-seealso: , DM, DMDA, DMDANaturalAllToGlobalCreate(), DMDAGlobalToNaturalEnd(), DMLocalToGlobalBegin(), DMDACreate2d(), DMGlobalToLocalBegin(), DMGlobalToLocalEnd(), DMDACreateNaturalVector()

External Links

source
PETSc.LibPETSc.DMDAGlobalToNaturalBeginMethod
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 - 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

-seealso: , DM, DMDA, DMDAGlobalToNaturalEnd(), DMLocalToGlobalBegin(), DMDACreate2d(), DMGlobalToLocalBegin(), DMGlobalToLocalEnd(), DMDACreateNaturalVector()

External Links

source
PETSc.LibPETSc.DMDAGlobalToNaturalEndMethod
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 - 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

-seealso: , DM, DMDA, DMDAGlobalToNaturalBegin(), DMLocalToGlobalBegin(), DMDACreate2d(), DMGlobalToLocalBegin(), DMGlobalToLocalEnd(), DMDACreateNaturalVector()

External Links

source
PETSc.LibPETSc.DMDAMapMatStencilToGlobalMethod
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 - 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

-seealso: , DM, DMDA, MatStencil

External Links

source
PETSc.LibPETSc.DMDANaturalAllToGlobalCreateMethod
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 - the DMDA context

Output Parameter:

  • scatter - the scatter context

Level: advanced

-seealso: , DM, DMDA, DMDAGlobalToNaturalAllCreate(), DMDAGlobalToNaturalEnd(), DMLocalToGlobalBegin(), DMDACreate2d(), DMGlobalToLocalBegin(), DMGlobalToLocalEnd(), DMDACreateNaturalVector()

External Links

source
PETSc.LibPETSc.DMDANaturalToGlobalBeginMethod
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 - 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

-seealso: , DM, DMDA, DMDAGlobalToNaturalEnd(), DMDAGlobalToNaturalBegin(), DMLocalToGlobalBegin(), DMDACreate2d(), DMGlobalToLocalBegin(), DMGlobalToLocalEnd(), DMDACreateNaturalVector()

External Links

source
PETSc.LibPETSc.DMDANaturalToGlobalEndMethod
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 - 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

-seealso: , DM, DMDA, DMDAGlobalToNaturalBegin(), DMDAGlobalToNaturalEnd(), DMLocalToGlobalBegin(), DMDACreate2d(), DMGlobalToLocalBegin(), DMGlobalToLocalEnd(), DMDACreateNaturalVector()

External Links

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

Level: advanced

-seealso: , DM, DMDA, DMDAGetArray()

External Links

source
PETSc.LibPETSc.DMDARestoreCoordinateArrayMethod
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 - the DMDA
  • xc - the coordinates

Level: intermediate

-seealso: , DM, DMDA, DMDASetCoordinateName(), DMDASetFieldName(), DMDAGetFieldName(), DMDAGetCoordinateArray()

External Links

source
PETSc.LibPETSc.DMDARestoreElementsMethod
DMDARestoreElements(petsclib::PetscLibType,dm::PetscDM, nel::PetscInt, nen::PetscInt, e::Vector{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

-seealso: , DM, DMDA, DMDAElementType, DMDASetElementType(), DMDAGetElements()

External Links

source
PETSc.LibPETSc.DMDARestoreSubdomainCornersISMethod
DMDARestoreSubdomainCornersIS(petsclib::PetscLibType,dm::PetscDM, is::IS)

Restores the IS obtained with DMDAGetSubdomainCornersIS()

Not Collective

Input Parameters:

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

Level: intermediate

-seealso: , DM, DMDA, DMDAElementType, DMDASetElementType(), DMDAGetSubdomainCornersIS()

External Links

source
PETSc.LibPETSc.DMDASNESSetFunctionLocalMethod
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 - 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

Calling sequence of func:

  • info - DMDALocalInfo defining the subdomain to evaluate the residual on
  • x - 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

source
PETSc.LibPETSc.DMDASNESSetFunctionLocalVecMethod
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 - 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

Calling sequence of func:

  • info - DMDALocalInfo defining the subdomain to evaluate the residual on
  • x - state vector at which to evaluate residual
  • f - residual vector
  • ctx - optional context passed above

Level: beginner

-seealso: , DMDA, DMDASNESSetFunctionLocal(), DMDASNESSetJacobianLocalVec(), DMSNESSetFunction(), DMDACreate1d(), DMDACreate2d(), DMDACreate3d()

External Links

source
PETSc.LibPETSc.DMDASNESSetJacobianLocalMethod
DMDASNESSetJacobianLocal(petsclib::PetscLibType,dm::PetscDM, func::external, ctx::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

Calling sequence of func:

  • info - DMDALocalInfo defining the subdomain to evaluate the Jacobian at
  • x - dimensional pointer to state at which to evaluate Jacobian (e.g. PetscScalar *x or **x or ***x)
  • J - Mat object for the Jacobian
  • M - Mat object used to compute the preconditioner often J
  • ctx - optional context passed above

Level: beginner

-seealso: , DMDA, DMDASNESSetFunctionLocal(), DMSNESSetJacobian(), DMDACreate1d(), DMDACreate2d(), DMDACreate3d()

External Links

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

Calling sequence of func:

  • info - DMDALocalInfo defining the subdomain to evaluate the Jacobian at
  • x - state vector at which to evaluate Jacobian
  • J - the Jacobian
  • M - approximate Jacobian from which the preconditioner will be computed, often J
  • ctx - optional context passed above

Level: beginner

-seealso: , DMDA, DMDASNESSetJacobianLocal(), DMDASNESSetFunctionLocalVec(), DMSNESSetJacobian(), DMDACreate1d(), DMDACreate2d(), DMDACreate3d()

External Links

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

Calling sequence of func:

  • info - DMDALocalInfo defining the subdomain to evaluate the Jacobian at
  • x - 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 subdomain
  • ctx - optional context passed above

Level: beginner

-seealso: , DMDA, DMSNESSetFunction(), DMDASNESSetJacobianLocal(), DMDACreate1d(), DMDACreate2d(), DMDACreate3d(), DMDASNESObjectiveFn

External Links

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

Calling sequence of func:

  • info - DMDALocalInfo defining the subdomain to evaluate the Jacobian at
  • x - state vector at which to evaluate the objective
  • obj - returned objective value for the local subdomain
  • ctx - optional context passed above

Level: beginner

-seealso: , DMDA, DMDASNESSetObjectiveLocal(), DMSNESSetFunction(), DMDASNESSetJacobianLocalVec(), DMDACreate1d(), DMDACreate2d(), DMDACreate3d(), DMDASNESObjectiveVecFn

External Links

source
PETSc.LibPETSc.DMDASNESSetPicardLocalMethod
DMDASNESSetPicardLocal(petsclib::PetscLibType,dm::PetscDM, imode::InsertMode, func::external, jac::external, ctx::Cvoid)

set a local right

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

Calling sequence of func:

  • info - defines the subdomain to evaluate the residual on
  • x - dimensional pointer to state at which to evaluate residual
  • f - dimensional pointer to residual, write the residual here
  • ctx - optional context passed above

Calling sequence of jac:

  • info - defines the subdomain to evaluate the residual on
  • x - dimensional pointer to state at which to evaluate residual
  • jac - the Jacobian
  • Jp - approximation to the Jacobian used to compute the preconditioner, often J
  • ctx - optional context passed above

Level: beginner

-seealso: , SNES, DMDA, DMSNESSetFunction(), DMDASNESSetJacobian(), DMDACreate1d(), DMDACreate2d(), DMDACreate3d()

External Links

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

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

source
PETSc.LibPETSc.DMDASetBlockFillsMethod
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 - 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

-seealso: , DM, DMDA, DMCreateMatrix(), DMDASetGetMatrix(), DMSetMatrixPreallocateOnly(), DMDASetBlockFillsSparse()

External Links

source
PETSc.LibPETSc.DMDASetBlockFillsSparseMethod
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 - 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

-seealso: , DM, DMDA, DMDASetBlockFills(), DMCreateMatrix(), DMDASetGetMatrix(), DMSetMatrixPreallocateOnly()

External Links

source
PETSc.LibPETSc.DMDASetBoundaryTypeMethod
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 - 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

-seealso: , DMDAGetBoundaryType(), DM, DMDA, DMDACreate(), DMDestroy(), DMBoundaryType, DM_BOUNDARY_NONE, DM_BOUNDARY_GHOSTED, DM_BOUNDARY_PERIODIC

External Links

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

Level: intermediate

-seealso: , DM, DMDA, DMDAGetCoordinateName(), DMDASetFieldName(), DMDAGetFieldName(), DMSetUp()

External Links

source
PETSc.LibPETSc.DMDASetDofMethod
DMDASetDof(petsclib::PetscLibType,da::PetscDM, 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

-seealso: , DM, DMDA, DMDAGetDof(), DMDACreate(), DMDestroy()

External Links

source
PETSc.LibPETSc.DMDASetElementTypeMethod
etype::DMDAElementType = DMDASetElementType(petsclib::PetscLibType,da::PetscDM)

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

-seealso: , DM, DMDA, DMDAElementType, DMDAGetElementType(), DMDAGetElements(), DMDARestoreElements(), DMDA_ELEMENT_P1, DMDA_ELEMENT_Q1

External Links

source
PETSc.LibPETSc.DMDASetFieldNameMethod
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 - 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

-seealso: , DM, DMDA, DMDAGetFieldName(), DMDASetCoordinateName(), DMDAGetCoordinateName(), DMDASetFieldNames(), DMSetUp()

External Links

source
PETSc.LibPETSc.DMDASetFieldNamesMethod
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 - 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

-seealso: , DM, DMDA, DMDAGetFieldName(), DMDASetCoordinateName(), DMDAGetCoordinateName(), DMDASetFieldName(), DMSetUp()

External Links

source
PETSc.LibPETSc.DMDASetGetMatrixMethod
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 - 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

-seealso: , DM, DMDA, DMCreateMatrix(), DMDASetBlockFills()

External Links

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

Level: intermediate

-seealso: , DM, DMDA, DMDACreate1d(), DMDACreate2d(), DMDACreate3d(), DMDestroy(), DMDAInterpolationType, DMDA_Q1, DMDA_Q0

External Links

source
PETSc.LibPETSc.DMDASetNonOverlappingRegionMethod
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 - 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

-seealso: , DM, DMDA, DMDAGetOffset(), DMDAVecGetArray()

External Links

source
PETSc.LibPETSc.DMDASetNumLocalSubDomainsMethod
DMDASetNumLocalSubDomains(petsclib::PetscLibType,da::PetscDM, 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

-seealso: , DM, DMDA, DMCreateDomainDecomposition(), DMDAGetNumLocalSubDomains()

External Links

source
PETSc.LibPETSc.DMDASetNumProcsMethod
DMDASetNumProcs(petsclib::PetscLibType,da::PetscDM, 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

-seealso: , DM, DMDA, DMDASetSizes(), PetscSplitOwnership()

External Links

source
PETSc.LibPETSc.DMDASetOffsetMethod
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 - 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

-seealso: , DM, DMDA, DMDAGetOffset(), DMDAVecGetArray()

External Links

source
PETSc.LibPETSc.DMDASetOverlapMethod
DMDASetOverlap(petsclib::PetscLibType,da::PetscDM, x::PetscInt, y::PetscInt, z::PetscInt)

Sets the size of the per

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

-seealso: , DM, DMDA, DMCreateDomainDecomposition(), DMDAGetOverlap()

External Links

source
PETSc.LibPETSc.DMDASetOwnershipRangesMethod
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 - 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

-seealso: , DM, DMDA, DMDACreate(), DMDestroy()

External Links

source
PETSc.LibPETSc.DMDASetRefinementFactorMethod
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 - the DMDA object
  • 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)

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

Level: intermediate

-seealso: , DM, DMDA, DMRefine(), DMDAGetRefinementFactor()

External Links

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

Level: intermediate

-seealso: , DM, DMDA, PetscSplitOwnership()

External Links

source
PETSc.LibPETSc.DMDASetStencilTypeMethod
DMDASetStencilType(petsclib::PetscLibType,da::PetscDM, 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

-seealso: , DM, DMDA, DMDACreate(), DMDestroy(), DMDAStencilType, DMDA_STENCIL_BOX, DMDA_STENCIL_STAR.

External Links

source
PETSc.LibPETSc.DMDASetStencilWidthMethod
DMDASetStencilWidth(petsclib::PetscLibType,da::PetscDM, width::PetscInt)

Sets the width of the communication stencil

Logically Collective

Input Parameters:

  • da - The DMDA
  • width - The stencil width

Level: intermediate

-seealso: , DM, DMDA, DMDACreate(), DMDestroy(), DMDAStencilType, DMDA_STENCIL_BOX, DMDA_STENCIL_STAR.

External Links

source
PETSc.LibPETSc.DMDASetUniformCoordinatesMethod
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 - 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

-seealso: , DM, DMDA, DMSetCoordinates(), DMGetCoordinates(), DMDACreate1d(), DMDACreate2d(), DMDACreate3d(), DMStagSetUniformCoordinates()

External Links

source
PETSc.LibPETSc.DMDASetVertexCoordinatesMethod
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 - 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

-seealso: , DM, DMDA

External Links

source
PETSc.LibPETSc.DMDATSSetIFunctionLocalMethod
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 - 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

-seealso: , DMDA, DMDATSIFunctionLocalFn, DMTSSetIFunction(), DMDATSSetIJacobianLocal(), DMDASNESSetFunctionLocal()

External Links

source
PETSc.LibPETSc.DMDATSSetIJacobianLocalMethod
DMDATSSetIJacobianLocal(petsclib::PetscLibType,dm::PetscDM, func::DMDATSIJacobianLocalFn, ctx::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

-seealso: , DMDA, DMDATSIJacobianLocalFn, DMTSSetIJacobian(), DMDATSSetIFunctionLocal(), DMDASNESSetJacobianLocal()

External Links

source
PETSc.LibPETSc.DMDATSSetRHSFunctionLocalMethod
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 - 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

-seealso: , DMDA, DMDATSRHSFunctionLocalFn, TS, TSSetRHSFunction(), DMTSSetRHSFunction(), DMDATSSetRHSJacobianLocal(), DMDASNESSetFunctionLocal()

External Links

source
PETSc.LibPETSc.DMDATSSetRHSJacobianLocalMethod
DMDATSSetRHSJacobianLocal(petsclib::PetscLibType,dm::PetscDM, func::DMDATSRHSJacobianLocalFn, ctx::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

-seealso: , DMDA, DMDATSRHSJacobianLocalFn, DMTSSetRHSJacobian(), DMDATSSetRHSFunctionLocal(), DMDASNESSetJacobianLocal()

External Links

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

Level: developer

-seealso: , DMDA, DM, PETSCVIEWERVTK, DMDASetFieldName()

External Links

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

Output Parameter:

  • array - the array

Level: intermediate

-seealso: , , DM, DMDA, DMDAGetGhostCorners(), DMDAGetCorners(), VecGetArray(), VecRestoreArray(), DMDAVecRestoreArray(), DMDAVecRestoreArrayDOF() DMDAVecGetArrayDOF(), DMDAVecGetArrayWrite(), DMDAVecRestoreArrayWrite(), DMDAVecGetArrayRead(), DMDAVecRestoreArrayRead(), DMStagVecGetArray()

External Links

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

Output Parameter:

  • array - the array pointer

Level: intermediate

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

External Links

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

Output Parameter:

  • array - the array

Level: intermediate

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

External Links

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

Output Parameter:

  • array - the array

Level: intermediate

-seealso: , , DM, DMDA, DMDAGetGhostCorners(), DMDAGetCorners(), VecGetArray(), VecRestoreArray(), DMDAVecRestoreArray(), DMDAVecGetArray(), DMDAVecGetArrayDOF(), DMDAVecGetArrayWrite(), DMDAVecRestoreArrayWrite()

External Links

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

Output Parameter:

  • array - the array

Level: intermediate

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

External Links

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

Output Parameter:

  • array - the array

Level: intermediate

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

External Links

source
PETSc.LibPETSc.DMDAVecRestoreArrayMethod
DMDAVecRestoreArray(petsclib::PetscLibType,da::PetscDM, vec::PetscVec, array::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

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

External Links

source
PETSc.LibPETSc.DMDAVecRestoreArrayDOFMethod
DMDAVecRestoreArrayDOF(petsclib::PetscLibType,da::PetscDM, vec::PetscVec, array::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

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

External Links

source
PETSc.LibPETSc.DMDAVecRestoreArrayDOFReadMethod
DMDAVecRestoreArrayDOFRead(petsclib::PetscLibType,da::PetscDM, vec::PetscVec, array::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

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

External Links

source
PETSc.LibPETSc.DMDAVecRestoreArrayDOFWriteMethod
DMDAVecRestoreArrayDOFWrite(petsclib::PetscLibType,da::PetscDM, vec::PetscVec, array::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

-seealso: , , DM, DMDA, DMDAGetGhostCorners(), DMDAGetCorners(), VecGetArray(), VecRestoreArray(), DMDAVecGetArray(), DMDAVecGetArrayDOF(), DMDAVecRestoreArrayDOF(), DMDAVecGetArrayWrite(), DMDAVecRestoreArrayWrite()

External Links

source
PETSc.LibPETSc.DMDAVecRestoreArrayReadMethod
DMDAVecRestoreArrayRead(petsclib::PetscLibType,da::PetscDM, vec::PetscVec, array::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

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

External Links

source
PETSc.LibPETSc.DMDAVecRestoreArrayWriteMethod
DMDAVecRestoreArrayWrite(petsclib::PetscLibType,da::PetscDM, vec::PetscVec, array::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

-seealso: , , DM, DMDA, DMDAGetGhostCorners(), DMDAGetCorners(), VecGetArray(), VecRestoreArray(), DMDAVecGetArrayWrite(), DMDAVecGetArray(), DMDAVecRestoreArray(), DMDAVecGetArrayRead(), DMDAVecRestoreArrayRead()

External Links

source