[petsc-users] reordering the dmda dof

Matthew Knepley knepley at gmail.com
Fri Oct 11 08:13:42 CDT 2013


On Fri, Oct 11, 2013 at 8:09 AM, Bishesh Khanal <bisheshkh at gmail.com> wrote:

> Dear all,
> By default, dmda puts all dof at a given node logically in consecutive
> order. The corresponding vectors and matrices created also follow this
> order. What should I do to change it so that it puts all the grid nodes for
> a 1st dof consecutively, then do the same for 2nd dof and so on. I also
> want the same behavior for the matrix it creates so that the rows
> corresponding to a particular dof are put in a consecutive manner instead
> of interleaving different dofs.
>

What do you really want to accomplish? This ordering is disastrous for
cache architectures.

1) If you want segregated solves, use PCFIELDSPLIT.

2) If you want to mess around with a single field, use
VecStrideGather/Scatter():
http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Vec/VecStrideGather.html

  Thanks,

     Matt

Thanks,
> Bishesh
>



-- 
What most experimenters take for granted before they begin their
experiments is infinitely more interesting than any results to which their
experiments lead.
-- Norbert Wiener
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20131011/3ce3e32b/attachment.html>


More information about the petsc-users mailing list