Exporting Matrices of AS method for Poisson Equation

The restriction is the list of indices in the Outer subdomain: that you get with -ksp_view. You can define in your external solver a matrix of dimension (size of local matrix, that you get in the -ksp_view as well) x (size of global matrix, in your case 5654). Then, you just fill with ones for all lines at each column index given in the -ksp_view.