[petsc-users] DMComposite and Matrix construction

Gideon Simpson gideon.simpson at gmail.com
Tue Jul 28 21:02:44 CDT 2015

I’m working with a DMComposite where I have a DMRedundant with 2 parameters, and then a standard DMDACreate with some number of entires that I would like to have distributed.  For concreteness, suppose it is 

DMCompositeCreate(PETSC_COMM_WORLD, &packer);
DMRedundantCreate(PETSC_COMM_WORLD, 0, 2, &p_dm);

Now, I would like to construct a matrix for this problem that can be used for computing Jacobians in a nonlinear solve.  Is there a way to get the matrix size to layout in a “useful” way, in the sense that the first process, which owns the two degrees of freedom of p_dm and the first N0 number of the rows of u_dm, controls the corresponding N0+2 rows of the matrix, and analgously for the second process has the next N1 rows of the u_dm vector, and has the next N1 rows of the matrix?


More information about the petsc-users mailing list