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

Fix SolutionTransfer when coarsening from FE_Nothing #8860

Merged
merged 3 commits into from Sep 26, 2019

Conversation

masterleinad
Copy link
Member

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.

{
tmp.reinit(dofs_per_cell, true);
const unsigned int old_index =
pointerstruct->second.active_fe_index;
Copy link
Member

@tjhei tjhei Sep 26, 2019

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?!

Copy link
Member Author

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.

@masterleinad
Copy link
Member Author

/rebuild

@tjhei
Copy link
Member

tjhei commented Sep 26, 2019

Looks good! I am glad you found the bug. :-)

@Rombur Rombur merged commit 112cb92 into dealii:master Sep 26, 2019
const unsigned int dofs_per_cell = this->get_fe().dofs_per_cell;
if (dofs_per_cell == 0)
{
interpolated_values = 0;
Copy link
Member

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.

Copy link
Member Author

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).

Copy link
Member

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!

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

4 participants