-
Notifications
You must be signed in to change notification settings - Fork 299
Fix refinement with non-default diagonal selection #3772
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
Conversation
Make our return value here diagonal choice dependent, otherwise we stitch nodes together wrongly when refining Tet14s.
One level down from a build_cube of tets wasn't enough to trigger the diagonal-selection issues that were trashing Tet14 results. This is more expensive than I like for a unit test; might want to cut it down later.
Going to merge to see if I can get this to master in time to slip it into idaholab/moose#26462 It isn't breaking any tests, and it's fixing breakage in both the new unit test and a MOOSE input, so I feel like even if I'm still missing any bugs at least we're less buggy now. |
CPPUNIT_ASSERT(!parent->interior_parent()); | ||
CPPUNIT_ASSERT_EQUAL(parent, elem->top_parent()); | ||
CPPUNIT_ASSERT_EQUAL(parent, parent->top_parent()); | ||
if (n == 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.
Hi Roy, a bit too late I know. :/
If you want, I think you could write this whole 11-line block as:
CPPUNIT_ASSERT_EQUAL(elem->top_parent(), parent->top_parent());
CPPUNIT_ASSERT((n == 1) != (parent != elem->top_parent()));
or if that's too cumbersome,
CPPUNIT_ASSERT_EQUAL(elem->top_parent(), parent->top_parent());
if (n == 1)
CPPUNIT_ASSERT_EQUAL(parent, elem->top_parent());
else
CPPUNIT_ASSERT(parent != elem->top_parent());
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.
I like that second one. Not enough to open a new PR for it, though. :-)
I think this might've shielded me from the bug indeed. :) |
That was the one you pointed me to in Slack, right? Yeah, it works with that for me after this PR. |
Pinging @lindsayad, who first noticed the problem, and @nmnobre, who I'm hoping hasn't also already been bitten by it.
Previously, when doing refinement with any diagonal selection except
DIAG_02_13
, we were failing to take account of the diagonal selection inparent_bracketing_nodes()
, which would lead us to stitch up nodes between the new child elements wrongly, creating some horribly distorted elements. It seems that, when we just get our tets from abuild_cube()
, they're all neatly oriented to selectDIAG_02_13
for the first level of refinement, and so only with the second level do you get some that choose a different diagonal and trigger the bug.