# Function write and read

**URL:** <https://fenicsproject.discourse.group/t/function-write-and-read/9650>\
**Category:** I/O\
**Created:** [October 31, 2022, 9:57pm UTC](https://fenicsproject.discourse.group/t/function-write-and-read/9650 "2022-10-31T21:57:35Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![bay\_swiss](https://yyz2.discourse-cdn.com/free1/user_avatar/fenicsproject.discourse.group/bay_swiss/32/8778_2.png) [@bay\_swiss](https://fenicsproject.discourse.group/u/bay_swiss)\
**Post date:** [October 31, 2022, 9:57pm UTC](https://fenicsproject.discourse.group/t/function-write-and-read/9650/1 "2022-10-31T21:57:35Z")

</div>

Hello everyone,

I have a simple question: can a dolfinx function, after being exported in a (for example) xdmf file with write\_function(), be read in another code?  
I don’t need that specific format, but I need the possibility to export a function and import it later.

I think that I could handle this with PETSc vectors, but I wonder if there is a more straightforward way with dolfinx.

Thank you very much

---

<div class="post-metadata">

**Author:** ![dokken](https://yyz2.discourse-cdn.com/free1/user_avatar/fenicsproject.discourse.group/dokken/32/1560_2.png) [@dokken](https://fenicsproject.discourse.group/u/dokken)\
**Post date:** [November 1, 2022, 8:28pm UTC](https://fenicsproject.discourse.group/t/function-write-and-read/9650/2 "2022-11-01T20:28:50Z")

</div>

For now I would suggest using PETSc: [I/O from XDMF/HDF5 files in dolfin-x - #23 by hawkspar](https://fenicsproject.discourse.group/t/i-o-from-xdmf-hdf5-files-in-dolfin-x/3122/23)

Checkpointing is on the DOLFINx roadmap for 2023, and anyone who would like to make a contribution is very welcome to do so.
