I would like to extract the stiffness matrix from the Poisson demo in parallel.
I tried to assemble the a(V,V) form into a PETScMatrix in parallel and non-parallel, but unfortunately didn't get the same J matrix.
PETScMatrix JJ;
assemble(JJ,a);
Mat J = JJ.mat();
PetscViewer viewer;
MatView(J,viewer);
For example on a 10x10 mesh:
non-parallel:
row 120: (118, -0.5) (119, -0.5) (120, 1)
parallel:
row 120: (0, -0.5) (115, -1) (116, -0.5) (119, 0) (120, 2)
What's the reason for that, and how could I extract the same matrix in parallel?