[petsc-users] VecLoad into a SubVector ?

Matthew Knepley knepley at gmail.com
Mon Jul 27 19:06:19 CDT 2020


On Mon, Jul 27, 2020 at 6:09 PM Sajid Ali <sajidsyed2021 at u.northwestern.edu>
wrote:

> Hi PETSc-developers,
>
> When I load data (using VecLoad) into a subvector, the parent vector does
> not seem to get the data after the subvector is restored. I tried doing a
> VecSet to verify that the index set (used to select the subvector) is valid
> and the values set by VecSet are transferred back to the parent vector.
> Could anyone point out if I'm missing something when I try transferring the
> data via a VecLoad from a subvector to the parent vector ?
>
> I'm attaching the code for selecting the subvector and loading data along
> with a test hdf5 file (filled with random values). I expect the output
> `testload.h5` to be a vector of size 100 with the first 50 being 1 and the
> rest being the input values.
>

You should be able to see with the debugger why the update does not happen.
My guess is that the state is not updated. It should be updated
by VecReplaceArray(), so I do not understand, but you should be able to see
it clearly in gdb.

  Thanks,

     Matt


> Thank You,
> Sajid Ali | PhD Candidate
> Applied Physics
> Northwestern University
> s-sajid-ali.github.io
>


-- 
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.cse.buffalo.edu/~knepley/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20200727/dd9aee82/attachment.html>


More information about the petsc-users mailing list