Skip to content

Conversation

@nilsvu
Copy link
Member

@nilsvu nilsvu commented Apr 1, 2025

Proposed changes

Split up the interpolation functions so that they can be reused by the new PointwiseInterpolator class, which holds volume data in memory and supports repeated interpolation to arbitrary points. This can be used to load data once and then interpolate many times, e.g. for ray tracing. A follow-up PR will do the time interpolation that's needed for ray tracing, which will use the PointwiseInterpolator class as well.

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 changed the title Exporter: split functions, add SpatialInterpolator Exporter: split functions, add PointwiseInterpolator Apr 1, 2025
@nilsvu nilsvu force-pushed the interpolator branch 3 times, most recently from 789eada to 8765711 Compare April 1, 2025 22:58
@nilsvu
Copy link
Member Author

nilsvu commented Apr 2, 2025

@knelli2 on your request I dropped all but the first 3 commits for now. These just split up the functions so they can be reused. Mind taking a look?

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.

Clang-tidy has some reasonable errors as well

Comment on lines 22 to 24
target_points_dv.get(d).set_data_ref(
const_cast<double*>(gsl::at(target_points, d).data()),
Copy link
Contributor

Choose a reason for hiding this comment

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

Thow some NOLINTs in there or use make_const_view

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't think we have make_const_view for double*, so I added the nolint

Comment on lines 103 to 104
template <typename ResultDataType, size_t Dim>
void _interpolate_to_points(
Copy link
Contributor

Choose a reason for hiding this comment

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

Why the underscores at the beginning of the function names? I thought our convention with functions in cpp files was just an anonymous namespace

Copy link
Member Author

Choose a reason for hiding this comment

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

changed underscore to _impl

Comment on lines 152 to 153
template <size_t Dim>
void _interpolate_to_point(
Copy link
Contributor

Choose a reason for hiding this comment

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

This function doesn't seem to be used anywhere. Is it necessary?

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh it will be used by the interpolator class in the next PR. I can remove it for now

@nilsvu
Copy link
Member Author

nilsvu commented Apr 2, 2025

Thanks for reviewing! I pushed two fixups

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.

Looks good, you can squash

@nilsvu nilsvu changed the title Exporter: split functions, add PointwiseInterpolator Exporter: split functions for reuse Apr 2, 2025
@nilsvu nilsvu force-pushed the interpolator branch 2 times, most recently from 7704d57 to f1bea2c Compare April 2, 2025 20:52
@nilsvu
Copy link
Member Author

nilsvu commented Apr 2, 2025

Done 👍

@knelli2 knelli2 merged commit 96f6c01 into sxs-collaboration:develop Apr 4, 2025
46 of 48 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