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 bug in initial condition for transform_real_to_unit_cell #13278

Merged
merged 2 commits into from Jan 22, 2022

Conversation

kronbichler
Copy link
Member

Fixes #13246.

@blaisb could you please test this fix?

It turns out that our initial guess for the Newton iteration in the computation via the inverse quadratic approximation did not apply the normalization for the code path with bilinear/trilinear cells (when, in fact, the inverse approximation is only affine and not quadratic). I also cleaned up some internal functions.

@kronbichler
Copy link
Member Author

/rebuild

@@ -0,0 +1,11 @@

DEAL::Transform on cell with center: -0.08086235035 -0.8200448543 -0.08086235035 with mapping degree 1
DEAL::Combined transform -0.04896990000 -0.8590530000 -0.04896990000 gives 0.7082205181 0.2510034894 0.7082205181
Copy link
Member Author

Choose a reason for hiding this comment

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

This would fail with the previous version of the code, giving a point with unit coordinates around 12.

@blaisb
Copy link
Member

blaisb commented Jan 21, 2022

Fixes #13246.

@blaisb could you please test this fix?

It turns out that our initial guess for the Newton iteration in the computation via the inverse quadratic approximation did not apply the normalization for the code path with bilinear/trilinear cells (when, in fact, the inverse approximation is only affine and not quadratic). I also cleaned up some internal functions.

This works with the test provided by #13269 and does not lose particles. Consequently once this is merge, I'll fix #13269 to just keep the test and remove the changes to the particle.

Thanks @kronbichler for taking a look at it. This is a much nicer solution.

Copy link
Member

@blaisb blaisb left a comment

Choose a reason for hiding this comment

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

I'm not the best expert to review this, but it is a very clear and understandable PR. No comments on my side. Great work!

Copy link
Member

@tjhei tjhei left a comment

Choose a reason for hiding this comment

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

👍

@kronbichler kronbichler merged commit 4e8af90 into dealii:master Jan 22, 2022
@kronbichler kronbichler deleted the fix_real_to_unit branch May 11, 2022 20:05
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.

Randomly disappearing particles in non-trivial geometries (hyper_ball) since the merge of #13202
3 participants