Replace this with
A=fem.petsc.assemble_matrix(a, bcs=[bc])
The other assemble matrix is for the built-in sparse matrix in DOLFINx, Which does not support block size (vector spaces) or Dirichlet BCs yet.
Replace this with
A=fem.petsc.assemble_matrix(a, bcs=[bc])
The other assemble matrix is for the built-in sparse matrix in DOLFINx, Which does not support block size (vector spaces) or Dirichlet BCs yet.