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

Add a function to take a view of an index set with regard to an index set mask. #16079

Merged
merged 4 commits into from Oct 5, 2023

Conversation

bangerth
Copy link
Member

@bangerth bangerth commented Oct 2, 2023

I will need this for geodynamics/aspect#5412, but I think it will, at some point or other, be of independent interest as well.

@bangerth bangerth added this to the Release 9.6 milestone Oct 2, 2023

// Now turn the ranges of overlap we have accumulated into an IndexSet in
// its own right:
IndexSet result(size());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't you want to make the size equal the number of entries in the mask: The documentation states then the result will be an index set for a space of size 50 that contains those indices that [...]. Overall, I am not sure yet how you want to achieve this in a parallel setting. If I read the documentation correctly, I need to be sure that the mask can be defined for the entirety of the indices on all processes in the user code, and only afterwards call this here. Is this understanding correct?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh yes, excellent catch! This should have been

Suggested change
IndexSet result(size());
IndexSet result(mask.n_elements());

I made the fix, and also added assertions in this regard to the three tests added here.

@bangerth
Copy link
Member Author

bangerth commented Oct 5, 2023

Thanks for the careful reading, @kronbichler . I fixed the bug, and I've also added an example to the documentation that explains the sort of context in which I want to use this function.

@kronbichler kronbichler merged commit 7f0ef6a into dealii:master Oct 5, 2023
15 checks passed
@bangerth bangerth deleted the view branch October 5, 2023 14:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants