Stokes/Elasticity using biharmonic/Laplace - #162
Conversation
Uh oh!
There was an error while loading. Please reload this page.
95a898d to
acc5ae0Comparealexfikl
commented
Aug 4, 2022
isuruf
commented
Aug 4, 2022
| @@ -0,0 +1,166 @@ | |||
| __copyright__ = "Copyright (C) 2021 Isuru Fernando" | |||
There was a problem hiding this comment.
I think it'd be good to have CalculusPatch tests to ensure that PDE rediual for Stokes and elasticity is zero.
There was a problem hiding this comment.
That's technically not testing the Stokes potential, it's testing pytential-computed derivatives thereof.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
alexfikl
left a comment
There was a problem hiding this comment.
Added a bunch of nitpicks to pytential.symbolic.stokes (mostly based on how I've been using the new stuff). Many are ignorable, so feel free!
The main thing that bothered me while going through it was the nu_sym everywhere. It feels like that should be handled in elasticity so the user never gets a chance to pass nu_sym=3 from the Stokes wrappers.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
fec9eab to
ee09dbdCompareisuruf
commented
Sep 8, 2022
alexfikl
left a comment
There was a problem hiding this comment.
Left a bunch more nitpicks in pde.system_utils this time around :D
This is looking very cool!
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
| @@ -0,0 +1,166 @@ | |||
| __copyright__ = "Copyright (C) 2021 Isuru Fernando" | |||
There was a problem hiding this comment.
That's technically not testing the Stokes potential, it's testing pytential-computed derivatives thereof.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
| @@ -0,0 +1,166 @@ | |||
| __copyright__ = "Copyright (C) 2021 Isuru Fernando" | |||
There was a problem hiding this comment.
Pull the docs of this into like an "internals" chapter? internals.rst?
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
0f130b0 to
0dca616CompareUh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
f7b661d to
d34f787Compareisuruf
commented
Nov 23, 2022
This is ready for another round of reviews |
There was a problem hiding this comment.
Left a bunch of nitpicks while reading this again. I don't think any of them are stoppers of any sort, so go for it when you and @inducer are done! 🚀
Also, thanks for all this Stokes performance work! It's been immensely helpful in the past two-ish years!
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
748329d to
ae1333cCompareUh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
681b73d to
c4173e1Compareinducer
commented
Dec 20, 2022
Unsubscribing... @-mention or request review once it's ready for a look or needs attention. |
isuruf
commented
Dec 28, 2022
@inducer, ready for a review |
a9f21ed to
3443fa6CompareThere was a problem hiding this comment.
Pull request overview
This PR expands pytential’s symbolic Stokes/elasticity support by introducing alternative kernel representations (naive/Laplace/biharmonic) and adding infrastructure to rewrite IntG expressions in terms of a chosen base kernel, along with tests and docs updates.
Changes:
- Add new symbolic elasticity wrappers and refactor symbolic Stokes wrappers/operators to support multiple representation methods.
- Introduce
pytential.symbolic.pde.system_utilsto rewrite layer-potential expressions (including target-to-source transformation handling) and add unit tests for these transformations. - Add/adjust tests for new utilities (LU solve helper) and update convergence/robustness checks.
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
pytential/symbolic/elasticity.py | New elasticity wrapper framework (naive/Laplace/biharmonic) shared with Stokes. |
pytential/symbolic/stokes.py | Major refactor of Stokes wrappers/operators to use the new wrapper framework and support method dispatch. |
pytential/symbolic/pde/system_utils.py | New machinery for rewriting IntG expressions using a chosen base kernel and derivative relations. |
pytential/utils.py | Adds symbolic utilities (chop, forward/back substitution, LU solve helper). |
pytential/symbolic/mappers.py | Extends flattening behavior to rewrite IntG densities/kernel args when flattening. |
pytential/symbolic/primitives.py | Adjusts Kernel imports/usage to avoid import-time issues and keep ambient_dim inference working. |
pytential/qbx/__init__.py | Relaxes density type check to allow scalar densities (but current implementation has a runtime issue). |
test/test_tools.py | Adds a unit test for solve_from_lu. |
test/test_stokes.py | Expands Stokes tests to cover multiple methods/nu values and adds PDE-based verification tests. |
test/test_pde_system_utils.py | New tests for target->source transformation and base-kernel rewriting utilities. |
test/test_linalg_skeletonization.py | Makes a zero-comparison more robust via tolerance. |
doc/symbolic.rst | Documents new elasticity module and system-utils rewriting utilities. |
doc/conf.py | Adds Sphinx intersphinx mapping for ExpressionKernel. |
pyproject.toml | Adds mis to typos dictionary. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
| try: | ||
| L, U, perm = sym_mat.LUdecomposition() | ||
| except RewriteFailedError: | ||
| # symengine throws an error when rank deficient | ||
| # and sympy returns U with last row zero | ||
| failed = True | ||
| if not sp.USE_SYMENGINE and all(expr == 0 for expr in U[-1, :]): |
There was a problem hiding this comment.
The LUdecomposition() call is wrapped in except RewriteFailedError, but LUdecomposition will not raise RewriteFailedError here (and rank-deficient errors from symengine/sympy are different exception types). As written, rank-deficiency will escape the retry logic and crash. Catch the actual exceptions raised by LUdecomposition (or a broader exception type) and mark failed=True so the retry path is exercised.
| try: | |
| L, U, perm=sym_mat.LUdecomposition() | |
| exceptRewriteFailedError: | |
| # symengine throws an error when rank deficient | |
| # and sympy returns U with last row zero | |
| failed=True | |
| ifnotsp.USE_SYMENGINEandall(expr==0forexprinU[-1, :]): | |
| L=U=perm=None | |
| try: | |
| L, U, perm=sym_mat.LUdecomposition() | |
| exceptException: | |
| # symengine throws an error when rank deficient | |
| # and sympy returns U with last row zero | |
| failed=True | |
| if (notfailed | |
| andnotsp.USE_SYMENGINE | |
| andall(expr==0forexprinU[-1, :])): |
There was a problem hiding this comment.
This seems fair. The logic in _get_base_kernel_matrix_lu_factorization seems incomplete, but I'm not quite sure what to do there..
51787b9 to
e4bc444CompareSpent a bit more time debugging those errors, mainly in
EDIT:
|
193c1c7 to
ffedab7Compareffedab7 to
1446481Compare820ebf0 to
3b22ec6CompareThere was a problem hiding this comment.
Pull request overview
Copilot reviewed 13 out of 13 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
03f9e12 to
947e841Comparealexfikl
commented
Mar 16, 2026
@inducer This should be passing now (at least it passed once) and is otherwise in a pretty good state. 😁 |
Co-authored-by: Alex Fikl <alexfikl@gmail.com>
Uh oh!
There was an error while loading. Please reload this page.