<div dir="ltr"><div><div>Hi all,<br><br></div>I created a DMComposite using two DMDAs (representing the x and y components of velocity in a 2-D staggered cartesian grid used for CFD simulations). DMCompositeGetISLocalToGlobalMappings gives me the global indices of the elements and ghost cells, which I can use to set up a matrix that operates on the vector created with the DMComposite. I obtain the correct global indices for all the interior points. But when I look at the global indices of the ghost cells, the ones outside the domain from the x-component DM return -1, but the ones outside the domain from the y-component DM return a positive value (which seems to be the largest global index of the interior points on Process 0). My question is: Why do they not return -1? Wouldn't that make matrix assembly easier (since MatSetValues ignores negative indices)? I have attached a code which demonstrates the above.<br>

<br></div><div>On a related note: Is it possible to use MatSetValuesStencil for assembling a block diagonal matrix that operates on a vector created using the above DMComposite?<br></div><div><br></div><div>Thanks,<br></div>

<div>Anush<br></div></div>