[Dune] topology of triangles clockwise/anticlockwise

Leopold Stadler 23poldi23 at mailbox.org
Fri Jul 30 09:32:47 CEST 2021


Dear Dune developers and users,

writing out the topology for triangular mesh I noticed that ALUGrid uses a clockwise orientation for triangles while UGGrid uses the more common anticlockwise orientation. I use a XDMF/HDF5 writer, since vtk will produces too many single files when running large simulations (1000+ ranks).  

The clockwise orientation of triangles can be a problem for some pre-/postprocessing tools (e.g. Matplotlib.tri), wich assume that all triangles are sorted anticlockwise. It looks like the anticlockwise orientation is sometimes seen as a defacto standard. It is not a big deal for me to flip two nodes of each triangle during my python postprocesing to have an anticlockwise topology. 

I thought it would be a great idea to write out the topology with anticlockwise ordering when using ALUGrid. However, I'm not sure if this is true.  

1.) Can one assume that the orientation of the cells within a gridView is always clockwise/anticlockwise for all triangles? If so, is there a simple check for this?

2.) Why is the orientation (clockwise/anticlockwise) no issue for Dune? Are all methods/alogrithms independent from the orientation of elements? Or is there some magic method that flips the orientation if needed?

3.) Do you think it is a bad habit to assume that triangles are anticlockwise oriented? 

Best regards,

Leo




More information about the Dune mailing list