dolfin-convert generates old-style XML?

Asked by Nico Schlömer

When converting a Gmsh-mesh with a mesh function using dolfin-xml with, e.g.,

$ dolfin-convert mymesh.msh mymesh.xml

"new style" XML-files should come out.
However, when trying to read in the generated file in parallel, the following error message appears

*** Error: Unable to read mesh function from XML file.
*** Reason: Reading old-style XML MeshFunctions is not supported in parallel. Consider using the new format.
*** Where: This error was encountered inside XMLMeshFunction.h.
*** Process: 0

This can be reproduced with the mesh at http://win.ua.ac.be/~nschloe/other/circles2d.msh and the Python lines

from dolfin import *
mesh = Mesh('circles2d.xml')
subdomains = MeshFunction('size_t', mesh, 'circles2d_physical_region.xml'

Question information

Language:
English Edit question
Status:
Solved
For:
DOLFIN Edit question
Assignee:
No assignee Edit question
Solved by:
Nico Schlömer
Solved:
Last query:
Last reply:
Revision history for this message
Jan Blechta (blechta) said :
#1

Workaround:
run your code serially, then
File('circles2d.xml') << mesh
File('circles2d_physical_region.xml') << subdomains

Then you can load these xml in parallel. Worked for me: http://artax.karlin.mff.cuni.cz/~blecj6am/dolfin_plot_1.png

Or you can fix gmsh2xml() in site-packages/dolfin_utils/meshconvert/meshconvert.py

Revision history for this message
Jan Blechta (blechta) said :
#2

File('circles2d.xml') << mesh

rewriting mesh is of cource pointless

Revision history for this message
Nico Schlömer (nschloe) said :
#3

This appears to work, thanks for the hint.
I had a brief look at gmsh2xml() and found the code somewhat involved, so I won't tackle a rewrite at this point. I'll file this as a bug though.