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

Solve for psi-1 in XCTS system #5684

Merged
merged 5 commits into from
Jan 12, 2024
Merged

Conversation

nilsvu
Copy link
Member

@nilsvu nilsvu commented Dec 20, 2023

Proposed changes

Psi-1 approaches zero at the outer boundary rather than 1, hence has a more accurate numerical derivative on the stretched outer wedges. Combined with the weak primal form of the elliptic DG scheme (#5667 and #5679) this enables BBH ID with a large outer radius and fixes #4597 (some optimizations can still be done to accelerate the solves).

Try it like this:

./bin/spectre bbh generate-id -q 1 -D 16 -w 0.0144 -L 0 -P 5 -o ./ID

Upgrade instructions

In XCTS input files replace ConformalFactor and LapseTimesConformalFactor with ConformalFactorMinusOne and LapseTimesConformalFactorMinusOne in analytic boundary conditions and error observations.

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

@nilsvu nilsvu force-pushed the xcts_minus_one branch 5 times, most recently from 24beb8d to 765e0f6 Compare December 26, 2023 08:46
@nilsvu nilsvu force-pushed the xcts_minus_one branch 2 times, most recently from dfb9a01 to 51b6a33 Compare January 3, 2024 09:44
@nilsdeppe
Copy link
Member

I can review once CI is happy :)

@nilsvu nilsvu force-pushed the xcts_minus_one branch 3 times, most recently from de9e2f8 to bfd9810 Compare January 7, 2024 10:25
@nilsvu
Copy link
Member Author

nilsvu commented Jan 8, 2024

CI is mostly ok now. I don't think I can silence the clang-tidy warning.

nilsdeppe
nilsdeppe previously approved these changes Jan 8, 2024
Copy link
Member

@nilsdeppe nilsdeppe left a comment

Choose a reason for hiding this comment

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

LGTM, couple ideas/thoughts. Feel free to respond how you prefer (e.g., just merging is acceptable :P)

Also, fantastic job on figuring all this out and getting it to work! These are in my experience the most challenging types of bugs to fix and are very frustrating. It's a huge accomplishment and I think you should be really proud! This took a lot of hard work and perseverance! 💯


namespace tt {
namespace detail {
CREATE_HAS_TYPE_ALIAS(ElementType)
CREATE_HAS_TYPE_ALIAS_V(ElementType)
Copy link
Member

Choose a reason for hiding this comment

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

[optional] One idea to try is [[maybe_unused]] on this line. If that fails to build, we could mark the ones in the macro as that? I'm also fine ignoring and have no strong preference.

Copy link
Member Author

Choose a reason for hiding this comment

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

Added a nolint block to silence this warning (new feature since clang-format 14). There's still another warning about an infinite recursion that cannot happen, which I don't think I can silence since I don't want to nolint the general code in CachedTempBuffer.

@@ -190,8 +190,9 @@ void negative_expansion_quantities(

Copy link
Member

Choose a reason for hiding this comment

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

[optional, random line] there are a lot of divisions by the conformal factor. I'm not sure if it matters because this is a BC, but it may be possible to factor those out and do only one. Probably doesn't matter, though.

Copy link
Member Author

Choose a reason for hiding this comment

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

Haven't profiled this recently, but I'll keep this in mind when doing a round of optimizations 👍 Not much use to do this blindly I think.

@@ -61,60 +61,61 @@ void add_hamiltonian_sources(
const gsl::not_null<Scalar<DataVector>*> hamiltonian_constraint,
Copy link
Member

Choose a reason for hiding this comment

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

[musing] It might be worth revisiting this in a followup performance review of the elliptic code. It might be possible to precompute the conformal factor and then pass it around. I think this is low priority, but if you have a list somewhere to keep track of these things, maybe add this?

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, will do. I have no idea if precomputing it is faster or not.

@nilsvu
Copy link
Member Author

nilsvu commented Jan 11, 2024

Thank you!

@nilsdeppe nilsdeppe added the auto-merge GitHub's auto-merge has been enabled for this PR. label Jan 11, 2024
@nilsvu nilsvu disabled auto-merge January 12, 2024 17:55
@nilsvu nilsvu merged commit de35179 into sxs-collaboration:develop Jan 12, 2024
20 of 22 checks passed
@nilsvu nilsvu deleted the xcts_minus_one branch January 12, 2024 17:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-merge GitHub's auto-merge has been enabled for this PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Initial data: can we make BBH initial data with a large outer boundary?
2 participants