This is a read only copy of the old FEniCS QA forum. Please visit the new QA forum to ask questions

HDF5File doesn't work with Fenics 2017.1

0 votes

Hi,

I was used to use the HDF5File function with Fenics 2016 (see example bollow).

from fenics import*
mesh = Mesh("grain.xml")
grains = MeshFunction("size_t", mesh,"grain_physical_region.xml")
hdf = HDF5File(mesh.mpi_comm(), "file.h5","w")
hdf.write(mesh,"/mesh")
hdf.write(grains,"/grains")

Now I use Fenics 2017.1 and it doesn't work anymore. I get this error :

Traceback (most recent call last):
File "HDF.py", line 8, in
hdf = HDF5File(mesh.mpi_comm(), "file.h5","w")
NameError: name 'HDF5File' is not defined
Abandon (core dumped)

I saw here Saving boundary-markers to HDF in FEniCS 2017.1 that it seems to work.
Can anybody help me with this issue?

Thanks

asked Jun 14, 2017 by emile FEniCS Novice (120 points)

You probably have a DOLFIN installation without support for HDF5. How did you install FEniCS?

Hey

we've installed this last version with Anaconda from Continuum Analytics and Python 2.7

conda create --name fenics                                  
conda info --envs                                       
source activate fenics                                          

conda install python=2.7.13                                 
conda install matplotlib numpy scipy mkl                            

conda install -c conda-forge fenics                     
conda install -c conda-forge mshr                                   

conda install -c conda-forge hdf5                                   

as explained on FEniCS website

we also have installed hdf5 package but there are only shared libraries with this package
no python file and HDF5File function

Thanks

The conda package is not linked against HDF5 (see issue #5).

This is fixed now. Please update to the latest fenics conda package.

ok I'm going to update our FEniCS installations witch Anaconda, we'll make you a feedback

...