On Fri, Oct 30, 2015 at 9:50 AM, Xujun Zhao <xzha...@gmail.com> wrote:

> Hi all,
>
> I want to find the neighboring nodes that are connected with an specific
> node i. Does libMesh have functions to do this? Thank you very much.


Yes.

// find_nodal_neighbors() needs a data structure which is prepared by
another function
std::vector<std::vector<const Elem*> > nodes_to_elem_map;
MeshTools::build_nodes_to_elem_map(mesh, nodes_to_elem_map);

// Then you can call (*node is a reference to the node whose neighbors you
want):
std::vector<const Node*> neighbors;
MeshTools::find_nodal_neighbors(mesh, *node, nodes_to_elem_map, neighbors);

-- 
John
------------------------------------------------------------------------------
_______________________________________________
Libmesh-users mailing list
Libmesh-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libmesh-users

Reply via email to