Sets the routine used by the DMDA to allocate a matrix.


#include "petscdmda.h"   
PetscErrorCode DMDASetGetMatrix(DM da, PetscErrorCode (*f)(DM da, Mat *A))

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


If the function is not provided a default function is used that uses the DMDAStencilType, DMBoundaryType, and value of DMDASetStencilWidth() to construct the matrix.

See DMDASetBlockFills() that provides a simple way to provide the nonzero structure for the diagonal and off-diagonal blocks of the matrix without providing a custom function

Developer Note#

This should be called DMDASetCreateMatrix()

See Also#

DMDA - Creating vectors for structured grids, DM, DMDA, DMCreateMatrix(), DMDASetBlockFills()





Index of all DMDA routines
Table of Contents for all manual pages
Index of all manual pages