Find derivative recurrences from PDE (via parametric derivative taking)#204
Open
hirish99 wants to merge 8 commits intoinducer:mainfrom
Open
Find derivative recurrences from PDE (via parametric derivative taking)#204hirish99 wants to merge 8 commits intoinducer:mainfrom
hirish99 wants to merge 8 commits intoinducer:mainfrom
Conversation
Contributor
Author
|
Requesting review @inducer |
Contributor
Author
|
Request review @inducer |
f77f639 to
e363248
Compare
Contributor
Author
|
Request review |
inducer
reviewed
Oct 28, 2024
sumpy/recurrence.py
Outdated
| # Sort terms and create idx_l | ||
| idx_l = [] | ||
| for i in range(len(terms)): | ||
| tms = list(terms[i].atoms(sp.Number)) |
Owner
There was a problem hiding this comment.
Carefully destructure term for correctness.
| @@ -0,0 +1,83 @@ | |||
| from sumpy.expansion.diff_op import ( | |||
inducer
reviewed
Nov 4, 2024
test/test_recurrenceqbx.py
Outdated
| return result_qbx | ||
|
|
||
|
|
||
| def _qbx_lp_laplace_general(sources, targets, centers, radius, strengths, order): |
test/test_recurrenceqbx.py
Outdated
| return sources, centers, normals, density, h, radius | ||
|
|
||
|
|
||
| def test_recurrence_laplace_2d_ellipse(): |
test/test_recurrence.py
Outdated
Comment on lines
113
to
125
| w = make_identity_diff_op(2) | ||
| helmholtz2d = laplacian(w) + w | ||
| _, _, r = get_processed_and_shifted_recurrence(helmholtz2d) | ||
|
|
||
| n = sp.symbols("n") | ||
| s = sp.Function("s") | ||
|
|
||
| var = _make_sympy_vec("x", 2) | ||
| var_t = _make_sympy_vec("t", 2) | ||
| abs_dist = sp.sqrt((var[0]-var_t[0])**2 + | ||
| (var[1]-var_t[1])**2) | ||
| k = 1 | ||
| g_x_y = (1j/4) * hankel1(0, k * abs_dist) |
Owner
There was a problem hiding this comment.
Get from a Kernel object? (Here and elsewhere.)
inducer
reviewed
Nov 12, 2024
sumpy/recurrenceqbx.py
Outdated
|
|
||
|
|
||
| # ================ Recurrence LP Eval ================= | ||
| def recurrence_qbx_lp(sources, centers, normals, strengths, radius, pde, g_x_y, |
sumpy/recurrence.py
Outdated
Comment on lines
369
to
375
| def shift_recurrence(r: sp.Expr) -> sp.Expr: | ||
| r""" | ||
| A function that "shifts" the recurrence so it's center is placed | ||
| at the origin and source is the input for the recurrence generated. | ||
|
|
||
| :arg recurrence: a recurrence relation in :math:`s(n)` | ||
| """ |
sumpy/recurrenceqbx.py
Outdated
| r""" | ||
| With the functionality in this module, we aim to compute layer potentials | ||
| using a recurrence for one-dimensional derivatives of the corresponding | ||
| Green's function. See recurrence.py. |
Owner
There was a problem hiding this comment.
Suggested change
| Green's function. See recurrence.py. | |
| Green's function. See :mod:`sumpy.recurrence`. |
sumpy/recurrenceqbx.py
Outdated
sumpy/recurrenceqbx.py
Outdated
sumpy/recurrenceqbx.py
Outdated
|
|
||
| .. autofunction:: recurrence_qbx_lp | ||
| """ | ||
| from __future__ import annotations # noqa: I001 |
Contributor
Author
|
Plots updated in plot_taylor_recurrence and plot_normal_recurrence |
Adds recurrence-based QBX layer potential evaluation with on-axis and off-axis computation support for Laplace and Helmholtz kernels in 2D and 3D.
- Add pyright ignore comments for sympy typing issues in recurrence.py and recurrence_qbx.py (sum() return type, .subs() return type, ObjectArray1D vs ndarray) - Broaden parameter types from sp.Expr to sp.Basic where .subs() results are passed - Remove personal plotting code from test files - Remove tracked experimental files (pgf, png, svg, ipynb) - Update .gitignore to exclude *.ipynb, *.pgf, output.png, qbxrecurrence.svg
8f58772 to
03e0eeb
Compare
- Add pyright ignore comments for reportMissingImports, reportCallIssue, reportArgumentType, reportAttributeAccessIssue, and reportIndexIssue in test files (meshmode/pytential are optional deps without full stubs) - Fix RST formatting in recurrence.py docstrings (indentation, bullet lists) - Fix wrong function name in autofunction directive - Fix typo in class reference (LinearSystemPDEOperator -> LinearPDESystemOperator)
basedpyright reports reportMissingImports on the 'from' line, not on the inner item line where ruff moved the comment.
Rename functions to match paper (arXiv:2509.03687) terminology: - get_on_axis_recurrence -> get_large_x1_recurrence - get_off_axis_recurrence -> get_small_x1_recurrence - get_off_axis_expression -> get_small_x1_expansion Add documentation with diagram and usage examples for computing derivatives in both regimes. Add recurrence_qbx to docs.
- Fix recurrence_qbx_lp docstring: evaluation is at target points (center + radius * normal), not at expansion centers. - Merge baseline with upstream/main to cover CI-specific diagnostics for pre-existing files while adding entries for new recurrence files.
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.
Revised version of #202, using parametric approach to compute recurrences for derivatives.