Ok, I ended up using David Well's suggestion on using
std::map<Node*,std::set<Elem*> > to map out a node in the mesh to set of
elements sharing that node. Similar stuff for edge --> elements mapping.

The sample code is here:
https://paste.ofcode.org/36JLbnSn4cqFwGJaMyhzLsy

On Mon, Dec 30, 2019 at 11:58 AM Stogner, Roy H <royst...@ices.utexas.edu>
wrote:

>
> On Wed, 25 Dec 2019, Amneet Bhalla wrote:
>
> > I am working with triangulated surfaces in 3D, and I need to:
> >
> > 1) Calculate angle-weighted normals at the vertex points, and
> >
> > 2) Calculate average of normals of two triangles sharing an edge.
> >
> > For both cases, I think I would need to know all elements sharing a
> common
> > vertex, and two elements sharing a common edge, respectively. Can this
> > information extracted from libMesh?
>
> For (1) the answer can be *no* in the case of a distributed mesh with
> default ghosting, but if you use a replicated mesh or you have a
> ghosting functor that includes point neighbors then you can use
> Elem::find_point_neighbors().
>
> For (2) you just use Elem::neighbor_ptr().
> ---
> Roy
>


-- 
--Amneet

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

Reply via email to