This is a read only copy of the old FEniCS QA forum. Please visit the new QA forum to ask questions

Poisson parallel matrix assembly

0 votes

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?

asked Nov 16, 2015 by str FEniCS User (1,600 points)

1 Answer

0 votes
 
Best answer

I would guess that this is most likely due to DOF reordering. i.e row 120 is now some other row (columns are swapped in the same manner).

You can use the function space dofmap to reorder the dofs back to their original position (NOTE: this may not be the same as the serial, it can have been reordered too!)

answered Nov 16, 2015 by Tormod Landet FEniCS User (5,130 points)
selected Nov 17, 2015 by str
...