On Wed, 21 Oct 2020, John Peterson wrote:
On Wed, Oct 21, 2020 at 12:39 PM Laura Scarabosio <
laura.scarabo...@gmail.com> wrote:
I would like to find the neighbors of a mesh element including those that
share a vertex only with that element, not only those that share an edge
with the element (so the method neighbor_ptr does not help). Is there a way
to do this?
This information (point neighbors) isn't stored in the Mesh by default
since it isn't needed in most cases. You may want to look into calling
MeshTools::build_nodes_to_elem_map()
which builds a data structure which associates, to each Node, a vector of
connected Elem ids. It's a bit expensive to build this map, so best to do
it only once and then use it each time you need to find a point neighbor.
We do also have Elem::find_point_neighbors() - not as efficient on CPU
if you need to do a lot of lookups, but it avoids building the map.
---
Roy
_______________________________________________
Libmesh-users mailing list
Libmesh-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libmesh-users