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
Fix SolutionTransfer when coarsening from FE_Nothing #8860
Conversation
source/numerics/solution_transfer.cc
Outdated
{ | ||
tmp.reinit(dofs_per_cell, true); | ||
const unsigned int old_index = | ||
pointerstruct->second.active_fe_index; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't old_index already available above? Edit: and you don't need it at all?!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, forgot to remove after restructuring. Fixed now.
/rebuild |
Looks good! I am glad you found the bug. :-) |
const unsigned int dofs_per_cell = this->get_fe().dofs_per_cell; | ||
if (dofs_per_cell == 0) | ||
{ | ||
interpolated_values = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@masterleinad : I'm way late to this game, but isn't it the case that if you end in this branch, interpolated_values
needs to have size zero anyway? If so, one could just skip the if
and jump straight to the else
. If you agree, I can write that patch.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, in the test for this pull request the size of interpolated_values
is 4 since the new element is a FE_Q<2>(1)
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I see, it's the other way around. Thanks for confirming!
I was seeing some problems when trying to use adaptive refinement where some cells were using
FE_Nothing
. This pull request makes sure that coarsening works and the contributions from these cells are ignored.