[petsc-users] Extract subsection of DMDA

Matthew Knepley knepley at gmail.com
Wed Nov 12 10:36:04 CST 2014


On Wed, Nov 12, 2014 at 9:56 AM, Christopher Thiele <
christopher.thiele at itwm.fraunhofer.de> wrote:

> Hello,
>
> I have a 3d DMDA and a vector created by DMCreateGlobalVector. I want to
> visualize and therefore export a subset of the values, i.e. I want to
> "remove" some points at the boundary. For example, if the DMDA
> represents the domain [0,1]^3, I want to extract [0.25,0.75]^3.
> I already tried to create another (smaller) DMDA, use DMDAVecGetArray on
> both of them and then copy the values. The problem is that the vectors
> are distributed differently, so this approach leads to segfaults.
> Is there another way to do this?
>

You can force the same layout using lx, ly, lz in the constructor. However,
this kind of clipping
is usually much easier in a visualization program.

  Thanks,

    Matt


> Regards,
> Christopher
>



-- 
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/20141112/fc564cdd/attachment.html>


More information about the petsc-users mailing list