[petsc-users] working with different size of arrays in a single DA

Jed Brown jed at 59A2.org
Thu Apr 28 06:50:16 CDT 2011


On Thu, Apr 28, 2011 at 13:03, ilyas ilyas <ilyascfd at gmail.com> wrote:

> May be, It is a simple question, but I am little bit confused.
> If I have two different size of arrays (one is cell-based which is from 1
> to N,
> other one is face-based which is from 1 to N+1).
> How can  I create and work with them within a single DA structure,
> for example in evaluating a function or setting up a matrix ?
>

Two choices:

1. Increase the block size (number of components per node) and just write
the identity into the equatiosn for the "N+1" cell (which does not exist).
This will normally give better memory performance and the few extra trivial
equations around the margin are not a big deal.

2. Use two separate DAs and make the parallel decomposition compatible. You
can put them together into one system using DMComposite. This is usually
overkill for staggered grids, but extends to general multi-physics problems.
Support for this option is better in petsc-dev, see, for example,

http://www.mcs.anl.gov/petsc/petsc-as/snapshots/petsc-dev/src/snes/examples/tutorials/ex28.c.html
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20110428/d7b46bd5/attachment.htm>


More information about the petsc-users mailing list