warp_and_refine_until_resolved: support tensor product elements#494
Merged
warp_and_refine_until_resolved: support tensor product elements#494
Conversation
Copilot
AI
changed the title
[WIP] Add support for tensor product elements in warp_and_refine_until_resolved
warp_and_refine_until_resolved: support tensor product elements
Mar 19, 2026
Co-authored-by: inducer <352067+inducer@users.noreply.github.com>
c2cbdb7 to
2eb4ef2
Compare
2eb4ef2 to
7dad429
Compare
There was a problem hiding this comment.
Pull request overview
Extends warp_and_refine_until_resolved to work on Modepy-based non-simplex element groups (notably TensorProductElementGroup for quads/hexes) and adds a regression test to cover the new capability.
Changes:
- Generalize
warp_and_refine_until_resolvedfrom simplex-only toModepyElementGroupand switch to a generic Modepy interpolation error estimator matrix. - Add a new test exercising
warp_and_refine_until_resolvedon a warped quad mesh. - Minor typing cleanup in tensor-product quadrature node reshaping.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
meshmode/mesh/generation.py |
Removes simplex-only restriction and uses Modepy’s generic interpolation error estimator for refinement decisions. |
test/test_mesh.py |
Adds a tensor-product (quad) regression test for warp_and_refine_until_resolved. |
meshmode/discretization/poly_element.py |
Simplifies node reshaping code by removing an unnecessary cast. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TODO:
req.txtwarp_and_refine_until_resolvedpreviously raisedTypeErrorfor any non-simplex element group. This extends support toTensorProductElementGroup(quads/hexes).Changes
meshmode/mesh/generation.pySimplexElementGroup-only guard; acceptTensorProductElementGroupas wellsimplex_interp_error_coefficient_estimator_matrix), selecting high-order modes via:sum(mode_id)for simplex elements (total polynomial degree)max(mode_id)for tensor product elements (max per-direction degree, matching Q^k space structure)vdm_invcomputation that existed in the original codetest/test_mesh.pytest_warp_and_refine_until_resolved_tensor_product: creates a 2D quad mesh, applies a sinusoidal warp, and verifies the function converges and refines elementsOriginal prompt
warp_and_refine_until_resolved: support tensor product elements #493📍 Connect Copilot coding agent with Jira, Azure Boards or Linear to delegate work to Copilot in one click without leaving your project management tool.