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

Extrapolate from nearest element #6382

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

nilsvu
Copy link
Member

@nilsvu nilsvu commented Nov 19, 2024

Proposed changes

Uses the Lagrange basis in the nearest element to extrapolate into the excision region. This can be unstable when we want to extrapolate far into the excision because we're extrapolating over many logical element sizes. However, it can be useful for extrapolating only very slightly into the excision, e.g. if the excision in the initial data is the apparent horizon and the evolution needs a little space around it to find and track the horizon.

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 extrapolate_from_nearest_element branch 2 times, most recently from f4f44f9 to 3ed9516 Compare November 20, 2024 19:36
Uses the Lagrange basis in the nearest element to extrapolate into the
excision region. This can be unstable when we want to extrapolate
far into the excision because we're extrapolating over many logical element sizes.
However, it can be useful for extrapolating only very slightly into the
excision, e.g. if the excision in the initial data is the apparent horizon
and the evolution needs a little space around it to find and track the
horizon.
@nilsvu nilsvu force-pushed the extrapolate_from_nearest_element branch from 3ed9516 to 482207f Compare November 20, 2024 19:39
Copy link
Member

@wthrowe wthrowe left a comment

Choose a reason for hiding this comment

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

Tests are failing.

@@ -65,10 +65,12 @@ std::optional<double> SphereTransition::original_radius_over_radius(
if ((original_radius + eps_) >= r_min_ and
(original_radius - eps_) <= r_max_) {
return std::optional<double>{original_radius / mag};
} else if ((a_ > 0.0 and mag > r_max_) or (a_ < 0.0 and mag < r_min_)) {
} else if ((a_ > 0.0 and original_radius > r_max_) or
(a_ < 0.0 and original_radius < r_min_)) {
Copy link
Member

Choose a reason for hiding this comment

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

Is it easy to add a test for this?

/// @}

/*!
* \brief Finds the block-logical coordinates of a point in an excision sphere.
Copy link
Member

Choose a reason for hiding this comment

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

This isn't showing up in the documentation. Maybe needs an \ingroup?

if (radial_distance_this_block < 1.) {
continue;
}
// The checks above should leave only 1 valid block, so return that
Copy link
Member

Choose a reason for hiding this comment

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

Do we need to handle points on extrapolations of block boundaries?

@@ -69,10 +71,32 @@ auto block_logical_coordinates(
const domain::FunctionsOfTimeMap& functions_of_time = {})
-> std::vector<BlockLogicalCoords<Dim>>;

/// \par Extrapolation
Copy link
Member

Choose a reason for hiding this comment

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

Doxygen does not seem to handle adding combining this with the documentation from the enclosing /// @{ group. Maybe \copydoc would work?

{{domain::BlockId{4},
// If the shape map preserved the BL-KS transformation within the
// excision, the result should be -1.5. However, apparently it
// doesn't.
Copy link
Member

Choose a reason for hiding this comment

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

Is this a bug in the map?

os << "RadialAnchors";
break;
default:
os << "Unknown";
Copy link
Member

Choose a reason for hiding this comment

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

ERROR for invalid input?

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