Iterate over edges of triangulation

26 views
Skip to first unread message

Joshua Hansel

unread,
Jun 26, 2015, 4:28:27 PM6/26/15
to dea...@googlegroups.com
Hi, I was wondering if there were any way to iterate over the edges of the triangulation directly; currently the only way I know to loop over edges is to loop over cells, then faces in that cell, then edges in that face. However, if an edge is shared by multiple cells, this approach would access that edge multiple times, which I'd like to avoid, since it just duplicates the operations I'm performing on the edge.

Thanks,
Joshua Hansel

Wolfgang Bangerth

unread,
Jun 26, 2015, 5:14:02 PM6/26/15
to dea...@googlegroups.com
You can directly access the edges of a cell via
cell->line(l)
without going through faces. There is, however, no way to iterate over
the edges directly. The usual way would be to set a user flag on each
edge you encounter, and only work on those for which the user flag is
not set. Then, clear the user flags at the end of the process (there is
a function in Triangulation that clears all of these user flags at once).

Best
W.

--
------------------------------------------------------------------------
Wolfgang Bangerth email: bang...@math.tamu.edu
www: http://www.math.tamu.edu/~bangerth/

Reply all
Reply to author
Forward
0 new messages