Manav Bhatia <bhatiama...@gmail.com> writes: > Hi, > > I have quick questions about MatCreateSubMatrix: > > — Once the sub matrix is created, do I need to keep the IS (isrow and iscol) > in memory till this matrix is active, or can I destroy it immediately after > the creation of the matrix and continue to use the matrix?
You don't need to keep them. > — Is the assembly begin/end supposed to be called on the submatrix or the > original full matrix? Is it a problem is I call this on both? I think you're referring to MatCreateSubMatrixVirtual, and you only need to assemble on the outer matrix. > — If I modify values in the sub matrix, would these be reflected in the > original matrix after assembly begin/end, or do I need to do something else > for that to happen? Normally you would only call MatSetValues* on the virtual submatrix. I hope src/snes/examples/tutorials/ex28.c answers further questions by way of example, but let us know if not.