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

Have time steppers overwrite in update_u again #4748

Merged
merged 2 commits into from Feb 27, 2023

Conversation

wthrowe
Copy link
Member

@wthrowe wthrowe commented Feb 16, 2023

It turns out that it is sometimes difficult for the caller to determine the correct value to pass into the function.

This largely reverts bf4fd0a.

Fixes #4399

@geoffrey4444 This should remove the need for the dense output hack. Can you test this and verify that your results look good?

Proposed changes

Upgrade instructions

Code review checklist

  • The code is documented and the documentation renders correctly. Run
    make doc to generate the documentation locally into BUILD_DIR/docs/html.
    Then open index.html.
  • The code follows the stylistic and code quality guidelines listed in the
    code review guide.
  • The PR lists upgrade instructions and is labeled bugfix or
    new feature if appropriate.

Further comments

It turns out that it is sometimes difficult for the caller to
determine the correct value to pass into the function.

This largely reverts bf4fd0a.
nilsdeppe
nilsdeppe previously approved these changes Feb 20, 2023
@geoffrey4444
Copy link
Contributor

Sorry, but it looks to me like this PR does not fix the dense output bug #4399. I tried running a BBH with the 3-index constraint set to zero at t=0. I used this branch at 3 different revisions: , and one of the following:

1: nothing (no additional commit) — revision 9200dd5
2: the commit in this PR — revision 291a228
3: the hack commit you previously suggested to fix the bug — revision b9fbf8e

I verified that spectre.out reported the correct revision in each case. At t=0, here's the L2 norm of the 3-index constraint for each case:

  1. 8.81945e-06
  2. 8.81945e-06
  3. 1.60104e-17

@wthrowe
Copy link
Member Author

wthrowe commented Feb 21, 2023

OK, try now. An old optimization was bypassing the fix when run at t=0.

This fix is not really related to the update_u changes, so I'm going to leave it as a separate commit.

Comment on lines 369 to 372
if ((coupling.local_end() - 1)->value() == time) {
return;
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this means if we are at the most recent history time, just return (i.e. don't do dense output), but I'm not 100% certain. Could you add a comment?

Copy link
Member Author

Choose a reason for hiding this comment

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

You are correct. I've added a comment.

Copy link
Contributor

@knelli2 knelli2 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 happy with the changes, but @geoffrey4444 should confirm again that these changes now fix the LTS dense output bug

@geoffrey4444
Copy link
Contributor

OK, try now. An old optimization was bypassing the fix when run at t=0.

This fix is not really related to the update_u changes, so I'm going to leave it as a separate commit.

I will try this again. Thanks!

Copy link
Contributor

@geoffrey4444 geoffrey4444 left a comment

Choose a reason for hiding this comment

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

I did not review the code line by line but did try this again, and now the dense and not-dense output for the 3-index constraints agree, even at t=0.

image

Without this fix, the constraints are not zeroed correctly at t=0, and they level off to a larger value by time t=10 (though strangely even without the fix, I don't see the linear growth I saw back in November when I first spotted the symptoms of the bug this PR fixes).

I see small differences vs the hack fix, but I don't think they are significant.

So I'm happy to approve.

@nilsdeppe nilsdeppe merged commit 0d22834 into sxs-collaboration:develop Feb 27, 2023
@wthrowe
Copy link
Member Author

wthrowe commented Feb 27, 2023

If you're doing filtering, I'm guessing the hack and this version interact with that differently. If not, I don't immediately see a reason they would differ, but I wouldn't worry about it for the moment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Dense output with local time stepping gives incorrect results
4 participants