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

Enable interpolation for shells using spherical harmonics #6479

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

Conversation

kidder
Copy link
Member

@kidder kidder commented Feb 13, 2025

Proposed changes

Adds ability to interpolate if the basis is spherical harmonic

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

*
* \note The accuracy of the interpolation will depend upon the number and
* distribution of the source points. It is strongly suggested that you
* carefully investiage the accuracy for your use case.
Copy link
Member

Choose a reason for hiding this comment

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

"investigate"

namespace intrp {
/*!
* \brief Computes the matrix for interpolating a non-periodic function known at
* the set of points \f$x_{source}\f$ to the set of points \f$x_{target}\f$
Copy link
Member

Choose a reason for hiding this comment

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

This is polynomial interpolation? Do you have a citation for the algorithm?

* \details The returned matrix \f$M\f$ will have \f$n_{target}\f$ rows and
* \f$n_{source}\f$ columns so that \f$f_{target} = M f_{source}\f$
* Formally, this computes the sum
* \f[ n w_j = 1 + 2 \sum_{k=1}{\lfloor (n-1)/2 \rfloor} \cos(k(x - X_j))
Copy link
Member

Choose a reason for hiding this comment

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

Missing a ^ between }{.

* source_mesh. (These are equivalent to those returned by
* Spectral::interpolation_matrix.)
* - For a Fourier basis, the matrix is given by
* intrp::fourieer_interpolation_matrix at the quadrature points of the
Copy link
Member

Choose a reason for hiding this comment

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

"fourier"

These will be used to construct interpolation matrices for basis
functions other than Chebyshev and Legendre functions.
No longer store the coordinates in the class; just pass them in as
function arguments.
This interpolator interpolates dimension by dimension and can handle
spherical harmonic interpolation.
The interpolation matrix for the Irregular interpolant is used to
interpolate in all dimensions at once.  It is constructed by
combining one-dimensional interpolation matrices.  For spherical
harmonics, these 1D matrices are provided by a Cardinal interpolator.
@kidder kidder force-pushed the spherical_interpolation branch from f9b80d6 to e2665ad Compare February 26, 2025 21:38
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