MatAssemblyBegin

Begins assembling the matrix. This routine should be called after completing all calls to MatSetValues().

Synopsis

#include "petscmat.h" 
int MatAssemblyBegin(Mat mat,MatAssemblyType type)
Collective on Mat

Input Parameters

mat - the matrix
type - type of assembly, either MAT_FLUSH_ASSEMBLY or MAT_FINAL_ASSEMBLY

Notes

MatSetValues() generally caches the values. The matrix is ready to use only after MatAssemblyBegin() and MatAssemblyEnd() have been called. Use MAT_FLUSH_ASSEMBLY when switching between ADD_VALUES and INSERT_VALUES in MatSetValues(); use MAT_FINAL_ASSEMBLY for the final assembly before using the matrix.

See Also

MatAssemblyEnd(), MatSetValues(), MatAssembled()

Level:beginner
Location:
src/mat/interface/matrix.c
Index of all Mat routines
Table of Contents for all manual pages
Index of all manual pages

Examples

src/sles/examples/tutorials/ex1.c.html
src/sles/examples/tutorials/ex2.c.html
src/sles/examples/tutorials/ex3.c.html
src/sles/examples/tutorials/ex4.c.html
src/sles/examples/tutorials/ex5.c.html
src/sles/examples/tutorials/ex7.c.html
src/sles/examples/tutorials/ex8.c.html
src/sles/examples/tutorials/ex9.c.html
src/sles/examples/tutorials/ex11.c.html
src/sles/examples/tutorials/ex12.c.html
src/sles/examples/tutorials/ex13.c.html