reading from xdmf file fails in debug build

Issue #418 resolved
Thomas Hisch created an issue
#meshwriter.py
import dolfin as do
mesh = do.UnitCubeMesh(4,4,4)
do.File('mesh.xml.gz') << mesh
subdomains = do.MeshFunction('size_t', mesh, 3, mesh.domains())
do.File('domains.xdmf') << subdomains
#meshreader.py
import dolfin as do
mesh = do.Mesh('mesh.xml.gz')
subdomains = do.MeshFunction('size_t', mesh, 'domains.xdmf')

In a debug build the second code snippet fails with the following assertion msg:

Traceback (most recent call last):
  File "meshreader.py", line 4, in <module>
    subdomains = do.MeshFunction('size_t', mesh, 'domains.xdmf')
  File "~/miniconda3/envs/py27/lib/python2.7/site-packages/dolfin/cpp/mesh.py", line 7221, in __new__
    return MeshFunctionSizet(*args)
  File "~/miniconda3/envs/py27/lib/python2.7/site-packages/dolfin/cpp/mesh.py", line 5543, in __init__
    _mesh.MeshFunctionSizet_swiginit(self,_mesh.new_MeshFunctionSizet(*args))
RuntimeError: 

*** Error:   Unable to complete call to function read_mesh_function().
*** Reason:  Assertion value_bits.size() == 5 failed.
*** Where:   This error was encountered inside ~/fenics/dev/dolfin/dolfin/io/XDMFFile.cpp (line 734).

Comments (4)

  1. Chris Richardson

    There seems to be a mistake when creating the XDMF. There is a line like this:

              <DataItem Format="HDF" Dimensions="384 1">domains.h5:domains.h5:/Mesh/0/values</DataItem>
    
  2. Log in to comment