I suggest storing the FunctionSpace data under unique identifiers from
hashing the Mesh and FiniteElement, separate from the Function.

When writing a new Function to the HDF5File, it can easily be checked
whether the FunctionSpace data exists. If not, write it.

This should work without modifying the read-functionality, and for many
functions from different meshes, function spaces and number of processes.


-Øyvind


2013/9/28 Chris Richardson <[email protected]>

>
> This is a continuation of the discussion at:
>
> https://bitbucket.org/fenics-**project/dolfin/pull-request/52<https://bitbucket.org/fenics-project/dolfin/pull-request/52>
>
> The question is how best to save a time-series of Function in HDF5, when
> the cell and dof layout remains constant.
>
> It has been suggested to use:
>
> u = Function(V)
> h0 = HDF5File('Timeseries_of_**Function.h5', 'w')
> h0.write(u, '/Function')
> # Then later
> h0.write(u.vector(), "/Vector/0")
> h0.write(u.vector(), "/Vector/1")
>
> and to read back:
>
> u = Function(V)
> h0 = HDF5File('Timeseries_of_**Function.h5', 'r')
> h0.read(u, "/Function")
> h0.read(u.vector(), "/Function/vector")
>
> The problem with this, is not so much the saving of the vector, but the
> reading back. It works OK if the vector is distributed in the same way, but
> will fail
> in the general case.
>
> To fix the problem, there needs to be some kind of connection between the
> original Function and the subsequent Vectors. This could be provided at
> write time, by storing a link back to the original Function when writing a
> Vector, or at read time by specifying a base Function and an alternative
> Vector to read.
>
> Chris R.
> ______________________________**_________________
> fenics mailing list
> [email protected]
> http://fenicsproject.org/**mailman/listinfo/fenics<http://fenicsproject.org/mailman/listinfo/fenics>
>
_______________________________________________
fenics mailing list
[email protected]
http://fenicsproject.org/mailman/listinfo/fenics

Reply via email to