MatCreateSeqBAIJ

Creates a sparse matrix in block AIJ (block compressed row) format. For good matrix assembly performance the user should preallocate the matrix storage by setting the parameter nz (or the array nzz). By setting these parameters accurately, performance during matrix assembly can be increased by more than a factor of 50.

Synopsis

int MatCreateSeqBAIJ(MPI_Comm comm,int bs,int m,int n,int nz,int *nnz, Mat *A)
Collective on MPI_Comm

Input Parameters

comm - MPI communicator, set to PETSC_COMM_SELF
bs - size of block
m - number of rows
n - number of columns
nz - number of block nonzeros per block row (same for all rows)
nzz - array containing the number of block nonzeros in the various block rows (possibly different for each block row) or PETSC_NULL

Output Parameter

A -the matrix

Options Database Keys

-mat_no_unroll -uses code that does not unroll the loops in the block calculations (much slower)
-mat_block_size -size of the blocks to use

Notes

The block AIJ format is fully compatible with standard Fortran 77storage. That is, the stored row and column indices can begin ateither one (as in Fortran) or zero. See the users' manual for details.

Specify the preallocated storage with either nz or nnz (not both). Set nz=PETSC_DEFAULT and nnz=PETSC_NULL for PETSc to control dynamic memoryallocation. For additional details, see the users manual chapter onmatrices.

See Also

MatCreate(), MatCreateSeqAIJ(), MatSetValues(), MatCreateMPIBAIJ()

Location: src/mat/impls/baij/seq/baij.c
Matrix Index
Table of Contents