Unreadable mesh files in dolfin repository

Bug #1095687 reported by Martin Sandve Alnæs
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
DOLFIN
Fix Released
Low
Martin Sandve Alnæs

Bug Description

Looking at <dolfin trunk>/data/meshes/, there are meshes that cannot be loaded by dolfin because the tag meshfunction has been changed to mesh_function, see example with cylinder.xml.gz below. Has the mesh file format been deliberately made incompatible for such a small estethic issue? Seems like a bad idea to break compatibility like this. Is there a way to update mesh files to the new format? dolfin-convert doesnt seem to do the job.

In [1]: from dolfin import *

In [2]: mesh = Mesh("cylinder.xml.gz")
---------------------------------------------------------------------------
RuntimeError Traceback (most recent call last)
<ipython-input-2-2b33cf4c68b9> in <module>()
----> 1 mesh = Mesh("cylinder.xml.gz")

/home/martinal/opt/fenics/dorsal-unstable/lib/python2.7/site-packages/dolfin/mesh/meshes.pyc in __init__(self, *args, **kwargs)
     91
     92 # Initialize base class
---> 93 cpp.Mesh.__cppinit__(self, *args, **kwargs)
     94
     95 # Change mesh constructor

/home/martinal/opt/fenics/dorsal-unstable/lib/python2.7/site-packages/dolfin/cpp/mesh.pyc in __init__(self, *args)
   1840
   1841 """
-> 1842 _mesh.Mesh_swiginit(self,_mesh.new_Mesh(*args))
   1843 __swig_destroy__ = _mesh.delete_Mesh
   1844 def num_vertices(self, *args):

RuntimeError:

*** -------------------------------------------------------------------------
*** DOLFIN encountered an error. If you are not able to resolve this issue
*** using the information listed below, you can ask for help at
***
*** https://answers.launchpad.net/dolfin
***
*** Remember to include the error message listed below and, if possible,
*** include a *minimal* running example to reproduce the error.
***
*** -------------------------------------------------------------------------
*** Error: Unable to read mesh data from XML file.
*** Reason: The XML tag <meshfunction> has been changed to <mesh_function>.
*** Where: This error was encountered inside XMLMesh.cpp.
*** Process: 0
*** -------------------------------------------------------------------------

Revision history for this message
Martin Sandve Alnæs (martinal) wrote :

The only affected meshes from data/meshes/ were cylinder.xml.gz and rotator.xml.gz. I fixed those.

Revision history for this message
Anders Logg (logg) wrote : Re: [Bug 1095687] Re: Unreadable mesh files in dolfin repository

On Thu, Jan 03, 2013 at 04:04:52PM -0000, Martin Sandve Alnæs wrote:
> The only affected meshes from data/meshes/ were cylinder.xml.gz and
> rotator.xml.gz. I fixed those.

Thanks. The change in syntax was made a long time ago for
consistency. I think it's been at least 2 years.

--
Anders

Revision history for this message
Garth Wells (garth-wells) wrote :

We should have unit tests for the meshes in data/

Garth

On Thu, Jan 3, 2013 at 4:04 PM, Martin Sandve Alnæs
<email address hidden> wrote:
> The only affected meshes from data/meshes/ were cylinder.xml.gz and
> rotator.xml.gz. I fixed those.
>
> --
> You received this bug notification because you are a member of DOLFIN
> Core Team, which is subscribed to DOLFIN.
> https://bugs.launchpad.net/bugs/1095687
>
> Title:
> Unreadable mesh files in dolfin repository
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/dolfin/+bug/1095687/+subscriptions

Changed in dolfin:
status: New → Fix Released
status: Fix Released → Fix Committed
importance: Undecided → Low
assignee: nobody → Martin Sandve Alnæs (martinal)
milestone: none → 1.1.0
Changed in dolfin:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.