Skip to content

Conversation

@knelli2
Copy link
Contributor

@knelli2 knelli2 commented Jul 21, 2025

Proposed changes

Ninth PR in horizon finder changes. This adds a function that runs every time a new element has sent and added its data to the horizon finder. It tries to interpolate the volume data from any new elements received to the trial surface points.

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

@knelli2 knelli2 added this to the AH finder improvements milestone Jul 21, 2025
@knelli2 knelli2 requested a review from wthrowe July 21, 2025 07:08
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.

My overall comment here is that this needs a lot more documentation, since I'm still not sure what the function is actually doing. I've given some code comments, but I may have more insight after the docs are updated.

#include "ParallelAlgorithms/ApparentHorizonFinder/Storage.hpp"

template <size_t VolumeDim>
class Domain;
Copy link
Member

Choose a reason for hiding this comment

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

/// \cond around the forward declarations.


namespace ah {
/*!
* \brief Interpolate volume data from any new elements to the target points
Copy link
Member

Choose a reason for hiding this comment

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

Expand on this documentation a bit. What are "new elements"? None of the const arguments contain any data, so what are the inputs and outputs?

*/
template <typename Fr>
void interpolate_volume_data(
gsl::not_null<ah::Storage::Iteration<Fr>*> current_iteration_storage,
Copy link
Member

Choose a reason for hiding this comment

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

Forward declare not_null.


// Loop over each tensor
tmpl::for_each<ah::vars_to_interpolate_to_target<3, Fr>>([&](auto tag_v) {
using tag = tmpl::type_from<decltype(tag_v)>;
Copy link
Member

Choose a reason for hiding this comment

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

[optional] Use an explicit template parameter on the lambda. Also in a few other places.

// Temporarily disable FPEs
const ScopedFpeState fpe_state{false};
interpolated_vars.initialize(
expected_num_points, std::numeric_limits<double>::signaling_NaN());
Copy link
Member

Choose a reason for hiding this comment

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

Are the nans being tested for somewhere else? I.e., is there a reason to override the default initialization behavior in non-debug builds?

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.

You can squash, including the new docs.

* `ah::Tags::CurrentTime`. The volume data that is received from Elements is
* stored in \p all_volume_variables and information on which elements have
* already interpolated their volume data is stored in
* \p current_iteration_storage.
Copy link
Member

Choose a reason for hiding this comment

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

This still doesn't actually tell me what this function does. How about something along the lines of "For each new element, the vars_to_interpolate_to_target in \p all_volume_variables are computed from its source_vars member, and the results are interpolated and stored in \p current_iteration_storage.".

@knelli2
Copy link
Contributor Author

knelli2 commented Jul 22, 2025

Done!

@wthrowe wthrowe merged commit bb2cca3 into sxs-collaboration:develop Jul 23, 2025
23 of 24 checks passed
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