[petsc-users] Loading external array data into PETSc

Matthew Knepley knepley at gmail.com
Wed Mar 3 16:01:57 CST 2021


On Wed, Mar 3, 2021 at 4:23 PM Smit Thijs <thijs.smit at hest.ethz.ch> wrote:

> Hi All,
>
>
>
> I would like to readin a fairly large external vector into PETSc to be
> used further. My idea was to write a hdf5 file using Python with the vector
> data. Then read that hdf5 file into PETSc using PetscViewerHDF5Open and
> VecLoad. Is this the advised way or is there a better alternative to
> achieve the same (getting this external array data into PETSc)?
>

I think there are at least two nice ways to do this:

1) Use HDF5. Here you have to name your vector to match the HDF5 object

2) Use raw binary. This is a specific PETSc format, but it is fast and
simple.

  Thanks,

    Matt


> Best regards,
>
>
>
> Thijs Smit
>
>
>
> PhD Candidate
>
> ETH Zurich
>
> Institute for Biomechanics
>
>
>


-- 
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/20210303/0927a8db/attachment.html>


More information about the petsc-users mailing list