[petsc-users] Question about I/O in PETSc

Dave May dave.mayhem23 at gmail.com
Sun Aug 26 01:04:10 CDT 2018


On Sun, 26 Aug 2018 at 03:54, Yingjie Wu <yjwu16 at gmail.com> wrote:

> Dear PETSc developer:
> Hello,
> I am a student of nuclear energy science from Tsinghua University. I want
> to do some work of neutron numerical simulation based on PETSc. At present,
> some examples of learning and testing PETSc have the following questions:
>
> 1. How to input data to PETSc conveniently?
>

What sort of data? Heavy data or stuff like model parameters / simulation
params / meta data?

For single values or relatively short arrays the methods
PetscOptionsGetInt()
and
PetscOptionsGetIntArray()
are useful. There are variants for real's, bool's and char's as well.

See

http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Sys/PetscOptionsGetInt.html

Options can be parsed from the command line or collected in a text file
which is parsed.

In some examples of VEC, PETSc support data input and output in .dat and
> HDF5 format. I don't know much about HDF5, and the binary data file I can't
> open with any software.
>

You can use matlab
See here

https://www.mcs.anl.gov/petsc/documentation/faq.html#matlab

I suggest following point b

Thanks,
  Dave


I need an easy-to-view input and output format, preferably a file format
> that can be opened with a text editor for subsequent analysis and data
> loading.
>

> I'm not very good at using "petsc-users" mailing list. I'm very sorry if I
> disturb you.
> And I am looking forward to your reply.
> Thanks,
> Yingjie
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20180826/ebcdc375/attachment.html>


More information about the petsc-users mailing list