Skip to content

Conversation

lwJi
Copy link
Contributor

@lwJi lwJi commented Jul 28, 2025

This PR is trying to fix bug in the Hermite type of prolongation.

  1. Since the first order Hermite interpolation is the same with Lagrange Interpolation and quit different from higher Hermite interpolations, we removed that coeffs and calling POLY directly for first order Hermite.
  2. We update the coeffs for higher Hermite interpolation according to the derivation here: https://github.com/lwJi/Docs-CarpetX-Public/blob/main/notes/Prolongation/Hermite.ipynb
  3. We update the size the stencils required by Hermite because it's two points larger compared to the same order Lagrangian.

@lwJi lwJi requested review from eschnett and rhaas80 July 28, 2025 01:31
Copy link
Member

@rhaas80 rhaas80 left a comment

Choose a reason for hiding this comment

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

this will need some discussion, in particular one wants to be very sure that the coefficients are actually correct (eg were they tested to be "Hermite" like in that they give continuous derivatives?).

56 / T(96),
56 / T(96),
-9 / T(96),
+1 / T(96)
Copy link
Member

Choose a reason for hiding this comment

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

while I agree that Hermite of same order needs more points, I suspect that we may need to (same as Carpet) read "order" really as "this many ghost points" to be able to mix operators of different orders using the same number of ghost points.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure. If we do that, are we forced to only mix low order of Hermite with high order other method?


extern prolongate_3d_rf2<VC, VC, VC, HERMITE, HERMITE, HERMITE, 1, 1, 1,
extern prolongate_3d_rf2<VC, VC, VC, POLY, POLY, POLY, 1, 1, 1,
FB_NONE>
Copy link
Member

Choose a reason for hiding this comment

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

if these are actually the same as Langrangian, does it make sense to completely remove them instead and error out?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I guess we can do that. If the use want to use 1st order Hermite, it can error out and say please use Poly for 1st order case

assert(y1 == y);
// assert(y1 == y);
const T tol = 100 * std::numeric_limits<T>::epsilon();
assert(std::abs(y1 - y) <= tol);
Copy link
Member

Choose a reason for hiding this comment

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

ah, but if we carefully chose the test problem such that roundoff is not a problem (see comment in code above) why the (hardcoded!) tol?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah. That's just a quick fix. I can take a look and see if I can make y1==y work again.

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