petsc-3.13.6 2020-09-29
Report Typos and Errors

MatCreateKAIJ

Creates a matrix type to be used for matrices of the following form:

Synopsis

#include "petscmat.h" 
PetscErrorCode  MatCreateKAIJ(Mat A,PetscInt p,PetscInt q,const PetscScalar S[],const PetscScalar T[],Mat *kaij)
[I \otimes S + A \otimes T]

where S is a dense (p \times q) matrix T is a dense (p \times q) matrix A is an AIJ (n \times n) matrix I is the identity matrix The resulting matrix is (np \times nq)

S and T are always stored independently on all processes as PetscScalar arrays in column-major format.

Collective

Input Parameters

A - the AIJ matrix
p - number of rows in S and T
q - number of columns in S and T
S - the S matrix (can be PETSC_NULL), stored as a PetscScalar array (column-major)
T - the T matrix (can be PETSC_NULL), stored as a PetscScalar array (column-major)

Output Parameter

kaij -the new KAIJ matrix

Notes

This function increases the reference count on the AIJ matrix, so the user is free to destroy the matrix if it is not needed. Changes to the entries of the AIJ matrix will immediately affect the KAIJ matrix.

See Also

MatKAIJSetAIJ(), MatKAIJSetS(), MatKAIJSetT(), MatKAIJGetAIJ(), MatKAIJGetS(), MatKAIJGetT(), MATKAIJ

Level

advanced

Location

src/mat/impls/kaij/kaij.c

Examples

src/ksp/ksp/tutorials/ex74.c.html
src/ksp/ksp/tutorials/ex77.c.html

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