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

Provide an error message that is more meaningful for global MG transfer operator. #17036

Merged
merged 1 commit into from
May 19, 2024

Conversation

bangerth
Copy link
Member

One of my students, @jerett-cc, was trying to use the new across-mesh interpolate function from #16734 to build a transfer operator across more than one mesh refinement. This failed with a non-informative message, see jerett-cc/ryujin#30. This patch adds an assertion that ensures that we're not calling cell->subdomain_id() if the cell is not actually active, and give a useful error message for the case where the condition is violated.

Comment on lines +1448 to 1457
Assert(
cell_fine->child(0)->is_active(),
ExcMessage(
"In building a transfer operator, we are "
"expecting that a cell is not or at most once refined "
"on the other multigrid level. But it is refined more than once. "
"Are you trying to build a transfer operator across "
"more than one level of mesh refinement?"));
if (cell_fine->child(0)->subdomain_id() !=
cell->subdomain_id())
Copy link
Member Author

Choose a reason for hiding this comment

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

I am here implicitly assuming that the whole MG global coarsening transfer operator approach is indeed only meant if the two meshes differ by at most one level of refinement. Please correct me if that is not correct.

Copy link
Member

@kronbichler kronbichler left a comment

Choose a reason for hiding this comment

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

The standard interpolation operations cannot handle anything else (but the non-nested transfer could in principle).

@kronbichler kronbichler merged commit a34bd21 into dealii:master May 19, 2024
15 of 16 checks passed
@bangerth bangerth deleted the error-transfer branch May 21, 2024 01:23
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