[petsc-users] reordering the dmda dof

Bishesh Khanal bisheshkh at gmail.com
Fri Oct 11 08:25:55 CDT 2013


On Fri, Oct 11, 2013 at 3:13 PM, Matthew Knepley <knepley at gmail.com> wrote:

> 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.
>

Thanks Matt, but I was trying to check if there is any problem in a matrix
I created. I had my old prototype code in MATLAB where I created a matrix
by having a block of rows for each dof. So as a quick test, I wanted to
write the matrix I created in Petsc to a file and read it with matlab and
compare the two matrices, taking a difference would help me spot errors
quickly.
Please let me know if there is a quick way to do that. And if there are
better ways to track down possible errors in the matrix creation by having
better visualization of elements of the matrix created in petsc (without
going to matlab), I'd be happy to learn that too.



> 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/91ed6894/attachment.html>


More information about the petsc-users mailing list