# failure to read xdmf files generated by Fenics

**URL:** https://discourse.paraview.org/t/failure-to-read-xdmf-files-generated-by-fenics/4928
**Category:** ParaView Support
**Tags:** vtk
**Created:** [July 23, 2020, 12:07am UTC](https://discourse.paraview.org/t/failure-to-read-xdmf-files-generated-by-fenics/4928 "2020-07-23T00:07:32Z")
**Posts on this page:** 1
**Showing post:** 4

<div class="post-metadata">

### Author: ![azerad](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/a/db5fbb/32.png) [@azerad](https://discourse.paraview.org/u/azerad)
#### Post date: [July 23, 2020, 8:28am UTC](https://discourse.paraview.org/t/failure-to-read-xdmf-files-generated-by-fenics/4928/4 "2020-07-23T08:28:51Z")

</div>

Seems I didn’t generate the xdmf file correctly.  
I did it in python with the following commands:

# First I create the file before my time loop

xdmffile\_u = XDMFFile(‘velocity.xdmf’)

# then I save the time values within the time loop to file (XDMF/HDF5)

```
xdmffile_u.write(u, t)

```

Thanks to [https://fenicsproject.discourse.group/t/loading-xdmf-file-in-paraview/2291](https://fenicsproject.discourse.group/t/loading-xdmf-file-in-paraview/2291)

# I solved the issue inserting the command

**xdmffile\_u.parameters[“flush\_output”] = True**

just after the file creation:

xdmffile\_u = XDMFFile(‘velocity.xdmf’)  
xdmffile\_u.parameters[“flush\_output”] = True

Now all three xdmf readers work correctly. No need to use xdfm3 btw.

---

_[View the full topic](https://discourse.paraview.org/t/failure-to-read-xdmf-files-generated-by-fenics/4928)._
