Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Agglomerate using connected components #130

Merged
merged 2 commits into from
Sep 18, 2024
Merged

Conversation

fdrmrc
Copy link
Owner

@fdrmrc fdrmrc commented Sep 10, 2024

To be merged after #129. This PR expands the interface to define agglomerates by checking if the input patch of cells is connected. If not, the connected components are computed using depth-first-search on the graph associated to the agglomerate and each one is agglomerated in the standard way. The relevant commit is aed376b

The following test explains the matter and has been added. Consider the following fine grid and flag for agglomeration the following cells:

$K_0 = \{ 0,1,2,3,12,13,14,15\}$
$K_1 = \{4, 5, 6, 7, 8, 9, 10\}$
$K_2 =\{11\}$


x - - - - - - - - - - - - -x
|     |     |      |       |
|  10 |  11 |  14  |  15   |
|     |     |      |       |
| - - | - - - - - -| - - - |
|     |     |      |       |
|  8  | 9   |  12  |  13   |
| - - | - - - - - -| - - - |
|     |     |      |       |
|  2  |  3  |  6   |   7   |
| - - | - - - - - -| - - - |
|  0  |  1  |  4   |    5  |
|     |     |      |       |
x - - - - - - - - - - - - -x

$K_0$ and $K_1$ are clearly disconnected. The new routine produces the following final set of agglomerates, by agglomerating the connected components separately.

$K_0 = \{0,1,2,3\}$
$K_1 = \{4, 5, 6, 7\}$
$K_2 = \{11\}$
$K_3 = \{8, 9, 10\}$
$K_4 = \{12,13,14,15\}$

The test simply checks that we can capture exactly on this new mesh some manufactured solutions which live in the test space.

@fdrmrc fdrmrc added enhancement New feature or request discussion Open for discussion labels Sep 10, 2024
@fdrmrc fdrmrc force-pushed the connected_components_agglomerate branch 2 times, most recently from d9b7c64 to 3c18c7b Compare September 16, 2024 13:57
@fdrmrc fdrmrc force-pushed the connected_components_agglomerate branch from 3c18c7b to c3e211f Compare September 16, 2024 13:57
@fdrmrc
Copy link
Owner Author

fdrmrc commented Sep 16, 2024

The failing test will be fixed in #134

@fdrmrc fdrmrc merged commit c547c83 into main Sep 18, 2024
1 of 3 checks passed
@luca-heltai luca-heltai deleted the connected_components_agglomerate branch November 21, 2024 17:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion Open for discussion enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant