#include "petscdm.h" #include "petscdmlabel.h" PetscErrorCode DMCreateMatrix(DM dm,Mat *mat)Collective on DM Many br
Many br
Notes: This properly preallocates the number of nonzeros in the sparse matrix so you Many brdo not need to do it yourself. Many br
By default it also sets the nonzero structure and puts in the zero entries. To prevent setting Many brthe nonzero pattern call DMDASetMatPreallocateOnly() Many br
For structured grid problems, when you call MatView() on this matrix it is displayed using the global natural ordering, NOT in the ordering used Many brinternally by PETSc. Many br
For structured grid problems, in general it is easiest to use MatSetValuesStencil() or MatSetValuesLocal() to put values into the matrix because MatSetValues() requires Many brthe indices for the global numbering for DMDAs which is complicated. Many br
Level:beginner
Location:src/dm/interface/dm.c
Index of all DM routines
Table of Contents for all manual pages
Index of all manual pages