[petsc-dev] DMDA_*PERIODIC and DMDA_XYZGHOSTED

Jed Brown jed at 59A2.org
Tue Dec 7 16:50:02 CST 2010


On Tue, Dec 7, 2010 at 23:41, Ethan Coon <ecoon at lanl.gov> wrote:

> This probably doesn't merit a change in the DMDACreate* API (it would
> affect a very large amount of user code).  The most obvious alternative
> to an API change would be a larger, somewhat convoluted enum for the
> PeriodicType (DMDA_XPERIODIC_YGHOSTED, DMDA_XYGHOSTED, etc) which could
> at least be made backward compatible.
>

I think I prefer

enum {
NONPERIODIC = 0,
XGHOSTED = 0x1,
XPERIODIC = 0x3,
YGHOSTED = 0x4,
YPERIODIC = 0xc,
ZGHOSTED = 0x10,
ZPERIODIC = 0x11,
}

DMDACreate3D(...,XPERIODIC | YGHOSTED,...).

would produce periodic in X, ghosted in Y, and no endpoint ghosts (but still
internal neighbors) in Z.

If you really wanted, you could

#define DMDA_YZPERIODIC (DMDA_YPERIODIC | DMDA_ZPERIODIC)

but I don't think it's a big deal (users can do that if they want, but it's
working around an awkward initial API choice).

Handling anisotropic stencil width would be useful for some problems, but
it's a much bigger effort.

Jed
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20101207/a7ffb71c/attachment.html>


More information about the petsc-dev mailing list