MatReuse — PETSc 3.25.1 documentation

Skip to main content
`Ctrl`+`K`

# MatReuse

Indicates if matrices obtained from a previous call to `MatCreateSubMatrices()`, `MatCreateSubMatrix()`, `MatConvert()` or several other functions are to be reused to store the new matrix values.

## Synopsis

    typedef enum {
      MAT_INITIAL_MATRIX,
      MAT_REUSE_MATRIX,
      MAT_IGNORE_MATRIX,
      MAT_INPLACE_MATRIX
    } MatReuse;

## Values

- `MAT_INITIAL_MATRIX` - create a new matrix

- `MAT_REUSE_MATRIX` - reuse the matrix created with a previous call that used `MAT_INITIAL_MATRIX`

- `MAT_INPLACE_MATRIX` - replace the first input matrix with the new matrix (not applicable to all functions)

- `MAT_IGNORE_MATRIX` - do not create a new matrix or reuse a given matrix, just ignore that matrix argument (not applicable to all functions)

## See Also

Matrices, `Mat`, `MatCreateSubMatrices()`, `MatCreateSubMatrix()`, `MatDestroyMatrices()`, `MatConvert()`

## Level

beginner

## Location

include/petscmat.h

## Examples

src/ksp/ksp/tutorials/ex71.c
src/ksp/ksp/tutorials/ex81.c
src/ksp/ksp/tutorials/ex19.c
src/ksp/ksp/tutorials/ex72.c
src/ksp/ksp/tutorials/ex59.c
src/ksp/ksp/tutorials/ex27.c
src/ksp/ksp/tutorials/ex49.c
src/ksp/ksp/tutorials/ex29.c
src/ksp/ksp/tutorials/ex34.c
src/ksp/ksp/tutorials/ex64.c

## Examples

src/ksp/ksp/tutorials/ex76.c
src/ksp/ksp/tutorials/ex81.c
src/ksp/ksp/tutorials/ex43.c
src/ksp/ksp/tutorials/ex87.c
src/ksp/ksp/tutorials/ex74.c
src/ksp/ksp/tutorials/ex79.c
src/ksp/ksp/tutorials/ex77.c
src/ksp/ksp/tutorials/ex29.c
src/ksp/ksp/tutorials/ex34.c
src/ksp/ksp/tutorials/ex72.c

## Examples

src/tao/pde_constrained/tutorials/elliptic.c
src/ksp/ksp/tutorials/ex81.c

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