petsc-3.8.4 2018-03-24
Report Typos and Errors

MatDuplicateOption

Indicates if a duplicated sparse matrix should have its numerical values copied over or just its nonzero structure.

Synopsis

typedef enum {MAT_DO_NOT_COPY_VALUES,MAT_COPY_VALUES,MAT_SHARE_NONZERO_PATTERN} MatDuplicateOption;

Any additions/changes here MUST also be made in include/petsc/finclude/petscmat.h

  MAT_DO_NOT_COPY_VALUES    - Create a matrix using the same nonzero pattern as the original matrix, 
                              with zeros for the numerical values.
  MAT_COPY_VALUES           - Create a matrix with the same nonzero pattern as the original matrix 
                              and with the same numerical values.
  MAT_SHARE_NONZERO_PATTERN - Create a matrix that shares the nonzero structure with the previous matrix
                              and does not copy it, using zeros for the numerical values. The parent and 
                              child matrices will share their index (i and j) arrays, and you cannot 
                              insert new nonzero entries into either matrix.

Notes: Many matrix types (including SeqAIJ) do not support the MAT_SHARE_NONZERO_PATTERN optimization; in this case the behavior is as if MAT_DO_NOT_COPY_VALUES has been specified.

See Also

MatDuplicate()

Level:beginner
Location:
src/mat/../../include/petscmat.h
Index of all Mat routines
Table of Contents for all manual pages
Index of all manual pages

Examples

src/mat/examples/tutorials/ex9.c.html
src/ksp/ksp/examples/tutorials/ex5.c.html
src/ksp/ksp/examples/tutorials/ex58.c.html
src/tao/pde_constrained/examples/tutorials/elliptic.c.html
src/tao/pde_constrained/examples/tutorials/parabolic.c.html
src/tao/pde_constrained/examples/tutorials/hyperbolic.c.html