Skip to main content

A tiny package to modify the node order of quadratic triangles and tets in a xdmf-hdf mesh to work with FEniCS/DOLFIN.

Project description


There is an xdmf import issue in FEniCS/DOLFIN. Quadratic triangles and tetrahedrons are imported incorrectly. The CLI tool xdmf-dolfin-fix fixes this issue by reordering element numbers.

Example usage

xdmf-dolfin-fix old.xdmf            # fix old.xdmf
xdmf-dolfin-fix old.xdmf new.xdmf   # create fixed new.xdmf
xdmf-dolfin-fix old.geo -d3         # create fixed old.xdmf from gmsh
xdmf-dolfin-fix old.msh new.xdmf    # create fixed new.xdmf from gmsh


At some point of the simulation FEniCS/DOLFIN orders the vertices of all elements in numerically accending order. Nodes on the edges of elements -- as present in quadratic triangles and quadratic tetrahedrons -- are not swapped.

So internally, the node numbers of an arbitrary quadratic tetrahedron

[ vertices |    edges   ]
[ 51 74 12 | 14 72 1003 ]

would be reordered to

[ 12 51 74 | 14 72 1003 ]

Now, the vertex nodes [12 51 74] are sorted, but the edge nodes [14 72 1003] are left unchanged. This results in a twisted geometry.


xdmf-dolfin-fix sorts the vertex nodes and reorders the edge nodes accordingly. This will result in

[ 12 51 74 | 1003 14 74 ]

A further sorting within DOLFIN has no effect and, thus, will not mess up this ordering.

Project details

Release history Release notifications

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for xdmf-dolfin-fix, version 0.6.2
Filename, size File type Python version Upload date Hashes
Filename, size xdmf_dolfin_fix-0.6.2-py3-none-any.whl (9.4 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size xdmf-dolfin-fix-0.6.2.tar.gz (6.1 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page