dolfin-convert crashes on meshes generated by triangle

Bug #1063836 reported by Patrick Farrell
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
DOLFIN
Fix Released
Undecided
Unassigned

Bug Description

Consider trying to use a simple mesh generated by triangle:

[pef@aislinn:/tmp]$ cat simple.node
4 2 0 0
0 0 0
1 0 1
2 1 0
3 1 1
[pef@aislinn:/tmp]$ triangle simple.node
Opening simple.node.
Constructing Delaunay triangulation by divide-and-conquer method.
Delaunay milliseconds: 0

Writing simple.1.node.
Writing simple.1.ele.

Output milliseconds: 0
Total running milliseconds: 0

Statistics:

  Input vertices: 4

  Mesh vertices: 4
  Mesh triangles: 2
  Mesh edges: 5
  Mesh exterior boundary edges: 4

[pef@aislinn:/tmp]$ dolfin-convert simple.1.node simple.xml
Converting from Triangle format {.node, .ele} to DOLFIN XML format
Expecting 4 vertices
Found all vertices
Expecting 2 cells
Traceback (most recent call last):
  File "/usr/bin/dolfin-convert", line 131, in <module>
    main(sys.argv[1:])
  File "/usr/bin/dolfin-convert", line 78, in main
    meshconvert.convert2xml(ifilename, ofilename, iformat=iformat)
  File "/usr/lib/python2.7/dist-packages/dolfin_utils/meshconvert/meshconvert.py", line 1154, in convert2xml
    convert(ifilename, XmlHandler(ofilename), iformat=iformat)
  File "/usr/lib/python2.7/dist-packages/dolfin_utils/meshconvert/meshconvert.py", line 1178, in convert
    triangle2xml(ifilename, ofilename)
  File "/usr/lib/python2.7/dist-packages/dolfin_utils/meshconvert/meshconvert.py", line 563, in triangle2xml
    write_cell_triangle(ofile, tri+tri_off, tri_t[0] + node_off,
NameError: global name 'write_cell_triangle' is not defined

I've attached a (very simple) patch.

Related branches

Revision history for this message
Patrick Farrell (pefarrell) wrote :
Revision history for this message
Andy R Terrel (andy-terrel) wrote :

That's embarrassing. Do we not run tests on the supplied meshes in scripts/dolfin-convert ?

Johan Hake (johan-hake)
Changed in dolfin:
status: New → In Progress
Johan Hake (johan-hake)
Changed in dolfin:
status: In Progress → Fix Committed
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.