-
Notifications
You must be signed in to change notification settings - Fork 17
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
DiscretizationCollection._base_to_geoderiv_connection
is broken when using overintegration in lazy-mode
#174
Comments
With absolutely no actual knowledge of the problem.. Don't all geometry derivatives need to be computed on the base discretization and then interpolated to the quadrature grid from there? How is |
The derivatives are interpolated to the quadrature grid here: https://github.com/inducer/grudge/blob/main/grudge/geometry/metrics.py#L142-L143 The reason The incoming dof descriptor must be on the quadrature grid when using overintegration ( When using affine, we just need to broadcast a constant value to each quad node. |
Do you have a branch that exhibits the failure? Based on pure speculation, I suspect that the issue might be that you're asking the metrics to return a value on the quadrature grid. I don't think they're currently able to do that, but we should be able to teach them (simply compute the derivative on the base and then upsample that). (And that in turn would remove a bunch of repeated computation in the overintegrated case!) |
That makes sense. Thank you for the detailed explanation! Maybe an easy fix would be to just disable the interpolation to the quadrature grid (in the metrics) when using the |
Can you point to code that does that? I don't think the metrics attempt to project to a quadrature grid (but I'm suggesting we teach them how to do that). |
From the code @thomasgibson linked in here? It seems to remove the quadrature tag, do the derivatives, and then interpolate back, right? |
Ah, yep! Do all the metrics do that consistently? (I searched for |
They should, yeah. All the other metrics just use the result from |
@inducer You can hit the exact error this issue is describing by running |
DiscretizationCollection._base_to_geoderiv_connection
is broken when using overintegrationDiscretizationCollection._base_to_geoderiv_connection
is broken when using overintegration in lazy-mode
I believe I fixed this problem in this commit: 2c9c90c In summary, this commit completely removes the Interpolation to the quadrature grid happens at the very last moment (just before memoization), and it will only happen if the Thoughts on this approach? |
Can you explain the context of the approach a bit better? What does the removal of the |
Just summarizing what @inducer and I discussed: The approach taken in #172 fixes this issue by moving the interpolation step (to a quadrature grid) at the very last moment (near the user-facing level in the relevant geometry routines; No major removals/additions were necessary 😄 |
The relatively recent change for storing affine geometric terms as constants for the pytato array context is broken when using overintegration. The code currently assumes that the
from_discr
is interpolatory, which is just not true when you have terms defined on a quadrature grid.I have attempted to circumvent this issue in #172 but I would really like to settle this once and for all. And by this, I mean actually taking advantage of affineness even when overintegrating. Especially since having working overintegration with lazy evaluation is a high priority right now.
@inducer --- I don't know if I'm being dense here, but I don't see this as a simple 2-line change in the method. The problem is getting
meshmode
to do the right thing by transferring aDOFArray
defined on a quadrature grid to the appropriate shape for thegeo_deriv_discr
. Is there something we can do ingrudge
to spoon-feedmeshmode
something it can work with?The text was updated successfully, but these errors were encountered: