← Back to team overview

dolfin team mailing list archive

dolfin-convert, fix

 

I fixed the dolfin-convert script and changes the code between 268 and 304 like this:

       elif state == 4:
           num_cells  = int(line)
           if num_cells == 0:
               print "No cells found in gmsh file."
break else: write_header_cells(ofile, num_cells) state += 1
       elif state == 5:
           element = line.split()
       cell_type = int(element[1])
           if cell_type == 2:
               nn = [int(node) for node in element[5:8]]
               for node in nn:
                   if not node in nodelist:
error("Vertex %d of triangle %d not previously defined." % (node, num_cells_read))
               n0 = nodelist[nn[0]]
               n1 = nodelist[nn[1]]
               n2 = nodelist[nn[2]]
               write_cell_triangle(ofile, num_cells_read, n0, n1, n2)
           elif cell_type == 4:
               nn = [int(node) for node in element[5:9]]
               for node in nn:
                   if not node in nodelist:
error("Vertex %d of tetrahedron %d not previously defined." % (node, num_cells_read))
               n0 = nodelist[nn[0]]
               n1 = nodelist[nn[1]]
               n2 = nodelist[nn[2]]
               n3 = nodelist[nn[3]]
write_cell_tetrahedron(ofile, num_cells_read, n0, n1, n2, n3)

           num_cells_read +=1
           if num_cells == num_cells_read:
write_footer_cells(ofile) state += 1
       elif state == 6:
           break

no it works for me and does not loose a vertex in 2d...

cheers

Alex

--
Alexander H. Jarosch

Jarðvísindastofnun Háskólans
Institute of Earth Sciences, University of Iceland
Náttúrufræðahús, Askja
Building of Natural Sciences, Askja
Sturlugata 7
IS - 101 Reykjavík
Iceland

Tel.: +354 525 4906
http://raunvis.hi.is/~jarosch/