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

Support domain deformations in elliptic solver #5575

Merged
merged 6 commits into from
Oct 31, 2023

Conversation

nilsvu
Copy link
Member

@nilsvu nilsvu commented Oct 19, 2023

Proposed changes

This enables horizon-conforming (ellipsoidal) excision surfaces for spinning BH initial data. It will also allow for surface-fitting coordinates for BNS initial data. For reference, here's my thesis branch that had this implemented in a different way (using static deformed maps, not time dependence): develop...nilsvu:spectre:thesis

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

@nilsvu nilsvu force-pushed the elliptic_time_dependent_maps branch from 1cc38e4 to c9f6f33 Compare October 20, 2023 18:03
@nilsvu nilsvu marked this pull request as ready for review October 20, 2023 18:55
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.

Looks reasonable, I do have one design question. Might be easier to discuss briefly on a call, up to you. Squash any changes directly, please.

Frame::BlockLogical, TargetFrame, Dim>> {
if constexpr (std::is_same_v<TargetFrame, Frame::Inertial>) {
if (block.is_time_dependent()) {
if (block.has_distorted_frame()) {
Copy link
Member

Choose a reason for hiding this comment

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

Do you actually need this case? Shouldn't the else branch work even if there's a distorted frame? I'm fairly confident the evolution code at least requires grid->inertial to always be a valid map, independent of whether or not there's a distorted frame.

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're right 👍 removed the unnecessary case.

@@ -70,15 +70,14 @@ target_link_libraries(
DomainBoundaryConditions
Copy link
Member

Choose a reason for hiding this comment

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

In the elliptic code do you actually evaluate the maps outside of compute items? If not, this commit, if not the previous as well could be replaced by adding a grid->inertial map into the elliptic box and using the time-dependent compute tags we use in the evolution code. Those tags don't do any extra work for "static" domains. I guess they currently require a Tags::Time to be in the box, but we could reasonably template on a bool or something to elide the time if it's not needed.

Copy link
Member Author

Choose a reason for hiding this comment

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

Currently the map is only needed during initialization; in multiple actions though (domain init, subdomain init, faces & mortars). I thought about removing the ElementMap tag from the DataBox, but kept it for now so I don't have to recreate the ElementMap in these places. Could be done though I think. When we update the map parameters we have to re-evaluate the map as well though, which might be easier if the ElementMap is available. I haven't thought that part through yet.

Copy link
Member

Choose a reason for hiding this comment

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

Alright, that sounds good. Thanks for the explanation!

// Coordinates
*logical_coords = logical_coordinates(*mesh);
*inertial_coords = element_map->operator()(*logical_coords);
*inertial_coords =
Copy link
Member

Choose a reason for hiding this comment

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

Right, if you don't need the map in other places, this seems like the perfect place to just call the grid->inertial map once

I hit this limit by increasing the number of tags in the DataBox.
@nilsvu nilsvu force-pushed the elliptic_time_dependent_maps branch from 33596f2 to ba70951 Compare October 30, 2023 23:39
nilsdeppe
nilsdeppe previously approved these changes Oct 31, 2023
This enables horizon-conforming (ellipsoidal) excision surfaces
for spinning BH initial data. It will also allow for surface-fitting
coordinates for BNS initial data.
@nilsvu
Copy link
Member Author

nilsvu commented Oct 31, 2023

Fixed a use-after-move clang-tidy complaint in the ElementMap constructor ASSERT. Nice to have clang tidy to catch these things.

@nilsvu nilsvu merged commit 124f796 into sxs-collaboration:develop Oct 31, 2023
19 of 22 checks passed
@nilsvu nilsvu deleted the elliptic_time_dependent_maps branch October 31, 2023 23:46
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.

2 participants