Finding unconnected regions in a triangulation

12 views
Skip to first unread message

Kaushik Das

unread,
Jul 10, 2023, 10:33:21 AM7/10/23
to deal.II User Group
Hi all,
Is there any way to find or count number of unconnected regions in a triangulation. Triangulation will have non zero refinement levels. 
Thanks,
Kaushik 

Bruno Turcksin

unread,
Jul 10, 2023, 11:43:24 AM7/10/23
to deal.II User Group
Kaushik,

You could use get_face_connectivity_of_cells() or get_vertex_connectivity_of_cells() (depending on what you mean by connected) to have a sparsity pattern. This maps to a graph where the nodes are the cells, now you just need to check if the graph is connected see here

Best,

Bruno

Kaushik Das

unread,
Jul 10, 2023, 1:01:29 PM7/10/23
to dea...@googlegroups.com
Hi   Bruno, thank you very much for your quick reply. This is what I was looking for. Thanks. But I have another question, is there a way the generate these graph by only considering a subset of cells from a triangulation? Like cells that has a specific fe_index or material_id or flags? Thank you. 

--
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see https://groups.google.com/d/forum/dealii?hl=en
---
You received this message because you are subscribed to a topic in the Google Groups "deal.II User Group" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/dealii/gQH57TWRGP0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to dealii+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dealii/c77b5d42-9228-497a-ab2b-2ac25dc06fb7n%40googlegroups.com.

Daniel Arndt

unread,
Jul 10, 2023, 1:07:25 PM7/10/23
to dea...@googlegroups.com
Kaushik,

The implementation for those functions is pretty simple so it shouldn't be too hard to modify them to meet your needs, see https://dealii.org/current/doxygen/deal.II/grid__tools_8cc_source.html#l03828.

Best,
Daniel

You received this message because you are subscribed to the Google Groups "deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dealii+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dealii/CAC-fs6vmote0mqgCu7d60EjRrsAHpRPw-kSXeJJRtaFXg%2BXDtw%40mail.gmail.com.

Kaushik Das

unread,
Jul 10, 2023, 1:55:26 PM7/10/23
to dea...@googlegroups.com
I see. thanks for the tip. 

Reply all
Reply to author
Forward
0 new messages