MatSetUp#

Sets up the internal matrix data structures for later use.

Synopsis#

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

Collective on A

Input Parameters#

  • A - the matrix

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

This routine is called internally by other matrix functions when needed so rarely needs to be called by users

See Also#

Mat, MatMult(), MatCreate(), MatDestroy()

Level#

intermediate

Location#

src/mat/interface/matrix.c

Examples#

src/mat/tutorials/ex4.c.html
src/mat/tutorials/ex4f.F90.html
src/mat/tutorials/ex8.c.html
src/ksp/pc/tutorials/ex3.c.html
src/ksp/ksp/tutorials/bench_pcsetup.c.html
src/ksp/ksp/tutorials/ex100.c.html
src/ksp/ksp/tutorials/ex100f.F90.html
src/ksp/ksp/tutorials/ex11.c.html
src/ksp/ksp/tutorials/ex11f.F90.html
src/ksp/ksp/tutorials/ex12.c.html
src/ksp/ksp/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_SeqDenseCUDA in src/mat/impls/dense/seq/cuda/densecuda.cu
MatSetUp_SeqDense in src/mat/impls/dense/seq/dense.c
MatSetUp_SeqDenseHIP in src/mat/impls/dense/seq/hip/densehip.hip.c
MatSetUp_Elemental in src/mat/impls/elemental/matelem.cxx
MatSetUp_HYPRE in src/mat/impls/hypre/mhypre.c
MatSetUp_IS in src/mat/impls/is/matis.c
MatSetUp_KAIJ in src/mat/impls/kaij/kaij.c
MatSetUp_MAIJ in src/mat/impls/maij/maij.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_ScaLAPACK in src/mat/impls/scalapack/matscalapack.c
MatSetUp_MPISELL in src/mat/impls/sell/mpi/mpisell.c
MatSetUp_SeqSELL in src/mat/impls/sell/seq/sell.c


Edit on GitLab

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