:orphan:
# DMSlicedSetPreallocation
sets the matrix memory preallocation for matrices computed by `DMSLICED` 
## Synopsis
```
#include "petscdmsliced.h" 
PetscErrorCode DMSlicedSetPreallocation(DM dm, PetscInt d_nz, const PetscInt d_nnz[], PetscInt o_nz, const PetscInt o_nnz[])
```
Not Collective


## Input Parameters

- ***slice -*** the `DM` object
- ***d_nz  -*** number of block nonzeros per block row in diagonal portion of local
submatrix  (same for all local rows)
- ***d_nnz -*** array containing the number of block nonzeros in the various block rows
of the in diagonal portion of the local (possibly different for each block
row) or `NULL`.
- ***o_nz  -*** number of block nonzeros per block row in the off-diagonal portion of local
submatrix (same for all local rows).
- ***o_nnz -*** array containing the number of nonzeros in the various block rows of the
off-diagonal portion of the local submatrix (possibly different for
each block row) or `NULL`.





## Note
See `MatMPIBAIJSetPreallocation()` for more details on preallocation.  If a scalar matrix (`MATAIJ`) is
obtained with `DMSlicedGetMatrix()`, the correct preallocation will be set, respecting `DMSlicedSetBlockFills()`.


## See Also
 `DM`, `DMSLICED`, `DMDestroy()`, `DMCreateGlobalVector()`, `MatMPIAIJSetPreallocation()`,
`MatMPIBAIJSetPreallocation()`, `DMSlicedGetMatrix()`, `DMSlicedSetBlockFills()`

## Level
advanced

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/dm/impls/sliced/sliced.c.html#DMSlicedSetPreallocation">src/dm/impls/sliced/sliced.c</A>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/dm/impls/sliced/sliced.c)


[Index of all DM routines](index.md)  
[Table of Contents for all manual pages](/manualpages/index.md)  
[Index of all manual pages](/manualpages/singleindex.md)  
