[petsc-users] DM vector restriction questions

Xiangdong epscodes at gmail.com
Sun May 25 19:23:27 CDT 2014


Hello everyone,

I have a questions about vectors in an DMDA with DOF>1. For example, in 1d
with number of grid N and DOF=2 (two fields u and v), the length of the
global vector is 2*N.

What is the best way to restrict this vector (length 2*N) to a vector
(length N) corresponding to the field u only?  This will help me obtain the
properties of field u by using VecSum and other vec functions.

With DMDAVecGetArray and looping over only u field can do the job. However,
I am just wondering whether any petsc function can provide either the
restriction matrix or the vector restricted to a single field.

Thank you.

Best,
Xiangdong
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20140525/43a09d36/attachment.html>


More information about the petsc-users mailing list