[petsc-dev] DACreate3d should work for 1 node in Z

Jed Brown jed at 59A2.org
Tue Apr 19 18:19:14 CDT 2011


On Wed, Apr 20, 2011 at 00:35, Ethan Coon <ecoon at lanl.gov> wrote:

> Ok, here's a patch that does the very very special case of:
>
> p=P=1, s > p, DMDA_BOUNDARY_PERIODIC in the z-direction.
>
> Note this is really only possible in the z-direction...
>

That is the case that you usually want, otherwise DMDAVecGetArray has rather
inefficient indexing.


> when in the
> z-direction, we can just check if the global index < 0 or > x*y*z and
> adjust appropriately.  So this can't generalize to x- or y- directions
> (though it could do the y-direction in the 2D case, allowing one to do
> 1D problems in a 2D algorithm?)
>
> Compared to the rest of the cruft in da3.c and how non-general the
> global index generation is overall, it's not actually that ugly...
>

We should all go unstructured for everything. Then we would have already
paid the storage cost of heavier data structures so many of the special
cases go away. :-)


>
> I've tested with s=2 and 3, BOX and STAR, and the indices look right
> (i.e. they are identical in the z-dimension).  But it's ugly, so please
> test with your stuff too Jed.
>

It seems to be working with Andrew's MHD code so I've pushed your
patch. Thank you Ethan.

Andrew, your code is running now with NZ=1. Your function evaluation still
evaluates to zero so SNESSolve is not doing any iterations. I assume there
is some other step to turn on your source terms.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20110420/48ce4531/attachment.html>


More information about the petsc-dev mailing list