On Tue, Apr 17, 2018 at 2:06 PM, Oleksandr Koshkarov <[email protected]>
wrote:

> Hello All,
>
> I have a 3d DMDA with big DOF number. I want to save one component of DOF
> to the file, however I see only a solution where I create 3D DMDA with
> DOF=1, then copy a slice and then save the resulting vector with VecView.
> There should be a simpler way. I hope you can help me with this :)
>

I would create the same DMDA with just 1 component (one line), get a vector
from it (one line),
call this to map your big vector to the smaller one (one line),


http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Vec/VecStrideGather.html

and VecView() it, so 4 lines instead of 1-2.

  Thanks,

     Matt

Thank you,
>
> Oleksandr Koshkarov.
>
>


-- 
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

https://www.cse.buffalo.edu/~knepley/ <http://www.caam.rice.edu/~mk51/>

Reply via email to