[petsc-users] Extract subsection of DMDA

Christopher Thiele christopher.thiele at itwm.fraunhofer.de
Wed Nov 12 09:56:18 CST 2014


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?

Regards,
Christopher


More information about the petsc-users mailing list