petsc-3.11.2 2019-05-18
Report Typos and Errors


Sets the fill pattern in each block for a multi-component problem of the matrix returned by DMCreateMatrix(), using sparse representations of fill patterns.


#include "petscdmda.h"     
PetscErrorCode  DMDASetBlockFillsSparse(DM da,const PetscInt *dfillsparse,const PetscInt *ofillsparse)
Logically Collective on DMDA

Input Parameter

da - the distributed array
dfill - the sparse fill pattern in the diagonal block (may be NULL, means use dense block)
ofill - the sparse fill pattern in the off-diagonal blocks

Notes: This only makes sense when you are doing multicomponent problems but using the MPIAIJ matrix format

The format for dfill and ofill is a sparse representation of a dof-by-dof matrix with 1 entries representing coupling and 0 entries for missing coupling. The sparse representation is a 1 dimensional array of length nz + dof + 1, where nz is the number of non-zeros in the matrix. The first dof entries in the array give the starting array indices of each row's items in the rest of the array, the dof+1st item contains the value nz + dof + 1 (i.e. the entire length of the array) and the remaining nz items give the column indices of each of the 1s within the logical 2D matrix. Each row's items within the array are the column indices of the 1s within that row of the 2D matrix. PETSc developers may recognize that this is the same format as that computed by the DMDASetBlockFills_Private() function from a dense 2D matrix representation.

DMDASetGetMatrix() allows you to provide general code for those more complicated nonzero patterns then can be represented in the dfill, ofill format

Contributed by Philip C. Roth

See Also

DMDASetBlockFills(), DMCreateMatrix(), DMDASetGetMatrix(), DMSetMatrixPreallocateOnly()






DMDASetBlockFillsSparse_Private in src/dm/impls/da/fdda.c

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