petsc-3.10.5 2019-03-28
Report Typos and Errors

# MatSetUp

Sets up the internal matrix data structures for the later use.

### Synopsis

    #include "petscmat.h"
    PetscErrorCode MatSetUp(Mat A)

Collective on Mat

### Input Parameters

A -the Mat context

### Notes

If the user has not set preallocation for this matrix then a default preallocation that is likely to be inefficient is used.

If a suitable preallocation routine is used, this function does not need to be called.

See the Performance chapter of the PETSc users manual for how to preallocate matrices

### Keywords

Mat, setup

### See Also

MatCreate(), MatDestroy()

### Level

beginner

### Location

src/mat/interface/matrix.c

### Examples

src/mat/examples/tutorials/ex4.c.html
src/mat/examples/tutorials/ex8.c.html
src/ksp/pc/examples/tutorials/ex3.c.html
src/ksp/ksp/examples/tutorials/ex1.c.html
src/ksp/ksp/examples/tutorials/ex5.c.html
src/ksp/ksp/examples/tutorials/ex6.c.html
src/ksp/ksp/examples/tutorials/ex8.c.html
src/ksp/ksp/examples/tutorials/ex9.c.html
src/ksp/ksp/examples/tutorials/ex11.c.html
src/ksp/ksp/examples/tutorials/ex12.c.html
src/ksp/ksp/examples/tutorials/ex15.c.html

### Implementations

MatSetUp_HYPREStruct in src/dm/impls/da/hypre/mhyp.c
MatSetUp_HYPRESStruct in src/dm/impls/da/hypre/mhyp.c
MatSetUp_MPIAIJ in src/mat/impls/aij/mpi/mpiaij.c
MatSetUp_SeqAIJ in src/mat/impls/aij/seq/aij.c
MatSetUp_MPIBAIJ in src/mat/impls/baij/mpi/mpibaij.c
MatSetUp_SeqBAIJ in src/mat/impls/baij/seq/baij.c
MatSetUp_MPIDense in src/mat/impls/dense/mpi/mpidense.c
MatSetUp_SeqDense in src/mat/impls/dense/seq/dense.c
MatSetUp_Elemental in src/mat/impls/elemental/matelem.cxx
MatSetUp_HYPRE in src/mat/impls/hypre/mhypre.c
MatSetUp_MAIJ in src/mat/impls/maij/maij.c
MatSetUp_NestIS_Private in src/mat/impls/nest/matnest.c
MatSetUp_Preallocator in src/mat/impls/preallocator/matpreallocator.c
MatSetUp_MPISBAIJ in src/mat/impls/sbaij/mpi/mpisbaij.c
MatSetUp_SeqSBAIJ in src/mat/impls/sbaij/seq/sbaij.c
MatSetUp_MPISELL in src/mat/impls/sell/mpi/mpisell.c
MatSetUp_SeqSELL in src/mat/impls/sell/seq/sell.c
Index of all Mat routines
Table of Contents for all manual pages
Index of all manual pages