petsc-3.9.4 2018-09-11
Report Typos and Errors

MatConvert

Converts a matrix to another matrix, either of the same or different type.

Synopsis

#include "petscmat.h" 
PetscErrorCode MatConvert(Mat mat, MatType newtype,MatReuse reuse,Mat *M)
Collective on Mat

Input Parameters

mat - the matrix
newtype - new matrix type. Use MATSAME to create a new matrix of the same type as the original matrix.
reuse - denotes if the destination matrix is to be created or reused. Use MAT_INPLACE_MATRIX for inplace conversion (that is when you want the input mat to be changed to contain the matrix in the new format), otherwise use MAT_INITIAL_MATRIX or MAT_REUSE_MATRIX (can only be used after the first call was made with MAT_INITIAL_MATRIX, causes the matrix space in M to be reused).

Output Parameter

M -pointer to place new matrix

Notes

MatConvert() first creates a new matrix and then copies the data from the first matrix. A related routine is MatCopy(), which copies the matrix entries of one matrix to another already existing matrix context.

Cannot be used to convert a sequential matrix to parallel or parallel to sequential, the MPI communicator of the generated matrix is always the same as the communicator of the input matrix.

See Also

MatCopy(), MatDuplicate()

Level

intermediate

Location

src/mat/interface/matrix.c

Examples

src/ksp/ksp/examples/tutorials/ex34.c.html
src/ksp/ksp/examples/tutorials/ex6f.F90.html
src/snes/examples/tutorials/ex28.c.html

Implementations

MatConvert_MPIAIJ_ML in src/ksp/pc/impls/ml/ml.c
MatConvert_MPIAIJ_MPIAIJMKL in src/mat/impls/aij/mpi/aijmkl/mpiaijmkl.c
MatConvert_MPIAIJ_MPIAIJPERM in src/mat/impls/aij/mpi/aijperm/mpiaijperm.c
MatConvert_MPIAIJ_MPIAIJCRL in src/mat/impls/aij/mpi/crl/mcrl.c
MatConvert_SeqAIJMKL_SeqAIJ in src/mat/impls/aij/seq/aijmkl/aijmkl.c
MatConvert_SeqAIJ_SeqAIJMKL in src/mat/impls/aij/seq/aijmkl/aijmkl.c
MatConvert_SeqAIJPERM_SeqAIJ in src/mat/impls/aij/seq/aijperm/aijperm.c
MatConvert_SeqAIJ_SeqAIJPERM in src/mat/impls/aij/seq/aijperm/aijperm.c
MatConvert_SeqAIJ_SeqAIJCRL in src/mat/impls/aij/seq/crl/crl.c
MatConvert_SeqAIJ_SeqAIJViennaCL in src/mat/impls/aij/seq/seqviennacl/aijviennacl.cxx
MatConvert_MPIBAIJ_MPIBAIJMKL in src/mat/impls/baij/mpi/baijmkl/mpibaijmkl.c
MatConvert_MPIBAIJ_MPIAdj in src/mat/impls/baij/mpi/mpibaij.c
MatConvert_MPIBAIJ_MPIAIJ in src/mat/impls/baij/mpi/mpibaij.c
MatConvert_SeqBAIJ_SeqAIJ in src/mat/impls/baij/seq/aijbaij.c
MatConvert_SeqAIJ_SeqBAIJ in src/mat/impls/baij/seq/aijbaij.c
MatConvert_SeqBAIJMKL_SeqBAIJ in src/mat/impls/baij/seq/baijmkl/baijmkl.c
MatConvert_SeqBAIJ_SeqBAIJMKL in src/mat/impls/baij/seq/baijmkl/baijmkl.c
MatConvert_MPIDense_Elemental in src/mat/impls/dense/mpi/mpidense.c
MatConvert_SeqAIJ_SeqDense in src/mat/impls/dense/seq/dense.c
MatConvert_SeqDense_SeqAIJ in src/mat/impls/dense/seq/dense.c
MatConvert_SeqDense_Elemental in src/mat/impls/dense/seq/dense.c
MatConvert_Elemental_Dense in src/mat/impls/elemental/matelem.cxx
MatConvert_SeqAIJ_Elemental in src/mat/impls/elemental/matelem.cxx
MatConvert_MPIAIJ_Elemental in src/mat/impls/elemental/matelem.cxx
MatConvert_SeqSBAIJ_Elemental in src/mat/impls/elemental/matelem.cxx
MatConvert_MPISBAIJ_Elemental in src/mat/impls/elemental/matelem.cxx
MatConvert_HYPRE_IS in src/mat/impls/hypre/mhypre.c
MatConvert_AIJ_HYPRE in src/mat/impls/hypre/mhypre.c
MatConvert_HYPRE_AIJ in src/mat/impls/hypre/mhypre.c
MatConvert_MPIAIJ_IS in src/mat/impls/is/matis.c
MatConvert_Nest_IS in src/mat/impls/is/matis.c
MatConvert_SeqMAIJ_SeqAIJ in src/mat/impls/maij/maij.c
MatConvert_MPIMAIJ_MPIAIJ in src/mat/impls/maij/maij.c
MatConvert_Nest_SeqAIJ_fast in src/mat/impls/nest/matnest.c
MatConvert_Nest_AIJ in src/mat/impls/nest/matnest.c
MatConvert_MPIAIJ_MPISBAIJ in src/mat/impls/sbaij/mpi/mpiaijsbaij.c
MatConvert_MPIBAIJ_MPISBAIJ in src/mat/impls/sbaij/mpi/mpiaijsbaij.c
MatConvert_SeqSBAIJ_SeqAIJ in src/mat/impls/sbaij/seq/aijsbaij.c
MatConvert_SeqAIJ_SeqSBAIJ in src/mat/impls/sbaij/seq/aijsbaij.c
MatConvert_SeqSBAIJ_SeqBAIJ in src/mat/impls/sbaij/seq/aijsbaij.c
MatConvert_SeqBAIJ_SeqSBAIJ in src/mat/impls/sbaij/seq/aijsbaij.c
MatConvert_MPISELL_MPIAIJ in src/mat/impls/sell/mpi/mpisell.c
MatConvert_MPIAIJ_MPISELL in src/mat/impls/sell/mpi/mpisell.c
MatConvert_SeqSELL_SeqAIJ in src/mat/impls/sell/seq/sell.c
MatConvert_SeqAIJ_SeqSELL in src/mat/impls/sell/seq/sell.c
MatConvert_Shell in src/mat/impls/shell/shellcnv.c

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