# HDF5File multiple outputs

**URL:** <https://fenicsproject.discourse.group/t/hdf5file-multiple-outputs/1679>\
**Category:** I/O\
**Created:** [October 6, 2019, 6:13pm UTC](https://fenicsproject.discourse.group/t/hdf5file-multiple-outputs/1679 "2019-10-06T18:13:46Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ninnamon12](https://yyz2.discourse-cdn.com/free1/user_avatar/fenicsproject.discourse.group/ninnamon12/32/554_2.png) [@Ninnamon12](https://fenicsproject.discourse.group/u/Ninnamon12)\
**Post date:** [October 6, 2019, 6:13pm UTC](https://fenicsproject.discourse.group/t/hdf5file-multiple-outputs/1679/1 "2019-10-06T18:13:46Z")

</div>

I am looking for a way to save multiple Functions to the same HDF5File. I do not want to override the previous Functions but append them. My current file creation and writing to the file looks like the following.

> P1 = FiniteElement(“Lagrange”, mesh.ufl\_cell(), 1)  
> P2 = VectorElement(“Lagrange”, mesh.ufl\_cell() ,2)  
> P3 = FiniteElement(“Lagrange”, mesh.ufl\_cell() ,2)
> 
> T = FunctionSpace(mesh, P3)  
> VP = FunctionSpace(mesh, MixedElement([P2,P1]))  
> vp = Function(VP)  
> temp = Function(T)  
> file8 = HDF5File(comm, “output.h5”,“w”)  
> file8.write((vp, temp), “output.h5”,time)

I expected there to be an error

> Traceback (most recent call last):  
> File “primary.py”, line 241, in   
> file8.write((vp, temp), “output.h5”,time)  
> TypeError: in method ‘HDF5File\_write’, argument 2 of type ‘dolfin::Mesh const &’

I was wondering if there was a way to code this in one line or will it be two separate lines. Thank you.
