Add the Brinkman kernel#282
Open
alexfikl wants to merge 2 commits intoinducer:mainfrom
Open
Conversation
There was a problem hiding this comment.
Pull request overview
Adds support for a Brinkman (Brinkmanlet) kernel to sumpy.kernel, together with test coverage to exercise PDE checks, translations, and pickling.
Changes:
- Introduce
BrinkmanletKernelas anExpressionKernelwith loopy/codegen support for special functions (2D Hankel form). - Extend kernel PDE-check tests (
test_misc.py) to include Brinkmanlet components in 2D/3D. - Extend kernel translation/pickling tests (
test_kernels.py) to include Brinkmanlet and its runtime parameters.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
sumpy/kernel.py |
Adds BrinkmanletKernel, mapper hookups, and updates a comment in YukawaKernel.is_complex_valued. |
sumpy/test/test_misc.py |
Adds PDE-check parametrization coverage for BrinkmanletKernel in 2D/3D. |
sumpy/test/test_kernels.py |
Adds translation and pickle test coverage for BrinkmanletKernel, including runtime args (mu, k) and custom arg names. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
alexfikl
commented
May 10, 2026
| # [1] Equations 7.7.5 and 7.7.6 | ||
| a = K0 + K1 / R - 1 / R**2 | ||
| b = 2 / R**2 - 2 * K1 / R - K0 | ||
| expr = a * delta_ij + b * d[icomp] * d[jcomp] / r ** 2 |
Collaborator
Author
There was a problem hiding this comment.
Does this a * delta_ij get flattened somewhere? Is it better to flatten it here?
Collaborator
Author
|
For what it's worth, doing the |
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.
This adds the Brinkman kernel and the corresponding Brinkman stress tensor. I'm not particularly sure the scaling is right (the 2-3 papers I've found all had different scaling), but I've checked (in Mathematica) that
Also added these to some tests:
test_pde_check_kernelsandtest_translations. There's probably more things we could test, but it should be ok for now.TODO: