From: Roy Stogner <roystgnr@ic...>  20091029 14:53:30

On Thu, 29 Oct 2009, Tim Kroeger wrote: > > Is there any easy way to loop over all elems that are neighbors of a > given elem accross either a face or an edge? As fas as I understand, > Elem::neighbor() only cares about neighbors accross faces. On the > other hand, Elem::find_point_neighbors() does too much. I think, it > should be easy to implement a method Elem::find_edge_neighbors() > analogously to Elem::find_point_neighbors(), where just each call to > Elem::contains_vertex_of() is replaced with a call to > Elem::contains_edge_of(), the latter is implemented analogously to > Elem::contains_vertex_of() with the only difference that for returning > true, it requires at least *two* vertices of the one element contained > to be contained in the other. What do you guys think? If you agree > that this would be correct, I'd be happy to do this (easy and > straightforward) task. Sounds good... Something that needs thought, though: there's a limitation in find_point_neighbors() which will become a more significant limitation in find_edge_neighbors(): behavior on adaptive meshes. With find_point_neighbors, an elem can share a point with its neighbor without sharing any nodes with its neighbor, for some firstorder elements two levels apart or some secondorder elements three levels apart. This is only a minor problem for our patch recovery estimator, which doesn't quite grow patches in the most optimal way, so I never worried about it. With find_edge_neighbors, an elem can share part of an edge with its neighbor without sharing a pair of nodes with its neighbor, this time for any firstorder elements one level apart or any secondorder elements two levels apart. I don't know what you'd be using find_edge_neighbors for, though, so I don't know if this is a problem.  Roy 