<div class="gmail_quote">On Thu, Apr 28, 2011 at 13:03, ilyas ilyas <span dir="ltr"><<a href="mailto:ilyascfd@gmail.com">ilyascfd@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div>May be, It is a simple question, but I am little bit confused.</div><div>If I have two different size of arrays (one is cell-based which is from 1 to N,</div><div><div>other one is face-based which is from 1 to N+1).</div>
<div>How can I create and work with them within a single DA structure, </div><div>for example in evaluating a function or setting up a matrix ? </div></div></blockquote></div><br><div>Two choices:</div><div><br></div><div>
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.</div>
<div><br></div><div>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,</div>
<div><br></div><div><a href="http://www.mcs.anl.gov/petsc/petsc-as/snapshots/petsc-dev/src/snes/examples/tutorials/ex28.c.html">http://www.mcs.anl.gov/petsc/petsc-as/snapshots/petsc-dev/src/snes/examples/tutorials/ex28.c.html</a></div>